Micro-Kernel Server/Services/Driver/Module Load Syncro
Posted: Tue Aug 21, 2007 7:48 pm
Micro-Kernel Server/Services/Driver/Module Load Synchronization
This is actually a stumbling stone for people when writing a Micro-Kernel, or any type of kernel in actuality. I think a lot of troubles come when people actually realize that things have to be loaded or have synchronized loading. For example: The disk driver can not completely load before the virtual file system (module/driver/service/server) loads. In practical thinking you actually have to ask your-self who tells the disk driver to load and what controller does it drive?
I am sure a lot of people actually get to a point where they can load some type of module or meta-module of code, into memory or execute in memory in a specified manner. The general assumption and outcome is to just load all modules one after another as quick as possible. I am not saying this is a bad idea but simply giving a example of a situation you might find your self in.
When thinking about it I come up with three broad types of load synchronization:
1. Just load them.
Let each driver implement it's own waiting mechanism. Such as allowing the VFS to define messages that can be used to communicate if it has finished loading and such... basically the developer implementing custom load synchronization.
Just for a more in depth example we could imagine a bunch of people being lead into a room, and then saying o-kay now get something done. The main point here is that each people will have to wait for the other appropriate person to become ready. The communication by mouth should be the equivalent of sending messages back and forth between modules.
2. Tree loading approach. The kernel module loads a <nameless> module which then attempts to load a:
Well the idea is simply to eliminate the Physical Disk Manager (JUST FOR EXAMPLE!) to load before the Virtual File System Module. Instead allow the VFS module to explicitly load the Physical Disk Manager instead and so forth essentially using the structure of the tree as guide for synchronization.
3. Layer Loading Approach
Here each driver or module is assigned a layer number 0 to <whatever>. The lowest module are loaded first, and send a message back saying they have loaded then the next layer (1..2...3...) and so forth is loaded while this same process repeats.
This is actually a stumbling stone for people when writing a Micro-Kernel, or any type of kernel in actuality. I think a lot of troubles come when people actually realize that things have to be loaded or have synchronized loading. For example: The disk driver can not completely load before the virtual file system (module/driver/service/server) loads. In practical thinking you actually have to ask your-self who tells the disk driver to load and what controller does it drive?
I am sure a lot of people actually get to a point where they can load some type of module or meta-module of code, into memory or execute in memory in a specified manner. The general assumption and outcome is to just load all modules one after another as quick as possible. I am not saying this is a bad idea but simply giving a example of a situation you might find your self in.
When thinking about it I come up with three broad types of load synchronization:
1. Just load them.
Let each driver implement it's own waiting mechanism. Such as allowing the VFS to define messages that can be used to communicate if it has finished loading and such... basically the developer implementing custom load synchronization.
Just for a more in depth example we could imagine a bunch of people being lead into a room, and then saying o-kay now get something done. The main point here is that each people will have to wait for the other appropriate person to become ready. The communication by mouth should be the equivalent of sending messages back and forth between modules.
2. Tree loading approach. The kernel module loads a <nameless> module which then attempts to load a:
Code: Select all
2.1 Human Interface Device Module
2.1.1 Mouse Driver
2.1.2 Keyboard Driver
2.2 Virtual File System Module
2.2.1 Physical Disk Manager
2.2.1.1 Appropriate Drivers For Controllers
2.2.2 Network Disk Manager
3. Layer Loading Approach
Here each driver or module is assigned a layer number 0 to <whatever>. The lowest module are loaded first, and send a message back saying they have loaded then the next layer (1..2...3...) and so forth is loaded while this same process repeats.