Microkernel loading

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
FlashBurn

Microkernel loading

Post 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?
ASHLEY4

Re:Microkernel loading

Post by ASHLEY4 »

hi
Try this site for example code :

http://www.v2os.cx/old/

hope this helps.
Tim

Re:Microkernel loading

Post 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.
FlashBurn

Re:Microkernel loading

Post 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!
Tim

Re:Microkernel loading

Post 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.
FlashBurn

Re:Microkernel loading

Post 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.
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Microkernel loading

Post 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?
-- Stu --
Tim

Re:Microkernel loading

Post 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.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Microkernel loading

Post 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.
FlashBurn

Re:Microkernel loading

Post 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.
Tim

Re:Microkernel loading

Post 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.
Post Reply