uKernels and Memory Management

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
deadmutex

uKernels and Memory Management

Post 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? ???
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:uKernels and Memory Management

Post 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.
Every good solution is obvious once you've found it.
deadmutex

Re:uKernels and Memory Management

Post 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?
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:uKernels and Memory Management

Post 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
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:uKernels and Memory Management

Post 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?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:uKernels and Memory Management

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