Android 和 RISC-V:您需要了解什么才能做好准备
Android and RISC-V: What you need to know to be ready

原始链接: https://opensource.googleblog.com/2023/10/android-and-risc-v-what-you-need-to-know.html

综上所述,Android现在通过提供原生支持来兼容RISC-V开源指令集架构。 要更详细地了解它,这里有一篇综合文章。 RISC-V 通过创建专为满足现代芯片需求而设计的新开源指令集架构,为芯片设计提供了革命性的新方法。 它可以减少盗版,同时提高效率、安全性和灵活性。 目前有超过 60 名贡献者,专注于开发开放标准和设计低成本技术以造福人类,加入该项目代表着 Android 开发的一个重要里程碑。 目前,某些元素需要优化才能用作标准 Android 功能的一部分,但总体而言,在 Android 上原生支持 RISC-V 不会导致在 Android 上使用它与在其他地方使用它之间存在明显差异。 正如本博客之前所述,Google 正在与其他数十个项目一起参与并参与 RISC-V 指令集架构 (ISA) 项目。 在 Android 上原生支持 RISC-V 意味着无需修改或更改即可支持,以保持与 Android 的兼容性。 此外,由于兼容性,不需要对主线分支进行重大内核或 SoC 修改。 在花了几个月的时间考虑将 RISC-V 集成作为另一种选择而不是替代品之后,加入了这一努力; 然而,考虑到服务器领域已经取得的成功以及在减少核心硅消耗方面所带来的潜在效率优势,似乎值得进一步探索。 虽然某些项目在针对参考图像与非参考图像进行测试时可能会表现出细微的差异,但大多数事物总体上看起来相当相同。 正如本博客之前提到的,Google 早在 5 月份就加入了 RISC-V ISA 项目,共同开发开放标准并设计旨在造福人类的低成本技术; 今天标志着它正式进入 Android 开发,从 CTS(或者对于早期采用者来说更早)开始。在 Android 上原生支持 RISC-V 可能会允许在基于 CTS 和 Android 内核源代码的真实 Android 设备上运行普通 Linux,具体取决于什么成为标准移动 向前,类似于 Linaro 对 Arm Linux 所做的事情(以及其他人,如 Menta 的 Gnome Linux)。这样的机会可能会导致 Chromium OS 发行版的建立,用户可以在其中访问 vanilla Linux,但也可以使用 Play Store

虽然开源和开放标准开发的基本原则确实令人钦佩,但在竞争激烈的消费电子领域实施它们却面临着独特的挑战。 例如,创建像 AOSP(或 Replicant,更接近原生 Android,但仍包含 GApps 等专有组件)这样的完全开源操作系统,特别是对于资源匮乏的社区来说,需要专业技能和大量资源。 此外,即使使用开源内核,由于软件堆栈各层中的专有限制和依赖性,在什么是可能的以及什么是不可能的方面仍然可能存在限制。 此外,在瑞典等某些市场或地区,网上银行严重依赖由专用专有硬件解决方案专门支持的特定安全基础设施,仍然不确定替代方法是否可以提供足够的功能和便利性,以证明在实际限制下广泛采用的合理性。 最终,考虑到当前在处理性能、优化机会、能耗能力和潜在经济激励方面的限制,很难明确确定短期或中期内是否会出现向开源芯片组或架构的重大转变。 然而,正如学术机构和研究组织对开源硬件概念和解决方案日益浓厚的兴趣所表明的那样,半导体工程及相关领域显然存在着提高透明度和协作探索的势头。 从本质上讲,这种情况说明了在快速发展的技术环境中创新与商品之间持续存在的紧张关系,该技术环境日益以专有软件、硬件和内容元素为特征,这些元素共同塑造了新兴趋势和模式,同时提出了有关知识产权所有权模式、隐私保护的有趣问题以及对网络安全漏洞、数字主权框架和关键基础设施弹性要求日益关注的可信度考虑。
相关文章

原文

Android is an open source operating system that is freely available to port to many devices and architectures. As such it supports many different device types and CPU architectures. We’re excited to be adding a new one to that list - RISC-V.

RISC-V is a free and open instruction set architecture (ISA), bringing the same spirit of industry-wide collaboration and innovation that we see in software around open source to the hardware ecosystem. Invented 10 years ago at the University of California, Berkeley, RISC-V has seen rapid adoption in embedded and microcontroller spaces, and in recent years has expanded into accelerators, servers, and mobile computing.

In November of 2022, we announced at the RISC-V Summit that we were accepting patches for RISC-V:

The latest update that we have is that now not only are we accepting patches, but we have begun to mature support for RISC-V in Android. RISC-V is a modular ISA, meaning that there are a large number of optional extensions. We have also determined an initial set that we feel is critical to ensure that any CPU running RISC-V will have all of the features we expect to achieve high performance. This set includes the rva22 profile as well as the vector and vector crypto extensions. This update was provided at the RISC-V summit in Europe:

You can build, test, and run the Android support for RISC-V on your own machine as well now! Just like other platform targets in AOSP, you can use the Cuttlefish Virtual Device support:

$ lunch aosp_cf_riscv64_phone-userdebug $ m -j $ launch_cvd -cpus=8 -memory_mb=8192

Then, you can use vncviewer to connect to the running device and interact.

Moving image of vncviewer running on an Android device

At this time, these patches will support building and running a basic Android Open Source Project experience, but are not yet fully optimized. For example, work on a fully optimized backend for the Android Runtime (ART) is still a work in progress. Additionally, AOSP, our external projects, and compilers haven’t generated fully optimized, reduced code that also takes advantage of the latest ratified extensions, such as the one for vectors. However, we believe that it is ready to allow experimentation and collaboration.

Later this year, we expect to have the NDK ABI finalized and canary builds available on Android’s public CI soon and RISC-V on x86-64 & ARM64 available for easier testing of riscv64 Android applications on a host machine. By 2024, the plan is to have emulators available publicly, with a full feature set to test applications for various device form factors! As recently announced in our collaboration with Qualcomm, we expect wearables to be the first form factor available.

However, just porting the Android operating system itself is not enough! We are working with the community and RISE (RISC-V Software Ecosystem). The RISE Project has been established to provide a way to accelerate the availability of software for high-performance and power-efficient RISC-V processor cores running high-level operating systems. That includes not only Android, but also Linux and other operating systems across a variety of application domains, including high-performance computing. The RISE Project includes members from Andes, Google, Intel, Imagination Technologies, MediaTek, Nvidia, Qualcomm Technologies, Red Hat, Rivos, Samsung, SiFive, T-Head, and Ventana.

Google is also continuing and expanding our strong investments at RISC-V International, even beyond our long-standing Premium membership and board participation. We also have many other contributors in key roles on horizontal committees, working groups, and technical committees to ensure that specifications are rapidly being designed and ratified to benefit not only Android but also many other use cases.

Android's support for RISC-V is dependent on a wide range of contributions from toolchain to basic support libraries. We are very appreciative of the ongoing efforts which requires countless projects to support RISC-V build configurations and quality implementations. If you are interested in contributing please visit the following resources:

  • https://github.com/google/android-riscv64 for detailed information on how to build and test the RISC-V support in Android, list of known issues and opportunities to contribute to AOSP at source.android.com and toolchain projects and support libraries.
  • Subscribe to RISC-V Android SIG mailing list or join directly, if your organization is a member of RISC-V International to stay tuned in to progress and offer your suggestions and feedback.

Make sure to stay tuned as we look into ways to make it as easy for Android developers writing native to target new platforms as it is for our Java and Kotlin developers!

Planning to head to the RISC-V International Summit in November? Find us there– we’ll be hosting a Community Collaboration Breakfast on Wednesday morning! Not attending the conference but interested? Learn more and register here.

By Lars Bergstrom – Android Platform Programming Languages & Greg Simon - Google Low-level Operating System

联系我们 contact @ memedata.com