Subject: darwin_lib
To: netbsd-help <netbsd-help@NetBSD.ORG>
From: john mcloskey <johnmcloskey@gmail.com>
List: netbsd-help
Date: 03/03/2006 18:55:24
Hello,
I am new to this list, thanks in advance to all information and or
advice you all have.
My problem is with the darwin compatability built into NetBSD.
I have not been able to find any documentation on the subjuct other
than that its possible.
Basically I have a clean install of NetBSD 3.0 on intel pentium 4.
From this I have downloaded syssrc.tar.gz and untarred it to /usr/src.
Then I went into /usr/src/sys/arch/i386/conf and copied GENERIC.MPACPI
to MACHO_KERNEL.
I edited the MACHO_KERNEL config file as follows (only removing the hash ma=
rks);

#options         COMPAT_MACH     # binary compatibility with Mach binaries
#options         COMPAT_DARWIN   # binary compatibility with Darwin binarie=
s
#options         EXEC_MACHO      # exec MACH-O binaries

options         COMPAT_MACH     # binary compatibility with Mach binaries
options         COMPAT_DARWIN   # binary compatibility with Darwin binaries
options         EXEC_MACHO      # exec MACH-O binaries

Then I ran config MACHO_KERNEL, and it told me to run make depend in
../complie/MACHO_KERNEL, so went into ../compile/MACHO_KERNEL and
executed the make depend command. It finished and I finally executed
make command. It finished and I moved the resulting netbsd file from
the /usr/src/sys/arch/i386/compile/netbsd to /netbsd and rebooted into
the new system.

Once in the new system, I went into the
/usr/pkgsrc/emulators/darwin_lib and executed the command, make
install clean. It finshed successfully and left me with a /emul/darwin
directory populated with System usr and private subdirectories.

This is where I am stuck, I have not been able to read about the
compatibility layer any further, so any links would be appreciated. My
questions about darwin_lib are;

1. Do I need to chroot into /emul/darwin in order to execute mach binaries?
This is what currently happens;

bash-3.00$ /emul/darwin/usr/bin/strings
bash: /emul/darwin/usr/bin/strings: cannot execute binary file
bash-3.00$ ls -l strings
-r-xr-xr-x  1 root  wheel  182596 Mar  2 00:11 strings
bash-3.00$ cd /emul/darwin/usr/bin
bash-3.00$  ./strings
bash: ./strings: Cannot allocate memory

2. What should I see when I execute the file command on mach binaries?
This is what I currently see;

bash-3.00$ file /emul/darwin/usr/bin/strings
/emul/darwin/usr/bin/strings: compiled Java class data, version 2.0

3. Can I update the /emul/darwin directory with i386 binary
distribution 7.x or 8.x

I have a large number of darwin apps that I would enjoy running under NetBS=
D.
Thanks for any info you all can assist me with.