Building Qemu 1.1.1-1 for Win32

I still can’t see how to build this for win64 … 🙁

The first major stumbling block on Win32 is glib, and again going back to the MinGW wiki there is a good laundry list of how to bootstrap Glib on MinGW.

Things you’ll need:

Be sure to run ming-get install for the following:

  • gcc
  • g++
  • libiconv
  • zlib
  • libz
  • gettext
  • msys
  • msys-perl
  • msys-m4

Install Python.. Nothing to fancy from what I gather Qemu still requires you have a level 2 Python, not 3 …

Build libffi

This should be the usual dance of configure & make / make install…  But sure to at least run configure like this:

./configure –prefix=/mingw

Build Glib without pkg-config

Be sure to add Python to your path..

PATH=/c/Python27:/c/Python27/DLLs:$PATH
export PATH

Glib is packed with something called ‘xz’ so hopefully you have xzcat .. Otherwise add it!

export LIBFFI_CFLAGS=’-I /mingw/lib/libffi-3.0.9/include’
export LIBFFI_LIBS=-lffi
export lt_cv_deplibs_check_method=”pass_all”
export CFLAGS=”-O0 -g -pipe -Wall -march=i486 -mms-bitfields -mthreads”
export CPPFLAGS=”-DG_ATOMIC_OP_USE_GCC_BUILTINS=1”
export LDFLAGS=”-Wl,–enable-auto-image-base”
configure –prefix=/mingw –with-pcre=internal –disable-static –disable-gtk-doc –enable-silent-rules

* You may have some weird issue where when running configure it tells you it cannot create executables, or you get a bunch of weird errors trying to paste in the CFLAGS line.. For me the MinGW prompt was stripping the quotes and the leading – to the -O0 (disable optimization) bit.  I don’t know what on earth its issue was, but I had to type that line in manually.

Then do the make/make install dance. This will take a WHILE. At least with -pipe it’ll run each stage of GCC on multiple processors… But yeah.. This is intense to build.  Good thing we get to do it twice.

I also ran into some weird error in the GIO directory where it couldn’t find my Python, and was looking for python2.5 .. So I copied python.exe to python2.5.exe …

PYTHON = /usr/bin/env python2.5

pkg-config

Naturally pkg-config depends on Glib2, and pkg-config to build… Which of course is a circular problem, much like Glib2 requires pkg-config to build.   So to configure it, it goes something like this now that we’ve built a Glib2 ..

export GLIB_CFLAGS=”-I/mingw/include/glib-2.0 -I/mingw/lib/glib-2.0/include”
export GLIB_LIBS=”-lglib-2.0″
configure –prefix=/mingw

At the same time I can’t help but wonder if this version of pkg-config can use it’s own Glib with the following config:

configure –prefix=/mingw –with-internal-glib

Anyways with any luck we can now build & install pkg-config.  This only takes a few seconds..

Glib2 (again)

From this point you should open a new MinGW prompt window, as you don’t want the old CFLAGS screwing things up.  Re-eport the Python path/dll vars and now we can get on to building glib2 (again!) …

configure –prefix=/mingw;make;make install

 

SDL

This should be somewhat straightforward …

configure –prefix=/mingw;make;make install

In the old days we built zlib, but now we can just quickly add in the package (as we did way above) so we should.. now be ready for the main event!

 

And now we can finally build Qemu 1.1.1-1!!!

Now there is a few things I like to tweak, the first is in the configure script, I like to add in AdLib support.  Look for the line

audio_card_list=”ac97 es1370 sb16 hda”

and add adlib into the list

audio_card_list=”ac97 es1370 sb16 hda adlib”

Next I like to modify hw/pc.c and alter the ISA NE2000, as Qemu doesn’t like to share IRQ 9 with the card, so it is just easier to remove the 0x300/IRQ 9 definition.

static const int ne2000_io[NE2000_NB_MAX] = { 0x300, 0x320, 0x340, 0x360,
0x280, 0x380 };
static const int ne2000_irq[NE2000_NB_MAX] = { 9, 10, 11, 3, 4, 5 };

to this:

static const int ne2000_io[NE2000_NB_MAX] = { 0x320, 0x340, 0x360,
0x280, 0x380 };
static const int ne2000_irq[NE2000_NB_MAX] = { 10, 11, 3, 4, 5 };

The next tweak deals with the ability to use older qcow2 disk images… I guess converting them to RAW with an older version of Qemu, then using the new version of Qemu to convert them back into qcow2’s may be a “good ideaâ„¢” but for now modifying the source is a quicker fix.

Comment out the “return -EINVAL;”  in block/qcow2.c

if (ext.len > end_offset – offset) {
error_report(“Header extension too large”);
//return -EINVAL;
}

Now one fun thing I’ve noticed is that building with the default O2 flags Qemu will crash out the moment you access a hard disk image.  It appears that coroutine-win32 is at issue (again?).  So the “easy” way I address it is to first build qemu as normal, and verify that if you attach a hard disk image (any kind) and try to access it, partition it etc, it should crash.  Next remove the file coroutine-win32.o , and edit the file config-host.mak and change the CFLAGS that specify

CFLAGS=-O2 -g

to

CFLAGS=-O1 -g

Now run make again, and it *should* just rebuild coroutine-win32.o with the lesser optimization flags, and relink all the exe’s.  If I’ve done this right, you should now have a working Qemu.

You can go ahead and strip the binaries if you so please, but that should be it.

PHEW.  For anyone who wants my build, but doesn’t want to go through this ‘exciting’ process, you can find the Win32 i386 build here.

Weird scaling in action .. Control+ALT+u kind of undoes it, but it just doesn’t look right and it is far too slow.

In preliminary testing I’ve found this version to be MUCH slower than 0.15.1 .. I think it has something to do with it wanting to scale the SDL window.  Also I’ve had issues with various network cards not initializing with the BIOS that ships with this version of Qemu so I’ve included the bios directory from 0.15.1 .  And lastly yes the disk images… I’ve had major issues with my qcow2 disks, and disk corruption with this build.  I’ve gone ahead and  included the qemu-img tool from 0.15.1 so you can convert qcow2 to raw, then use the 1.1.1 tool to take them from raw back into qcow2 … But I’d probably only do it as a test.

You may want to kick the tires on this version but 0.15.1 really blows this one away…

Qemu on OS X …

So after the whole mountain lion thing I got the latest Xcode..

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/src/configure –disable-checking –enable-werror –prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 –mandir=/share/man –enable-languages=c,objc,c++,obj-c++ –program-prefix=llvm- –program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ –with-slibdir=/usr/lib –build=i686-apple-darwin11 –enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/dst-llvmCore/Developer/usr/local –program-prefix=i686-apple-darwin11- –host=x86_64-apple-darwin11 –target=i686-apple-darwin11 –with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

And it ‘compiles’ a Qemu but it just hangs… LLVM really broke Qemu … So in the interim if you want Qemu on OS X keep a copy of Snow Leopard handy!

Of course I tried using Snow Leopards gcc on Mountain Lion, but it won’t compile any of the Cocoa stuff.

Go figure.

rtl8139 drivers..

I don’t know why but looking for working rtl8139 drivers for OS/2 and Windows NT 4.0 has proven to be more difficult than it should have been…

But what I’ve found is that the file “oem-8139(500).zip” on realtek‘s site basically contains everything! (well old stuff).

C:.
├───BROM
├───CLIENT32
├───DMI
│ ├───95LOADER
│ ├───NTLOADER
│ ├───WINEXE
│ └───WINSYS
├───FREEBSD
├───LINUX
├───MACOS
├───MACOSX
├───MSLANMAN.DOS
│ └───DRIVERS
│ ├───ETHERNET
│ │ └───RTL8139
│ └───NIF
├───MSLANMAN.OS2
│ └───DRIVERS
│ ├───ETHERNET
│ │ └───RTL8139
│ └───NIF
├───NDIS2DOS
├───NDIS2OS2
├───NT351
├───NWCLIENT
│ ├───DOS
│ └───OS2
├───NWSERVER
│ ├───311
│ ├───312
│ ├───40
│ ├───41X
│ └───42_5X
├───RTOS
├───RTSPKT
├───SCO
│ ├───4.X
│ ├───5.X
│ └───TXT
├───TXT
│ ├───GENERAL
│ ├───IBM
│ ├───MS
│ ├───NETWARE
│ ├───OTHERS
│ └───UNIX
├───UW7
├───W95OSR2
├───WFW311
├───WIN2000
├───WIN95A
├───WIN98
├───WINDIAG
├───WINME
├───WINNT4
└───WINXP

I don’t know if the link will last, but click here, and look for “OEM disk for users and manufacturers (LAN Card)”

Tetris for the IBM PC

Well for some reason I was interested in Tetris (Тетрис), and wanted to find an early version.  Looking around I did manage to find some background by Vadim Gerasimov, on the whole origin of Tetris.  What I never realized is that the first version was written for a Soviet PDP-11 clone, then ported to the IBM PC using Turbo Pascal! Or that it was all done in text mode!  The thought at the time is that every PC could run 40 colum mode, and thus would run Tetris.

Along the way I did manage to find some other early Russian artifacts for the IBM PC, namely MS-DOS 4.01 which not only has its own site, but has an excellent view into the history of localizing MS-DOS, and what the culture was like at the time.  There is even a promo video in Russian of course..

And I did come across a ‘Перевод’ of Windows 2.1 done in 1990, but no luck on Windows 3.0 ..  I wonder if they ever had OS/2 1.x ..?  Which speaking of non english versions of OS/2 1.x seem non existent, but I did find reference to there being a release in Japan, but naturally not even a screen shot.. I did find one rather harsh review of Windows/286 2.1 (Pусский), but seeing as far as I can tell there was no Excel 2 or Word 1 for Windows in Russian it would have been pointless running it back then.. Unless you had the 386 version!

So I figured, I’d mash in as much of the Russian bits into Windows/386, add in Tetris, and include some Amiga MOD files for the music (yes, besides being text based, there was *NO* music in the original tetris!  The Adlib! didn’t exist back then).  I’ve used the excellent 8bitboy to play the music.. You can mute if if you so wish, or skip around to various tracks…

Tetris on Windows/386

So while not all that ‘authentic’ it’s close enough I think…

Enjoy!

IBM PS/1 preload software

Club PS/1!

I don’t think it’ll do anyone any good, but for some reason I’ve gotten two requests since I’ve mentioned that I’ve got a PS/1 and if I could dump all the weird software that it comes with…

Not that prodigy even exists anymore, or there is anything you can do with it, so I figured I’d just add it in with jdosbox, and you can just click along..

I guess it was unique at the time when most OEMs just slapped together some stuff and shipped without going that extra crazy mile of doing some custom programs, or even trying to foster their own online community even if it was just too forward looking, and too much of an Island for 1991.

So pastel, so Miami Vice!

There is some very 90’s feeling Learning Windows that also came with the system.. I’ve never heard of it before.  What is more interesting is that it is a Windows program, unlike the later introduction/tutors for Windows that were MS-DOS programs.  It’ll even run in real mode, which makes me wonder was it just such a major pain to put together that they swore to never do again, or was it specially made for IBM?

Introduction to the PS/1

At any rate most of the programs are MS-DOS based, there is a version of AOL that sits in between the time of Quantium Link & AOL called Promenade.  Again since the service is dead there isn’t much you can do with the dialer software.  It does use GEOS like the later AOL software, but its skinned to look like Windows (SAA?).

Oh well its a look at a distant OEM past, now IBM doesn’t make PC’s and I would almost guess that OEM’s would be forbidden or heavily shunned to make their own online social type thing, as of course everyone would be on face book ….

PS/1 2121 doing what it does best..

At any rate, I’ve upgraded mine with a semi compatible sound blaster, and a network card.. With rlfossil an Conex, its a nice BBS terminal, with good ansi support.  Sadly the bigger DJGPP stuff won’t run as I don’t have a math coprocessor, and I’m just not going to go through the motion of finding an 80387sx .. Assuming the PS/1 even has a socket for one (I haven’t seen it, but I didn’t look too hard).  But I’ve found it good with old era games, as there is some things that just don’t seem to cooperate just right with emulation.. And sometimes it is nice to have some real machines… Sometimes.

Upgraded my Mac Pro to include Wifi & Bluetooth!

There! Done!

Trust me if you’ve ever attempted this, then you know not only just how difficult this whole process is, but to not only get it working was a major accomplishment!

And I only lost ONE of the screws.. Sigh they are just too small, I finally broke down and got an eye glass repair kit after losing one of them (no idea where it went to, I shook the case like crazy then it stopped rattling, so its either wedged somewhere good, or I’ve thrown it somewhere around here….).  The trick was to use a small plastic sleeve to jam the screw almost all the way in, with enough of the stem showing so I could carefully get a few twists of the tread into the hole…

But of course I didn’t start it out that way, instead I thought it’d be easier to clip on the antennas to the wifi card (BCM94311MCAG) first, then slip it into its slot, then screw it down, but since it goes in at an angle, it forces itself up & out so you end up fighting it.  This is where I lost the one screw during installation.  The ‘trick’ was to use my iphone’s camera light so I could see what I was doing, then try to press down on the wifi card while trying to screw in the board using one of the plastic sleeve things from the repair kit.  Surprisingly after enough false starts I got it to thread and was able to finish screwing it in with the driver.

The Bluetooth module (A1115) was much easier, as it is just a simple daughter card, that you just push onto the board, then screw in.  Because its not actively resisting you, it was much easier to get into place, and screw in…. I just hope mine lasts ok as its only got the one screw.

As always have a clean work area, and take your time.  Working with stuff this insanely small is going to take longer than you expect..

Hack 1.0.3 for Xenix (i386)

Hack

I figured that since I could build hack for some ancient 4BSD flavors that I should be able to build hack for good old fashioned Xenix.

And it all seems to work as it should!

I used the source from here, and only had to do a few small modifications to get it to compile and run on Xenix via GCC 1.37.1 .

You can download my binary, and source mods.

I’ve managed to keep this instance of Xenix up for 19 hours, I was thinking about doing some kind of public access to this system, but I don’t know if people would even be vaguely interested..

But if you want access, I can set you up.

Although all that is of interest is ‘dungeon’, fortune, hack, robots, and ircII …

 

PC Plus magazine reviews OS/2 2.0

June 1992

I thought this was cool, PC Plus magazine is doing a best of, 25 year retrospective, and up there is of course, the release of OS/2 2.0!

It really is an in depth look, and a great job for a magazine!  I’ve always like the UK based stuff, nice glossy photos, etc..

But even at the end it was the same old same old, installation issues, and speed..

I remember OS/2 2.0 on a 386sx 16 with 4MB of ram was unusable, while OS/2 1.3 was great… But like everything else that was involved at the time, keep in mind they had not reviewed NT yet… Although the pre-releases were floating around.. Naturally they have both Windows 3.1 & Windows 95 launches..