Subject: Re: usermode kernel
To: beez <beez@proxy.goblin.cx>
From: None <jchacon@genuity.net>
List: netbsd-ports
Date: 12/10/2000 17:07:05
What is the advantage for doing this? In the linux world they're trying
it (via a god awful ptrace() interface iirc) because they have no kernel 
debugger. The ones on netbsd (ddb and remote gdb) work great.

James

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