[En-Nut-Discussion] Nut/OS Initialization

Nathan Moore nategoose at gmail.com
Wed Sep 17 20:12:29 CEST 2008


>
> OK, that one is clear. Currently Nut/OS often checks if a function
> pointer is NULL, which has the same result, but produces more code.
>
> But initially Ole suggested a structure containing function pointers,
> quite similar to the NUTDEVICE structure we have now. My question still
> is, how should Nut/OS know about these structure, so it can call its
> initialization functions? Nathan explained the contents of the
> structure, but not its link to the Nut/OS initialization. Correct me if
> I'm wrong.


Linker magic lets the OS know if you can force the linker to put all of the
structures
in one section (similar to .data, .bss, .text, ...), all of the device
structures are the
same size (or know how big they are), and the OS can see where the beginning
and
end of this section is.
I'm not a linker wiz, but I'm pretty sure that you can do this with gnu ld
scripts and
a gcc __attribute__((section("  "))) for NUTDEVICEs.
Finding the location and size of this section should be as simple as finding
the location
and size of the heap in NutOs.

Nathan



More information about the En-Nut-Discussion mailing list