Coherent on Qemu

well apparently it *DOES* work, however the disk access is incredibly slow, like 1kb/sec slow.. I can’t help but wonder if it is somehow tied to how NetWare 3.12 bombs on Qemu once it tries to mount a volume….

Anyways, you can read all about it on “The beez speaks:” which goes into some detail on how to dump Qemu’s running state, and restore.. Kind of handy actually.

I remember the print ads for Coherent, nearly bought it but I felt too weirded out by it being mail order.  My loss I guess, but it sure would have been nice to have before the whole rise of 386 BSD / Linux …

Qemu 0.15.1 patched

I went ahead and slapped together a bunch of favorite patches to Qemu that I seemed to not have put in all together… so here we go the i386 version…..

  • AdLib! enabled
  • NE2000 set to 0x320 IRQ 10
  • GNS udp
  • control+alt+d to do a CAD
  • control+alt+r to reset
  • ISA Cirrus VGA adapter (CLGD5426)

I’ve also found for Windows 95, that if you set the graphics one notch off of full acceleration  that the mouse pointer will ‘work’ …

Of all the testing Iv’e done so far, it’s just been with Windows 95, the soundblaster/adlib works along with the networking (NAT) as I installed IE 3.01 for good measure.

For those who are interested, my build is available here, and the patch is here.

The ISA Cirrus VGA is enabled with -vga isacirrus … Enjoy!

Using Qemu

I get notes every now and then about people not being able to use Qemu.  While Qemu is great, cross platform, and free it can be a little crazy to use, esp to people who are scared of the command line.

But rest assured it really isn’t that bad, once when you see the order of its seeming chaos.

Take this string for example:

C:\qemu\NTwalk>..\qemu-1.0.1\qemu-system-i386.exe -L ..\qemu-1.0.1\pc-bios -m 64
-cpu pentium -drive file=nt31disk,if=ide,index=0,media=disk,cache=writeback -ne
t nic,model=pcnet -net user -cdrom “Windows NT 3.1, Win32 SDK.iso” -fda “\temp\extensions.img” -soundhw sb16,adlib

Lets break it down as follows:

C:\qemu\NTwalk>..\qemu-1.0.1\qemu-system-i386.exe

First I specify the Qemu emulator I’m going to use.  I’m using the i386 one here, and as you can see, I’m running this from a different directory than where I’m working with disk images.

-L ..\qemu-1.0.1\pc-bios

Next is where I tell Qemu where it can find the needed BIOS files.  I think there is some global install path, but I tend to run all kinds of versions of Qemu all at once so this will *not* work for me, and it is just easier to tell it where to find them.

-m 64

I’ve set my VM to a maximum of sixty four megabytes of RAM.  The default is 128MB, but  sometimes you want less, as some OS’s can’t use more than 8/16/64 anyways and they may have issues finding RAM where they aren’t expecting it.

-cpu pentium

Most OS’s will run and boot on a modern CPU, this includes MS-DOS 3.30 which I have booted via a USB floppy controller on my 8core AMD processor.  However some OS’s fell into the trap of how to identify the processor, and configure themselves accordingly.  All was well until the Pentium 4, Itanium, and the CORE CPU’s came into existence.

 -drive file=nt31disk,if=ide,index=0,media=disk,cache=writeback

With a lot of experimentation I’ve found that this combination works best for qcow2 disk images.  While a lot more complicated than “-hda nt31disk” it does perform significantly quicker.  Another ‘tip’ I like is that you can have Qemu mount a directory (as long as it is under 500MB) and it’ll create a virtual FAT-16 formatted disk.  The flags are [ -hdb fat:<path> ]  this is a great way to copy in things like device drivers, and even programs.  However this disk is read only, so you cannot copy data out.

-net nic,model=pcnet -net user

This enables the AMD PCNet PCI network card, and sets it to User mode NAT.  I like the AMD card as it has really good support.  With that in mind, Qemu supports the following models:

  • ne2k_pci
  • ne2k_isa
  • i82551
  • i82557b
  • i82559er
  • rtl8139
  • e1000
  • pcnet
  • virtio

I’ve never really messed with the tun/tap stuff as you can only have one host on it, so its kind of useless to me.  With the usermode NAT the VM should be configured the following way if it doesn’t support DHCP:

Address 10.0.2.15
NetMask 255.255.255.0
Gateway 10.0.2.2
DNS 10.0.2.3

If you have DNS issues, you may want to try a DNS server that you are using on your physical computer, or perhaps 4.2.2.4/8.8.8.8 . Also you will *NOT* be able to ping outside of the VM, but you *CAN* ping the gateway, 10.0.2.2 .

-cdrom “Windows NT 3.1, Win32 SDK.iso”

Just as it appears, this adds an ISO image into the VM which is typically located on the second IDE interface, on the primary port. To force the VM to boot from CD, add the flag ‘-boot d’ and the BIOS will attempt to boot from the CD-ROM.

-fda “extensions.img”

And like the CD-ROM, this is for the floppy disk.  Sizes can be 360k, 720k, 1.2M and 1.4M. If you wish to boot from the floppy disk you simply add the flag ‘-boot a’  Older floppies will not contain a boot check sum, so to force them to boot, you’ll need the additional flag ‘-no-fd-bootchk’ to ignore the check sum that later diskettes used.  In my above example I’m just using a disk image, not booting from it.

-soundhw sb16,adlib

And finally I’m enabling both the SoundBlaster 16 & Adlib emulation.  By default in the builds of Qemu the adlib is turned off, but I just turn it back on when I build Qemu.  Other sound cards include the recent HDA & AC97 chipsets.

Remember the Sound Blaster is configured for an IO base of 0×220, IRQ 5, DMA 1 and High DMA 5.

 

I hope this gives some insight to users on how to effectively use QEMU.

Dell UNIX Lives Again!

(please note that this is a guest post from Antoni Sawicki)

Dell UNIX is so ultra rare among rare Unix species that it doesn’t even have a Wikipedia entry. I have been hunting this elusive but important piece of computer history for well over 15 years now. Fortunately thanks to Charles H. Sauer and his excellent blog post I was finally able to lay my hands on disk and tape images and the restoration process begun.

The install tape

The system can be installed from either a tape or network server (presumably NFS). Unfortunately no virtualization software can emulate a tape drive. Hopes for a network install are even slimmer since the required network support floppy disk has been lost and chances of suitable Ethernet driver working in Bochs or Qemu are equal to that of finding the lost floppy disk.

I have decided to try a hard disk image from a readily pre-installed system. The original Dell 486 workstation had a 1GB SCSI hard disk. Unfortunately neither Dell UNIX supports LBA mode nor Qemu/Bochs support the Adaptec 154x controller required by the OS.

As all normal install options have been exhausted, the only option left was to use a second hard disk image as source of cpio archive files. Booting from the two install floppies and attaching two disk images was a snap. The next step was to inject the tape “file” in to a right place on the disk, so it can be read by cpio command. A hard disk in Dell UNIX is pretty much unusable without a valid SysV partition and VTOC. Fortunately dellsetup command does it all for you. Once VTOC was put in place I’ve attached the transfer disk image as a loopback device in my host OS. In couple of iterations I was able to aim the host os dd if=file1 of=/dev/loop0 bs=512 seek=offset at the right place, which you work out using prtvtoc /dev/rdsk/1s0 command. Then cpio -ict < /dev/dsk/1s1 was able to list contents of the emulated tape… with errors…

In my infinite wisdom, for some unknown reason I’ve assumed that LBA addressing is required above 540MB. So to be on a safe side I have made the hard disk images 512 MB. What a mistake it was! I have lost several hours trying to figure out cpio header errors coming from the disk… By pure coincidence, while the tape archive was installing (with errors) I was researching for this very blog article and found that LBA starts at 504 MB… Recreating the hard disk images just few MB smaller took all tape and prior boot problems away!

Once the cpio archive was extracted I have made few final touches taken from the original tape install script. After a reboot Dell UNIX booted perfectly. You can experience this by using the firstboot image file. The final part of installation was injecting the second tape file containing System V PKG file to the transfer disk image and running pkgadd -d /dev/dsk/1s1. This is what’s included on allsoft.img.

Dell Unix at First Boot

Some final notes on running the OS:

  • To enable mouse to work:
    • Qemu just add “-chardev msmouse,id=msmouse -device isa-serial,chardev=msmouse” to the launch arguments.
    • Bochs add to the config file:
      mouse: type=serial, enabled=1 
      com1: enabled=1, mode=mouse
      then you have to kill mousemgr process and prevent from starting by deleting /etc/rc2.d/S25mse
      then edit /usr/lib/X11/Xconfig:
      disable Xqueue
      enable Microsoft Mouse
  • To enable keyboard to work correctly in VirtualBOX start with Num Lock OFF.
  • You can use qemu-img utility to convert the image to VMware vmdk to use in VirtualBox.
  • To run X window type startx

X11 and all its glory

  • To attach it to internet use SLIP as there is no working Ethernet driver.  Contrary to most UNIXen of the time, the command is not slattach, but rather slipattach.  Thankfully it does work the same way.  I have found that running Dell Unix with VirtualBOX, along with Windows NT 4.0 I was able to connect into the Dell Unix VM, and get network access.  Just set the two VM’s up for a named pipe (\\.\pipe\dellunix) and make one of them a server, and start that VM 1st.  The steps to prepare Windows NT have been outlined before.

Telnet via SLIP

Legal disclaimer: Dell UNIX is a commercial software and should not be distributed without manufacturers permission. However as the operating system has been dead for 20 years and with a long tradition from Unix Heritage Society and Bitsavers I’m publishing this in good faith under abandonware category. If Dell or any other copyright holder wishes this software removed, please let me know.

Attached are:

  • firstboot image
  • all (pkg) software installed
  • setup instructions if you wish to install from scratch.

Download:

You may also be interested in my post about a sister System V operating system – Interactive UNIX:

Update: Dell Unix now runs on 86Box with higher resolution and proper networking.

Newer ‘fixed’ Qemu 1.0.1 binaries

Well I booted my PC back up, and did a test with Darwin… I’d kind of given up on the newer Qemu because anything beyond MS-DOS & OS/2 would crash as soon as the disk was to be accessed from protected mode… Like this:

So as I had found out before from this post, I rebuilt coroutine-win32.c without any optimizations (-O0) and….

It works!

It booted up like it was expected!

I’ve relinked everything, and just uploaded it to the old package name, so anyone new that comes along that doesn’t hit this page first won’t get binaries that won’t work.  Naturally these have the NE2000 on Interrupt 10, port 0x320, the AdLib included and my shortcuts for control alt delete & reset (control+alt+d/control+alt+r) ..

Download it here.

Enjoy!

Slow VM disk access on Qemu/SIMH or other emulators running on Windows?

Turns out from an interesting thread on the SIMH mailing list, is that the Windows volume shadow copy service, and other ‘system’ protecting services may tag files like .dsk to be monitored, and to save a difference of every write to the file.

Yes that is right, on top of NTFS’s transaction log and rolls, you have the OS doing the same thing which in turn makes your disk access slower than hell.

The fix?

Quite simple, dont use TLA (three letter acronym) file extensions, or no extensions at all and suddenly you’ll find that your disk based emulation is significantly faster.

Speaking of Qemu 1.0.1 and instabilities

I came across this site, which drops this bomb:

February 29, 2012: updated for Qemu-1.0.1 – Still a “to be tested” version. See bug report win32: git rev 59f971d crashes when accessing disk (coroutine issue). In my version a workaround was to compile coroutine-win32.c without optimisation (-O0): contains qemu-system-arm.exe, qemu-system-i386.exe, qemu-system-ppc.exe, qemu-system-sparc.exe, qemu-system-x86_64.exe and the linux-0.2.img image

Well isn’t that amazing… I know I’d given up on it as as soon as some OS’s accessed the hard disk once they’ve initialized in protected mode it’d just lock up…

I may well have to revisit my Win32 builds of Qemu 1.0.1

Building Qemu 0.15.1 on OS X 10.5.8

End of the line for the PPC

So I was wanting to build Qemu for my somewhat new G5.  After going through some hardware hell, of a bad hard disk, ram, and having to reseat the video card (should have figure it’d get shaken in the transit) and blowing out all the gunk, my G5 is now in action! … But silly me I wanted to play with OS/2 and while I do have Virtual PC for OS X (yeah MSDN) I wanted to play with Qemu.

I didn’t feel like dealing with 1.0.1, I thought I’d take a stab at the older stable branch, 0.15.1 .. And what a joy that was.

So first off I installed OS X 10.5 from the nicely provided install DVD.  That went fine with good RAM (shockingly with bad memory it gets corrupted and has all kinds of errors, if only the RAM test from the boot ROM was worth anything…. but it makes a nice chime noise).  So I found out much to my amazement after unpacking and going to build 10.15.1 that it requires.. glib-2.0 .  Well damn, this puts me in the same build hell that made Qemu 1.0+ in Win32.

But I figured OS X being a UNIX it may be somewhat easier to build… Somewhat.

So I started with glib-2.30.2, which of course dies because there is no pkg-config.  I download pkg-config-0.26 which won’t build because… yes, there is no glib-2.0 …. GRRRR!!!!  So I try pkg-config-0.18.1 and it actually builds!  One thing to keep in mind is that you *MUST* have the environment variable “PKG_CONFIG_PATH” set to something like this:

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

or it won’t work. I tried to build glib again, and now it fails because there is no libffi.  I try libffi-3.0.10 and it won’t build with some weird error of:

$ make
MAKE powerpc-apple-darwin9.8.0 : 0 * all-all
make: *** [all-all] Error 1

And yes it still did it after I was able to build glib2 (spoiler!?)…

Thankfully, libffi-3.0.4 did build, and installed fine.  So I try to build glib2 again, and now I fail because it wants gettext, so I went ahead and was able to build and install gettext-0.18.1.1 .  I went to build glib-2 and was totally shocked when it not only configured, but actually compiled!

I installed it, and was able to build Qemu 0.15.1, I just did the i386-softmmu target with the NE2000 fixed to be 0x300,IRQ 10, and enabled the AdLib!  And it compiled!

Now I’m sure some of the things that I’m fighting is that I’m on a PowerPC (G5!) and needless to say this version has been pretty much abandoned by everyone. I’m also using the dev tools that came on the 10.5 DVD, gcc version 4.0.1 (Apple Inc. build 5465) Which is great because they don’t seem to let you download any of the old X-Code stuff anymore..

The good news is that I could boot up my OS/2 disk image, the TCP/IP worked, however the mouse was all screwed up, left clicking just jumps the mouse like crazy, but it seems to track correctly, it just doesn’t click correctly… However the sound works GREAT!

Doom 1.1 on OS/2 2.0 via Qemu 0.15.1 on OS X

I know it isn’t much to look at, but it actually runs!

So here, for my fellow PowerPC OS X refugees, here is Qemu 0.15.1, I just built it for the i386. Doom in OS/2 on it is quite playable, but I’ve got a 2.5Ghz G5 so…. Your millage may vary.  Greatly.

And for the real daring people, here is Qemu 1.0.1 for the PowerPC.  I haven’t done much of any testing outside of loading up OS/2 2.0 from an image I had on my Windows 8 PC, connecting to the internet, and then loading up the shareware version of Doom 1.1

Windows 8 x64 and Qemu

Since people have been asking, does it work with Qemu 1.0.1?  And the answer, sadly is ….

 

sadly…

no.

As you can see the primary error code is 0x000000c4

0x0000000000000091

0x000000000000000f

0xfffff802cc92e880

0x0000000000000000

And that is about it…..  And of course keeping in mind that Qemu hasn’t been able to boot a 64bit version of Windows since 0.9.0 and Windows XP x64/Windows 2003.

Qemu 1.0.1 released

nothing much to see here…. but here it is.

Also the changelog:

  • (commit) Version 1.0.1
  • (commit) Merge branch ‘s390-1.0’ of git://repo.or.cz/qemu/agraf
  • (commit) Merge branch ‘ppc-1.0’ of git://repo.or.cz/qemu/agraf
  • (commit) e1000: bounds packet size against buffer size
  • (commit) s390: fix cpu hotplug / cpu activity on interrupts
  • (commit) s390x: add TR function for EXECUTE
  • (commit) pseries: Don’t try to munmap() a malloc()ed TCE table
  • (commit) pseries: Populate “/chosen/linux,stdout-path” in the FDT
  • (commit) pseries: Add a routine to find a stable “default” vty and use it
  • (commit) pseries: Emit device tree nodes in reg order
  • (commit) kvm-ppc: halt secondary cpus when guest reset
  • (commit) pseries: Fix array overrun bug in PCI code
  • (commit) console: Fix segfault on screendump without VGA adapter
  • (commit) Merge branch ‘master’ of ssh://git.qemu.org/pub/git/qemu-stable-1.0
  • (commit) rbd: always set out parameter in qemu_rbd_snap_list
  • (commit) Documentation: Add qemu-img -t parameter in man page
  • (commit) qemu-img rebase: Fix for undersized backing files
  • (commit) coroutine: switch per-thread free pool to a global pool
  • (commit) qiov: prevent double free or use-after-free
  • (commit) PPC: Fix linker scripts on ppc hosts
  • (commit) target-sh4: ignore ocbp and ocbwb instructions
  • (commit) usb-ohci: td.cbp incorrectly updated near page end
  • (commit) usb-host: properly release port on unplug & exit
  • (commit) usb-storage: cancel I/O on reset
  • (commit) Fix parse of usb device description with multiple configurations
  • (commit) pc: fix event_idx compatibility for virtio devices
  • (commit) pc: add pc-0.15
  • (commit) cris: Handle conditional stores on CRISv10
  • (commit) configure: Enable build by default PIE / read-only relocation sections on OpenBSD amd64/i386.
  • (commit) target-i386: fix cmpxchg instruction emulation
  • (commit) hw/9pfs: Use the correct signed type for different variables
  • (commit) hw/9pfs: replace iovec manipulation with QEMUIOVector
  • (commit) hw/9pfs: Use the correct file descriptor in Fsdriver Callback
  • (commit) hw/9pfs: Add qdev.reset callback for virtio-9p-pci device
  • (commit) hw/9pfs: Reset server state during TVERSION
  • (commit) hw/9pfs: use migration blockers to prevent live migration when virtfs export path is mounted
  • (commit) hw/9pfs: Improve portability to older systems
  • (commit) exec.c: Fix subpage memory access to RAM MemoryRegion
  • (commit) malta: Fix regression (i8259 interrupts did not work)