Boot Modules with GRUB (Info Request)
Posted: Wed Jun 23, 2004 11:00 pm
I have been thinking about writing an OS for a while now since I love low level programming. I've been doing lots of research into the subject and am trying to come up with a design for the OS I want to write. So far, I'm leaning towards the Micro Kernel approach and so I'm trying to figure how I can keep the kernel small.
I ran into a chicken and the egg sort of problem with trying to figure out how to handle the device driver for a file system format, like ext2fs. I would want to store that driver on the hard drive, but I would need it to read the hard drive. The idea of putting primitive hard drive reading routines in the kernel seemed counter productive to the approach I wanted to take.
GRUB was something that I was thinking about using. I read up on how to do the multiboot header and stuff. Then somewhere along the way I read something about how it can load additional boot modules into memory after the kernel. It was suggested that GRUB can load some device drivers, like for the file system, this way. All I can say is that lights started coming on because this sounded like the solution I was looking for.
So I've been searching the web. I found how one can find such a module in memory from the Multiboot information structure and I found this article on your web site:
http://www.osdev.org/wiki/Wiki.jsp?page=Modules
But other than that, there seems to be very little information online.
Based on the above web article, there appears to be a header for the module. Is that something that these modules require or is it a design created by the author of the article so that the kernel can find the module's functions? Is any header information required for a module for GRUB? Is there any more information about how to make these modules?
If possible, I would like to pursue this approach. I'm thinking that if one had a module that handled a FAT file system and one that handled the ext2fs file system and they shared identical interfaces that the kernel or other OS component can use, then all one would have to do is use the FAT module when installing the OS on a FAT file system or the ext2fs module if the OS is being installed on an ext2fs file system.
Anyway, any help or information on this subject would be greatly appreciated.
I ran into a chicken and the egg sort of problem with trying to figure out how to handle the device driver for a file system format, like ext2fs. I would want to store that driver on the hard drive, but I would need it to read the hard drive. The idea of putting primitive hard drive reading routines in the kernel seemed counter productive to the approach I wanted to take.
GRUB was something that I was thinking about using. I read up on how to do the multiboot header and stuff. Then somewhere along the way I read something about how it can load additional boot modules into memory after the kernel. It was suggested that GRUB can load some device drivers, like for the file system, this way. All I can say is that lights started coming on because this sounded like the solution I was looking for.
So I've been searching the web. I found how one can find such a module in memory from the Multiboot information structure and I found this article on your web site:
http://www.osdev.org/wiki/Wiki.jsp?page=Modules
But other than that, there seems to be very little information online.
Based on the above web article, there appears to be a header for the module. Is that something that these modules require or is it a design created by the author of the article so that the kernel can find the module's functions? Is any header information required for a module for GRUB? Is there any more information about how to make these modules?
If possible, I would like to pursue this approach. I'm thinking that if one had a module that handled a FAT file system and one that handled the ext2fs file system and they shared identical interfaces that the kernel or other OS component can use, then all one would have to do is use the FAT module when installing the OS on a FAT file system or the ext2fs module if the OS is being installed on an ext2fs file system.
Anyway, any help or information on this subject would be greatly appreciated.