Dead end on the ISA disks.

Well I really thought I was going to make some headway on this.

But the answer was no.

However for the sake of completeness, let me at least document what I did.. The IBMPC hardware is initalized in hw/pc_piix.c

You’ll find this little GEM:

if (pci_enabled) {
PCIDevice *dev;
dev = pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
idebus[0] = qdev_get_child_bus(&dev->qdev, “ide.0”);
idebus[1] = qdev_get_child_bus(&dev->qdev, “ide.1”);
} else {
for(i = 0; i < MAX_IDE_BUS; i++) { ISADevice *dev; dev = isa_ide_init(ide_iobase[i], ide_iobase2[i], ide_irq[i], hd[MAX_IDE_DEVS * i], hd[MAX_IDE_DEVS * i + 1]); idebus[i] = qdev_get_child_bus(&dev->qdev, “ide.0”);
}
}

So I did the obvious thing and just wrapped it with a ‘pci_enabled=0;’ and a ‘pci_enabled=1’, basically turning off PCI for the IDE initialization so it’d load the isa_ide_init proc. Well that just then crashed Qemu when it was reconciling geometry for the NVRAM. 20 minutes with GDB and I figure that the code has morphed enough that it’s basically expecting 2 IDE controllers, and the ISA thing just isn’t building out what it wants so it’s just a quick fix in hw/pc.c

static void pc_cmos_init_late(void *opaque)

ide_get_bs(hd_table, arg->idebus0);
ide_get_bs(hd_table + 2, arg->idebus1);

So I comment out the second ide_get_bs and lo Qemu doesn’t crash anymore! But the BIOS says there is no hard disks?! So I’m figuring it’s a SeaBIOS issue, so checking their changelog, I see that there is something about not trusting ISA controllers on PCI systems.

So I’ll just have to back out that change, or just hack the thing to re-enable ISA IDE controllers. Luckily this was kind of easy to spot, as someone had left the magical words ‘isapc’ in ata.c

if (!CONFIG_COREBOOT && !pcicount) {
// No PCI devices found – probably a QEMU “-M isapc” machine.
// Try using ISA ports for ATA controllers.
init_controller(0, -1, IRQ_ATA1
, PORT_ATA1_CMD_BASE, PORT_ATA1_CTRL_BASE, 0);
init_controller(1, -1, IRQ_ATA2
, PORT_ATA2_CMD_BASE, PORT_ATA2_CTRL_BASE, 0);
}

So all I had to do was ensure that this was called, no matter what (comment out the if, leave the block). Sadly MinGW couldn’t build SeaBIOS so I spent the better part of an hour downloading Slackware 13.37 (which was … less then expected) fighting with it’s frame buffer, then the linker gave me this exciting bit.

cannot move location counter backwards (from 00000000000067e0 to 0000000000000000)

Good grief.

The fix is to apparently use binutils 2.20.51 . Slackware came with 2.21.51 .. Which apparently broke this needed function (again). So I wound up downloading the source from the MinGW project of all things (I know, wth?) having fun with p7zip (it installs a 7za?!) then I could FINALLY build my BIOS. First a generic test to make sure it works, then the modified one.

And into the crash. To verify I at least was doing what I thought, I turned on some debugging in the BIOS, which seamed normal, and then just fired up qemu with this flag:

-monitor telnet:127.0.0.1:2023,server,nowait

So I can telnet in, and capture the full device tree. Which you get with…

info qtree

And you can see, the IDE is indeed on the ISA bus.

bus: main-system-bus
type System
dev: hpet, id “”
gpio-in 1
dev-prop: timers = 3
dev-prop: msi = off
mmio fed00000/00000400
dev: i440FX-pcihost, id “”
bus: pci.0
type PCI
dev: PIIX4_PM, id “”
dev-prop: smb_io_base = 45312
bus-prop: addr = 01.3
bus-prop: romfile =
bus-prop: rombar = 1
bus-prop: multifunction = off
bus-prop: command_serr_enable = on
class Bridge, addr 00:01.3, pci id 8086:7113 (sub 1af4:1100)
bus: i2c
type I2C
dev: smbus-eeprom, id “”
bus-prop: address = 87
dev: smbus-eeprom, id “”
bus-prop: address = 86
dev: smbus-eeprom, id “”
bus-prop: address = 85
dev: smbus-eeprom, id “”
bus-prop: address = 84
dev: smbus-eeprom, id “”
bus-prop: address = 83
dev: smbus-eeprom, id “”
bus-prop: address = 82
dev: smbus-eeprom, id “”
bus-prop: address = 81
dev: smbus-eeprom, id “”
bus-prop: address = 80
dev: PIIX3, id “”
bus-prop: addr = 01.0
bus-prop: romfile =
bus-prop: rombar = 1
bus-prop: multifunction = on
bus-prop: command_serr_enable = on
class ISA bridge, addr 00:01.0, pci id 8086:7000 (sub 1af4:1100)
bus: isa.0
type ISA
dev: isa-ide, id “”
dev-prop: iobase = 0x170
dev-prop: iobase2 = 0x376
dev-prop: irq = 15
isa irq 15
bus: ide.0
type IDE
dev: ide-drive, id “”
dev-prop: unit = 0
dev-prop: drive = ide1-cd0
dev-prop: logical_block_size = 512
dev-prop: physical_block_size = 512
dev-prop: min_io_size = 0
dev-prop: opt_io_size = 0
dev-prop: bootindex = -1
dev-prop: discard_granularity = 0
dev-prop: ver = “0.14.0”
dev-prop: serial = “QM00003”
dev: isa-ide, id “”
dev-prop: iobase = 0x1f0
dev-prop: iobase2 = 0x3f6
dev-prop: irq = 14
isa irq 14
bus: ide.0
type IDE
dev: ide-drive, id “”
dev-prop: unit = 0
dev-prop: drive = ide0-hd0
dev-prop: logical_block_size = 512
dev-prop: physical_block_size = 512
dev-prop: min_io_size = 0
dev-prop: opt_io_size = 0
dev-prop: bootindex = -1
dev-prop: discard_granularity = 0
dev-prop: ver = “0.14.0”
dev-prop: serial = “QM00001”
dev: isa-fdc, id “”
dev-prop: driveA = floppy0
dev-prop: driveB =
dev-prop: bootindexA = -1
dev-prop: bootindexB = -1
isa irq 6
dev: port92, id “”
dev: i8042, id “”
isa irqs 1,12
dev: isa-parallel, id “”
dev-prop: index = 0
dev-prop: iobase = 0x378
dev-prop: irq = 7
dev-prop: chardev = parallel0
isa irq 7
dev: isa-serial, id “”
dev-prop: index = 0
dev-prop: iobase = 0x3f8
dev-prop: irq = 4
dev-prop: chardev = serial0
isa irq 4
dev: mc146818rtc, id “”
dev-prop: base_year = 2000
dev: i440FX, id “”
bus-prop: addr = 00.0
bus-prop: romfile =
bus-prop: rombar = 1
bus-prop: multifunction = off
bus-prop: command_serr_enable = on
class Host bridge, addr 00:00.0, pci id 8086:1237 (sub 1af4:1100)
dev: ioapic, id “”
gpio-in 24
mmio fec00000/00001000
dev: fw_cfg, id “”
dev-prop: ctl_iobase = 0x510
dev-prop: data_iobase = 0x511
mmio ffffffff/00000002
mmio ffffffff/00000002
dev: apic, id “”
dev-prop: id = 0
mmio fee00000/00100000

So while it didn’t do what I wanted, this kind of was a good way to see that I could at least enable ISA IDE hard disks on Qemu.

I can only wonder why on earth they are still broken with regards to Netware.

And this is why Linux will never take over anything.

So here we are, 2011. Linux has been around for nearly 20 years.

Would you like to load custom fonts?

No thanks, I’m fine with VGA.

Well FUCK YOU!

Look guys, it’s been WAY too long, and really this is unacceptable. I’ve tried to live the ‘year of the linux desktop’ back in 1994, 1995 ad nauseum, and really, when it comes to simple stuff, like a TEXT MODE INTERFACE, and it’s fucked up… Yeah Linux will remain where it is. And that’s nowhere.

I know that the 0.7% of the internet will rush in to apologize, or flame, because Linux simply cannot drive a simple VGA console, or how it’s my fault, but really get a grip.

It’s 2011, and asking for a normal textmode install is a fucking disaster. I can almost expect that after 40 years of Linux it’ll still fail.

Virtual PC 2007 issues with TAB and ESCAPE keys on Windows 7 sp1

The hits keep rolling.

Well no doubt if you are still using VPC 2007, at some point you’ve probably found under Windows 7 sp1, the tab & esc keys stop working. According this page, you can create a local security policy to allow %appdata%\microsoft\vritual pc\vpckeyboard.dll to be runnable by all.

So just open up your LSA tool and…… You’ll quickly find out that Home versions have lovingly cut this functionality out.

But the only ‘fix’ is to simply run it as administrator.

Oh well I guess the hint is that Virtual PC for Windows thing, that took vpc from a virtualization solution into a crappy host for IE 6 (way to destroy a product), and they took out the sound blaster and floppy drive support. Nothing like a reducing functionality as a way forward.

Retro: a PC/XT emulator

A friend of mine just pointed me to Retro, a PC/XT emulator written in Java.

It’s got a few games ready to roll, which is cool. While not a full featured as dosbox, it does feel significantly smaller, compared to jdosbo’s 2mb image. And since it’s browser based, it’s not like it’s all that difficult to check out.

ISA Cirrus Logic for Qemu

So after some annoyance with control-alt-delete in Qemu, I figured I’d try to tackle another thing that’s been driving me nuts, which is no ISA Cirrus video card.

This is a far cry from restoring the -M isapc in Qemu but it’s a step in the right direction. I guess the IDE is the only big thing to do next (I haven’t even looked) but anyways… babysteps.

So why would you want this? Well if you have an ancient non PCI supported OS (Windows 95) you have to suffer through the standard VGA because the Cirrus mapping won’t work. Sure you can load the PCI driver set, but as I found out with the ДЕМОС/DEMOS & Russian thing, it won’t load on Windows 95 Russian.

So I’ve updated the Qemu 0.14.0 download (again). And here is the gobbed up diff that I’m working from that changes the keyboard to support more ancient stuff from Royatm, moves the ne2000 ISA to 0x300 IRQ 3 (like the real thing). I’ve also put the AdLib sound card back in (why is it optional?) so you can have sb16,adlib sounds. It also includes ctrl-alt-delete as Control+Alt+d and now addes -vga isacirrus.

Anyways, my mangled Qemu 0.14.0 download is here.

Oh one more tip, for Windows if the hardware cursor doesn’t work, and your mouse is a white square, turn on mouse trails, then set it for the shortest setting. This way it forces the mouse to be blitted normally, and it’ll look fine.

Minor update for Qemu 0.14.0

I simply can’t take the ‘sendkey ctrl-alt-delete’ shuffle anymore. So I investigated the ui/sdl.c and it seemed somewhat easy to do…

keycode = sdl_keyevent_to_keycode(&ev->key);
switch(keycode) {
case 0x20: /* ‘d’ key on US keyboard */
kbd_put_keycode(0x1d); /* left ctrl key */
kbd_put_keycode(0x38); /* left alt key */
kbd_put_keycode(0xd3); /* delete key */
break;
case 0x21: /* ‘f’ key on US keyboard */
toggle_full_screen(ds);
gui_keysym = 1;
break;
case 0x16: /* ‘u’ key on US keyboard */

So what does this mean? Hitting ctrl-alt-d will now send a contrl-alt-delete. Woo. I’ve updated my binary for Qemu 0.14.0 here.

It certainly makes logging into Windows NT & friends significantly easier.

——-
As an update the CAD worked for some things, but not others.. so after some printf’s in the input module I came up with this…

kbd_put_keycode(56);
kbd_put_keycode(29);
kbd_put_keycode(157);
kbd_put_keycode(184);
kbd_put_keycode(29);
kbd_put_keycode(56);
kbd_put_keycode(224);
kbd_put_keycode(83);
kbd_put_keycode(224);
kbd_put_keycode(211);
break;

which basically is slamming every possible combination of control/alt/delete. And the rest of you will have to download yet again for this update.

SIMH on the Itanium…

So I figured it’d be as good time as any to see how various compilers (mostly Microsoft) stack up on the Itanium. So I built SIMH, and loaded up 4.2 BSD & the old dhrystone benchmark.

And before we get to the numbers, I’m using a 900Mhz Itanium 2, clearly the bottom of the barrel. I ended up loading Windows 2003 server, as XP for the Itanium can’t even install Internet Explorer 7. If you thought a world of Internet Explorer 6 was fun, it’s hell when it is your only browser.

In addition, Visual C++ 2005 was never released on the Itanium, they made it as far as Beta 2, before discontinuing native support. However I like it’s debugger so I’m using the Beta 2 version.

Microsoft (R) C/C++ Optimizing Compiler Version 13.10.2240.8 for IA-64 (from the Feb 2003 platform SDK)

Dhrystone(1.1) time for 500000 passes = 77
This machine benchmarks at 6493 dhrystones/second

Dhrystone(1.1) time for 500000 passes = 76
This machine benchmarks at 6578 dhrystones/second

Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50215.44 for Itanium (Visual Studio 2005 beta)

Dhrystone(1.1) time for 500000 passes = 64
This machine benchmarks at 7812 dhrystones/second

Dhrystone(1.1) time for 500000 passes = 65
This machine benchmarks at 7692 dhrystones/second

Intel(R) C++ IA-64 Compiler for applications running on IA-64, Version 10.1 Build 20080112 Package ID: w_cc_p_10.1.014

Dhrystone(1.1) time for 500000 passes = 53
This machine benchmarks at 9433 dhrystones/second

Dhrystone(1.1) time for 500000 passes = 53
This machine benchmarks at 9433 dhrystones/second

And for some sense of what the emulation is like…

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 10.20.6166 for 80×86 (visual C++ 4.2)

Dhrystone(1.1) time for 500000 passes = 92
This machine benchmarks at 5434 dhrystones/second

Dhrystone(1.1) time for 500000 passes = 91
This machine benchmarks at 5494 dhrystones/second

Not to bad, the Intel compiler is 2x the speed of an i386 executable, while it’s easily 18% + faster then the Microsoft Compiler. I built everything with /Ox flags (Which the Intel compiler honers!).. Executable sizes varied as much as the performance.

1,672,704 Intel C vax780.exe
986,624 Vax780feb2003.exe
495,616 Vax780visualc4.exe
1,232,896 vax780visualstudio2005b2.exe

And of course the larger the executable the faster it ran. No wonder EPIC was driving people insane!