riscv / sail-riscv

Sail RISC-V model
https://lists.riscv.org/g/tech-golden-model
Other
438 stars 163 forks source link

Update Linux images #580

Open Timmmm opened 5 days ago

Timmmm commented 5 days ago

The Linux images in os-boot a) are very out of date, awkward to use because they require patching the model, and don't really belong there anyway.

We should

  1. Create up-to-date images and put them in another repo, probably with the ELF's attached to Github releases.
  2. Remove the images from os-boot, and replace them with instructions (or maybe a script) to use the ELFs from the other repo.

It would be really great if the images could run on all of the major emulators:

  1. Sail
  2. Spike
  3. QEMU
  4. Whisper
  5. Imperas

(I think that's it?)

Timmmm commented 5 days ago

I have got Sail and Spike working, and Imperas partly working with a newer Linux (with no userspace admittedly but I don't know if that really matters). The hard bit is getting console output working on all the emulators, and how to supply the DTB.

  1. Sail and Spike support HTIF for console output. OpenSBI supports this and can expose this to Linux, so they're pretty easy. Both support supplying a DTB on the command line.
  2. Imperas doesn't support HTIF or supplying DTBs on the command line. OpenSBI can embed the DTB but I'm not sure how to get console output yet.
  3. For some reason my Linux image doesn't boot with the default Sail memory limit. Changing it to match Spike makes it work. Probably a good idea anyway.

I haven't tried QEMU or Whisper yet.