Ultra fast boot

Could we just skip opensbi and just use Uboot-SPL to boot linux kernel? Anybody has tried this? I think in my case we have no need to do pre-console or instruction emulation support. And we want it boot as fast as it can.

Opensbi is not optional, since it is required for the linux kernel running in supervisor mode to access machine mode registers. I don’t know opensbi, but maybe you can eliminate some features that you aren’t using to make it smaller and faster. Maybe there are small real time OSes that can run in machine mode that eliminate the need for opensbi. But linux can’t run without it.

Thanks a lot. So linux must use opensbi to communicate with M-Mode register, right? Could we do some hack in kernel to work around this?

Only by running the kernel in M mode instead of S mode.

You lose all portability by doing that, because OpenSBI is specialized to the CPU core and SoC, so the Linux kernel is identical on all machines.

SBI is not big and it is not slow.

modify flash/rom to boot from nvme directly, if possible.

Since kernel is compressed so does it really help to move it to nvme disk?

Haiku can start from machine mode without SBI by using bare metal boot loader (“haiku_loader.riscv”). It implements its own “MSyscall” interface for kernel. But it currently can be used only in virtual machines (QEMU, TinyEMU). Running it on real hardware will require implementing hardware-specific code.

A couple of minutes difference in boot time. The SD card is really slow.

Thank you very much and it will help a lot!

For me it takes several seconds from pressing power button to getting first serial output. What is happening at that moment and why it so long?