Help me understand iPXE code
|
2013-05-16, 10:09
Post: #4
|
|||
|
|||
RE: Help me understand iPXE code
(2013-05-16 08:34)Rickert Wrote: I'm not aware of this technique having a name. It's something I created, inspired by the way that the old Etherboot code handled the PCI driver list. The concept of vector-valued macros as used in tables.h is, as far as I am aware, an original idea. If your code is licensed under GPL then you can include iPXE's tables.h directly. You can see examples of how to declare a specific table in e.g. init.h, and examples of how to declare table entries in any file containing e.g. __startup_fn. The only other part you'll need is the linker script directive to keep all table entries and sort them alphabetically: Code: KEEP(*(SORT(.tbl.*))) The reason for doing this is that allows the contents of the array to be determined at link time rather than compile time. For example, both bin/realtek.rom and bin/intel.rom can be generated from the exact same compiled code simply by adjusting the options passed to the linker. Using an array of function pointers would require something like: Code: struct pci_driver * pci_drivers[] = { See http://dox.ipxe.org/ifdef_harmful.html for some more detailed background. 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: 4 Guest(s)