Page 1 of 1

Native and Hosted kernel design

Posted: Fri Dec 14, 2012 7:53 pm
by zeitue
I wrote a small X86 monolithic kernel with a few command line commands about 3 years ago.
It got deleted as well as 1 TB of data. no I have decided to return and try again. This time with a new design.

I am trying to do a micro kernel this time (written in C and Assembly(gas syntax)) with two different modes of running it.
one as a native micro kernel.
Two hosted on top of a host kernel like Linux, *BSDs, Mac OS X, etc.
I would like to know what would be required to run on top of these other kernels and be able to both use the host's drivers and allow the host to use my drivers. While at the same time keeping the hosted programs [-X that are running on my kernel from talking to the host system or using the host APIs.
I has thinking virtual drivers to access the host hardware and using PCI pass through to allow my hosted kernel to access the hardware for which the Host OS my not have a driver for.
I don't have any Idea how I could allow the host to use my drivers though :?:

Re: Native and Hosted kernel design

Posted: Sat Dec 15, 2012 8:22 am
by bluemoon
It depends on which part you want your OS to glue with other, and the common feature set on both side (say. the outcome of hosting your OS within DOS is totally different from Linux).

Take a look at FreeBSD's binary emulation layer, which it emulate linux's layer via syscall and is good enough to run 90% of native linux binary application (no, drivers are usually written specifically for one OS and simply cannot plug into other directly).

Bottom line, write an OS alone is an extraordinary complex task, and glue your OS with another OS is like merging two black holes, there is no good theory on the topic and nobody sure what it look like.

Re: Native and Hosted kernel design

Posted: Sat Dec 15, 2012 1:43 pm
by zeitue
Thank you for the information on the "FreeBSD's binary emulation layer" I had not really looked at it before.

I've look at AROS http://aros.sourceforge.net/ which uses the host kernel's system calls, which is where I got the Idea from. AROS can read and write to the host's filesystem using HostFS, however it does not allow for driver sharing with the host.

The next thing I've looked at was User Mode Linux(UML) http://user-mode-linux.sourceforge.net/ which is a port of the Linux kernel to it's own system call interface (Hosted kernel). It also has it's own HostFS and can't use share it's drivers with the host.

Then VirtualBox https://www.virtualbox.org/ which uses PCI passthrough to access the host hardware for it's own use. It allows host files to be read by a shared internal network. In an example you could run Windows in VirtualBox on Linux then plug in a piece of hardware only Windows can use and by the use of the PCI passthrough the Windows VM can access the hardware even though Linux does not know what it is.

X2 Standard is a cross platform driver interface http://www.bisque.com/x2standard/index.html

The X Windowing System http://x.org/ can run on multiple different system and has it's own drivers which work on all of it's platforms