Page 1 of 1

Microkernel Initialization

Posted: Fri Nov 09, 2007 5:41 pm
by frank
I am thinking about creating a microkernel next because of the extra level of safety that it can provide. Okay so when you first boot the computer up you are in real mode, my boot loader then puts you in flat protected mode (base 0, limit 4GB). So my question is since all of the servers have to be mapped to a certain address in virtual memory before they can run how do you do that before actually mapping and starting the memory/process server?

In the microkernels I have looked at so far, I think that the kernel actually sets up paging and loads the server before passing control of memory to the memory/process server. Does this sound right?

Thanks

Posted: Fri Nov 09, 2007 6:23 pm
by JackScott
Another option is to have the memory server inside the microkernel. IIRC, this is what most production microkernels do (along with process management, scheduling, hardware abstraction).

Posted: Sun Nov 11, 2007 7:26 pm
by frank
That's what I was planning on doing. That way there won't be that extra overhead for every memory operation.

Posted: Sun Nov 11, 2007 9:42 pm
by AndrewAPrice
You could create a special condition that loads the memory server first and sets up a temporary page directory first.

Anyway, the whole point of a microkernel is to protect processes from one enough. E.g. a bug in one couldn't leak to another. However, the memory server, due to it's nature, isn't really protected from accessing other process's memory since it controls the memory. Therefore the main advantage of having servers outside of kernel land doesn't really apply to the memory server.

This is only my opinion, so I don't know. My kernel is a hybrid between a micro/monolithic kernel. It's monolithic in terms of all drivers/servers exist within shared kernel-space. But, these modules can also be dynamically loaded/unloaded, contain multiple threads, and communicate via events/messages like any other process.

Posted: Mon Nov 12, 2007 9:15 pm
by iammisc
Honestly, I think that microkernels should handle memory themselves in a manner like a monolithic kernel. Microkernels, IMHO, should handle processes and memory management. Their main responsibility should be to provide a consistent interface for applications and to handle time-critical tasks. This means that they should handle scheduling, processes, memory management, interrupts, and the PIT.

Note that processes means they should be able to save the process state and switch the state and switch address spaces and store the floating point state.

In my microkernel, a process is created by spawning a thread(which always starts in kernel mode) and then sending messages to that thread to create a new address space, map the process, set the userspace stack, and then jump to userspace.