Bootloader idea - Boot programs
Posted: Tue Aug 05, 2008 1:50 pm
Hi,
I'm working on my bootloader and have had an idea for it: boot programs.
The current idea is that the bootloader loads a configuration file which contains the names of all the kernels on the disc. Then the user chooses which kernel to load. Some kernels can have 'boot programs' associated with them. The bootloader then loads the kernel to the point that it wants. Then if no 'boot program' is associated with that kernel it jumps straight to it. However if there is one the following happens:
1) It sets up a set of system calls for loading files from the disc and for other things.
2) It sets up a new stack and pushes the return segment and return address onto the stack
3) It jumps to the address the boot program is loaded to
4) The boot program does what it is designed to do.
5) If data structure is to be returned i.e. the boot program makes a memory map or does something else. The address is put in the eax register.
6) The boot program jumps back to the location specified on the stack.
7) The bootloader jumps to the kernel with the address still in eax.
Do you think this is a good idea or is it a bit of overkill for a bootloader? Would you change anything or edit it. I'm also adding support for standalone 16 bit realmode programs that could be loaded by the bootloader as well.
I'm releasing the bootloader once this is added so do you think this is a feature that would be used or one that would go by the wayside?
I'm working on my bootloader and have had an idea for it: boot programs.
The current idea is that the bootloader loads a configuration file which contains the names of all the kernels on the disc. Then the user chooses which kernel to load. Some kernels can have 'boot programs' associated with them. The bootloader then loads the kernel to the point that it wants. Then if no 'boot program' is associated with that kernel it jumps straight to it. However if there is one the following happens:
1) It sets up a set of system calls for loading files from the disc and for other things.
2) It sets up a new stack and pushes the return segment and return address onto the stack
3) It jumps to the address the boot program is loaded to
4) The boot program does what it is designed to do.
5) If data structure is to be returned i.e. the boot program makes a memory map or does something else. The address is put in the eax register.
6) The boot program jumps back to the location specified on the stack.
7) The bootloader jumps to the kernel with the address still in eax.
Do you think this is a good idea or is it a bit of overkill for a bootloader? Would you change anything or edit it. I'm also adding support for standalone 16 bit realmode programs that could be loaded by the bootloader as well.
I'm releasing the bootloader once this is added so do you think this is a feature that would be used or one that would go by the wayside?