[U-Boot] Where is the edge between a loader and (microkernel) OS?

Good Day
I'm looking at u-boot source code, and see a huge amount of hardware drivers, used only for the loader. On the other side, modern Linux kernels eat a more than half of RAM on cheap embedded modules like HLK-R04.
Is it suitable to morph u-boot into tiny embedded microkernel OS adding multitasking scheduler or share its drivers for i/o with some other tiny RTOS?
------------------------------ With best regards, Dmitry Ponyatov, CNC/embedded engineer, tel. +7 917 10 10 818

Dear Dmitry,
In message CAHs5x+N5O2zuO9C+12w2Ci7LF6r7Zupop2Sq+Cy9PDR5o=CwLA@mail.gmail.com you wrote:
I'm looking at u-boot source code, and see a huge amount of hardware drivers, used only for the loader. On the other side, modern Linux kernels eat a more than half of RAM on cheap embedded modules like HLK-R04.
Is it suitable to morph u-boot into tiny embedded microkernel OS adding multitasking scheduler or share its drivers for i/o with some other tiny RTOS?
No, it is not.
I recommend reading the U-Boot Design Principles [1]; many of these focus on being easy to port to new hardware and/or bring up new hardware, and to favour simple code over complex functionality.
From the beginning, a strictly single-threaded design has been
assumed. By adding multi-task support you would have to introduce locking conecpts and - even more difficult - to review the whole code base. Also, the implementation frequently assumes it's single-tasking - for example, a large number of device drivers use simple polling techniques which are OK for single-task systems, but which would hurt like hell if you hade several parallel tasks.
The situation is simple: If youneed an OS, then boot one. If only minimal OS functionality is needed, then boot a simple OS.
[1] http://www.denx.de/wiki/U-Boot/DesignPrinciples
Best regards,
Wolfgang Denk
participants (2)
-
Dmitry Ponyatov
-
Wolfgang Denk