[1410] in netbsd-help mailing list archive
installing athena binaries
daemon@ATHENA.MIT.EDU (Adam Skwersky)
Mon Mar 8 14:36:58 1999
To: netbsd-help@MIT.EDU
Date: Mon, 08 Mar 1999 14:36:39 EST
From: Adam Skwersky <askwersk@MIT.EDU>
Hi,
I got NetBSD 1.3.2 to install on VirtualPC. I followed the directions found
on
http://www.cs.mu.OZ.AU/tsa/projs/vpcbsd.html
I'd now like to try installing the Athena binaries to run a "virtual Athena
workstation". How do I do this?
I'll summarize how I installed NetBSD (following the directions in the
aforementioned URL), since I think it will be informative:
Basically, I downloaded the 1.3.2 bins to a dos partition.
There was a "hacked" kernel used which recognizes the PS/2 mouse and the
emulated DEC tulip. There was also an ld.so fix and an XF86Config.vga16
file. A fixed "ld.so" was copied to the dos partition for copying to
the netBSD installation.
The install was done using the 1.3.2 floppy (not hacked).
After the install complets I go to the Utilities menu and run the /bin/sh
and:
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
to setup the X server:
# 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
The porting issues were as follows: (the nice thing is that the source
code for the port is available).
Porting Issues
To help in porting other versions of UNIX to Virtual PC, the following issues need to be addressed.
The VPC PCI cards like to be configured using PCI_CONF_MODE 1, not mode 2 which is the default in NetBSD. In
the file /usr/src/sys/arch/i386/pci/pci_machdep.c you can redefine PCI_CONF_MODE (there is an option to do this in
the kernel config file but it ends up defining PCI_CONF_MODE="1" and the quotes confuse the code in the
pci_machdep.c file).
The file /usr/src/sys/dev/pci/if_de.c needs a few changes to make the ethernet driver functional. In summary it was
necessary to disable interrupts in the interrupt routine, rewrite the tulip setup code to do the setup synchronously (as
implied in the DEC 21041 documentation) and access the virtual PCI ethernet card using I/O mapping i/o instead of
memory mapped i/o. The working version of if_de.c is actually based on a snapshot from the NetBSD-current
distribution
/* $NetBSD: if_de.c,v 1.69 1998/06/08 06:55:55 thorpej Exp $ */
Dynamically linked programs don't work very well because of the use of a self-modifying code jump table in a heavily
code cached environment. In the unmodified ld.so, the code table uses a 386 CALL instruction to a binder_entry
routine with an index to the required library routine. The binder looks up the library routine in the dynamic library and
changes the CALL to a JMP offset, resetting the index value. Because Virtual PC caches a lot of 386 code routines,
subsequent calls to the library routine often result in the CALL binder operation being re-executed, but without the
right index value. The simplest approach for now is to removed the index reset code from the file
/usr/src/gnu/usr.bin/ld/arch/i386/md.c. This results in unnecessary overheads in calling the binder routine, but only
while this code is actually cached by Virtual PC.
The real time timekeeping is atrociously bad, presumably clock interrupts are being lost because MacOS is busy doing
other things. To some degree you can work around this by running 'rdate -s otherhost' or by a combination of this and
the NTP daemon 'xntpd'. This of course requires a network connection. If you build your own NetBSD kernel, you
should modify the option RTC_OFFSET=0 to reflect reality. IE: the PC harware clock and MacOS operate in local
time, the UNIX kernel uses UTC.
If you use the UNIX shutdown command to shutdown your NetBSD session, you will end up in the kernel debugger
with the 'beep' sound running continuously. Type 'continue' and as many RETURNS as it takes to complete the
shutdown process. You could alternately use sync; sync; halt.
The kernel causes a floating-point-exception divide-by-zero error in order to determine the method of FPU error
reporting (by IRQ 13 or by exception 16). Under VirtualPC, the kernel exception routine is never called. User-level
exceptions are, however, presumably this is due to FPU exceptions not working in supervisor mode. One workaround is
to hardwire exception 16 as the default reporting method.
The emulated ATAPI CD-ROM device sets the Task File Register, Error = 0x01 as suggested by the ATAPI spec. but
it also SETS the ERROR flag in the Status register. It appears that the BUSY flag is never de-asserted after an
ATAPI_SOFT_RESET. This confuses the NetBSD "wd" driver. Similarly, following an
ATAPI_IDENTIFY_DEVICE command, the driver never sees a drive ready status. The workarounds are to ignore the
wait_for_unbusy() call after the ATAPI_SOFT_RESET command and the atapi_ready() call after the
ATAPI_IDENTIFY_DEVICE command.
The current set of source code changes are available from the source code changes directory.