Saturday, August 14, 2010

Submitted SunOS 4.1.4 & Solaris 2.2 fix upstream

Sent upstream the serial port patch. The patch allows booting SunOS 4.1.4 and Solaris 2.2.

Booting Solaris 2.2 is more tricky than SunOS 4.1.4, since it doesn't support SPARCStation-5. It has to be started in SS-20 emulation.

Will update the how-to shortly.

19 comments:

Neozeed said...

Wow, can't wait!!!

atar said...

It's there. Just pull the current git. The how-to is also already updated.

Neozeed said...

Just to let you know I built the 0.13-rc0 and it's in there, and now my SunOS hangs after the kernel boots at the "Wh" thingie..

So it's "good" from that aspect.

atar said...

yeah. It was "released" ~ a week before my patch. I haven't seen the official announcement anywhere up to now. And the both slavio and serial patches are still not in the 0.13 branch, I haven't got any answer why.

So, git master is still your friend.

Ted Lemon said...

This is pretty cool. I managed to find some 4.1.4 media, and now I've been able to boot the CDROM. Unfortunately, when I try to install the miniroot, I get an obscure error, presumably because of the hdb vs. cdrom problem:

checking writeability of /dev/rsd3b
0+1 records in
1+0 records out
Extracting miniroot ...
using cdrom partition number 3
fastread: failed to open /dev/rsr0No such device or address
ERROR while loading miniroot disk: /dev/rsd3b

I tried to do the copy manually, but I'm not sure I did it right:

fastread /dev/sd1c 3 4194304 7168000 >/dev/sd3b

This didn't print any errors, so it did something, but I don't know if using sd1c was the right move.

Have you been able to get a 4.1.4 install to happen, or did you just get to the point of being able to boot off of the CD-ROM?

atar said...

Yes, I did install it. Now I realize I had to document it, as it wasn't straightforward.

I think I created a symlink declaring sd1a to be a cdrom. But it was required one step later, during software selection. I don't remember how did I install the miniroot. I vaguely remember to have done it manually, but maybe this was before I fixed the escc bug.

Have to look whether I made any notes.

Ted Lemon said...

That would be handy. There was a time when I probably could have done the miniroot in my sleep, but it's been *so* long since I did a SunOS 4.1 install...

atar said...

Found some records. Hope this is enough to get you going. They are from the time when escc was still broken, so it may go much easier now, but I don't have time to test. Feel free to send me back a better install procedure. :) If something doesn't work the described way, feel free to report.

- Formatted a new 1.3 G image (one of a standard SunOS types) with the format utility.
- created / (sd0a), swap (sd0b) and /usr (sd0g) partitions. Haven't marked swap somehow special.
- dd'ed the Solaris 1.1.2 miniroot to the swap partition
- mounted miniroot, chrooted there
- hacked /dev/ so that the cd would point to a hdb partition
- started suninstall script.
- selected the 'full' install and that was it.

Ted Lemon said...

Okay, what you're doing doesn't really match what I think I can do with the SunOS 4.1.4 CD that I have. There's no mount or chroot command in the in-memory filesystem that you boot before you set up the miniroot.

What I have been able to do is dd what I think is the miniroot onto the b partition as follows:

dd if=/dev/rsd1a seek=8192 count=14000 of=/dev/rsd3b

Then I get the name of the device like this:

/usr/kvm/unixname2bootname /dev/sd3b

Unfortunately, when I try to boot this I get an error:

ok boot /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:b
Boot device: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:b File and args:
The file just loaded does not appear to be executable.

So my theory is that our paths diverge at the point where we set up the miniroot--in order to mount it, you must have booted off of something other than the CD-ROM, or else you have a different CD-ROM.

I don't know if my dd command is correct--it looks correct based on the miniskip= and minicount= settings from /extract on the install filesystem, but it doesn't appear to be producing any sort of working miniroot.

Ted Lemon said...

Oops, I just realized that seek seeks the output, not the input. So I changed the dd command as follows:

dd if=/dev/sd1a skip=8192 count=14000 of=/dev/sd3b

Unfortunately, I still get the same error message.

atar said...

I wonder why do you need the "skip" magic? There must be a "miniroot" file lying around sun4m/directory.

And, not sure, but I might booted from a CD with -a option and specified the hard disk as a root.

Ted Lemon said...

Okay, I'd better write down what I'm doing--your advice has definitely helped me to make some progress.

I'm not able to use mount on the sunos install cd, so I booted off of a NetBSD install CD and mounted the cd-rom:

../qemu/sparc-softmmu/qemu-system-sparc -M SS-5 -bios ./ss5.bin -nographic -hda SunOS4.1.4 -hdd 1-sunos414.iso -hdb sparccd-5.0.2.iso

(SunOS4.1.4 is a qcow2 200M drive that I had already formatted from the SunOS install CD as a Sun207 drive.)

at the ok prompt, I typed "boot disk1:d" I selected to install from cdrom, and specified the cd-rom device as /dev/hd1a instead of the default. Once I got the default instfs set up, I selected S for shell and typed the following:

mount -t cd9660 /dev/sd2a /mnt
cd /mnt/export/exec/kvm/sun4m_sunos_4_1_4
dd if=miniroot_sun4m of=/dev/sd0b

This did in fact get me a mountable miniroot. Then to boot it I found I needed an extra disk for swap, so I just copied my SunOS disk image and re-ran qemu:

../qemu/sparc-softmmu/qemu-system-sparc -M SS-5 -bios ./ss5.bin -nographic -hda SunOS4.1.4 -hdb 1-sunos414.iso -hdc swap

Then I booted as follows:

boot disk1:d -a
4.2 <- filesystem type
disk0:b <- disk for filesystem
vmunix <- what to boot
4.2 <- filesystem type
sd3b <- disk for filesystem
spec <- swap type
sd2b <- disk for swap

This gets me to a prompt. However, when I try to run suninstall, I get an error that it can't find the install media. It appears to remake /dev within suninstall, so making a link from rsd1a to rsr0 doesn't seem to help.

Ted Lemon said...

Oh, at the unix prompt after booting I needed to remount / to make it writeable:

mount -o remount /dev/sd3b /

Ted Lemon said...

more progress: suninstall blows away stuff in /dev when it runs, so I run it once, which fails (after filling in /dev). Then I do:

cd /dev
mv MAKEDEV MAKEDEV.foo
ln -s /bin/true MAKEDEV
rm sr0
ln -s /dev/sd1a sr0

Then I run suninstall again, and this time it seems to work (it's chugging along installing right now).

Ted Lemon said...

Yup, that did it. The rest of the install was cake. boot disk0: works to boot the operating system. Now I just have to figure out how to get networking working...

John said...

I'm doing my darndest to acquire a copy of Solaris 2.2... I'd like to get it running under qemu, as well as install it on a real SS10. Can any of you guys help me out? Please?

Ted Lemon said...

Don't have it. :(

Robert Dinse said...

I'm curious what you are seeing with networking. I've got an old SS-10 I'd dearly like to retire and replace with an emulation because I know it's going to retire itself sooner than later. I've run out of spare parts so the next thing that cooks is it.

atar said...

The networking works fine under SunOS 4.1.4. Don't remember how it was with 2.2, but since I didn't mention any problems, it probably worked. What software do you use on this SS-10?