Solaris 2.4-8 Emulation Problems

Discussions about *nix and Other Operating Systems should go in this forum.
Post Reply
Courage
User avatar
Posts: 1018
Joined: Thu Oct 18, 2012 1:59 pm

Solaris 2.4-8 Emulation Problems

Post by Courage »

I have the following versions of Solaris:

2.4 (from this FTP)
2.5.1 (from this FTP)
7 11/99 (from this FTP)
8 02/00 (Some copy I got from a torrent)
8 07/01 (from another FTP)
8 02/02 (from archive.org)

All are x86 versions. I have tried to set up a system which has Openwindows/CDE working with at least VGA (not the most ideal config), not just a text based system.

I tried to use both Battler's branch of PCem and Virtualbox 5.0.22 to set these up, but I'm just not able to do it. I have my PCem config set like this:

Image

For Virtualbox, I set the guest settings to 'Other -> Other/Unknown' and disabled all acceleration.

For both PCem and Virtualbox, I used a 4 GB hard drive.

My processor is a Core i7 @ 3.4GHz, which seems to be related to many boot crashes when trying to emulate/virtualize Solaris.

I was able to install both Solaris 2.4 and 2.5.1 in both PCem and Virtualbox, but when I tried to use the S3/VGA drivers in PCem/Virtualbox respectively both times when kdmconfig shows up during install or when I run kdmconfig after install, all I get is a shell or a black screen.

The Solaris 7 11/99 CD is not bootable, as with 2.4 and 2.5.1 above, but I was able to find a boot disk on another FTP. After that I ran into a crash described on the OS/2 Museum, but after I used kadb and continued booting, Virtualbox crashes with a breakpoint.

8 02/00 boots from the CD, but it immediately stops with a 'Not a valid UFS filesystem' error, even before going into secondary boot. This would probably be a result of a bad dump, but I'm not too experienced with Solaris <10.

8 07/01 also boots from the CD, but it just crashes right before the 'Running Configuration Assistant' shows up. It doesn't let me run 'kadb' because it happens very early in the boot sequence.
When encountering this crash, PCem just exits, and Virtualbox throws up an error offering me to quit or run its own debugger.

8 02/02 boots from the CD and even installs, but it hangs/crashes when formatting the hard disk with both PCem and Virtualbox respectively, for unknown reasons.

I hope I can get some help on these problems, as they seem to be pretty obscure.

sparcdr
User avatar
Posts: 138
Joined: Tue Jul 05, 2016 6:57 am

Re: Solaris 2.4-8 Emulation Problems

Post by sparcdr »

Have you tried qemu-system-i386 (Force the pc/cpu model using -cpu flags) with bochs vesa mode; or for that matter bochs itself? I have had success getting qemu to work with SunOS 4.1.4 sparc(32) in single user mode. I'm thinking the unable to load UFS error is caused by the cd-rom sector size. Solaris on SPARC required 512 byte blocks (SCSI era) while PC's have pretty much always been 2048. I agree that the copy is probably bad with Solaris 8 02/00.

As far as graphics and qemu, if the os supports Cirrus CLGD 5446, X11 could possibly work. I have cobbled some qemu scripts together below for non IA32 platforms that could be used for x86 all the same if you want to try it and get overwhelmed by the dystopic command-lines it has. This doesn't include graphics support, but could be easily hacked to support it for an ia32 target since sparc32 doesn't really have framebuffer and I used serial-line with socat to get it working.

I can't comment on Virtualbox in regards to Solaris, but have similar problems running Xenix 80386 on it. (Don't ask) So I think part of the problem is that it's passing bad (or real) CPU information.

QEmu docs (Incase you need them):
https://qemu.weilnetz.de/qemu-doc.html# ... m-emulator

(Potentials only) qemu-system-i386 -cpu ?:

Code: Select all

pentium
pentium2
pentium3
athlon
While not particularly useful unless you want to run qemu under linux under a vm to use my "dynamic qemu" script, here's the code I used to run Gentoo 2006.0 on SPARC32 (Debian host):

command-line:

Code: Select all

sudo ./sparc32.sh --name S1 --ip 192.168.2.3 --monport 10001 --serport 10101 --hwmodel SS-20 --cpu "TI SuperSparc II" --ram 2047 --macaddr 00:50:56:00:9F:F5 --tapdev tap1 --bootorder c
/etc/network/interfaces:

Code: Select all

# Loopback device:
auto lo
iface lo inet loopback
iface lo inet6 loopback

auto br0
iface br0 inet static
        address 192.168.2.2
        netmask 255.255.255.0
        gateway 192.168.2.1
        bridge_ports eth0
        bridge_stp off
        bridge_fd 1
        bridge_hello 2
        bridge_maxage 12
./scripts/qemu-ifup:

Code: Select all

switch=br0
echo "$0: adding tap interface \"$1\" to bridge \"$switch\""
/sbin/ip link set $1 up promisc on
/sbin/brctl addif $switch $1
sleep 2
exit 0
./scripts/qemu-ifdown:

Code: Select all

switch=br0
echo "$0: deleting tap interface \"$1\" from bridge \"$switch\""
/sbin/ip link set $1 down
/sbin/brctl delif $switch $1
/sbin/ip link delete dev $1
exit 0
./sparc32.sh

Code: Select all

#!/usr/bin/env bash
export BASEDIR="/home/sparcdr"
export \
DWNSCRIPT="$BASEDIR/scripts/qemu-ifdown" \
UPSCRIPT="$BASEDIR/scripts/qemu-ifup"
if [[ $EUID -ne 0 ]]; then
        echo "[ABRT] You must be root user!" 2>&1
        exit 1
fi
STD_IN=0
prefix=""
key=""
value=""
for keyValue in "$@"
do
  case "${prefix}${keyValue}" in
    -n=*|--name=*)       key="-n";  value="${keyValue#*=}";;
    -i=*|--ip=*)         key="-i";  value="${keyValue#*=}";;
    -m=*|--monport=*)    key="-m";  value="${keyValue#*=}";;
    -s=*|--serport=*)    key="-s";  value="${keyValue#*=}";;
    -h=*|--hwmodel=*)    key="-h";  value="${keyValue#*=}";;
    -c=*|--cpu=*)        key="-c";  value="${keyValue#*=}";;
    -r=*|--ram=*)        key="-r";  value="${keyValue#*=}";;
    -a=*|--macaddr=*)    key="-a";  value="${keyValue#*=}";;
    -t=*|--tapdev=*)     key="-t";  value="${keyValue#*=}";;
    -b=*|--bootorder=*)  key="-b";  value="${keyValue#*=}";;
    -d=*|--iso=*)        key="-d";  value="${keyValue#*=}";;
    -l=*|--localtime=*)  key="-l";  value=1;;
    -u=*|--date=*)       key="-u";  value="${keyValue#*=}";;
    -a=*|--sadapter=*)   key="-a";  value="${keyValue#*=}";;
    -z=*|--sindex=*)     key="-z";  value="${keyValue#*=}";;
    -v|--verbose)        key="-v";  value=1;;
    *)                              value=$keyValue;;
  esac
  case $key in
    -n)  NAME="${value^^}";         prefix=""; key="";;
    -i)  HOSTIP="${value}";         prefix=""; key="";;
    -m)  MONPORT="${value}";        prefix=""; key="";;
    -s)  SERPORT="${value}";        prefix=""; key="";;
    -h)  HWMODEL="${value}";        prefix=""; key="";;
    -c)  CPU="${value}";            prefix=""; key="";;
    -r)  RAM="${value}";            prefix=""; key="";;
    -a)  MACADDR="${value}";        prefix=""; key="";;
    -t)  TAPDEV="${value}";         prefix=""; key="";;
    -b)  BOOTORDER="${value}";      prefix=""; key="";;
    -d)  ISO="${value}";            prefix=""; key="";;
    -l)  LOCALTIME="${value}";      prefix=""; key="";;
    -u)  CLOCKDATE="${value}";      prefix=""; key="";;
    -a)  SADAPTER="${value}";       prefix=""; key="";;
    -z)  SINDEX="${value}";         prefix=""; key="";;
    -v)  VERBOSE="${value}";        prefix=""; key="";;
     *)   prefix="${keyValue}=";;
  esac
done
# Non-KVM Runs Under Single Thread (Disable SMP)
cmd="qemu-system-sparc -nographic -smp 1"
# Host Monitor/Serial Bind
if [ -z "$HOSTIP" ]; then
        echo "[INFO] Host IP unspecified, binding to all."
        export HOSTIP='0.0.0.0'
fi
# Host Monitor Port
if [ -z "$MONPORT" ]; then
        echo "[ABRT] Host monitor port unspecified!"
        exit 0
fi
# Host Serial Port (TTYA/COMM1)
if [ -z "$SERPORT" ]; then
        echo "[ABRT] Serial port unspecified!"
        exit 0
fi
cmd=" $cmd -monitor tcp:$HOSTIP:$MONPORT,server,nowait,nodelay"
cmd=" $cmd -serial telnet:$HOSTIP:$SERPORT,server,nowait,nodelay"
# SS-5, SS-20
if [ -z "$HWMODEL" ]; then
        export HWMODEL='SS-20'
        echo "[INFO] Hardware model unspecified, defaulting to SS-20."
fi
cmd=" $cmd -M \"$HWMODEL\""
# Fastest Available @ 90MHz (ROSS HyperSPARC Not Available) ~525 BogoMIPS
if [ -z "$CPU" ]; then
        export CPU="TI SuperSparc II"
        echo "[INFO] CPU unspecified, defaulting to TI SuperSparc II."
fi
cmd=" $cmd -cpu \"$CPU\""
# RAM Unset, Assign Defaults
if [ -z "$RAM" ]; then
        if [ "$HWMODEL" != "SS-20" ]; then
                # Sane Default
                if [ "$HWMODEL" != "SS-5" ]; then
                        export RAM="512"
                else
                        # Maximum on SPARCStation-5
                        export RAM="256"
                fi
        else:
                # Maximum Possible (512MB on REAL Hardware)
                export RAM="2047"
        fi
        echo "[INFO] RAM unspecified, defaulting to $RAM MB."
else
        # Validate RAM Inputs
        if [ "$HWMODEL" == "SS-5" ]; then
                # Too Much On SS-5
                if [ $RAM -gt 256 ]; then
                        export RAM=256
                        echo "[INFO] SS-5 PROM only supports 256MB RAM, setting default."
                fi
        else
                # Too Much!
                if [ $RAM -gt 2047 ]; then
                        export RAM=2047
                        echo "[INFO] OpenBIOS PROM only supports 2047MB RAM, setting default."
                fi
        fi
fi
cmd=" $cmd -m $RAM"
# TODO: Make dynamic (Use dodgy .file or something)
if [ -z "$TAPDEV" ]; then
        echo "[ABRT] TAP node unspecified!"
        exit 0
fi
# Check MAC Address
if [ -z "$MACADDR" ]; then
        echo "[ABRT] WAN MAC address unspecified!"
        exit 0
else
        # WAN MAC Address Specified (V2W)
        cmd=" $cmd -net tap,vlan=0,ifname=$TAPDEV,script=$UPSCRIPT,downscript=$DWNSCRIPT -net nic,model=lance,macaddr=$MACADDR"
fi
# Boot Order Unset, Assume SCSI CD-ROM then SCSI HDD
if [ -z "$BOOTORDER" ]; then
        echo "[INFO] Boot order unspecified, set defaults: dc."
        export BOOTORDER="dc"
fi
cmd="$cmd -boot order=$BOOTORDER"
# ISO Set, Validate
if [ ! -z "$ISO" ]; then
        IPATH="$BASEDIR/iso/$ISO"
        # Find File
        if [ -f "$IPATH" ]; then
                # Attach CD-ROM
                cmd="$cmd -drive file=$IPATH,cache=none,media=cdrom,if=scsi,index=1"
                echo "[INFO] ISO image was specified, attaching media to SCSI bus."
        fi
fi
# Localtime Specified
if [ ! -z "$LOCALTIME" ]; then
        cmd="$cmd -localtime"
        echo "[INFO] Localtime specified, appending to command string."
fi
# Date Manually Set
if [ ! -z "$CLOCKDATE" ]; then
        cmd="$cmd -startdate $CLOCKDATE"
        echo "[INFO] Clock date specified, appending to command string."
fi
# For Pretty Print
if [ -z "$ISO" ]; then
        ISO="N/A"
fi
if [ ! -z "$LOCALTIME" ]; then
        LOCALTIME="True"
else
        LOCALTIME="False"
fi
if [ -z "$CLOCKDATE" ]; then
        CLOCKDATE="N/A"
fi
# HDD Bus
if [ -z "$SADAPTER" ]; then
        # Assume SCSI if None Given
        SADAPTER="scsi"
fi
# SCSI Indexes
if [ -z "$SINDEX" ]; then
        # Assume 0-Index
        SINDEX=0
fi
HDD="$BASEDIR/hdd/$NAME"
if [ ! -z "$VERBOSE" ]; then
        printf "Parameters: \n\
        \tName: $NAME, \n\
        \tIP: $HOSTIP, \n\
        \tMonitor: $MONPORT, \n\
        \tSerial: $SERPORT, \n\
        \tHardware: $HWMODEL, \n\
        \tCPU: $CPU, \n\
        \tRAM: $RAM, \n\
        \tMAC: $MACADDR, \n\
        \tTAP: $TAPDEV, \n\
        \tVTAP: $VTAPDEV, \n\
        \tBoot: $BOOTORDER, \n\
        \tCDROM: $ISO, \n\
        \tLocaltime: $LOCALTIME, \n\
        \tDate: $CLOCKDATE, \n\
        \tHDD: $HDD, \n\
        \tHDD Adapter: $SADAPTER, \n\
        \tHDD Index: $SINDEX\n"
fi
if [ ! -f "$HDD" ]; then
        echo "[ABRT] No HDD image found, aborting!"
        exit 0
fi
# Assign HDD
cmd="$cmd -drive file=\"$HDD\",cache=none,if=$SADAPTER,index=$SINDEX"
# Run Command String
if [ ! -z "$VERBOSE" ]; then
        eval $cmd
else
        cmd="$cmd > /dev/null"
        eval $cmd
fi
exit 1
Notes:
Find:

Code: Select all

cmd="qemu-system-sparc -nographic -smp 1"
Change to:

Code: Select all

cmd="qemu-system-i386 -smp 1"
(Remove nographic)

Find:

Code: Select all

cmd=" $cmd -net tap,vlan=0,ifname=$TAPDEV,script=$UPSCRIPT,downscript=$DWNSCRIPT -net nic,model=lance,macaddr=$MACADDR"
Change to:

Code: Select all

cmd=" $cmd -net tap,vlan=0,ifname=$TAPDEV,script=$UPSCRIPT,downscript=$DWNSCRIPT -net nic,model=ne2k_pci,macaddr=$MACADDR"
Network models:

Code: Select all

sparcdr@hammer:~$ qemu-system-i386 -net nic,model=?
qemu: Supported NIC models: ne2k_pci,i82551,i82557b,i82559er,rtl8139,e1000,pcnet,virtio
Delete these lines:

Code: Select all

-h=*|--hwmodel=*)    key="-h";  value="${keyValue#*=}";;

-h)  HWMODEL="${value}";        prefix=""; key="";;

# SS-5, SS-20
if [ -z "$HWMODEL" ]; then
        export HWMODEL='SS-20'
        echo "[INFO] Hardware model unspecified, defaulting to SS-20."
fi
cmd=" $cmd -M \"$HWMODEL\""

# RAM Unset, Assign Defaults
if [ -z "$RAM" ]; then
        if [ "$HWMODEL" != "SS-20" ]; then
                # Sane Default
                if [ "$HWMODEL" != "SS-5" ]; then
                        export RAM="512"
                else
                        # Maximum on SPARCStation-5
                        export RAM="256"
                fi
        else:
                # Maximum Possible (512MB on REAL Hardware)
                export RAM="2047"
        fi
        echo "[INFO] RAM unspecified, defaulting to $RAM MB."
else
        # Validate RAM Inputs
        if [ "$HWMODEL" == "SS-5" ]; then
                # Too Much On SS-5
                if [ $RAM -gt 256 ]; then
                        export RAM=256
                        echo "[INFO] SS-5 PROM only supports 256MB RAM, setting default."
                fi
        else
                # Too Much!
                if [ $RAM -gt 2047 ]; then
                        export RAM=2047
                        echo "[INFO] OpenBIOS PROM only supports 2047MB RAM, setting default."
                fi
        fi
fi

\tHardware: $HWMODEL, \n\
Create hdd (36GB):

Code: Select all

dd if=/dev/zero of=S1 bs=1M count=36864
New command-line (Boot off iso):

Code: Select all

sudo ./sparc32.sh --name S1 --ip 192.168.2.3 --monport 10001 --serport 10101 --cpu "pentium2" --ram 2047 --macaddr 00:50:56:00:9F:F5 --tapdev tap1 --bootorder d --iso "/data/solaris.iso"
New command-line (Boot off disk):

Code: Select all

sudo ./sparc32.sh --name S1 --ip 192.168.2.3 --monport 10001 --serport 10101 --cpu "pentium2" --ram 2047 --macaddr 00:50:56:00:9F:F5 --tapdev tap1 --bootorder c
* Note the boot order. C is the virtual disk, D would be the ISO. You may be able to use -net user (slirp) on a Windows host (Instead of tuntap) as x86 is the main target anyways and is one of the only targets with any decent level of graphics support. The SCSI target I use above may not work at all on x86 so may need to be also changed.

If you need any explanations about the above snippet(s) I'm happy to help.

Post Reply