yhzhang0128 / egos-2000

Envision a future where every student can read all the code of a teaching operating system.
Other
2.2k stars 157 forks source link

Can it run on ESP32-C3 a RISC V chipset? #4

Closed gshiva closed 1 year ago

gshiva commented 1 year ago

Can it run on https://www.espressif.com/en/products/socs/esp32-c3 ?

From the website

ESP32-C3 is a single-core Wi-Fi and Bluetooth 5 (LE) microcontroller SoC, based on the open-source RISC-V architecture. It strikes the right balance of power, I/O capabilities and security, thus offering the optimal cost-effective solution for connected devices. The availability of Wi-Fi and Bluetooth 5 (LE) connectivity not only makes the device's configuration easy, but it also facilitates a variety of use-cases based on dual connectivity.

yhzhang0128 commented 1 year ago

Thanks for the pointer. I take a look at the document of ESP32C3 and I feel that it is possible to port egos-2000 on it. It has enough memory and flash storage.

gshiva commented 1 year ago

@yhzhang0128 thanks for the prompt reply. Just plug it in and upload the code? Any guidance would be greatly appreciated

yhzhang0128 commented 1 year ago

I think it could take some time to port egos-2000 to ESP32-C3. The key is to adjust the memory regions for this processor. I could image the following needs to be done.

  1. Put the earth layer to the 384 KB ROM
  2. Put the 4MB disk image to the embedded flash
  3. Adjust other memory regions into the 400 KB SRAM.

In order to do this, you will need to read and modify

  1. All the lds files in this repo
  2. The memory map defined here: https://github.com/yhzhang0128/egos-2000/blob/main/library/egos.h#L53

It is a good exercise though. I went through the exercise myself with several months when I played with the Arty board.

gshiva commented 1 year ago

This is very helpful. Is there a way to test it using a ESP32-C3 emulator?

yhzhang0128 commented 1 year ago

When I played with SiFive FE310, the chip company, SiFive, provides an open-sourced QEMU patch that I can use for emulation. I guess you may need to see whether the company producing ESP32-C3 provides something similar.