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

Wolfgang Denk wd at denx.de
Thu Feb 1 16:36:43 UTC 2018


Dear Dmitry,

In message <CAHs5x+N5O2zuO9C+12w2Ci7LF6r7Zupop2Sq+Cy9PDR5o=CwLA at 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

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.


More information about the U-Boot mailing list