OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 8:24 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: For lack of a better word: Virtual Kernel?
PostPosted: Sat May 26, 2007 7:37 pm 
Offline
User avatar

Joined: Sun Apr 29, 2007 12:22 pm
Posts: 13
Alright, my OS is designed around a x64 architecture so assuming space and speed are not an issue I've been toying with an idea that I thought might be an interesting idea to implement. Has anyone ever thought of something like a virtual kernel? Like a virtual machine enables you to load a kernel on a 'fake' portion of the hard drive, could a kernel have a procedure to load a version of itself?

My idea kind of breaksdown like this:
1. The base kernel is booted
2. A function in the base kernel set to run on boot runs
3. That function sets the base kernel's I/O ports (I am uneducated at this point, trying to learn, regarding what to call the addresses that the kernel interacts with so I'll say I/O ports) to a secondary position where they wont get in the way.
4. The function boots a second kernel, identical to the first but without the function that loads the virtual kernel
5. The empty I/O ports and other values for the hardware and stuff from the base kernel are assigned to the virtual kernel
6. Use continues as normal except that all processes are directed through the virtual kernel with the function used to start it running in the background.
7. Should a serious kernel error occur, a trigger in the function used to start the virtual kernel will terminate the virtual kernel, return the base kernel to the proper I/O ports and stuff and direct process through that until the virtual kernel is ready to work again at which point the process is repeated.

I'll try to make a flowchart:

Once virtual kernel is running:
_____________
|user interface| ----- Virtual Kernel ------ Process 1,2,3,etc
|_____________|,,,,,,,,,,,,,,,,,|
......................................| Function running the virtual kernel
......................................|
...............................Base Kernel

If an error occurs:

_____________
|user interface| ----- Virtual Kernel ------ Process 1,2,3,UH OH BADNESS!
|_____________|................|
.....................................X Function running the virtual kernel terminates
.....................................|
...............................Base Kernel

After the error:

_____________
|user interface| ----- Base Kernel ------ Process 1,2,3,minus the error giver
|_____________|

Then the base kernel rebuilds the virtual kernel

I know that this may be difficult and impractical, but it seems like an interesting idea for system stability. Can anyone supply me with an absolute deterrent besides 'it would slow stuff down' to try to implement this in Fenrir?

**EDIT**Not just deterrents but also suggestions would be nice too**EDIT**


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 26, 2007 8:11 pm 
Offline
Member
Member

Joined: Thu Oct 21, 2004 11:00 pm
Posts: 248
So you're just virtualizing the kernel-level CPU privileges? What do you mean by I/O ports (since that's a defined term)?

Here's a suggestion: abstract over kernel-level CPU functionality with a Hardware Abstraction Layer, and then virtualize that.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 27, 2007 8:42 am 
Offline
User avatar

Joined: Sun Apr 29, 2007 12:22 pm
Posts: 13
By I/O ports, I mean whatever the proper term is for wherever/whatever the kernel uses to interface with hardware etc. I currently do not know the proper term for those locations, but I'm looking into that right now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 47 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group