Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I want do use grub as my OS bootloader. But I design my own filesystem not fat or ext2. Could grub find my kernel image under my own filesystem? If yes, what else need I do? If not, does it means if I decide to implement my own filesystem, I can't use grub?
GRUB only supports the filesystems it supports. If you make one up, it seems obvious that it won't be able to use it.
Either:
1) Make a small partition made only for loading the kernel. Make this ext2/fat.
2) Don't use GRUB
3) Download the grub source code, and add a new filesystem to it.
Systems and Computer Engineering Researcher
"Do you pine for the nice days of Minix-1.1, when men were men and wrote their own device drivers?" -- Linus Torvalds http://sce.carleton.ca/~maslan
xyb wrote:I want do use grub as my OS bootloader. But I design my own filesystem not fat or ext2. Could grub find my kernel image under my own filesystem? If yes, what else need I do? If not, does it means if I decide to implement my own filesystem, I can't use grub?
Like JamesM said, you could have an ext2 or fat boot partition, and after booting access your own partition. I'd advise that at least until you have a fill OS up and running. Creating a grub module for your own FS is possible, but I'd advise you to wait with that. I'd consider devoting a considerable amount of time for something not directly related to your OS a waste. Writing your own multiboot compliant bootloader taylored for your OS is probably faster.
I know this thread is a bit old, but I just wanted to add that you can also specify files as blocklists instead of filenames. That way GRUB doesn't need to understand the filesystem, but you do have to make sure the blocklist is kept up-to-date (either by never moving or extending the files, or by updating the blocklists every time one of those things happens). You should probably also make sure there's no junk at the end of the last sector, and that the extra bytes are ignored.
You can specify kernel images, modules and even the config file itself this way (the location of the config file is hardcoded into stage2, so you may have to hex-edit it).
This isn't the best option I'll grant you, but it could at least be useful as a temporary measure, until you have GRUB support for your filesystem, partition support [1] in your OS, (insert popular FS) support in your OS, or switch to a different bootloader.
[1] (So a separate boot partition can be used, with a GRUB-supported FS)
MessiahAndrw wrote:Why not use ext2/FAT or one of the FS's already supported?
Either for the pride of doing it your own way, and having it be yours, or because you think you have an idea for a better way to build a filesystem than those other crappy ones. Or both, of course.
One thing not mentioned (at least that I saw), if you don't want to have multiple partitions, you could incorporate FreeBSD disklabels, and have your kernel image and grub readable filesystem on one label, and your filesystem on another.
I haven't tried it that way, but I believe it should work.