Using GRUB2 modules in the kernel
Posted: Fri Sep 27, 2019 7:06 am
Hi! I read the multiboot documentation, and I saw that it was possible for the bootloader to load boot modules in RAM for the kernel. Because I want to create a microkernel I find this awesome, I searched in the documentation of GRUB how it was possible to do that and I finally find the "module" command to load GRUB module in RAM for the kernel.
What I would like to do is to use a GRUB module to load the disk driver and process management program of my kernel, and then use them to load the rest. I was able to find the GRUB modules in RAM, but now I struggle on how to use them. They are a relocatable elf, so they need to be linked with something. Does this mean that I should know where the executable code of the core image of GRUB has been load in memory and write a small linker in my kernel? I think there is another way.
Does somebody know how to use GRUB modules as executable for the kernel? I can't find any info. Or maybe I can just call functions from the elf file of the GRUB module?
What I would like to do is to use a GRUB module to load the disk driver and process management program of my kernel, and then use them to load the rest. I was able to find the GRUB modules in RAM, but now I struggle on how to use them. They are a relocatable elf, so they need to be linked with something. Does this mean that I should know where the executable code of the core image of GRUB has been load in memory and write a small linker in my kernel? I think there is another way.
Does somebody know how to use GRUB modules as executable for the kernel? I can't find any info. Or maybe I can just call functions from the elf file of the GRUB module?