Darwin/OS-X support

mol-devel@lists.maconlinux.org mol-devel@lists.maconlinux.org
Wed, 2 Oct 2002 14:11:31 +0200


On Fri, Sep 27, 2002 at 03:01:29PM -0600, Nathan Wertman wrote:
> Not that much is necessary...I have been looking at it for the past 
> couple of days (I have been very busy so not much has been 
> accomplished).  I noticed that I can get most of it to compile down to 
> the kernel extension.  There are some comments in that code that says 
> the functions need to be written.
> 
> I also noticed that the compiler was having some trouble with the 
> debugger section of MOL.  I just removed it from the make file and 
> continued on.
> 
> If anyone else out there is interested in working on a Darwin port of 
> MOL please do not hesitate to get in contact with me.  I would love to 
> be able to run Linux over my OSX install.

As you say, not that much is necessary. I started the OS X port
some time ago, and the userspace part should be essentially
be working. I even got the debugger working eventually.

The main thing that remains is finishing the port of the
kernel module. So far the following has been done in
this area:

- A working communications model between the module
and the userspace program has been found; it remains
to utilize it (the Linux syscall-based implementation is
in misc.c).

- The assembly code compiles (OS X has a brain-dead assembler
essentially withouut macros, so I had to convert everything
to m4 macros).

- I have replaced Linux specific calls for allocating memory,
wiring memory etc. with generic ones.

The Technical questions remaining are:

- VSID allocation. MOL needs to own a number of VSIDs.
A kernel patch could easily give us that, but to run it
on a stock system, one probably has to use a more or
less hackish solution.

- Page fault handling. In Linux, MOL access the page table
directly. If a page is missing, it invokes the Linux page
fault handler (to allocate the mac-ram page).

- Page flush detection. In Linux MOL uses a hook to detect
when a page is flushed (e.g. swapped out). We need
something similar for OS X. I believe one can insert a hook
somewhere, but perhaps there is a cleaner solution.

Cheers,

/Samuel