[syslinux] COMBOOT modularization?

Murali Krishnan Ganapathy gmurali at cs.uchicago.edu
Tue Feb 3 09:41:09 PST 2004


Something to think about
-------------------------

Since we are going to be having lots of comboot stuff (I hope so 
atleast), is it possible to modularise the comboot coding like this.

* In principle each comboot computes a function, it takes its input 
through argv and sends it output *somewhere*.
* The caller of the comboot has access to the output of the called 
comboot code, and can choose to ignore it (which is what syslinux would do).

Complications which would arise:
1. We need a mechanism by which a comboot code, can return a string.
2. So the API to run a command may terminate if the command was a 
comboot and it terminated.
3. The calling comboot code, should be able to inspect the return 
structure of the called comboot code, and do something about it.
4. In particular this means one can have multiple comboot codes in 
memory (though only one is active at a given time).

What I have in mind is this....
* Rewrite chain.c32 so if necessary it only checks if the requested 
partition exists/exists and bootable/ exists and not bootable. (another 
argument to distinguish between checking mode and actually booting into it).
* Write a menu interface, which calls "chain.c32" enough number of 
times, to determine which partitions exist and it bootable.
* Dynamically generate the menu (hard disks, correspond to menu's, 
partitions to submenus... whatever).
* Once the user selects a partition to boot into, call "chain.c32" 
again, this time asking it to boot into the required partition.

* Ofcourse, chain.c32 will actually return a number and some kind of 
C-structure (which the callee and caller have to agree), containing the 
information. the number would be the exit code or the size of the 
structure of whatever. The C-structure in the case above would tell the 
caller if the required partition exists and if it is bootable, and if so 
what bootsector it found (Linux, DOS, Windows....).

I know this is a big change in thinking, but if one has something like 
this, then comboot code can be modularised, and maintainance will also 
be easy.

- Murali




More information about the Syslinux mailing list