Page 1 of 1

uKernels and Memory Management

Posted: Mon Jan 09, 2006 1:41 am
by deadmutex
I've read that in some microkernels, the memory manager runs as a service in user mode. Applications and drivers use IPC to communicate with the memory server. My question is, how is the kernel able to create a server and allocate memory for data structures if the memory server didn't start yet? ???

Re:uKernels and Memory Management

Posted: Mon Jan 09, 2006 2:02 am
by Solar
Same as with, "how can a kernel be booted from a file system if the file server isn't running yet": You provide some basic bootstrapping functionality, get the server up and running, and then disable / forget / delete the bootstrap code.

I would guess.

Re:uKernels and Memory Management

Posted: Mon Jan 09, 2006 2:20 am
by deadmutex
That makes sense; it seems to be much simpler than what I had expected. :P So basically, I should just init a temporary mem manager in kernel mode, load the memory manager, and discard the init code after everything loads?

Re:uKernels and Memory Management

Posted: Mon Jan 09, 2006 5:49 am
by distantvoices
have some boot loader like GRUB fetch the needed services alongside with the kernel into memory. GRUB passes the loco of the loaded modules in the multiboot struct. Look in the OSFAQ or fetch info about "MULTIBOOT MODULES" in google. It isn't hard to find. YOu just need to parse the right structures.

Stay safe

Re:uKernels and Memory Management

Posted: Mon Jan 09, 2006 6:50 am
by kataklinger
Solar wrote: Same as with, "how can a kernel be booted from a file system if the file server isn't running yet": You provide some basic bootstrapping functionality, get the server up and running, and then disable / forget / delete the bootstrap code.

I would guess.
Well then you need to provide basic storage device drivers, or maybe network driver.

I think that bootloader should load all needed device drivers and services without which kernel cannot work. Or is there a better solution?

Re:uKernels and Memory Management

Posted: Mon Jan 09, 2006 7:39 am
by Pype.Clicker
in the microkernel design, the code that put things together is *not* necessarily part of the microkernel itself. The bootloader loads a package that contains the microkernel, initialization code, early drivers/services.

If it was a "barebones ?K", i guess it would look like this:
  • setup.elf expects a well-known physical memory setup, such as 'microkernel loaded between 1M and 2M, setup.elf loaded at 2M, services & stuff loaded as GRUB modules. setup.elf called as the entry point."
  • setup.elf gather GRUB information about available memory and fills the content of an integrated "setup internal memory manager"
  • setup.elf prepares Page Directory for each 'server' according to some pre-defined rules (e.g. map microkernel at 0xF000ba12 in each of those services, and the service bits as the ELF loader instructs)
  • each service then starts, calling the microkernel when needed. 'setup.elf' could for instance then use microkernel services to instruct the memory manager service of what physical memory is still available.