Page 1 of 1
Microkernel loading
Posted: Wed Dec 10, 2003 12:07 pm
by FlashBurn
I will make a microkernel, but my problem is now how I load it without using GRUB? I need a loader which can handle the HDD and some filesystems. My Problem is that I have to load all servers and all modules. But I think that this is to much overhead! How do a "normal" microkernel os load its servers and modules?
Re:Microkernel loading
Posted: Wed Dec 10, 2003 12:28 pm
by ASHLEY4
hi
Try this site for example code :
http://www.v2os.cx/old/
hope this helps.
Re:Microkernel loading
Posted: Wed Dec 10, 2003 12:59 pm
by Tim
Well, you've got HDD support in the BIOS, for a start. And simple read-only FS support is not difficult. If you want, you can embed the sector numbers of the files your OS needs inside the loader itself; this is how LILO works on ext2.
Really this process is no different between microkernels and monolithic ones.
Re:Microkernel loading
Posted: Wed Dec 10, 2003 1:08 pm
by FlashBurn
The problem that I see is that I have to switch between PMode and RMode for every file and for every file which is bigger than 640KiB, too. I haven?t started yet with programing the HDD in PMode. Is this hard to do? Because this would be another option I have, but this is something I wont do now!
Re:Microkernel loading
Posted: Wed Dec 10, 2003 2:07 pm
by Tim
No, just do as every other OS loader does, and stay in real mode. Load all the files into memory using the BIOS, switch to protected mode, then JMP to the kernel entry point.
Re:Microkernel loading
Posted: Wed Dec 10, 2003 2:16 pm
by FlashBurn
The problem is that the kernel, the servers and all modules will be over 1MiB and so I need to move it behind 1MiB. But I will see how I will have look now at the V2OS source.
Re:Microkernel loading
Posted: Wed Dec 10, 2003 2:35 pm
by df
for each file to load
read 64kb
switch to pmode.
copy into into place in upper memory
switch to rmode
loop
how hard is that?
Re:Microkernel loading
Posted: Wed Dec 10, 2003 3:28 pm
by Tim
You don't even need to switch back and forth to copy the data to upper memory. You could use the INT 15h extended memory services, or switch to unreal mode when your loader starts and use A32 REP MOVSD or the like to copy.
Really, this has all been done before, and it's no different whether you're using a microkernel or not. The boot loader is definitely the wrong place to get stuck on when writing an OS.
Re:Microkernel loading
Posted: Fri Dec 12, 2003 5:47 am
by Candy
FlashBurn wrote:
The problem is that the kernel, the servers and all modules will be over 1MiB and so I need to move it behind 1MiB. But I will see how I will have look now at the V2OS source.
you're going to make a microkernel of over a megabyte? You might want to think your design over again. I would start by thinking up a boot procedure that has a driver for filesystems, and the core kernel you intend to make (which in case of a true microkernel IS the entire kernel). That should fit in 128KB, let alone 1MB.
And, putting only that in your startup code will simply make the problem disappear. You do not need a full OS to load an HDD driver.
Re:Microkernel loading
Posted: Fri Dec 12, 2003 7:15 am
by FlashBurn
I need to load the storage server with all modules and I need also the modules of the kernel and I think that this all together will be over 1MiB! But I give the unreal-mode a try.
Re:Microkernel loading
Posted: Fri Dec 12, 2003 8:25 am
by Tim
To get a microkernel running, you'll need to load:
- The microkernel (small, by definition)
- A file system driver, e.g. FAT
- A storage device driver, e.g. ATA
You're doing something wrong if those components come to over 1MB. Remember that these three are all you need to get the system running; you can use the FS/storage drivers to load the rest of the OS.