Subject: usermode kernel
To: None <netbsd-ports@netbsd.org>
From: beez <beez@proxy.goblin.cx>
List: netbsd-ports
Date: 12/10/2000 22:58:01
G'day, I've been kicking around an idea and would appreciate
some feedback;

Would it be possible to build a NetBSD kernel that would run
in usermode? In fact, would it be possible to build a kernel
that would run in usermode on top of other OS's (win32, dos32,
Linux, etc) ?

In theory it should be possible but I'm looking for practical
drawbacks that I would encounter. I see a couple of problems:

1. The host OS would need to support threads because the kernel
would need to rely on a synchronization mechanism from outside
the kernel (normally provided by the hardware clock) - the clock()
routine would need to run a seperate thread outside the kernel
itself.

2. Memory protection. I guess this is impossible, kernel and user
space would be one big malloc()'ed block from the host OS and
hardware MMU is not available (although a host-process might
have calls to lock certain parts of memory which the kernel
can take advantage of) - this means user space programs can
corrupt kernel memory (a problem yes, but it would still work
alas somewhat more 'dangerous')

3. practical problem: Since the kernel is essentially calling
libc from the host OS - how do I link the host's libc in? Since all
the libc functions are already defined by NetBSD's libc (e.g.
two fopen()'s)

4. Drivers - I don't see a problem here but I might be missing something,
I guess one could map a ethernet driver to the available networking
/video/keyboard/whatever functions of the host-OS.

 
Am I missing something, what other problems would arise if I want
to port the kernel to usermode? Are/were there any other people
doing something alike (in BSD land - in Linux land there is already
the user-mode linux project)

Any hints/tips/urls would be greatly appreciated!

p.s.: maybe this isn't even the proper mailing-list for this question...
or is it?

Cheers,
beez.