Hello everyone, I am a basketball enthusiast who writes code. Recently, I came across a very interesting project online where an expert has successfully ported the Linux kernel to the ESP32 and got it running.
On foreign websites, many people are discussing this matter.
https://hackaday.com/2021/07/21/its-linux-but-on-an-esp32/
The ESP32 is a chip launched by Espressif for smart devices. I used this chip during my startup; it supports Bluetooth and Wi-Fi and can run the FreeRTOS embedded system, making it an excellent choice for IoT applications.
It is inexpensive.
The ESP32 does not have an MMU, and previously, some classmates discussed in the group how it is possible to run Linux without an MMU. This can be checked in the Linux kernel documentation.
https://www.kernel.org/doc/Documentation/nommu-mmap.txt
——
This project has a detailed serialized process in the Waku developer community.
JuiceVm RISC-V virtual machine running the Linux kernel on ESP32
https://whycan.com/t_6899.html
There are open-source project materials available on GitHub.
https://github.com/juiceRv/JuiceVm/blob/master/README_zh.md
——
Recently, I had the privilege of contacting the project’s author, Li XiongHui, and I interviewed this expert. The details are as follows:
1. Can you give a brief self-introduction, including your studies, work, hobbies, etc.?
Li XiongHui
Currently employed at a domestic MCU chip company, previously developed the JUICE VM RISC-V virtual machine. Over 6 years of development experience, mainly engaged in IoT development, embedded software development, Linux kernel development, xboot, RTT, etc. Author of JUICE VM, a geek.2. How did you come up with the idea of porting Linux to the ESP32? This move has attracted a lot of attention and made it to foreign websites.
While working on the Linux kernel and drivers, I accidentally saw a foreign expert (https://dmitry.gr/index.php?proj=07.+Linux+on+8bit&r=05.Projects) running mainstream Linux on an AVR 8-bit machine, thinking that I could achieve this in the future.3. I noticed that you not only ported Linux to your system but also ported RTT and other embedded systems. You have spent a lot of time and effort on this. Is your hobby driving you?
Yes, it is driven by my interests. The magic of electronics fascinates me, and while realizing functional applications, I constantly delve into the underlying principles.4. Some netizens mentioned that the boot time of Linux 5.0 running on the ESP32 took nearly 6 hours. Do you have any improvement ideas for this, such as hardware upgrades?
This issue can be optimized from several points.
1. Performance optimization from the virtual machine, but it requires a lot of work to solve the compatibility issues of the optimized platform.
2. It is necessary to use faster interfaces for memory expansion on the ESP32, as the space on the ESP32 is insufficient to store the unoptimized Linux kernel mainline image.
5. What advice do you have for new embedded developers? Based on your experience, how can they better integrate this knowledge?
Everyone starts as a beginner, and everyone will be in a new field as a newcomer. It is not scary to be a newcomer; one should be happy to be in this state, as it means I am exploring new fields, making progress, discovering new things, and acquiring new knowledge and experiences.
After implementing some functional applications, we should also pay attention to the technologies and knowledge behind them, constantly digging deeper into the principles. Different fields can learn from each other, continuously trying to spark new knowledge through the collision of existing knowledge.6. What are your plans for the future? I have encountered many people asking me how long I will continue with my public account. For you, do you have more plans for this project?
This project will not stop; I will later modify the JuiceVM processing mechanism to improve performance and provide better debugging interfaces for users. Currently, I am developing a subset of the C language compiler based on the GNU-C99 standard, named JuiceCC. Welcome to follow! JuiceCC will generate a set of IR (Intermediate Representation) standards during development, and JuiceVM will also use this standard to provide higher optimization capabilities and simulation performance for customized software.
Finally, I hope everyone enjoys this project, and students who are learning can gain knowledge from it.