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!


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.


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

For networking:

And you will want a default route…

# cat > defaultrouter

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

hosts: files


hosts: files dns

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

# cat > resolv.conf

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

# cat >> hosts qemunat qemudns

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 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.


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.

SUN Solaris is effectively dead.

I wanted to wait to get a more concert announcement, but apparently it’s not going to come.  In case you missed it, on Friday Oracle robo called the people working on SUN hardware & software and effectively laid them all off.

We can now dispose of any pretense that Oracle was interested in any SUN technology, or has any plans for it in the future, rather it was a poor ruse to give the impression that there was a future that Oracle was interested in, to drum up a larger settlement amount for how Google deprived them of their licensing for the Dalvik, the Java inspired VM.

Now that Oracle has failed twice in suing Google, there is no longer any need to keep up the charade.

The mismanagement of SUN after the purchase by Oracle is nothing short of stupendous.  While busy chasing pie in the sky litigation, two very important and very lucrative markets were literally expunged from SUN’s portfolio as Oracle clearly has no vision or any competency.

SUN announces the ‘GRID’ in 2006 aka cloud computing

Seriously, look at this announcement from 11 years ago.  Oracle could have been a leader, although given their horrific support and business of treating customers like criminals, perhaps their incompetence is a good thing.

Hi. I’m Jonathan Schwartz, chief operating officer for Sun Microsystems. For nearly a quarter of a century, Sun Microsystems has been saying the network is the computer, and today I’m pleased to announce that Sun is launching the world’s first true computing utility. The Sun Grid is an Internet accessible compute utility that provides anyone in the United States easy access to a super computer for the affordable price of a buck per CPU hour.

So what does it mean for you? If you’re a biotech company, it means that you can plug into the Sun Grid to run complex modeling jobs and get results instantly. If you’re a startup, you can rely on Sun Grid now instead of spending your own capital to build out your own IT infrastructure. Sun Grid let’s you focus on your core competency and get to market faster. If you’re an online business that needs additional resources at peak times, why don’t you provision your own infrastructure for normal work — workloads and let Sun Grid handle the spikes? And if you’re an enterprise running at steady state, use the Sun Grid to test new products and innovations without jeopardizing production systems.

With Sun Grid, you’re not required to a commit to a long-term contract. There’s no hidden fees. You can dial up or dial down based on your own usage of your own compute resources. You don’t need to negotiate the price. You don’t need to negotiate the terms. And you don’t need to meet with a sales person or try to structure a funny finance contract. Simply go to, purchase hours through PayPal with a credit card and start computing.

Today we’re throwing open the doors to the public Sun Grid and inviting everyone to try it out. There’s an interesting sample application up there right now that reads text, say, from an article on the Web and converts it into an MP3 file that you can download to your iPod. Imagine everyone in New York streaming a custom version of the Wall Street Journal to their iPod every morning. With Sun Grid, they can.

We welcome all ISVs to build and deploy software services on the Sun Grid. We’ll be publishing the API specification shortly. For developers generally, Sun Grid offers a heavyweight runtime environment for low-testing your apps across multiple horizontally clustered systems.

Now, I’m sure there’s lots of uses of the Sun Grid that we haven’t even thought of, and we can’t wait to see how it evolves. One of our founders once said, “Innovation happens elsewhere.” Well, log onto and test drive today.

With Sun Grid, the network truly and finally is the computer.

Another interesting artifact of the time is that Jonathan is that he kept a blog, making SUN more accessible.  Sadly this didn’t catch on in the world of tech, where for some reason people either confine themselves to twitter, or Facebook, both platforms that they don’t own, nor can they actually control.  Instead modern CEO’s hide behind PR teams, as they have done since the advent of Public Relations (Thanks Ed!), and of course one of this many posts on the grid.

With the rise of AWS around the same time, there really could have been a far more stronger and competitive area, and as always Microsoft was totally asleep at the wheel letting Virtual Server languish with no x64 path for years to come, and a public cloud not available until 2010!

The Intel Itanium managed to kill almost all the popular RISC processors, and combined with Linux killed the majority of SYSV Unix in the world.  Just as the Itanium Linux combination upset the midrange world, AMD pushed x86_64 to the forefront upsetting the Itanium push before it even began.  In 2017 to not be on x86_64 & ARMv7 is just suicide.  Oddly enough IBM still managed to not only sell PowerPC based kit, but AIX hasn’t seen a new version since 2015 with the larger push of course going to Linux.

Open Solairs

SUN knowing that their future was imploding did the great thing of opening Solaris, Java and other great tech.  Naturally Oracle closed the door soon after buying SUN.


Naturally you’ll never see the words open over at Oracle.  To say the hacker open culture of SUN is incompatible with the litigious and highly customer toxic Oracle is an understatement.  At least this did get the OS out into the wild, with things like ZFS and Dtrace to live on, and outside of Solaris.  However even Apple was scared enough of the possibility of lawsuits from Oracle to have dumped ZFS from OS X, even though they did have it running.

The other amazing bit of tech they did have was VirtualBox, which started out as a German virtualization product to bring the wonders of OS/2 to other operating systems.  VirtualBox coupled with the grid on Solaris x86_64 could have been an incredibly robust platform, but of course that was never to be.  VirtualBox is still around however, so there is that at least.

I suppose there could be a lot more said about the ultimate rise and decline of SUN.

Like Cisco and Oracle, SUN’s fortunes took a dramatic uptick in the late 1999 .com fueled gold rush, along with the parallel Y2K gold rush.

$63.4 to $3.28, source Bloomberg

It’s hard to keep on going when you lose the majority of your value in the .com crash.  SUN struggled to re-define itself, and ultimately rebranding itself as JAVA just wasn’t enough to save itself.  Amazon may have been a retailer, but it quickly gained a reputation as a competent data centre operator, where as SUN was unable to do so.

The death of the SPARC, and Solaris was inevitable, just as the 68000 & SunOS was doomed in the 1980s.  When I talk to enterprise architects on what platforms they are going to use in upcoming projects, the new portable .net is catching some attention, c# may be gaining some traction again, but nobody wants that ‘killer’ combination of Solaris+Java+Oracle.  I know plenty are already tied to it, but I don’t see anyone championing it.

I know from my own personal experience of having a signed contract with Oracle, and having them arrive on site, doing an audit, invalidating their own contract as being “not properly authorized by a ‘rogue’ salesman”, and having our prices doubled overnight, and being forced to downsize our infrastructure as our faster processors had too many cores (even though we disabled the additional cores in the BIOS), I had moved all future projects to Microsoft SQL, as a flat rate of $5,500 retail for SQL Server was a flat out bargain.  I didn’t care if Oracle was 10x as fast, I could buy 100x more MS Servers for the price of an Oracle 10g grid.

The other lesson is that even though Apple could have bought SUN, and had an enterprise market, the bottom line is that it doesn’t matter.  Just as Apple abandoned Enterprise Objects, the X-serve, the Mac Pro, and OS X Server as a real viable server platform, the truth is they make so much more money on iTunes royalties, that they are the ones quickly approaching a 1 Trillion dollar market cap.  The ironic thing is that although you need an enterprise, there is no money in servicing the enterprise, there is far far far more consumers out there.

I’ll keep links I find on this developing story


More on adding disks to Solaris

So a while back, I built some stuff for Solaris on QEMU, and stuck it in a virtual disk.  Great.  Now the fun is years later trying to use it for yet another project.

By default Solaris doesn’t magically build out the dev tree so adding a disk won’t make it magically appear in the dev tree.  Add the ‘-r’ flag when booting, and it’ll do that.  I still like the verbose boot, so from the prom it’s ‘boot disk0 -rv’

Type help for more information
ok boot disk0 -rv
Boot device: /iommu/sbus/[email protected],8400000/[email protected],8800000/[email protected],0 File and args: -rv

And away we go!

while the kernel boots I can see it see’s my second disk

sd0 at esp0: target 0 lun 0
sd0 is /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0
<Qemu2GB cyl 4090 alt 2 hd 16 sec 63>
sd1 at esp0: target 1 lun 0
sd1 is /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0
<Qemu2GB cyl 4090 alt 2 hd 16 sec 63>
sd2 at esp0: target 2 lun 0
sd2 is /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0
<Qemu2GB cyl 4090 alt 2 hd 16 sec 63>

And once it starts user processes it’ll add in the device files

Configuring the /dev directory
Configuring the /dev directory (compatibility devices)

Which is great.  But how to view the disklabel?

prtvtoc can tell us, remember that s2 is the ‘whole disk’ on SYSV.

# prtvtoc /dev/rdsk/c0t2d0s2
* /dev/rdsk/c0t2d0s2 partition map
* Dimensions:
* 512 bytes/sector
* 63 sectors/track
* 16 tracks/cylinder
* 1008 sectors/cylinder
* 4092 cylinders
* 4090 accessible cylinders
* Flags:
* 1: unmountable
* 10: read-only
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 132048 132047
1 3 01 132048 263088 395135
2 5 01 0 4122720 4122719
6 4 00 395136 3727584 4122719

So we have a 0, the 1 is ‘swap’, 2 is he whole disk, and a 6.

Running fsck can reveal that 0 is a real filesystem:

# fsck /dev/rdsk/c0t2d0s0
** /dev/rdsk/c0t2d0s0
** Last Mounted on /mnt
** Phase 1 – Check Blocks and Sizes
** Phase 2 – Check Pathnames
** Phase 3 – Check Connectivity
** Phase 4 – Check Reference Counts
** Phase 5 – Check Cyl groups
4 files, 32504 used, 29111 free (15 frags, 3637 blocks, 0.0% fragmentation)

while 6 is not.

# fsck /dev/rdsk/c0t2d0s6
** /dev/rdsk/c0t2d0s6
eg. fsck [-F ufs] -o b=# [special …]
where # is the alternate super block. SEE fsck_ufs(1M).

Sadly none of the stuff in there is ‘ready to run’ but rather built in it’s source directory.

And I wanted to make a 2GB /usr/local on another disk, so I copied my disk template file, (can use the OS, or the gnu-utils) and run format on the disk.

It was a matter of clearing out partitions, and making ONE BIG partition 0.

# format /dev/rdsk/c0t1d0s2
selecting /dev/rdsk/c0t1d0s2: data
[disk formatted]
Warning: Current Disk has mounted partitions.

disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
format> partition

0 – change `0′ partition
1 – change `1′ partition
2 – change `2′ partition
3 – change `3′ partition
4 – change `4′ partition
5 – change `5′ partition
6 – change `6′ partition
7 – change `7′ partition
select – select a predefined table
modify – modify a predefined partition table
name – name the current table
print – display the current table
label – write partition map and label to the disk
partition> print
Volume: data
Current partition table (original):
Total disk cylinders available: 4090 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 alternates wm 0 – 4069 1.96GB (4070/0/0)
1 unassigned wu 0 0 (0/0/0)
2 backup wu 0 – 4089 1.97GB (4090/0/0)
3 unassigned wm 0 0 (0/0/0)
4 unassigned wm 0 0 (0/0/0)
5 unassigned wm 0 0 (0/0/0)
6 unassigned wm 0 0 (0/0/0)
7 unassigned wm 0 0 (0/0/0)

Good fun.  As always don’t forget how to mount the CD-ROM under Qemu, and add packages as needed.

I still think the quickest, and easiest way to power ‘off’ the VM is the poweroff command.

# poweroff
Apr 18 20:26:33 qemu24 poweroff: poweroffed by root
Apr 18 20:26:35 qemu24 syslogd: going down on signal 15
syncing file systems… done

Brutal, quick, and efficient.

Adding Solaris packages, under Qemu

So you know the drill, someone wants to do something with Solaris, and they’ve already installed the OS, and done a bunch of customization and whatnot, now they call up all in a panic as they copy in a binary distribution of GCC, but they can’t compile anything because they are missing values-Xa.o , or worse just about everything from the development tools.

Well I’m not sure about ancient Qemu, but 2.2 can mount the CD-ROM’s post install! … manually.

The poor guy didn’t want to re-install, but one option was to boot up the CD in single user mode, mount his disk, and copy the /cdrom path onto some partition so he could then install the packages as needed, and even better have the whole tree ready if need be.

But the better thing is to just mount the CD, install the package and be done with it right?

I’ve only tested this with Solaris 2.6…

While booting up single user mode from the CD (boot disk2:d -s) I noticed this line in the mount table:

/cdrom             (/devices/[email protected],e0000000/[email protected],e0001000/[email protected],400000/[email protected],800000/[email protected],0:a):       0 blocks        0 files

So I thought I’d try to mount that once the copy was done.  The first thing I did was make a symbolic link as that name is a little hard to type, and I didn’t want to remember that path after this day.

mkdir /cdrom
cd /dev
ln -s /devices/[email protected],e0000000/[email protected],e0001000/[email protected],400000/[email protected],800000/[email protected],0:a jr0

this gives me a /dev/jr0 linking to where the Solaris 2.6 install path was.

# mount -oro /dev/jr0 /mnt
mount: /dev/jr0 is not this fstype.

Well that was disappointing.  Could I even read the CD?

# head -1 /dev/jr0
CD-ROM Disc for SunOS Solaris Installation

Ok, so it must be the file-system type.  The ‘bootable’ partition on the CD contains a SYSV filesystem, as it’s a “live CD”..

mount -o ro /dev/dsk/c0t2d0s1 /mnt

# ls /mnt
a dev kernel opt reconfigure usr
bin devices lib platform sbin var
cdrom etc mnt proc tmp

You can even fsck it!

# fsck /dev/dsk/c0t2d0s1
** /dev/dsk/c0t2d0s1 (NO WRITE)
** Last Mounted on /tmp/MntDev.12554
** Phase 1 – Check Blocks and Sizes
** Phase 2 – Check Pathnames
** Phase 3 – Check Connectivity
** Phase 4 – Check Reference Counts
** Phase 5 – Check Cyl groups
2445 files, 19114 used, 4873 free (17 frags, 1214 blocks, 0.0% fragmentation)

But the part of the CD-ROM that we want, with all the packages uses a different file-system, and with a bit of hunting I found the right string:

mount -F hsfs -r /dev/jr0 /cdrom

Now we can manually add in the missing packages!

# mount -F hsfs -r /dev/jr0 /cdrom
# ls /cdrom
Copyright Solaris_2.6

We just have to point the pkgadd command to where the CD-ROM is mounted.  In my case I just had to type in:

pkgadd -d /cdrom/Solaris_2.6/Product/

And then I got the “interactive” mode showing off all 471 packages.  Don’t just slam the enter key or you’ll start installing everything.  Hit control-d and then we can manually add them in.

<RETURN> for more choices, <CTRL-D> to stop display:^D

Select package(s) you wish to process (or ‘all’ to process
all packages). (default: all) [?,??,q]:

And in this case, the packages I wanted were:


With those installed, now I can see the object files I wanted:

# find / -name ‘*.o’ -print

Wasn’t that great?  Nobody had to re-install, no disk space is wasted, and now if other packages are needed, it’ll be easy to add them.

Sad day for people who signed onto SUN’s virtualization strategies.

From slashdot, Oracle to stop developing SUN virtualization technologies.  In a way I’m surprised this didn’t happen sooner, as chasing after VMWare isn’t part of Larry’s strategy to take over the world with databases.

How long does the SPARC have left to live?

Or Solaris for that matter?

—edit seems they are going to keep VirtualBOX afterall!


Going forward, Oracle’s desktop portfolio investments will be focused on continued development and new enhancements to both Oracle Secure Global Desktop and Oracle VM VirtualBox software.

Solaris 9 x86 on VMware

(Note this is a guest post from Tenox)

Despite having an unofficial and experimental support for some time now I was not able to install Solaris 9 on VMware Workstation. I have recently upgraded to Workstation 9.0 and Lorenzo Gatti send me a link to complete Solaris 9 x86 u5 media kit so I had an excuse to retry.

After several tries I have determined that the easiest route is to boot and install from cd1 instead of the install disk. Also make sure to select VESA driver instead of standard VGA to get a decent resolution. VMware tools won’t install but it’s not a big deal. Apart from that everything else including networking works out of the box.


Just as a final note Solaris 9 is now 10 years old, time flies fast!

I have also installed Solaris 8 in a similar manner. Unfortunately it doesn’t have VESA drivers so all I could get is 640×480.


Solaris 11 came out today

They blew the 11/11/11 launch date.  I guess Oracle really just doesn’t care about magical numbers or whatever.

I guess for the two or three people who even run this stuff (no doubt to run Oralce and it’s draconian licensing) you can find out all about it here.

It appears they still keep the Fortran stuff around for it…  Oh and this release is x86_64 only.  Sorry 32bit users.

Installing gcc (and I imagine everything else) revolves around the pkg command… In this case ‘pkg install gcc-3’ will download and install gcc 3.  While ‘pkg install gcc-45’ will install GCC 4!.  Don’t forget to install system/header or you won’t have things like stdio.h!!

Another GCC tidbit, is that you can build 64bit binaries with GCC 4.5 by supplying the -m64 flag!

While Solaris 11 installs somewhat quickly in VirtualBox (but wow does it take forever to boot), it is bare minimum…

Also for those who want it, here is lynx & ircII for Solaris Oh and a Quake World Server.  At least wget is in the base, but I don’t see why lynx isn’t.

Formatting disks for Solaris

This applies to Qemu and real SPARC’s… Anyways, every disk that Solaris uses has to be tagged with a special ‘format’ and disk label for use. When you buy disks from SUN they did this at the factory. However if you go ahead with a 3rd party disk, you’ll have to do this yourself.

Luckily it’s not all that hard.

So in this quick example we’ll add a 36GB disk to Qemu for use with Solaris 2.6

Now I’ve had issues with Solaris 2.6’s format program so I also use a Solaris 8 CD for that portion. I’m going to assume you’ve got all the bits to make Solaris on Qemu work.

The first step is to create the hard disk.

$ ./qemu-img create -f qcow2 36GB.disk 36GB
Formatting ’36GB.disk’, fmt=qcow2 size=38654705664 encryption=off cluster_size=0

I’m running this on OS X, however the steps are all the same for Linux & Windows users.

Now the next step is to fire up Qemu with the Solaris 8 CDROM.

$ ./qemu-system-sparc -bios ss5.bin -nographic -L . -hda 36GB.disk -m 256 -M SS-5 -cdrom sol-8-u7-install-sparc.iso

Then the ROM will initialize:

Power-ON Reset

$$$$$ WARNING: No Keyboard Detected! $$$$$
MMU Context Table Reg Test
MMU Context Register Test
MMU TLB Replace Ctrl Reg Tst
MMU Sync Fault Stat Reg Test
MMU Sync Fault Addr Reg Test
MMU TLB RAM NTA Pattern Test
ERROR : Address= 000000fc, exp= 07ffffdc, obs= 00000000, xor= 07ffffdc
initializing TLB
initializing cache

Allocating SRMMU Context Table
Setting SRMMU Context Register
Setting SRMMU Context Table Pointer Register
Allocating SRMMU Level 1 Table
Mapping RAM
Mapping ROM

ttya initialized
Probing Memory Bank #0 32 Megabytes
Probing Memory Bank #1 32 Megabytes
Probing Memory Bank #2 32 Megabytes
Probing Memory Bank #3 32 Megabytes
Probing Memory Bank #4 32 Megabytes
Probing Memory Bank #5 32 Megabytes
Probing Memory Bank #6 32 Megabytes
Probing Memory Bank #7 32 Megabytes
Incorrect configuration checksum;
Setting NVRAM parameters to default values.
Setting diag-switch? NVRAM parameter to true
Probing CPU FMI,MB86904
Probing /[email protected],10000000/[email protected],10001000 at 5,0 espdma esp sd st SUNW,bpp ledma le
Probing /[email protected],10000000/[email protected],10001000 at 4,0 SUNW,CS4231 power-management
Probing /[email protected],10000000/[email protected],10001000 at 1,0 Nothing there
Probing /[email protected],10000000/[email protected],10001000 at 2,0 Nothing there
Probing /[email protected],10000000/[email protected],10001000 at 3,0 Nothing there
Probing /[email protected],10000000/[email protected],10001000 at 0,0 Nothing there
screen not found.
Can’t open input device.
Keyboard not present. Using tty for input and output.
Probing Memory Bank #0 32 Megabytes
Probing Memory Bank #1 32 Megabytes
Probing Memory Bank #2 32 Megabytes
Probing Memory Bank #3 32 Megabytes
Probing Memory Bank #4 32 Megabytes
Probing Memory Bank #5 32 Megabytes
Probing Memory Bank #6 32 Megabytes
Probing Memory Bank #7 32 Megabytes
Incorrect configuration checksum;
Setting NVRAM parameters to default values.
Setting diag-switch? NVRAM parameter to true
Probing CPU FMI,MB86904
Probing /[email protected],10000000/[email protected],10001000 at 5,0 espdma esp sd st SUNW,bpp ledma le
Probing /[email protected],10000000/[email protected],10001000 at 4,0 SUNW,CS4231 power-management
Probing /[email protected],10000000/[email protected],10001000 at 1,0 Nothing there
Probing /[email protected],10000000/[email protected],10001000 at 2,0 Nothing there
Probing /[email protected],10000000/[email protected],10001000 at 3,0 Nothing there
Probing /[email protected],10000000/[email protected],10001000 at 0,0 Nothing there

SPARCstation 5, No Keyboard
ROM Rev. 2.15, 256 MB memory installed, Serial #0.
Ethernet address 52:54:0:12:34:56, Host ID: 80000000.

Boot device: /iommu/sbus/[email protected],8400010/[email protected],8c00000 File and args:
Internal loopback test — Wrong packet length; expected 36, observed 64

Can’t open boot device

Type help for more information

Now we boot off the CD-ROM, but into single user mode, with the verbose flag…

ok boot disk2:d -vs

Now the kernel will boot up, and dump us into single user mode. Take note about the disk having a “corrupt label – wrong magic number’ error.

Boot device: /iommu/sbus/[email protected],8400000/[email protected],8800000/[email protected],0:d File and args: -vs
Size: 259712+54162+47510 Bytes
SunOS Release 5.8 Version Generic_108528-13 32-bit
Copyright 1983-2001 Sun Microsystems, Inc. All rights reserved.
Ethernet address = 52:54:0:12:34:56
Using default device instance data
vac: enabled in write through mode
mem = 262144K (0x10000000)
avail mem = 258383872
root nexus = SUNW,SPARCstation-5
iommu0 at root: obio 0x10000000
sbus0 at iommu0: obio 0x10001000
dma0 at sbus0: SBus slot 5 0x8400000
dma0 is /[email protected],10000000/[email protected],10001000/[email protected],8400000
/[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000 (esp0):
esp0 at dma0: SBus slot 5 0x8800000 sparc ipl 4
esp0 is /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000
sd0 at esp0: target 0 lun 0
sd0 is /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0
WARNING: /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0 (sd0):
corrupt label – wrong magic number

Vendor ‘QEMU’, product ‘QEMU’, 75497472 512 byte blocks
sd2 at esp0: target 2 lun 0
sd2 is /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0
root on /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0:b fstype ufs
obio0 at root
obio0 at obio0: obio 0x100000, sparc ipl 12
zs0 is /obio/[email protected],100000
obio1 at obio0: obio 0x0, sparc ipl 12
zs1 is /obio/[email protected],0
cpu0: FMI,MB86904 (mid 0 impl 0x0 ver 0x4 clock 1200 MHz)
Configuring /dev and /devices
pseudo-device: devinfo0
devinfo0 is /pseudo/[email protected]
ledma0 at sbus0: SBus slot 5 0x8400010
le0 at ledma0: SBus slot 5 0x8c00000 sparc ipl 6
le0 is /[email protected],10000000/[email protected],10001000/[email protected],8400010/[email protected],8c00000
pseudo-device: fssnap0
fssnap0 is /pseudo/[email protected]
sbusmem0 at sbus0: SBus slot 0 0x0
sbusmem0 is /[email protected],10000000/[email protected],10001000/[email protected],0
sbusmem1 at sbus0: SBus slot 1 0x0
sbusmem1 is /[email protected],10000000/[email protected],10001000/[email protected],0
sbusmem2 at sbus0: SBus slot 2 0x0
sbusmem2 is /[email protected],10000000/[email protected],10001000/[email protected],0
sbusmem3 at sbus0: SBus slot 3 0x0
sbusmem3 is /[email protected],10000000/[email protected],10001000/[email protected],0
sbusmem4 at sbus0: SBus slot 4 0x0
sbusmem4 is /[email protected],10000000/[email protected],10001000/[email protected],0
sbusmem5 at sbus0: SBus slot 5 0x0
sbusmem5 is /[email protected],10000000/[email protected],10001000/[email protected],0
NOTICE: SBus clock frequency out of range.
pseudo-device: winlock0
winlock0 is /pseudo/[email protected]
pseudo-device: lockstat0
lockstat0 is /pseudo/[email protected]
pseudo-device: llc10
llc10 is /pseudo/[email protected]
NOTICE: audiocs0:Couldn’t set value (../../sun/io/audio/sada/drv/audiocs/audio_4231.c, Line #1738 0x00 0x88)
audiocs0:audio may not work correctly until it is stopped and restarted
audiocs0 at sbus0: SBus slot 4 0xc000000 SBus level 5 sparc ipl 9
audiocs0 is /[email protected],10000000/[email protected],10001000/SUNW,[email protected],c000000
pseudo-device: lofi0
lofi0 is /pseudo/[email protected]
pseudo-device: fcp0
fcp0 is /pseudo/[email protected]
Using RPC Bootparams for network configuration information.
/sbin/rcS: manual_find_and_mount_cdrom: not found


I now issue the drvconfig/disks commands. This is more useful for adding disks to a live system..

# drvconfig
NOTICE: SBus clock frequency out of range.
inst_sync failed for /etc/path_to_inst.66: Read-only file system
drvconfig: WARNING: failed to update /etc/path_to_inst
# disks
disks: mkdir failed for /dev 0x1ed: Read-only file system

Now for the fun part of ‘formatting’ the disk. Looking at this page, they give the geometry of a SCSI disk with a capacity of 36 GB as:

24,622 cylinders
27 heads
107 sectors

As a note the format program likes to reserve the last 2 cylinders, so you must answer this appropriately.

So using the above information, I run the format command like this:

# format
Searching for disks…WARNING: /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0 (sd0):
corrupt label – wrong magic number

Vendor ‘QEMU’, product ‘QEMU’, 75497472 512 byte blocks

0. c0t0d0
/[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0
Specify disk (enter its number): 0

0. Auto configure
1. Quantum ProDrive 80S
2. Quantum ProDrive 105S
3. CDC Wren IV 94171-344
4. SUN0104
5. SUN0207
6. SUN0327
7. SUN0340
8. SUN0424
9. SUN0535
10. SUN0669
11. SUN1.0G
12. SUN1.05
13. SUN1.3G
14. SUN2.1G
15. SUN2.9G
16. Zip 100
17. Zip 250
18. other
Specify disk type (enter its number): 18
Enter number of data cylinders: 24620
Enter number of alternate cylinders[2]:
Enter number of physical cylinders[24622]:
Enter number of heads: 27
Enter physical number of heads[default]:
Enter number of data sectors/track: 107
Enter number of physical sectors/track[default]:
Enter rpm of drive[3600]:
Enter format time[default]:
Enter cylinder skew[default]:
Enter track skew[default]:
Enter tracks per zone[default]:
Enter alternate tracks[default]:
Enter alternate sectors[default]:
Enter cache control[default]:
Enter prefetch threshold[default]:
Enter minimum prefetch[default]:
Enter maximum prefetch[default]:
Enter disk type name (remember quotes): Qemu36GB
selecting c0t0d0
[disk formatted]

disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
repair – repair a defective sector
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
inquiry – show vendor, product and revision
volname – set 8-character volume name
! – execute , then return

Finally we just slap down a label and we should be good to go. I run the command twice to make sure that it took, as it should only mention the corrupt number one more time, then it’ll be ok.

format> label
Ready to label disk, continue? y

WARNING: /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0 (sd0):
corrupt label – wrong magic number

Vendor ‘QEMU’, product ‘QEMU’, 75497472 512 byte blocks

format> l
Ready to label disk, continue? y


Now we can quit, and reboot the VM.

format> q
# reboot
syncing file systems… done
Resetting …

And that’s it!

I’ve since then booted it up under Solaris 2.6, and now in the bootup it shows up like this:

sd0 at esp0: target 0 lun 0
sd0 is /[email protected],10000000/[email protected],10001000/[email protected],8400000/[email protected],8800000/[email protected],0

And even in the Solaris 2.6 install…

Disk Device (Size) Available Space
[X] c0t0d0 (34730 MB) 34730 MB (F4 to edit)

Total Selected: 34730 MB
Suggested Minimum: 487 MB

And that’s about it.

BSD-games & Solaris fun.

I was getting bored with a stock Solaris 2.4 system, so I decided to load up some basic BSD games. Since I like the torture of it, I went to build them from source.


I don’t mean to complain too much, but holy crap, the configuration for the BSD games package is INSANE.

After answering what feels like 100+ questions (it very well may be) you can eventually try to build BSD-games… but much to my dismay the 2.x series all hinges on you basically having a GNU environment, and well… I didn’t want to spend that much time just to run robots & fortune.

So thanks to this great page, there is some hints on building BSD=games 1.5 for Solaris… But where on earth to find something this old?! This is the weird thing, all of this older free software is being destroyed wholesale… I know right now people just don’t care, but there most certainly is this ‘digital’ divide that is coming, where most of our current history will be lost forever… Hell if nukes fell tomorrow, good luck to anyone decoding a DVD… And god help them if they succeeded. It certainly wouldn’t be worth the effort.

Anyways, with a bunch of searching I found a site in Germany with the goods.

Now the real fun starts…

I’m using gcc 2.8.1, because that is what was in the GNAT package. Anyways for some programs I was encountering errors like this:

gcc extern.o init_field.o main.o make_level.o move.o move_robs.o play_level.o query.o rnd_pos.o score.o flush_in.o -lncurses -lnsl -lsocket -L/usr/ucblib -R/usr/ucblib -lucb -o robots
Undefined first referenced
symbol in file
_tty main.o
_pfast main.o
_echoit main.o
_tty_ch main.o
_rawmode main.o
ld: fatal: Symbol referencing errors. No output written to robots
make: *** [robots] Error 1

I know.. .WTF?! So after building & rebuilding ncurses, I found on some obscure Fortran list that the linker in Solaris is… weird. So to save anyone the hell, here is the “correct” string in this instance.

gcc extern.o init_field.o main.o make_level.o move.o move_robs.o play_level.o query.o rnd_pos.o score.o flush_in.o -L/usr/ucblib -R/usr/ucblib -lcurses -ltermcap -lucb -lncurses -o robots

Notice the difference? Yeah, the big one, is that now it linked. The position of the -L & -R really matters to the SUN linker.

Another error I was getting (in this example from tetris) was this:

In file included from screen.c:59:
screen.h:62: parse error before `__P’
screen.h:63: parse error before `__P’
screen.h:64: parse error before `__P’
screen.h:65: parse error before `__P’
screen.h:66: parse error before `__P’
screen.h:67: parse error before `__P’
screen.h:68: parse error before `__P’

I assume in the future (or was it the past?) that this __P macro would be standard with GCC? Maybe it’s a linux-isim? I don’t know. What I do know is this block

#undef __P
#ifndef __P
#if __STDC__
#define __P(protos) protos
#define __P(protos) ()

Will fix it.

Another weird error revolves around setjmp.h . Now I know in Solaris some headers have to be included in a certain order or all hell will break loose, or the part you are looking for just won’t be included. But I just mined out the relevant parts to get what I wanted…

In file included from /usr/ucbinclude/setjmp.h:44,
from screen.c:47:
/usr/include/sys/ucontext.h:24: parse error before `sigset_t’
/usr/include/sys/ucontext.h:24: warning: no semicolon at end of struct or union
/usr/include/sys/ucontext.h:25: warning: data definition has no type or storage class
/usr/include/sys/ucontext.h:28: parse error before `}’
/usr/include/sys/ucontext.h:28: warning: data definition has no type or storage class

So I just removed the reference to setjmp.h & instead put in this:

#define _JBLEN 10 /* ABI value */
typedef int jmp_buf[_JBLEN];

And it was happy. Now I know this is a HORRIBLE “FIX” but heh, sometimes you just want the dammed thing to compile!

Next I was getting these weird sigset_t errors…

screen.c: In function `stopset’:
screen.c:238: `sigset_t’ undeclared (first use in this function)
screen.c:238: (Each undeclared identifier is reported only once
screen.c:238: for each function it appears in.)
screen.c:238: parse error before `sigset’
screen.c:242: `sigset’ undeclared (first use in this function)
screen.c:244: parse error before `)’

And again I just mashed in the definition of:

typedef struct { /* signal set type */
unsigned long __sigbits[4];
} sigset_t;

Lastly was another error revolving around sig_t … So just inserting this:

typedef void (*sig_t) (int);

Into the code, got it to stop complaining.

So the upshot is that after manually linking a bunch of these programs, and manually installing the binaries & datafiles (Solaris 2.4’s install doesn’t work the way BSD-games 1.5 expects…) I finally could do this:

UNIX(r) System V Release 4.0 (solaris24)

login: rootb
Last login: Sat Dec 12 19:01:49 from qemunat
bash# fortune
There can be no twisted thought without a twisted molecule.
— R. W. Gerard

Now the big question…. Was it worth it?

Yeah sure, I learned a valuable lesson about the linker. The rest, not so valuable.