NetBSD 0.9

Well by some strange google search I actually found a site in Russia that had NetBSD 0.9 for the i386! Wasting no time, I mirrored the site on my VPS, then spent some time late last night trying to figure out how to boot this thing, but to no avail. Qemu, Virtual BOX and Virtual PC, could not boot the disk images correctly, while BOCHS was running into all kinds of errors related to the 0.9 kernel’s floppy, and hard disk errors with 1.0’s handling of the hard disk.

So for the heck of it, I tried it on VMWare Fusion for OS X, and lo, it booted the NetBSD 0.9 kernel floppy! So I went ahead, and made all the diskettes for the release, and went ahead and installed it on VMWare. Now while VMWare may be able to install NetBSD, it doesn’t emulate peripherals like NE2000’s so networking would involve PPP or SLIP over the COM port, which sounds like a lot of work, looking back to my adventure with SLIP a while back, that I’m not looking to redo anytime soon.

So with my installed VMDK (the disk file VMWare uses), I used the qemu utility qemu-img to convert it to a compressed qcow2 image, then booted up Qemu with the image.

And it worked!

So with that in hand, I rebuilt Qemu to remove the NE2000 on 0x300/IRQ 9, and then rebuilt the NetBSD kernel to remove all the devices I don’t need/care about (SCSI,NFS,MATH EMULATION,etc..) and reconfigured the NE2000 to be on 0x320 IRQ 10, to match Qemu, and then ran the whole thing together, configured the network, and it seemed to be working fine.

From there it was a matter of transferring the disk image back to VMWare, I copied in the source code for lynx and ircII-4.4 then transfered it back to Qemu. And yes they worked as expected!

The only thing remaining in my flight of adventure was to build f2c, and see if it’d run Dungeon.

xx

Yes it runs Dungeon!

So with all of that out of the way, for anyone that wants to run it, I’ve uploaded my work on my sourceforge project page.

Now I just need to find myself a copy of NetBSD 0.8, and spend some more time with 386 BSD 0.0 & the hard disk parameters to see if I can get that to cleanly install.

In the meantime, feel free to load up NetBSD 0.9, fire up irc and say hi.

VMWare Fusion 3.1 & KOTOR

Well let me be the first to say this is a little “modern” compared to all of my prior stuff, but anyways I’ve been enjoying life under OS X the last few days (along with crunch time @ work.. .sigh). As part of my day job I do still have to maintain some MS-DOS & Windows stuff, so while I do run Qemu under OS X, I’ve also purchased a copy of VMWare Fusion 3.1 (available online, and as a 30 day eval!). Ok so it’s $89 with the one year support, pretty snazzy stuff.

Now one thing that I find very interesting, is that unlike all the other more expensive versions of VMWare, Fusion for the MAC allows for SOME 3d apps to run!

I’m still kind of amazed at the stuff that does run and how cleanly it does so.

So I’ve installed good old Windows XP in a VM, then tried Fallout 3. No go. For the hell of it I tried Sims 3, and surprisingly it worked.. Even though it’s silly as there is an OS X version available.

So for today (I think it may be over in a few hours….) Steam is selling Star Wars Knights of the Old Republic for $2.50 USD!

Now KOTOR has been kind of finicky about what machines it’ll run on, in the past, but I have to say, much to my surprise the emulated 3d hardware ran KOTOR out of the box, without any modifications or anything!

So here it is, KOTOR in a ‘window’ on Windows XP in a Window on OS X.

KOTOR under XP VMWare Fusion in a window windowed

KOTOR under XP VMWare Fusion in a window windowed

And it’s playable at 1024×786.. and 1280×960, although at higher resolutions I’ve had issues with the mouse tracking.. .perhaps something about hardware/software mice support?

Anyways, emulation has now come to the point where 3d stuff really does run!

Qemu 0.12.5 and OS X 10.4.1

Well as the maintainer of the SIMH binaries on sourceforge, I end up needing access to a bunch of different platforms to build some prebuilt binaries for non win32 people out there.

As a direct result, I end up emulating many of the platforms, but for OS X, I have an old PowerPC mac mini that I used to build stuff, but I gave it away last year. Anyways after digging around on various networks, I came across this file, “tiger-x86.tar.bz2” So after copying it to my pc, and doing the bzip2/tar decompress shuffle, I had what looked like a VMWare config for OSX on intel.

So I figured this was as good as any test for the latest build of Qemu. After a bunch of experimenting I worked out this was the best way to start it:

qemu.exe -L pc-bios -m 512 -hda tiger-x86-flat.img -net nic,model=rtl8139 -net user -no-acpi -no-reboot -k en-us

Then when the bootloader comes up, I just typed in:

platform=x86pc

Qemu 0.12.5 osx 10.4.1 logon screen

OS X’s logon screen

And away it went!

Now sure it works, but it’s SLOW. VERY Slow. You can remove some TPM extension, and it’ll speed up somewhat, and at least idle like a normal process. After all, I only wanted this setup to build some binaries, not run this like a desktop OS.
To make the bootstring permanent, you just have to open up a termianal window, and edit the file:

/Library/Preferences/SystemConfiguration/com.apple.Boot.plist

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>

<plist version=”1.0″>

<dict>

<key>Kernel</key>

<string>mach_kernel</string>

<key>Kernel Flags</key>

<string>platform=x86pc</string>

<key>Boot Graphics</key>

<string>Yes</string>

</dict>

</plist>

Save it, and you’ll be good to go!

For me it was nice that the networking works, so I had an easy way to get source code into the VM, and executables out of the VM. One cool thing about this VM image is that it contains the compiler! I just wonder since it’s super old will it’s exe’s I make run on modern machines…? I don’t have any way to tell, so it may all be in vain.

Even the PPC version of IE works!

Even the PPC version of IE works!

As a test for the heck of it, I downloaded Internet Explorer 5.2 for the PPC version of OSX, and it runs.. It’s too slow to actually use it, although I’ve run it on real intel macs at the apple store, and it FLIES… It’s too bad they killed it IMHO I kind of liked it.

I’m not trying to advocate piracy and all that, but rather show how Qemu can help you run some VMWare disk images, and just how flexible it is.

Sometimes less is more.

 

The more they overthink the plumbing, the easier it is to stop up the drain.

-Star Trek III

Well as of late we’ve been fighting this aging SQL server at work. It was originally a NT 4.0 server with SQL 6.5 upgraded to 7.0 then 2000 with Windows 2000. It also had to do some work with Oracle, and the dba’s were using MSDTC to make sure their transactions were getting committed into Oracle. Oh and to keep it ‘fresh’ the Oracle client was version 7 as it originally was talking to an Oracle 7 DB.

Well as the years go by, that Oracle 7 DB became Oracle 9i (already obsolete!), and we suddenly hit a transaction wall.

And along the way we virtualized the server to go into our VMWare ESX 2.x cluster, and it’s been since migrated to VMWare ESX 3.5

The server was dropping tens of thousands of these XA???????????????????.trc files, into the \winnt\system32 directory.

Well naturally you’ll eventually hit this wall of how many 8.3 translations you can do before the system CRAWLS. And boy oh boy did we hit that wall. So at first my idea was to delete all of these trc files, and let it live, but that’s not such a ‘great’ idea… As this reeks of a fundamental problem.

So the ‘first’ step in all of this madness was to up the OS to Windows 2003 enterprise (it was 2000 Advanced server before) And see how things were doing. The OS upgrade went smoothly I had slipstreamed sp2 into the update, so I only had some 90+ updates needing to be done once the OS had been upgraded. And for ‘good’ measure I thought I’d take the server from 768MB of ram up to 2GB, and set VMWare to allow 4 cpu’s for the database server. The node it was running on wasn’t doing terribly much so what the hell right?

Wrong…

The server was now performing markibly SLOWER… And yes, still dropping TRC files like there was no tomorrow.

After a bunch of digging around, I found out that in 2003 you have to click a box in the component manager to allow XA (cross architecture) transactions! Well now it wasn’t dropping as many XA trc files, but after watching it for a while, when two went to run at the same time, the SQL server would crash with a hex code saying it was out of memory.

Out of memory? I’d just given it more!?

So I did the ‘logical’ thing and gave the system 5 GB of ram, and enabled the /3GB flag in boot.ini

Same crashes.

I moved SQL server up to using 2GB of ram (out of 5, sure why not?). Same error.

Well this sucked, so we tried to update the Oracle client from 7 to 9i. In the process I found I couldn’t un-install the 7 client, nor could the 9i thing just ‘upgrade’ it, 9i kind of installed in parallel. Which led us to our next major fault, after swapping out the new client, removing the Oracle product key from the registry, and re-linking the Oracle servers using a new registration string, now ALL of our transactions against the oracle servers were failing.

Thank goodness for google, as we were able to deduce that the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsfot\MSDTC\MTxOCI was populated with all the old Oracle 7 values….

OracleOciLib -> oci.dll
OracleSqlLib -> orasql9.dll
OracleTraceFilePath -> c:\oratrace
OracleXaLib -> oraclient9.dll

So changing it to reflect Oracle 9i and suddenly our transactions were running! Even two at a time!!

But there was no doubt about it the transactions were slower then hell. We had gone from 1 minute to 11 minutes on one, and 5 minutes to just under an HOUR.

I added MORE memory to only find the SQL server couldn’t see the network card. So I added another one, and it got even SLOWER.

So in a minute of panic, I reduced the ram back to 768MB, took the VM from 4 cpu’s to 2 cpu’s and forced SQL server to use a single processor.

And our timings are now fantastic! That 1 minute process can complete now in 12 seconds!!! The other process finishes in about a minute give or take, but it’s tremendously faster.

From what I can gather, since SQL is so IO bound the more ‘top’ hardware you give it, the harder it pushes the IO stalling itself… Naturally it’s different on a physical machine, but sometimes it’s interesting to see what happens.

And may this be a lesson, just because it can emulate multiple CPU’s doesn’t mean it’ll run parallel things ‘better’…