Help me understand iPXE code
|
2013-05-15, 23:45
Post: #2
|
|||
|
|||
RE: Help me understand iPXE code
(2013-05-15 11:24)Rickert Wrote: __table is the end of what I can look into. The comment says that it "Declare a linker table". But how can it get the functions? I answered this same question in http://stackoverflow.com/questions/16562...4#16564674; posting here for the record: The linker script instructs the linker to arrange sections ".tbl.*" in alphabetical order. The __table_entry etc macros are used to place structures into these sections. The easiest way to understand this is probably to look at the linker map, which you can produce using e.g. "make bin/rtl8139.rom.map": Code: .tbl.init_fns.00 Here you can see the various structures (heap_init_fn, pxe_init_fn, smbios_init_fn) etc. have been placed consecutively in the final image, sorted by initialisation order (01=INIT_EARLY, used for heap_init_fn in malloc.c; 04=INIT_NORMAL, used for smbios_init_fn in smbios_settings.c etc). The __table_start and __table_end macros in init.c produce zero-length arrays placed in .tbl.init_fns.00 and .tbl.init_fns.99; these can then be used by the code in init.c to identify the start and end of the table that has been constructed by the linker. Hope that helps! Michael |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Help me understand iPXE code - Rickert - 2013-05-15, 11:24
RE: Help me understand iPXE code - mcb30 - 2013-05-15 23:45
RE: Help me understand iPXE code - Rickert - 2013-05-16, 08:34
RE: Help me understand iPXE code - mcb30 - 2013-05-16, 10:09
RE: Help me understand iPXE code - Rickert - 2013-05-17, 08:33
RE: Help me understand iPXE code - mcb30 - 2013-05-20, 07:00
|
User(s) browsing this thread: 2 Guest(s)