does any OS do this?

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.
Post Reply
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

does any OS do this?

Post by earlz »

I have been thinking of how to "practically" load a hdd driver if their is no hdd driver to load the hdd driver
so I came up with a bit of an idea, what if the bootsector loaded a media driver and if need be, a filesystem driver and then load the kernel.
this would make an OS possible to boot from any type of media(and with proper emulation, even from read-only media with write emulation) most importantly, you wouldn't have to make any modifications to the actual OS...

so now..is their any OS(major or hobby) that does this kinda thing?
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Post by bubach »

You can put the kernel + important drivers in one big image file to be loaded at boot.
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

umm... Isn't that what grub modules and initrds are supposed to do? load stuff in for the os to be able to bootstrap itself. My kernel isn't fully set up after being called by grub. It firsts reads the grub modules(which contains my real kernel) and loads that to 3gb. Then it reads the drivers needed for the kernel to boot. It then creates page tables for each driver(my os is a microkernel-based one) and gives control to the kernel telling it all the things that happened.
jvff
Member
Member
Posts: 46
Joined: Sun Oct 24, 2004 11:00 pm

Post by jvff »

I think the kernel image should contain all necessary drivers/modules to at least start loading all other drivers/modules. This basicly means error report module (and output driver), memory manager module (if you will relocate loaded modules) and a media driver (source of other modules, would be interesting if this was a network driver ;-) ). Then again this was said above...

JVFF
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

iammisc wrote:umm... Isn't that what grub modules and initrds are supposed to do? load stuff in for the os to be able to bootstrap itself. My kernel isn't fully set up after being called by grub. It firsts reads the grub modules(which contains my real kernel) and loads that to 3gb. Then it reads the drivers needed for the kernel to boot. It then creates page tables for each driver(my os is a microkernel-based one) and gives control to the kernel telling it all the things that happened.
Thath's how I do it too. Tell GRUB that your second-stage boot loader is actually your kernel, then, before launching my kernel proper I set up my physical RAM allocation bitmap, VESA (to be done!), paging, a GDT (as you cannot rely on a multiboot segment values), stack etc...

When I get around to implementing my disk drivers, I will get GRUB to load something like 'io.sys' which could be different depending on the medium you are using.

Cheers,
Adam
Post Reply