Macintosh Application Environment (Failure pt 1)

It’s a rainy day, and I didn’t feel well enough to wander around outside, and check out the ‘spyware street lights’. Although that’s the latest rage at the moment along with the usual stuff.

Instead I thought it’d be fun to try some ‘undercover’ software like that time when Apple thought it would be a good idea to port the ToolBox to Unix and run it as a competitor to programs like SoftPC as people with $30,000 workstations clearly needed a virtual Macintosh.

So I spent way too much time letting my 2006 Mac Pro grind out a Solaris 2.6 install, and then using the latest Tenox dump on archive.org I installed MAE 2.0! For anyone wondering the actual serial number is: 192c4838330166201b

And after serializing the app, and running it, I get a nice kernel panic. I thought I was playing it safe by opting out of the kernel module stuff as I don’t care about reading MacOS formatted diskettes.

I guess I really need Solaris 2.4 and those weird patches.

Internet Explorer. For Unix. Really.

Meanwhile you can rest assured that Internet Explorer 5.0 loads up just fine. It is painfully slow, but there it is. I was even able to download stuff with my ‘http backdoor’ thing to vpsland. So at least that works.

Hard to imagine a time that Microsoft was going cross platform under Gates, but Internet Explorer 3/4/5 were available on MacOS & OS X, with 4&5 under Solaris and HP/UX. Then of course there was that SUN Java lawsuit and they pulled the rug out from interoptability. Although I was a Linux on SPARC user in this era, having it available on Linux would have helped a LOT, but naturally Microsoft didn’t entertain that Linux market thing as it was cancer to them. Meanwhile Chromium Edge is only a Windows / OS X thing.

I was hoping to go further, but it appears not today.

Revisiting a Solaris on Qemu install

Since I had written about it the last time, quite a bit of the emulation on Qemu has improved significantly since then.  As always you’ll need to create and prepare a disk image, and I’m using an old SUN Station 5 PROM.

qemu-system-sparc -L . -m 64 -M SS-5 -bios ss5.bin -drive file=36G.disk,bus=0,unit=0,media=disk -drive file=solaris_2.6_598_sparc.iso,bus=0,unit=6,media=cdrom -startdate “1999-04-19”

One nice thing is that now you can boot off the CD-ROM.  And you can boot Solaris 2.6 directly into single user mode to format and label the disk.  It’s very convenient.  All you need here is

boot cdrom:d

And from there you can either kick off the disk partitioning, or the installer will boot up.

Booting from Prom to CD-ROM

And now to the graphical welcome screen!

Welcome

And then off to the ‘graphical’ installer.  Yes, it’s not that graphical at all.  Like before, it’s important that you don’t let it reboot on completion, you have to make changes to the system so it’ll boot up correctly, and make changes to the network config.  At least in graphical mode vi works.

installation

It is absolutely critical that you make this change or the disk will not boot at all.

cd /a/etc
# cat >> system
set scsi_options=0x58
^D

For networking:

And you will want a default route…

# cat > defaultrouter
10.0.2.2
^D

Then in the file /etc/nsswitch.conf change the following:

hosts: files

to

hosts: files dns

Then to ‘fix’ up your /etc/resolv.conf

# cat > resolv.conf
nameserver 10.0.2.3
#

And then I like to add the following hosts to speed up telnet…

# cat >> hosts
10.0.2.2 qemunat
10.0.2.3 qemudns
^D

And then hit Control+D and it’ll reboot back to the PROM.  Now all you have to type in the PROM monitor is:

boot disk0:

And in a minute you’ll be at the login screen.

Login Window

I went ahead with CDE, and over on archive.org the old SimCity for UNIX versions are over there.  One nice thing about being able to use CD-ROM’s is that Qemu can finally auto-mount the disk images.  It’s great.

Meltdown

There is no license for SimCity, and after 5 minutes the city goes into a ‘meltdown’ mode.  It’s a shame that back in the day the upstart x86 Linux was largely ignored by the UNIX market.  But Qemu has come quite a bit where you can run some of this proprietary VAR software.

Torbjörn Granlund’s Excellent resource on running free OS’s on Qemu

Ever get tired of x86 on x86?  yeah me too.

How to solve that problem?

Simple, grab QEMU, and jump off into all those cool RISC processors of the 1990’s that were going to save us all from the WINTEL hegemony!

Lots of instructions, samples, images, and hints here:

https://gmplib.org/~tege/qemu.html

It’s really more comprehensive than I’ve sat down to do, so yeah it’s awesome!

Supported platforms include:

mips32,mips64,sparc32,sparc64,ppc32,ppc64,arm32,arm64,s390x,alpha

20 years of OpenBSD

puffy58Yes, 20 years!

The list announcement:

OpenBSD's source tree just turned 20 years old.

I recall the import taking about 3 hours on an EISA-bus 486 with 
two ESDI drives.  There was an import attempt a few days earlier, 
but it failed due to insufficient space.  It took some time to 
repartition the machine.

It wasn't terribly long before David Miller, Chuck Cranor and 
Niklas Hallqvist were commiting... then more people showed up.

The first developments were improvements to 32-bit sparc.

Chuck and I also worked on setting up the first 'anoncvs' to make 
sure noone was ever cut out from 'the language of diffs' again.
I guess that was the precursor for the github concept these 
days :-).  People forget, but even FSF was a walled garden at 
the time -- throwing tar files with vague logs over the wall 
every couple months.

I was lucky to have one of the few 64Kbit ISDN links in town,
otherwise this would not have happened.  My desktop was a 
Sparcstation 10; the third machine I had was a very slow 386.

The project is now at:

~322,000 commits
~44 commits/day average
~356 hackers through the years

I thought I’d try OpenBSD 2.0 SPARC on Qemu!  Well either with SUN PROMs, or OpenBIOS the result is the same, it crashes when initializing the SCSI bus.

ok boot disk0:b
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0:b File and args:
>> OpenBSD BOOT [$Revision: 1.2 $]
Booting /bsd @ 0x4000
1179616+113448+93300+[48552+53058]=0x16f46e
(if this doesn’t work, fix pmap_bootstrap4m in pmap.c)[ preserving 101620 bytes of bsd symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

OpenBSD 2.0 (GENERIC) #2: Thu Oct 10 17:50:37 MDT 1996
deraadt@sun4c:/usr/src/sys/arch/sparc/compile/GENERIC
real mem = 33165312
avail mem = 29028352
using 404 buffers containing 1654784 bytes of memory
bootpath: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:b
mainbus0 (root): SUNW,SPARCstation-5
cpu0 at mainbus0: FMI,MB86904 @ 1169 MHz, MB86910 or WTL1164/5 FPU
cpu0: physical 16K instruction (32 b/l), 8K data (16 b/l) cache NOT enabled for 4/0 cpu/mmu combination
obio0 at mainbus0
clock0 at obio0 addr 0x71200000: mk48t08 (eeprom)
timer0 at obio0 addr 0x71d00000 delay constant 73
auxreg0 at obio0 addr 0x71900000
zs0 at obio0 addr 0x71100000 pri 12, softpri 6
zs0a: console i/o
zs1 at obio0 addr 0x71000000 pri 12, softpri 6
[slavioconfig at obio0] addr 0x71800000 not configured
power0 at obio0 addr 0x71910000
fdc0 at obio0 addr 0x71400000 pri 11, softpri 4: chip 82077
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
iommu0 at mainbus0 addr 0x10000000: version 5/0, page-size 4096, range 64MB
sbus0 at iommu0: clock = 584.500 MHz
dma0 at sbus0 slot 5 offset 0x8400000: rev 2
esp0 at dma0 slot 0x5 offset 0x8800000 pri 4: ESP200 40Mhz, target 7
scsibus0 at esp0
trap type 0x29: pc=f80e2494 npc=f80e2498 psr=4001bc0<EF,S,PS>
panic: trap
Stopped at _Debugger+0x4: jmpl [%o7 + 0x8], %g0
db>

But you can play kernel hangman, if you are into that kind of thing.

But make no mistake, the new 5.8 release (just released!) boots up just fine on Qemu:

Welcome to OpenBIOS v1.1 built on Jun 17 2015 18:50
Type ‘help’ for detailed information
Trying disk…
Not a bootable ELF image
Loading a.out image…
Loaded 66648 bytes
entry point is 0x4000
bootpath: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0

Jumping to entry point 00004000 for type 00000005…
switching to new context:
>> OpenBSD BOOT 2.11
Booting bsd
Loading at physical address 400000
1316320+2139464+409400=0x3b0604
cannot open /etc/random.seed: No such file or directory
console is ttya
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2015 OpenBSD. All rights reserved. http://www.OpenBSD.org

OpenBSD 5.8 (RAMDISK) #23: Sun Aug 9 00:08:29 GMT 2015
[email protected]:/usr/src/sys/arch/sparc/compile/RAMDISK
real mem = 117309440 (111MB)
avail mem = 111083520 (105MB)
mainbus0 at root: SUNW,SPARCstation-5
cpu0 at mainbus0: MB86904 @ 170 MHz, MB86910 or WTL1164/5 FPU
cpu0: 16K instruction (32 b/l), 8K data (16 b/l), 512K external (32 b/l) cache enabled
obio0 at mainbus0
clock0 at obio0 addr 0x71200000: mk48t08 (eeprom)
timer0 at obio0 addr 0x71d00000: delay constant 73, frequency 2000000 Hz
zs0 at obio0 addr 0x71100000 pri 12, softpri 6
zstty0 at zs0 channel 0: console
zstty1 at zs0 channel 1
zs1 at obio0 addr 0x71000000 pri 12, softpri 6
zskbd0 at zs1 channel 0: no keyboard
zstty2 at zs1 channel 1: mouse
fdc0 at obio0 addr 0x71400000 pri 11, softpri 4: chip 82077
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
auxreg0 at obio0 addr 0x71900000
power0 at obio0 addr 0x71910000
slavioconfig at obio0 addr 0x71800000 not configured
chosen “reg” property length = -1 (need multiple of 12)
builtin “reg” property length = -1 (need multiple of 12)
iommu0 at mainbus0 addr 0x10000000: version 0x5/0x0, page-size 4096, range 64MB
sbus0 at iommu0: 21.250 MHz
dma0 at sbus0 slot 5 offset 0x8400000: rev 2
esp0 at dma0 offset 0x8800000 pri 4: ESP200, 40MHz
scsibus0 at esp0: 8 targets, initiator 7
sd0 at scsibus0 targ 0 lun 0: <QEMU, QEMU HARDDISK, 2.4.> SCSI3 0/direct fixed
sd0: 6MB, 512 bytes/sector, 12288 sectors
cd0 at scsibus0 targ 2 lun 0: <QEMU, QEMU CD-ROM, 2.4.> SCSI3 5/cdrom removable
ledma0 at sbus0 slot 5 offset 0x8400010: rev 2
le0 at ledma0 offset 0x8c00000 pri 6: address 52:54:00:12:34:56
le0: 16 receive buffers, 4 transmit buffers
tcx0 at sbus0 slot 3 offset 0x800000 pri 9: 1024x768x8
wsdisplay0 at tcx0
wsdisplay0: screen 0 added (std, sun emulation)
“SUNW,CS4231” at sbus0 class serial slot 4 offset 0xc000000 not configured
“power-management” at sbus0 slot 4 offset 0xa000000 not configured
bootpath: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0
root on rd0a swap on rd0b dump on rd0b
erase ^?, werase ^W, kill ^U, intr ^C, status ^T

Welcome to the OpenBSD/sparc 5.8 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?

Just don’t bother with the ‘install diskette’ try the miniroot instead.

OpenBSD 5.6 Sparc64 on Qemu

Well the good news is that like NetBSD the kernel boots.  The downside is that none of the network adapters I could think of work.  They are either ignored, or crash out the kernel.

OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Nov 15 2014 12:59
Type ‘help’ for detailed information
Trying cdrom:f…
Not a bootable ELF image
Not a bootable a.out image

Loading FCode image…
Loaded 4829 bytes
entry point is 0x4000
OpenBSD IEEE 1275 Bootblock 1.3
..
Jumping to entry point 0000000000100000 for type 0000000000000001…
switching to new context: entry point 0x100000 stack 0x00000000ffe8aa09
>> OpenBSD BOOT 1.6
Trying bsd…
open /pci@1fe,0/pci-ata@5/ide1@2200/cdrom@0:f/etc/random.seed: No such file or d
irectory
Booting /pci@1fe,0/pci-ata@5/ide1@2200/cdrom@0:f/bsd
3864176@0x1000000+2448@0x13af670+3261928@0x1800000+932376@0x1b1c5e8
symbols @ 0xffc5a300 119 start=0x1000000

Unexpected client interface exception: -1
console is /pci@1fe,0/ebus@3/su
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved. http://www.OpenBSD.org

OpenBSD 5.6 (RAMDISK) #178: Fri Aug 8 05:00:27 MDT 2014
[email protected]:/usr/src/sys/arch/sparc64/compile/RAMDISK
real mem = 2147483648 (2048MB)
avail mem = 2103877632 (2006MB)
mainbus0 at root: OpenBiosTeam,OpenBIOS
cpu0 at mainbus0: SUNW,UltraSPARC-IIi (rev 9.1) @ 100 MHz
cpu0: physical 256K instruction (64 b/l), 16K data (32 b/l), 256K external (64 b
/l)
psycho0 at mainbus0: SUNW,sabre, impl 0, version 0, ign 7c0
psycho0: bus range 0-2, PCI bus 0
psycho0: dvma map c0000000-dfffffff
pci0 at psycho0
ppb0 at pci0 dev 1 function 0 “Sun Simba” rev 0x11
pci1 at ppb0 bus 1
ppb1 at pci0 dev 1 function 1 “Sun Simba” rev 0x11
pci2 at ppb1 bus 2
unknown vendor 0x1234 product 0x1111 (class display subclass VGA, rev 0x02) at p
ci0 dev 2 function 0 not configured
ebus0 at pci0 dev 3 function 0 “Sun PCIO EBus2” rev 0x01
“fdthree” at ebus0 addr 0-ffffffff not configured
com0 at ebus0 addr 3f8-3ff ivec 0x2b: ns16550a, 16 byte fifo
com0: console
“kb_ps2” at ebus0 addr 60-67 not configured
“Realtek 8029” rev 0x00 at pci0 dev 4 function 0 not configured
pciide0 at pci0 dev 5 function 0 “CMD Technology PCI0646” rev 0x07: DMA, channel
0 configured to native-PCI, channel 1 configured to native-PCI
pciide0: using ivec 0x7d4 for native-PCI interrupt
pciide0: channel 0 disabled (no drives)
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <QEMU, QEMU DVD-ROM, 2.2.> ATAPI 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
prtc0 at mainbus0
softraid0 at root
scsibus1 at softraid0: 256 targets
bootpath: /pci@1fe,0/pci-ata@5,0/ide1@2200,0/cdrom@0,0:f
root on rd0a swap on rd0b dump on rd0b
unix-gettod:interpret: exception -13 caught
interpret h# 01c099ec unix-gettod failed with error ffffffffffffffed
WARNING: bad date in battery clock — CHECK AND RESET THE DATE!
erase ^?, werase ^W, kill ^U, intr ^C, status ^T

Welcome to the OpenBSD/sparc64 5.6 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?

(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? (I)nstall, (U)pgrade, (A)utoinst
all or (S)hell? s

#

But it’s great it’s this close!

NetBSD 6.1.5 Sparc64 on Qemu

Yes, really!

I thought I’d try it for the heck of it, and it’s working enough to go multiuser, but it has some issues with hitting the disk & network pretty hard.  But it does let you install!

I just started it up like this:

qemu-system-sparc64.exe -cdrom NetBSD-6.1.5-sparc64.iso -net nic,model=ne2k_pci -net user -boot c -hda netbsd-615-sparc64.raw -nographic -serial mon:telnet:127.0.0.1:23,server,wait -m 2048 -boot d

And in no time I was booting up!

OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Nov 15 2014 12:59
Type ‘help’ for detailed information
Trying cdrom:f…
Not a bootable ELF image
Not a bootable a.out image

Loading FCode image…
Loaded 7478 bytes
entry point is 0x4000
NetBSD IEEE 1275 Multi-FS Bootblock
Version $NetBSD: bootblk.fth,v 1.13 2010/06/24 00:54:12 eeh Exp $
..
Jumping to entry point 0000000000100000 for type 0000000000000001…
switching to new context: entry point 0x100000 stack 0x00000000ffe8aa09
>> NetBSD/sparc64 OpenFirmware Boot, Revision 1.16
=0x8870a0
Loading netbsd: 8072208+553056+339856 [601032+393301]=0x9cd528
Unimplemented service set-symbol-lookup ([2] — [0])

Unexpected client interface exception: -1
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

NetBSD 6.1.5 (GENERIC)
total memory = 2048 MB
avail memory = 1997 MB
mainbus0 (root): OpenBiosTeam,OpenBIOS: hostid 80123456
cpu0 at mainbus0: SUNW,UltraSPARC-IIi @ 100 MHz, UPA id 0
cpu0: 256K instruction (64 b/l), 16K data (32 b/l), 256K external (64 b/l)
psycho0 at mainbus0
psycho0: SUNW,sabre: impl 0, version 0: ign 7c0 bus range 0 to 2; PCI bus 0
pci0 at psycho0
ppb0 at pci0 dev 1 function 0: Sun Microsystems Simba PCI Bridge (rev. 0x11)
pci1 at ppb0 bus 1
ppb1 at pci0 dev 1 function 1: Sun Microsystems Simba PCI Bridge (rev. 0x11)
pci2 at ppb1 bus 2
genfb0 at pci0 dev 2 function 0: unmatched vendor 0x1234 product 0x1111 (rev. 0x02)
ebus0 at pci0 dev 3 function 0
ebus0: Sun Microsystems PCIO Ebus2, revision 0x01
fdthree at ebus0 addr 0-ffffffff not configured
com0 at ebus0 addr 3f8-3ff ipl 2b: ns16550a, working fifo
com0: console
kb_ps2 at ebus0 addr 60-67 not configured
ne0 at pci0 dev 4 function 0: Realtek 8029 Ethernet
ne0: Ethernet address 52:54:00:12:34:56
ne0: 10base2, 10baseT, 10baseT-FDX, auto, default [0x40 0x40] 10baseT-FDX
ne0: interrupting at ivec 3010
cmdide0 at pci0 dev 5 function 0: CMD Technology PCI0646 (rev. 0x07)
cmdide0: primary channel configured to native-PCI mode
cmdide0: using ivec 14 for native-PCI interrupt
atabus0 at cmdide0 channel 0
cmdide0: secondary channel configured to native-PCI mode
atabus1 at cmdide0 channel 1
NULL phandle
Unexpected client interface exception: -1
pcons at mainbus0 not configured
No counter-timer — using %tick at 100MHz as system clock.
wd0 at atabus0 drive 0
wd0: <QEMU HARDDISK>
wd0: 2048 MB, 4161 cyl, 16 head, 63 sec, 512 bytes/sect x 4194304 sectors
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0: <QEMU DVD-ROM, QM00003, 2.2.50> cdrom removable
wd0: no disk label
wd0: no disk label
FATAL: boot device not found, check your firmware settings!
root device: cd0c
dump device (default cd0b):
file system (default generic):
root on cd0c dumps on cd0b
root file system type: cd9660
WARNING: no TOD clock present
WARNING: using default initial time
warning: no /dev/console
init path (default /sbin/init):
init: trying /sbin/init
Created tmpfs /dev (622592 byte, 1184 inodes)
init: kernel security level changed from 0 to 1

You are using a serial console, we do not know your terminal emulation.
Please select one, typical values are:

vt100
ansi
xterm

Terminal type (just hit ENTER for ‘vt220’): xterm

NetBSD/sparc64 6.1.5

This menu-driven tool is designed to help you install NetBSD to a hard disk,
or upgrade an existing NetBSD system, with a minimum of work.
In the following menus type the reference letter (a, b, c, …) to select an
item, or type CTRL+N/CTRL+P to select the next/previous item.
The arrow keys and Page-up/Page-down may also work.
Activate the current selection from the menu by typing the enter key.

┌─────────────────────────────────────────────┐
│>a: Installation messages in English │
│ b: Installation auf Deutsch │
│ c: Mensajes de instalacion en castellano │
│ d: Messages d’installation en français │
│ e: Komunikaty instalacyjne w jezyku polskim │
└─────────────────────────────────────────────┘

Wow, how’s that for cool?

A few notes though, if you use a VMDK disk access is dreadfully slow during the install, raw disk images are MUCH MUCH faster (36Kb/sec vs 3+MB/sec).  The kernel cannot figure out the root disk, so you have to tell it on every boot.  When installing it’s cd0c, when booting off the harddisk it’s wd0a. The e1000 adapter causes the kernel to go crazy, and on bootup the system indexes the man pages, which seems to kill the machine.

makemandb

makemandb indexing like crazy

As you can see this is what happens when you hit the disk too hard..

# dd if=/dev/wd0c of=/dev/null bs=1m
^Ccmdide0:0:0: lost interrupt
type: ata tc_bcount: 2048 tc_skip: 0
463+0 records in
463+0 records out
485490688 bytes transferred in 59.701 secs (8132036 bytes/sec)

and if you don’t incur the rage of the disk controller it’s the same speed:

# dd if=/dev/wd0c of=/dev/null bs=1m count=10
10+0 records in
10+0 records out
10485760 bytes transferred in 1.217 secs (8616072 bytes/sec)

But yeah, I can’t complain!

 

Qemu & SunOS 4.1.4

SunOS 4.1.4 was the last version of the BSD based SunOS for the SPARC platform.  I had received an email earlier asking if Qemu could run SunOS.  Earlier it was ‘capable’ however there were issues with the serial ports.  And the framebuffer stuff that the SUN Proms recognized was never mainlined (please tell me I’m wrong?).

But then with a quick google search I came across this wikibook page with detailed instructions on how to install SunOS 4.1.4.

SunOS

SunOS on Qemu 1.7.0rc2

So I quickly built a sparc version of Qemu 1.7.0rc2, and followed the instructions.  I was amazed that now we are able to boot off the CD (still attached as a HD though) but label the main hard disk, and install SunOS.  I have to say it is very impressive.

Another hint I came across is the more correct way to boot the Sparc Station 20’s

-bios /usr/local/share/qemu/ss20_v2.25_rom -M SS-20 -smp 2,cores=4 -cpu “TI SuperSparc 60”

Sadly there is no graphical output, but the PROM won’t crash.  I think you can have 512MB of ram on the SS-20.

SPARC NetBSD on Qemu 0.14.0

I came across this link, in some kind of vain search to see if NetBSD Sparc could run on Qemu.  And the answer is a resounding yes!

I have to admit it was pretty simple to setup too. I did a network install, so all I needed in a minimal config was a GENERIC kernel, and the miniroot. I did it this way because booting with the inserted kernel lets me easily choose my root…

First I created a 2GB data disk, then start up Qemu like this…

qemu-system-sparc.exe -kernel netbsd-GENERIC -L pc-bios -hda sparc.disk -hdb miniroot.fs -net nic -net user

And it’ll boot up!

I specify the root to be sd1c, I’m not sure if it’d pick up on sd1, or sd1a but at any rate sd1c certainly works. The other gotcha I found was the keyboard, sun-type4 worked best. I also had to configure the network manually (maybe I missed something?) but the settings are simple for NAT.

address 10.0.2.15
mask 0xffffff00
gateway 10.0.2.2
dns 8.8.8.8

Any attempt to ping the gateway will fail. But it’s nothing to worry about, and the install can continue normally. I pulled the rest of NetBSD down via HTTP, and it booted up!

I should also add that the CD-ROM iso install works as well. And the NetBSD site has lots of ways of getting the install ISO for the sparc.

And of course, will it run Zork?

Yes it does!

Solaris 2.4 on Qemu (SPARC)

 

Well after a lot of digging around, I was able to come up with Solaris 2.4 and proceeded to install it on QEMU.

And it works!

From my notes though, it was far easier to use Solaris 2.9’s “format” command to prepare a 2GB hard disk. For some reason Solaris 2.4’s format command didn’t want to write the label to the disk.

But with a labeled disk in hand, and placing the ISO image under the “hdb” position I was able to boot up the installer with a simple

boot disk1:d

During the installation, you can select networking, just remember that the ip address you’ll use is 10.0.2.15, the workstation is networked with a netmask of 255.255.255.0 and you should use the “other” method of resolving names.

As mentioned in the FAQ, don’t let the installer reboot when it’s done (it’s an option), be sure to do the following:

cd /a/etc
# cat >> system
set scsi_options=0x58
^D

Otherwise it’ll load up the drivers in the wrong order, and it won’t mount the root partition… The best part, is that the networking works great, and that I’m able to telnet INTO the VM, and out of the VM.

And you will want a default route…

# cat > defaultrouter
10.0.2.2
^D

Then in the file /etc/nsswitch.conf change the following:

hosts: files

to

hosts: files dns

Then to ‘fix’ up your /etc/resolv.conf

# cat > resolv.conf
nameserver 10.0.2.3
#

And then I like to add the following hosts to speed up telnet…

# cat >> hosts
10.0.2.2 qemunat
10.0.2.3 qemudns
^D

Then finally (yes!) the file /etc/default/login

comment out the line:

CONSOLE=/dev/console

Now you should be good to go!

Or at lest those are the steps I took to make my system boot. Oh, and don’t forget it won’t auto boot, you’ll have to issue

boot disk0

every time you fire up Qemu.

More CDROM madness.

Well I found that one of the things that was preventing me from booting up this “Solaris 1.1.2” AKA SunOS 4.1.4 CD is that Qemu on Win32 using raw devices has issues with all these slices and whatnot.

Slices you say?

Yeah, back in the ISO9660 Rock Ridge days, CD-ROMS were basically given a common format for the “LCD” of the day. In that case MS-DOS. Naturally people like Unix vendors were not to keen on that, as they wanted file attributes, long file names, symbolic links etc… So a *LOT* of people started to split up their CD’s into partitions like hard disks, and slap down actual filesystems on the disks. NeXT just used one giant partition on the CD-ROM, but their exe format let them ‘bind’ all the CISC machines onto one CD, and all the RISC machines on another. Meanwhile SUN decided to make all these ‘boot’ partitions for various machines, a miniroot, then an I9660 partition for basic tar files of the OS…

Like this:

2,998,272 DEBUGGING
4,161,536 DEMO
3,219,456 GAMES
1,826,816 GRAPHICS
999,424 INSTALL
1,073,152 NETWORKING
7,815,168 OPENWINDOWS_DEMO
9,748,480 OPENWINDOWS_FONTS
23,756,800 OPENWINDOWS_PROGRAMMERS
34,316,288 OPENWINDOWS_USERS
925,696 RFS
327,680 SECURITY
1,409,024 SHLIB_CUSTOM
524,288 SUNVIEW_DEMO
1,884,160 SUNVIEW_PROGRAMMERS
2,727,936 SUNVIEW_USERS
4,104,192 SYSTEM_V
729,088 TEXT
49,152 TLI
7,872,512 USER_DIAG
29,638,656 USR
622,592 UUCP
6,103,040 VERSATEC

Which is kind of funny seeing how some BSD derived OS’s still keep some of these package names alive.

Anyways, the problem is that I tried to use \\.\d: for the cdrom, and booting didn’t work at all. I even tried reading an ISO from the CD, but all it ended up doing was skipping to the ISO9660 part, and dumping that, ignoring the slices, giving me this:

243,599,360 sol14.iso

So after googling around, trying to at least find a way to back up this CD (it was a souvenir from Japan!) I found someone mentioning to backup their Solaris CD, they had to use the “readcd” program.

Well, I’d never explored that much with the cdrtools, but behold there is a readcd program that’ll dump an entire CD out!

So running it with –scan-bus to find your CD drive…

readcd -scanbus
scsibus0:
0,0,0 0) *
0,1,0 1) ‘HL-DT-ST’ ‘BDDVDRW GBC-H20L’ ‘1.B8’ Removable CD-ROM
0,2,0 2) *

We can go on to dump a full image of the CD.

readcd -dev=0,1,0 f=sunos.iso

Which now gives us a much larger ISO image…

329,605,120 sunos.iso

Sadly it crashes on bootup… But on Win32 it’s a lot better then not reading *ANYTHING* at all!

ok boot disk1:d -vs
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@1,0:d File and args: -vs
Boot Release 4.1.4 (sun4m) #2: Fri Oct 14 11:07:52 PDT 1994
Copyright (c) 1983-1990, Sun Microsystems, Inc.
Boot: Romvec version 3.
root on /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@1,0:d fstype 4.2
Boot: vmunix
.Size: 868352…………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………+2319136+75288 bytes
Statistics:

–edit

I should also add that Qemu’s CDROM (like 99% in the world) are fixed block, while SUN (and other vendors) had these CD ROM’s that could change block size… So in Qemu you have to use the DISK driver vs the CDROM driver….

ie use -hdb sunos.iso instead of -cdrom sunos.iso