|
[September 2002, New Stuff: the page rewrite didn't happen and no spare time
is likely to be available for it any time soon. The kernel file below will
allow you to run NetBSD 1.6 under VPC 4.0.
The file
netbsd.1.6/netbsd.1
is a more or less GENERIC NetBSD 1.6 kernel with a fix applied to allow the
"de" ethernet interface to be used. The kernel was built on a Titanium G4
PowerBook running NetBSD 1.6 installed from a standard NetBSD 1.6 disribution
CD.
See also the XF86Config and synctime files in the section below and the
README
file available on the FTP site.
]
[April 2001, New Stuff: Coming soon, a page rewrite and various updates for
NetBSD 1.5 running under VPC 4.0. In the meantime, Connectix have released
VPC 4.0.2 which offers support for the 1152x768 video mode available on
the Titanium G4 PowerBook.
The file
linux/XF86Config
will allow you to use the supplied RedHat Linux X server in 1152x768 mode.
Installs as /etc/X11/XF86Config (save the original somewhere first).
The file netbsd/XF86Config
can be used with a default NetBSD 1.5 installation and the X server (make sure
that /usr/X11R6/bin/X is a symbolic link to /usr/X11R6/bin/XF86_S3, optionally
install .xinitrc in your
home directory).
The file
netbsd/netbsd.0
is a GENERIC NetBSD 1.5 kernel with a fix applied to allow the "de" ethernet
interface to be used. The kernel was built on a Titanium G4 PowerBook running
NetBSD 1.5 installed from a standard NetBSD 1.5 disribution CD.
The files
linux/synctime,
netbsd/synctime.elf and
netbsd/synctime.aout
(the .elf version is for NetBSD 1.5 and the .aout version is for NetBSD 1.4
and lower, and OpenBSD) force the Linux/*BSD system time to track the underlying
Macintosh time.
Without this daemon running, the emulated system time will drift due to lost
interrupts, perhaps running slow by as much as 10-15%.
To install this program, download the appropriate format file, rename and
install it as /usr/local/sbin/synctime. Arrange for it to be called from
/etc/rc.local, /etc/rc.d/rc.local or equivalent so that it runs at boot time.
See also the OpenBSD on Virtual PC page
for details on installing and using OpenBSD.
]
This page should provide you with enough information to run
NetBSD version 1.3.2 under
Connectix's
Virtual PC 2.1 including a simple
XFree86 X-window server.
Packages
"The NetBSD Project is a collective volunteer effort to produce a freely
available and redistributable UNIX-like operating system.
NetBSD runs on a broad range of hardware platforms and is highly portable.
It comes with complete source code, and is user-supported."
Virtual PC is a commercial PC-harware emulator running on PowerPC CPUs under
MacOS. In addition to emulating a Pentium processor with MMX instructions,
Virtual PC emulates an accelerated SVGA card, ethernet controller,
sound-blaster Pro sound card, IDE/ATAPI controller and PCI bridge
interface.
"XFree86 is a freely redistributable implementation of the
X Window System that
runs on UNIX(R) and UNIX-like operating systems."
Hardware
As you might expect, the
overall speed of the PC emulator is highly dependant on the speed of your PPC
CPU, the amount of L2 cache and the amount of real RAM that you can allocate
to the program. Blinding speed, however, is not necessary for running a
simple UNIX environment for file editing, simple program development etc.
It's also very useful to be able to do this on a Macintosh PowerBook away
from any network connection (the ideal platform is probably a
PowerBook G3 Series laptop).
A quick non-scientific comparison on various NetBSD 1.3.N platforms gives
the following results for the command string (CPU time in seconds, smaller is
better):
% echo '2 ^ 100000' | /usr/bin/time bc |& grep user
PowerMac 7300/200: 31.51 real 31.11 user 0.19 sys
PowerBook G3S/250: 33.65 real 33.38 user 0.06 sys
Pentium/166MHz: 44.02 real 43.59 user 0.11 sys
Changes
Although NetBSD 1.3.2 almost works "out of the box" under Virtual PC, there are
some issues due to the way the emulator works (eg: code caching), assumptions
made by NetBSD or the way the hardware emulation differs in minor ways from
real world hardware. To fix these issues, you need to download a customised
NetBSD 1.3.2 kernel /netbsd
and a new version of the runtime link-editor for dynamically linked programs
/usr/libexec/ld.so, or you can get the source code or diffs and construct
your own versions (eg: on a system already running NetBSD) using the
source code changes.
See below for more details about what needed to be changed.
In the various versions of the kernel, the following subsystems are known
to be not working, the remaining problems are still under investigation
NetBSD 1.3.2 (GENERIC) #0: Sun May 24 19:45:48 EDT 1998
(generic 1.3.2 kernel in kern.tgz distribution set)
PCI cards
PS/2 Mouse driver
ATAPI CD-ROM driver
Tulip Ethernet driver
npx FPU (Floating Point Unit) (uses software emulation)
NetBSD 1.3.2 (VPC) #0: Tue Jul 14 14:46:31 EST 1998
(in ftp://munnari.OZ.AU/mac/vpcbsd/kern.tgz.0)
PS/2 Mouse driver
ATAPI CD-ROM driver
npx FPU (Floating Point Unit) (uses software emulation)
NetBSD 1.3.2 (VPC) #1: Sun Jul 26 11:26:04 EST 1998
(in ftp://munnari.OZ.AU/mac/vpcbsd/kern.tgz)
There are also some as yet unsolved issues with the XF86_S3 X-Windows server.
Installation
To do the installation, you will need to have already set up Virtual PC
with Windows 95, have enough disk space to create a UNIX filesystem of at least
250Mb, a temporary scratch DOS filesystem of around 40Mb and have Fetch or
another MacOS FTP client installed.
If you also want the C compiler, download the file set
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/binary/sets/comp.tgz
For the UNIX manual entries and UNIX typesetting tools, download the sets
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/binary/sets/man.tgz
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/binary/sets/text.tgz
For UNIX games, download the set
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/binary/sets/games.tgz
For the X-Windows system, download the sets
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/binary/sets/xbase.tgz
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/binary/sets/xcomp.tgz
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/binary/sets/xcontrib.tgz
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/binary/sets/xfont.tgz
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/binary/sets/xserver.tgz
(there may be a mirror site closer to you than ftp.NetBSD.ORG, check for
locations on the NetBSD web page).
You will also need to download the files
ftp://munnari.OZ.AU/mac/vpcbsd/ld.so
ftp://munnari.OZ.AU/mac/vpcbsd/XF86Config.vga16
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/INSTALL
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/installation/floppy/boot.fs
ftp://ftp.NetBSD.ORG/pub/NetBSD/NetBSD-1.3.2/i386/installation/misc/rawrite.exe
The rawrite utility allows you to make a boot floppy from the boot.fs image
using Windows or DOS. When you have the necessary NetBSD files, quit from
your FTP client and drop the 'PC DISK' volume into the Trash (to disconnect
from the 'DOS Scratch' image).
The next step is to make yourself a NetBSD boot floppy using the rawrite
utility and the file boot.fs now on the 'DOS Scratch' filesystem. You will
also need a 1.44Mb floppy (any format). Start your Windows 95 version of
Virtual PC, holding down the option key. When you get the 'PC Preferences'
dialog box select a new 'D-Drive' image as the 'DOS Scratch' image and hit
the Restart button. When Windows is running, choose 'MS-DOS Prompt' from
the Progams menu in the Start Menu. Enter the following DOS commands
d:
rawrite
boot.fs (for source file name)
a: (for destination drive)
ENTER (after inserting floppy)
exit (to exit DOS Prompt)
Select the Virtual PC 'Eject Floppy' button and then shutdown Windows. You
don't need to remove the 'DOS Scratch' filesystem from the Windows D-Drive
yet as it may be useful at some time in the future.
You now have a NetBSD boot floppy. Run the copied version of Virtual PC in the
NetBSD folder and *at the same time* reinsert the boot floppy. You should see
the usual boot messages about NetBSD.
>> NetBSD/i386 BIOS Boot, Revision 2.2
>> (frank@struis, Tue May 12 13:01:43 MEST 1998)
>> Memory: 640/22528 k
etc.
booting fd0a:netbsd.gz
etc.
Assuming that all is well (the process waits at some of the stages, so be
patient), you should get the 'NetBSD-1.3.2 Install System' page, select the
installation options on the various pages as follows (use the arrow keys to
move up and down the list and RETURN to make a selection, text you have to
enter appears in bold, UNIX commands are preceeded with #)
a: Install NetBSD to hard disk RETURN
b: Yes (to continue)
wd0 (as the drive to install NetBSD)
b: Continue with install (to accept the current geometry)
a: IDE (as the kind of disk drive being used)
a: No (to not exclude the last cylinder)
a: Use the entire disk (remember this is the NetBSD Image file)
b: Yes (to overwrite the non-NetBSD partition)
a: Standard (assuming you don't want X-Windows)
*OR* b: Standard with X (assuming you downloaded the X sets)
a: Partitions are ok (probably safe to use the defaults)
mydisk (as the disk name)
b: Yes (to continue)
Setting up the DOS partition table ...
etc.
Populating filesystems with bootstrapping binaries and config files...
etc.
RETURN (to proceed if no errors)
b: Custom installation (if you don't want X yet)
Use the arrow keys to toggle all X related distribution sets
- and any sets that you didn't choose in the list above - to No.
*OR* a: Full installation (to include X-Windows)
x: to exit
e: unmounted fs (to select the DOS-Scratch filesystem)
a: Device (set device to d: drive)
wd1e
b: Filesystem (set filesystem type)
msdos
d: Continue (to continue)
a: No (don't want to see all file names)
Extracting file /mnt2//kern.tgz ...
Extracting file /mnt2//base.tgz ... (this takes a while to complete)
etc.
a: ok (all unpacked successfully)
Making device files ...
a: ok (note the instructions!)
e: Utility menu (some more housework to do first)
a: Run /bin/sh (we need a shell to copy ld.so)
# mount /dev/wd0e /usr
# mount -t msdos /dev/wd1e /mnt
# cp /mnt/ld.so /usr/libexec/ld.so
# chown bin.bin /usr/libexec/ld.so
# chmod 555 /usr/libexec/ld.so
# sync
# exit
x: Exit (back to Install System page)
d: Reboot the computer (to boot the new kernel)
Terminated
# (wait for 20 seconds or so)
When the machine has rebooted, login as root (no initial password), then
do the following
# mount -t msdos /dev/wd1e /mnt
# cd /mnt
# view INSTALL
to read all about what you have just done, but on a Macintosh instead of
a PC ;-). In particular, read section 10. Finalizing your installation.
As for administering your personal UNIX machine, you're on your own, see
one or more of the many UNIX administration books available. At the very
least you should set up a root password using the passwd command
# passwd
You can also edit the /etc/fstab file to have the 'DOS Scratch' file
permanently available in the UNIX /d: directory. Add the line
/dev/wd1e /d: msdos rw,-u=0,-g=0 0 0
to the fstab file, either using vi or ed, or by
# cat >> /etc/fstab
/dev/wd1e /d: msdos rw,-u=0,-g=0 0 0
^D
Then make a /d: directory using
# mkdir /d:
To use the ATAPI CD-ROM (ie: really the Mac CD-ROM, requires (VPC) #1 kernel)
# mkdir /cdrom
# mount -t cd9660 /dev/cd0a /cdrom
To start the network, assuming you have been assigned an IP address of
192.43.207.21 via a gateway of 192.43.207.1, do the following commands as
root
# ifconfig de0 inet 192.43.207.21 netmask 255.255.255.0 media utp up
# route add default 192.43.207.1
If you are running this on a laptop, you probably want to put these commands
into a shell script in /usr/local/bin. If not, then you need to add a file
called /etc/ifconfig.de0 with the content something like
192.43.207.21 netmask 255.255.255.248 broadcast 192.43.207.255 media utp
This will cause the interface to be configured when the machine boots. You may
also need to edit the file /etc/netstart.
To be able to use a Domain Name Server for the internet, create a file called
/etc/resolv.conf with the content
search somedomain.com
nameserver 192.43.207.22
Where somedomain.com is your local domain, and 192.43.207.22 is the IP address
of your local nameserver host (you can have multiple nameserver entries).
Currently you can only run a 640 x 480, 16 colour X-Windows system, but this is
better than just the raw console. To setup the X-Server, perform the following
steps to: install the X configuration file, link the default X-server to the
VGA X-Server, create a mouse device, include the X binaries in your path,
include the X libraries in the default search path and start the X-Server.
(NB: if you are doing this after rebooting with the changed fstab, substitute
/d: for /mnt in the first line below)
# cp /mnt/XF86Config.vga16 /etc/XF86Config
# rm /usr/X11R6/bin/X
# ln -s /usr/X11R6/bin/XF86_VGA16 /usr/X11R6/bin/X
# ln /dev/pms0 /dev/mouse
# set path=($path /usr/X11R6/bin)
# touch /etc/ld.so.conf
# cat >> /etc/ld.so.conf
/usr/X11R6/lib
^D
# ldconfig
# rehash
# startx
You can also install another window manager (such as fvwm2) and get virtual
display panels. Information on doing this is outside the scope of this document.
Backing up your UNIX "partition"
Since your UNIX filesystem is simply a large Macintosh file, you can easily
make backup copies by copying the "NetBSD Image" file to another machine or
hard disc. You should have some backup regime!
Porting Issues
To help in porting other versions of UNIX to Virtual PC, the following issues
need to be addressed.
The current set of source code changes are available from the
source code changes directory.
Disclaimer
Neither the author or his employer have any affiliation with either of these
packages or the respective organisations mentioned herein, except as mostly
satisfied users. Virtual PC is a TradeMark of Connectix Corporation.
For more information about NetBSD, contact the NetBSD Foundation, Inc.
Enjoy!
|