Good news on the QEMU fronts!

First I found this blog post about building Qemu with CLANG instead of GCC, and I didn’t  even run it through google translate, but I had a feeling that it must work because there is simply too much text there for something that doesn’t work… Although it is with the TCG interpreter…

Qemu 1.1.0-1 on OS X 10.6.8 via clang!

And sure enough it works! (well so far I’ve only booted the IBM PS/1 MS-DOS 4.00 image I had handy. But that is good news for me as I’m planning on shifting away from running Windows all the time, and it was annoying having this powerful mac pro, but not being able to run / play with Qemu.

The move the clang would make sense as I under stand it Apple is moving away from GCC at any rate.

Also on the road to a non TGC build of Qemu I did find out the compiler included on the 10.6.3 DVD works while the later IOS update one does not…

Using built-in specs.
Target: i686-apple-darwin10
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/src/configure –disable-checking –enable-werror –prefix=/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-darwin10 –enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/dst-llvmCore/Developer/usr/local –program-prefix=i686-apple-darwin10- –host=x86_64-apple-darwin10 –target=i686-apple-darwin10 –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.1.00)

GCC for update for IOS 5 … which doesn’t build a working Qemu exe

Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646~6/src/configure –disable-checking –enable-werror –prefix=/usr –mandir=/share/man –enable-languages=c,objc,c++,obj-c++ –program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ –with-slibdir=/usr/lib –build=i686-apple-darwin10 –with-gxx-include-dir=/include/c++/4.2.1 –program-prefix=i686-apple-darwin10- –host=x86_64-apple-darwin10 –target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646)

While the one that does come on the 10.6.3 DVD works fine.

Next up for all those of you on Windows or Win32 i386 platforms, rainbow has kindly provided a Win32 build of Qemu, which you can download from his site!  Ive booted MS-DOS on it from within VirtualBOX and it seems to work fine!

One thing I’ve noticed about 1.1.0 is that it cannot read low density 3 1/2″ disks!!!!

Mouse issues with VirtualBOX on OS X

So I’ve been using this old intel mac pro, to run VirtualBOX with a really weird issue.. The moue pointer just doesn’t work in the VM no matter what I’ve done.

Ok, I’ll admit that instead of running in 32bit mode on this mac, I’ve set it up to boot like a PC into the chameleon bootloader to then let me boot OS X in 64bit mode.. Which makes this a great ‘hackintosh’ as its all Apple hardware.  But to get me through the booting and whatnot I’ve been using a USB keyboard/mouse, then once booted up I’ve been using bluetooth Apple keyboard/mouse (yes my desk is a disaster).

Anyways with the USB mouse plugged in, I can only move the mouse by right dragging in the VM.  It doesn’t matter if its relative mouse pointer or not.

But as soon as I unplugged the USB mouse, it works fine… Maybe its because I have two mice??

Also you’d think Apple could have done some softload 64bit firmware for the 2006 Mac Pro 1,1 but… I guess some times you have to take matters into your own hands….

Oh and that reminds me of another tip, when installing Windows XP you’ll be expected to hit F8, which on my keyboard just pauses the currently playing song.. Instead hold down the `fn` key, then press F8.  Which makes me all the more glad I got a real apple keyboard, as finding all these special keys on a windows keyboard… involved.

ircII-4.4 on Xenix

Building this was.. . Involved, but I finally got it to link! Oh happy days! But then disaster struck!

USER Not enough parameters

Not enough parameters? And the worst thing is that I got this error EVERYWHERE… Googling this has become useless as everyone just says google it, so google made all that turn into a negative feedback loop! Or even useful advice like ‘upgrade your client, LOL’, but after going through an hour of `fun` getting this to run on Xenix I wasn’t going to try a new version of the source just yet.

Going through the source, looking for the USER command and where its used and found this:

send_to_server(“USER %s %s %s :%s”, username,
(send_umode && *send_umode) ? send_umode : hostname,
server_list[server].name, realname);

Which looks nice, but according to this as a reference, it doesn’t have enough parameters! So I figured I’d change it to something more like this!

send_to_server(“USER %s 8 * : %s”, username,realname);

this is a bug free client. honest

And as you can see, it works!  Even the version string reports Xenix!

If anyone cares, you can download the binary here.

Installing Xenix on an IBM Aptiva 2176

Yes, $6.98 worth of IBM

So a while back I had scored this IBM Aptiva 2176 for $6.98 .  I had been running OS/2 1.21 on there with great success, but I felt like trying something different.

Something more like Xenix.

The IBM comes with a WDC AC32100H hard disk, 2GB in capacity.  I figured this would be quick and easy to install.

Boy was I WRONG.

First off Xenix has issues with disks bigger than 512MB.  Namely this kind of limitation:

You need to stay within the bounds of 16 heads, 63 
sectors/track, and 1024 cylinders.

And of course the WDC in question is one of these ‘new fangled’ LBA disks.  Booting up on LBA mode it looks like this:
hda: WDC AC32100H, 2014MB w/128kB Cache, LBA, CHS=1023/64/63, DMA

The other mode, is CHS which of course gives us this:
hda: WDC AC32100H, 2014MB w/128kB Cache, CHS=1023/64/63, DMA

So I thought I could just ‘override’ the disk parameters under Xenix, and tell it, that its 1023/16/63.  Sure that worked for formatting but booting? nope!

I pulled up the data sheet and it informs me of this as its native capabilities:

Recommended Setup Parameters
Cylinders 4092
Heads 16
Sectors/Track 63
Landing Zone 4092
WPC 4092
Jumper Setting Information Six Pin Drive

But how to get there?  What was worse, is that doing a probe under MS-DOS I kept on seeing output like this:

But the numbers look good!?

And yet trying to override the geometry with these parameters only lead to disaster.  Clearly what these programs were telling me were conflicting, what I needed was something to just tell me what it sees.  So I thought I’d use Linux.

But not some 8GB download, because that’d take far too long.  No weighing in a just over 2MB is the specialized ‘doom speaker sound‘ distribution. Its UMS DOS based, meaning that you can just unzip it onto a FAT drive, without any formatting/partitioning, and boot from MS-DOS into Linux.  So sure enough this is what I saw:

Drive translation in action

First, yes I have two disks, I’m only interested in the ide0/hda.  but as you can see its translating.  I found the same result for both CHS/LBA.  The only thing I didn’t notice for some reason was an option to turn drive translation OFF in the BIOS. Oops!

There we go!

So now I was able to boot the Xenix install, and it finally saw what it should have seen!

4092 Cylinders, 16 heads, 63 sectors/track!

then tell it that the disk was only 1024 cylinders, as mentioned in the usenet posting, along with changing the landing zone.  I knew it was going to work so I figured I’d make a separate /u filesytem for the heck of it.  Divvy takes me back to doing disklabels on 4.3 BSD

bust out the calculator!

With that all said and done, it was time to reboot, and it booted from the hard disk!  I could then complete the install.  After that was out of the way I noticed that it was not mounting the /u filesystem!

The following entry needed to be added to the /etc/default/filesys file:

bdev=/dev/u  cdev=/dev/ru  mountdir=/u \
   	desc="The User Filesystem" \
   	rcmount=yes \
   	fsckflags=-y

Now it mounts up like you’d expect! If you plan on making the /u for peoples home directories don’t forget to alter the /etc/default/mkuser file!

I have no idea if this works on a 1TB IDE disk, but I’d imagine if you can somehow get it into the limited geometry Xenix can understand, it should work…. Of course why you’d want to run a Unix that can only address 16mb of ram is beyond me…

Now that it’s booting, the next step will be to get it onto the internet….

How do you plug an RJ45 into an Etherlink II (3c503)

So on the heels of my prior post, someone was asking me, where do you exactly plug in an RJ-45 style cable to something like an Etherlink II?  It had never occured to me that many people today would have no idea what thicknet/thinnet were, or what the magical world of the AUI port is.. Sure there are transceivers still in use, but typically in larger networking equipment, and more so to choose what king of fiber optics to use (single mode? multimode? etc..).

So looking at the back of the card, we see this:

It’s not a joystick port!

Sorry for the poor quality but.. thems the breaks.  So anyways back in the day ethernet revolved around this big bulky cabling lovingly called Thicknet.  And you had to use these ‘vampire’ taps to plug into the cable, and the cable had markings that you could only tap into it a certain points.  So luckily for us, the transceiver component of Thicknet was external, letting us in the future plug in different transceivers for different media types.

Say something like this:

3Com rj45 transceiver

And that is how you can plug a cable into a card that is older than the rj45 ethernet standard!

PC Retro Networking at its finest

When most people think of old PC networking, they think ethernet, and of course most people I know think of the NE2000.  This card from Novel was cloned, and quite popular as time went on.  Its amazing how many variations of this card there was, and there is even a PCI version of this card, the RTL8029AS!

But that is not what this is about, as most OS stuff from the early 1990’s relies on another card, the 3com Etherlink II.

Notably products like IBM TCP/IP 2.0 for OS/2, Lan Manager for OS/2, Windows NT Pre-releases, Xenix, do not ship with NE2000 drivers, but they all support the Etherlink II card.

Now before you start jumping on fleabay, or scrounging around the Etherlink III card is *NOT* the same as the II, nor is it compatible!

My eight bit Etherlink II

Looking at the card, you can see it has *SOME* jumpers, that configure the IO Base, and where to locate its shared memory (or disable it).  But notice there are no jumpers to select the IRQ, the DMA channel!  I went in circles for a while looking for a softset utility for this card, and spent HOURS basically showing up with nothing.  So I figured at this point I’d just download some drives, and see how long it’d take to magically get it working.

On my first attempt, I used the packet driver, so I could load up some QuakeWorld for MS-DOS.  But something amazing happened, it worked on the default settings!  Experimenting more, as I changed IRQ it always worked unless there was a conflict ..  I then tried a Novel Netware client, but it didn’t work.  Also I loaded the lanman client for OS/2 on OS/2 1.21 and it didn’t work ether.  I was perplexed.  Then I found out two important things from an ancient usenet posting:

  • There is no softset program, because the device driver configures the card, and can change any/all of its hardware characteristics
  • Some drivers don’t detect if they should be using the internal transceiver, or an external one, and have to be told.

So I looked at the protocol.ini for lanman OS/2 and sure enough there was this entry, commented out:

TRANSCEIVER = EXTERNAL

And the Netware client just needed the following statement added:

CONNECTOR DIX

And now I can happily mount NetBEUI shares, mount my NetWare server, and of course use WatTCP programs from DOS without issue!

Donor time!

I was going to load an early Windows NT Preview onto my Aptiva, but then all it would do was crash with a kernel panic of 0x00000032. Then it hit me, the hard disk I have is 2GB and this early version can only handle disks up to 512MB.  So I was looking around where to get a small enough disk, and then I thought what the heck, and took apart a ‘new’ machine I scored last week, an IBM PS/1!

The IBM PS/1 was kind of a disappointment as it cannot run OS/2!  Can you believe it, IBM made a machine that can’t run their flagship Operating System??  As far as I can tell the heart of the matter is that the IDE controller doesn’t live at the default port/irq that any other PC uses, so OS/2 or any other protected mode OS can’t detect it.  I only have 2MB of ram, so loading OS/2 2.0 is out of the question.  So for the sake of the experiment, I took the disk out of this poor IBM PS/1 2121 and put it ‘on’ the Aptiva.

Pentium 150Mhz, 32MB of ram, and an 80MB disk!

First I really wondered if the 80MB disk would be big enough, but surprisingly after a format, and installation of IBM DOS 4.00 (its what the PS/1 runs in ROM and really really likes!) and using the network to bootstrap the files, it happily fit with the SDK in 40MB! (it adds another 20MB for swap…).

Its amazing just how large OSs have gotten over the years, but yeah at the same time, this version of NT is not ready for prime time that is for sure!

So I load it up, and notice two things… One its insanely slow, and secondarily I can’t figure out how to configure the network card. So for some reason I just tried to start up the server/workstation, and do a net view and…

Early Windows NT preview with networking

It worked!

The best part was loading up the October 1991 Windows NT Preview, and it just magically worked, after starting the server/client services!

SIMH 3.9-0 released!

And among the changes …

scp.c:

  • added *nix READLINE support (Mark Pizzolato)
  • fixed handling of DO with no arguments (Dave Bryan)
  • fixed “SHOW DEVICE” with only one enabled unit (Dave Bryan)
  • clarified some help messages (Mark Pizzolato)
  • added “SHOW SHOW” and “SHOW <dev> SHOW” commands (Mark Pizzolato)
  • fixed bug in deposit stride for numeric input (John Dundas)

sim_console.c

  • added support for BREAK key on Windows (Mark Pizzolato)

sim_ether.c

  • major revision (Dave Hittner and Mark Pizzolato)
  • fixed array overrun which caused SEGFAULT on hosts with many devices which libpcap can access.
  • fixed duplicate MAC address detection to work reliably on switch connected LANs

sim_tmxr.c:

  • made telnet option negotiation more reliable, VAX simulator now works with PuTTY as console (Mark Pizzolato)

h316_cpu.c:

  • fixed bugs in MPY, DIV introduced in 3.8-1 (from Theo Engel)
  • fixed bugs in double precision, normalization, SC (from Adrian Wise)
  • fixed XR behavior (from Adrian Wise)

hp2100 all peripherals (Dave Bryan):

  • Changed I/O signal handlers for newly revised signal model
  • Deprecated DEVNO modifier in favor of SC

hp2100_cpu.c (Dave Bryan):

  • Minor speedup in “is_mapped”
  • Added casts to cpu_mod, dmasio, dmapio, cpu_reset, dma_reset
  • Fixed I/O return status bug for DMA cycles
  • Failed I/O cycles now stop on failing instruction
  • Revised DMA for new multi-card paradigm
  • Consolidated DMA reset routines
  • DMA channels renamed from 0,1 to 1,2 to match documentation
  • Changed I/O instructions, handlers, and DMA for revised signal model
  • Changed I/O dispatch table to use DIB pointers
  • Removed DMA latency counter
  • Fixed DMA requests to enable stealing every cycle
  • Fixed DMA priority for channel 1 over channel 2
  • Corrected comments for “cpu_set_idle”

hp2100_cpu.h:

  • Changed declarations for VMS compiler

hp2100_cpu0.c (Dave Bryan):

  • Removed DS note regarding PIF card (is now implemented)

hp2100_cpu4.c (Dave Bryan):

  • Added OPSIZE casts to fp_accum calls in .FPWR/.TPWR

hp2100_cpu5.c (Dave Bryan):

  • Added sign extension for dim count in “cpu_ema_resolve”
  • Eliminated unused variable in “cpu_ema_vset”

hp2100_cpu6.c (Dave Bryan):

  • DMA channels renamed from 0,1 to 1,2 to match documentation

hp2100_cpu7.c (Dave Bryan):

  • Corrected “opsize” parameter type in vis_abs

hp2100_defs.h (Dave Bryan):

  • Added hp_setsc, hp_showsc functions to support SC modifier
  • DMA channels renamed from 0,1 to 1,2 to match documentation
  • Revised I/O signal enum values for concurrent signals
  • Revised I/O macros for new signal handling
  • Added DA and DC device select code assignments

hp2100_di.c, hp2100_di.h (Dave Bryan):

  • Implemented 12821A HP-IB Disc Interface

hp2100_di_da.c (Dave Bryan):

  • Implemented 7906H/20H/25H ICD disc drives

hp2100_dp.c (Dave Bryan):

  • Added CNTLR_TYPE cast to dp_settype

hp2100_ds.c (Dave Bryan):

  • Rewritten to use the MAC/ICD disc controller library
  • ioIOO now notifies controller service of parameter output
  • Corrected SRQ generation and FIFO under/overrun detection
  • Corrected Clear command to conform to the hardware
  • Fixed Request Status to return Unit Unavailable if illegal
  • Seek and Cold Load Read now Seek Check if seek in progress
  • Remodeled command wait for seek completion
  • Corrected status returns for disabled drive, auto-seek beyond drive limits, Request Sector Address and Wakeup with invalid or offline unit
  • Address verification reenabled if auto-seek during
  • Read Without Verify

hp2100_fp1.c (Dave Bryan):

  • Added missing precision on constant “one” in fp_trun
  • Completed the comments for divide; no code changes

hp2100_ipl.c (Dave Bryan):

  • Added CARD_INDEX casts to dib.card_index
  • A failed STC may now be retried
  • Consolidated reporting of consecutive CRS signals
  • Revised for new multi-card paradigm

hp2100_lps.c (Dave Bryan):

  • Revised detection of CLC at last DMA cycle
  • Corrected 12566B (DIAG mode) jumper settings

hp2100_ms.c (Dave Bryan):

  • Added CNTLR_TYPE cast to ms_settype

hp2100_mt.c (Dave Bryan):

  • Removed redundant MTAB_VUN from “format” MTAB entry
  • Fixed command scanning error in mtcio ioIOO handler

hp2100_stddev.c (Dave Bryan):

  • Add TBG as a logical name for the CLK device

hp2100_sys.c (Dave Bryan):

  • Deprecated DEVNO in favor of SC
  • Added hp_setsc, hp_showsc functions to support SC modifier
  • Added DA and dummy DC devices
  • DMA channels renamed from 0,1 to 1,2 to match documentation
  • Changed DIB access for revised signal model

hp_disclib.c, hp_disclib.h (Dave Bryan)

  • Created MAC/ICD disc controller library

i1401_cd.c:

  • fixed read stacker operation in column binary mode
  • fixed punch stacker operation (Van Snyder)

id_pas.c:

  • fixed TT_GET_MODE test to use TTUF_MODE_x (Michael Bloom)
  • revised to use clock coscheduling

id_tt.c, id_ttc.p:

  • revised to use clock coscheduling

id_uvc.c:

  • added clock coscheduling routine

1401_cpu.c:

  • reverted multiple tape indicator implementation
  • fixed EOT indicator test not to clear indicator (Van Snyder)
  • fixed divide not to clear word marks in quotient (Van Snyder)
  • revised divide algorithm (Van Snyder)

i1401_mt.c:

  • reverted multiple tape indicator implementation
  • fixed END indicator test not to clear indicator (Van Snyder)
  • fixed backspace over tapemark not to set EOR (Van Snyder)
  • added no rewind option (Van Snyder)

i1401_sys.c:

  • fixed misuse of & instead of && in decode (Peter Schorn)

pdp1_cpu.c:

  • fixed misuse of & instead of && in Ea_ch (Michael Bloom)

pdp1_stddev.c:

  • fixed unitialized variable in tty output service (Michael Bloom)

pdp10_fe.c:

  • revised to use clock coscheduling

pdp11_defs.h:

  • fixed priority of PIRQ vs IO; added INT_INTERNALn

pdp11_io.c:

  • fixed Qbus interrupts to treat all IO devices (except clock) as BR4
  • fixed order of int_internal (Jordi Guillaumes i Pons)

ppd11_rf.c

  • fixed bug in updating mem addr extension (Peter Schorn)

pdp11_rk.c:

  • fixed bug in read header (Walter F Mueller)

pdp11_rl.c:

  • added debug support

pdp11_rq.c:

  • added RD32 support

pdp11_tq.c: (Mark Pizzolato)

  • set UNIT_SXC flag when a tape mark is encountered during forward motion read operations
  • fixed logic which clears UNIT_SXC to check command modifier
  • added CMF_WR flag to tq_cmf entry for OP_WTM
  • made non-immediate rewind positioning operations take 2 seconds
  • added UNIT_IDLE flag to tq units.
  • fixed debug output of tape file positions when they are 64b
  • added more debug output after positioning operations
  • added textual display of the command being performed
  • fixed comments about register addresses

pdp11_ts.c:

  • fixed t_addr printouts for 64b big-endian systems (Mark Pizzolato)

pdp11_tu.c:

  • fixed t_addr printouts for 64b big-endian systems (Mark Pizzolato)

pdp11_vh.c: (Mark Pizzolato)

  • fixed SET VH LINES=n to correctly adjust the number of lines available to be 8, 16, 24, or 32.
  • fixed performance issue avoiding redundant polling

pdp11_xq.c: (Mark Pizzolato)

  • Fixed missing information from save/restore which caused operations to not complete correctly after a restore until the OS reset the controller.
  • Added address conflict check during attach.
  • Fixed loopback processing to correctly handle forward packets.
  • Fixed interrupt dispatch issue which caused delivered packets (in and out) to sometimes not interrupt the CPU after processing.
  • Fixed the SCP visibile SA registers to always display the ROM mac address, even after it is changed by SET XQ MAC=.
  • Added changes so that the Console DELQA diagnostic (>>>TEST 82) will succeed.
  • Added DELQA-T (aka DELQA Plus) device emulation support.
  • Added dropped frame statistics to record when the receiver discards received packets due to the receiver being disabled, or due to the XQ device’s packet receive queue being full.
  • Fixed bug in receive processing when we’re not polling. This could cause receive processing to never be activated again if we don’t read all available packets via eth_read each time we get the opportunity.
  • Added the ability to Coalesce received packet interrupts. This is enabled by SET XQ POLL=DELAY=nnn where nnn is a number of microseconds to delay the triggering of an interrupt when a packet is received.
  • Added SET XQ POLL=DISABLE (aka SET XQ POLL=0) to operate without polling for packet read completion.
  • Changed the sanity and id timer mechanisms to use a separate timer unit so that transmit and recieve activities can be dealt with by the normal xq_svc routine.
  • Dynamically determine the timer polling rate based on the calibrated tmr_poll and clk_tps values of the simulator.
  • Enabled the SET XQ POLL to be meaningful if the simulator currently doesn’t support idling.
  • Changed xq_debug_setup to use sim_debug instead of printf so that all debug output goes to the same place.
  • Restored the call to xq_svc after all successful calls to eth_write to allow receive processing to happen before the next event service time. This must have been inadvertently commented out while other things were being tested.

pdp11_xu.c: (Mark Pizzolato)

  • Added SHOW XU FILTERS modifier (Dave Hittner)
  • Corrected SELFTEST command, enabling use by VMS 3.7, VMS 4.7, and Ultrix 1.1 (Dave Hittner)
  • Added address conflict check during attach.
  • Added loopback processing support
  • Fixed the fact that no broadcast packets were received by the DEUNA
  • Fixed transmitted packets to have the correct source MAC address.
  • Fixed incorrect address filter setting calling eth_filter().

pdp18b_stddev.c:

  • added clock coscheduling
  • revised TTI to use clock coscheduling and to fix perpetual CAF bug

pdp18b_ttx.c:

  • revised to use clock coscheduling

pdp8_clk.c:

  • added clock coscheduling

pdp8_fpp.c: (Rick Murphy)

  • many bug fixes; now functional

pdp8_tt.c:

  • revised to use clock coscheduling and to fix perpetual CAF bug

pdp8_ttx.c:

  • revised to use clock cosheduling

pdp8_sys.c:

  • added link to FPP

pdp8_td.c:

  • fixed SDLC to clear AC (Dave Gesswein)

sds_mt.c:

  • fixed bug in scan function decode (Peter Schorn)

vax_cpu.c:

  • revised idle design (Mark Pizzolato)
  • fixed bug in SET CPU IDLE
  • fixed failure to clear PSL<tp> in BPT, XFC

vax_cpu1.c:

  • revised idle design Mark Pizzolato)
  • added VEC_QMODE test in interrupt handler

vax_fpa.c:

  • fixed integer overflow bug in EMODx (Camiel Vanderhoeven)
  • fixed POLYx normalizing before add mask bug (Camiel Vanderhoeven)
  • fixed missing arguments in 32b floating add (Mark Pizzolato)

vax_octa.c (Camiel Vanderhoeven)

  • fixed integer overflow bug in EMODH
  • fixed POLYH normalizing before add mask bug

vax_stddev.c:

  • revised to use clock coscheduling

vax_syscm.c:

  • fixed t_addr printouts for 64b big-endian systems (Mark Pizzolato)

vax_sysdev.c:

  • added power clear call to boot routine (Mark Pizzolato)

vax780_sbi.c:

  • added AUTORESTART switch support (Mark Pizzolato)

vax780_stddev.c

  • added REBOOT support (Mark Pizzolato)
  • revised to use clock coscheduling

vaxmod_def.h

  • moved all Qbus devices to BR4; deleted RP definitions

 

As always you can download it from the homepage, or from sourceforge.

Transferring data into CP/M with SIMH

This has been an exersize in insnaity..

So for some strange reason I wanted to load up Zork into SIMH‘s less featured (and much simpler) altair 8080 emulator.  The catch is the disk format which for the life of me I couldn’t get to work in any of the CP/M disk access tools.

The Altair z80 emulator as part of the same SIMH package includes a far more complicated setup, but out of the box it CANNOT read the disk image from the 8080 emulator.  After digging around it seems that one of the ‘approved’ methods of getting stuff into CP/M was to load it into memory, and just save the block (provided it fits in the 64k, more on that later).  The syntax really is quite simple:

load zork1.com 100

And that’ll load it up at the normal program entry point (just like an MS-DOS COM file!)..

Except it doesn’t want to work.

What?

but of course it works on the z80.

No problems here!

Which is great but the z80 can’t read the 8080’s disks..!  So after digging through the source code, I find this small gem that the z8080 has been changed to use a much larger disk size!

#define MAX_TRACKS 254 /* number of tracks,
original Altair has 77 tracks only */

So yes, by changing that to 77 I can now boot off the 8080’s boot disk on the z80!  Of course it also means that I’m unable to ‘see’ the hardisk in the z80, or any of the other great peripherals as no doubt the altair CP/M disk hasn’t been configured for all of these fine things.  I also tried only altering one of the disks on the z80 for 77 tracks, but once more again it seems that CP/M has an everything/nothing type idea for a disk controller.

But the load command works on the monitor, and the Altair CP/M can handle two disks, so its enough for me to format the B: drive ( a copy of the CP/M disks) and work with that.

Once you’ve loaded a program into memory, you toggle back to CP/M and run the ‘save’ command which then dumps how many pages back to disk.

For example, the program STAT is 5,248 bytes in size. 5248/256 = 20.5. Thus, the save command would be:

A>SAVE 21 STAT.COM

Pretty simple, right?  But what happens if you have a file greater than memory?  Well first I thought I could compress it, and I’d forgotten just how many old compression programs there were for CP/M, crunch, arc, zoo, zip … Finding MS-DOS equivalents wasn’t too bad (thanks for dosbox!) but I couldn’t get the 84kb data file into the memory limit, so I figure’d I’d just split the file into something on  a 256 byte boundary.  Loading them into RAM wasn’t too hard, as saving them out.. but how do you join them together on CP/M?  I found PLENTY of utils to split files, but nothing on putting them back together!

On MS-DOS you can just do a copy /B file1+file2 bigfile

But I couldn’t find out how to do this on CP/M until I looked further into the PIP command, CP/M’s answer to copy.

To join a binary file it goes something like this:

>PIP sd.com=sd.001[OV],sd.002[OV],sd.003[OV]

So with all that work, I was now able to create a zork1.dsk that the 8080 emulator is capable of playing!

Zork1 finally loaded on the SIMH Altair 8080

And for the curious, here is Zork1, in the old Altair 77 track format.

 

 

Working with the Microsoft Programmer’s Library

OS/2 Programmers Ref

Well recently I did manage to get some GREAT books on OS/2, going back to the Microsoft days.. And they contain a lot of information, which was actually quite substantial.

Although there is the impression after the fact that Microsoft really wasn’t that dedicated to OS/2 the wealth of information in these books seem to be otherwise..

Anyways there is four volumes in the set, 1-3 going over version 1.1, and volume 4 with the 1.2 release of OS/2.

As luck would have it, someone gave me a lead on an ISO that contained not only these, but all of the programming documentation of the time on a CD.  No doubt this was the predecessor to the excellent MSDN.

There of course, is just one catch.  It uses the .hlp files, but not from Windows 3.00 its something much earlier and the only way to view the files is with an MS-DOS program.

Glorious MS-DOS interface

I even tried it on OS/2 hoping it was a family api program (like so many of the era were) but no luck.  I was then hoping maybe I could just ‘print’ the files to a virtual printer, and spool the whole job.  BUT YOU CANT PRINT.

So I then wondered if I could put together a TSR that would scrape the screen, append it to a file, and just keep hitting page down.   A few hours of cobbling together some example programs, and remembering to compile with the LARGE memory model (FAR pointers! remember those?)  I could then finally unleash the TSR through the program and extract some of the texts.

For those wondering how to do this kind of thing from MS-DOS here is the source.  While I wanted to use Scott’s program, there was the one drawback that almost everything grabs printscreen now so doing a REAL printscreen that hits interrupt 5 seems like it’d actually require a physical PC in MS-DOS.  And my current ‘retro’ PC has no ethernet so I wasn’t going to go that route.

So there is a lot of hacks with this, you can’t even uninstall it, just reboot …. but this hooks the clock, gives you about a minute to go where you want to go, then it saves a portion of the screen to a file, waits a few seconds and hits pagedown, and repeats….

// Written by Scott Hall of the U. of Missouri - Columbia, USA.
// This program will redirect your print screen button so that
// it goes to a file.  The file name is at the beginning of the
// start() function.  It can easily be modified to print screens
// that are larger than 80x25.

#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include <dos.h>

#ifdef __cplusplus
#define __CPPARGS ...
#else
#define __CPPARGS
#endif

char far *scr=(char far*)0xb0008000L;
#define VIDMEM 0Xb0008000L
#define INTR 0x1c

int busy=0;                                     // mutual exclusion (MUTEX)
void interrupt (*oldhandler)(__CPPARGS);
char far *old_dta;
char fname[9];

void interrupt int_5();
void tsr(unsigned size);                        // standard tsr bios call
void write_char(int x, int y, char ch, int attrib);
void write_string(int x, int y, char *str, int attrib);

void start(void);
void interrupt handler(__CPPARGS);

int main(int argc, char*argv[])
{
   if(argc==2)
   sprintf(fname,argv[1]);
      else
   sprintf(fname,"log.txt");

   printf ("installing\n");
   disable();
   oldhandler=getvect(INTR);
   setvect(INTR,handler);
   setvect(32,oldhandler);
   enable();
   printf("done\n");
   tsr(1000);
return 0;
}

void tsr(unsigned size)                 // standard tsr bios call
{                                       // you can also use keep()
union REGS r;

r.h.ah = 49;                            // function 0x31
r.h.al = 0;
r.x.dx = size;
int86(0x21,&r, &r);                     // last line executed
}                                       // never get to this line

unsigned char j=0;
unsigned int tcount;
unsigned int dcount=0;

//void interrupt int_5()                  // print screen button starts here
void interrupt handler(__CPPARGS)
{

if(dcount>480)
   {
   if(!busy&&tcount>5)
      {
      char far *p;
      union REGS r;
      struct SREGS s;

      p=scr;
      *p+=6;
      *p++=j;
      *p++=0x4f;

      j++;

      busy = !busy;                   // mutex around tsr
      start();

      r.h.ah=0x5;
      r.h.ch=0x51;    //pagedown?
      r.h.cl=0x0;
      int86x(0x16,&r, &r, &s);

      busy = !busy;
      tcount=0;
      }
   tcount++;
   }
else
   dcount++;
}

void write_char(int x, int y, char ch, int attrib)
{                                       // displays 1 character at (x,y)
char far *v;

v = (char far *) VIDMEM;
v += y*160 + x*2;
*v++ = ch;
*v = attrib;
}

void write_string(int x, int y, char *str, int attrib)
{                                       // writes string str at (x,y)
for( ; *str; str++,x++)
   write_char(x, y, *str, attrib);
}

int firsttime=0;        //need to skip 3 lines after the first time we
//page down.

void start(void)
{
int fd,x,y;
char cr=0x0D, lf=0x0A;

old_dta=getdta();
setdta((char far *)MK_FP(_psp,0x80));

//if((fd =_open("c:\\temp\\log.txt",O_WRONLY))<0) // open the file
//        if((fd =_creat("c:\\temp\\log.txt",_A_NORMAL))<0) // try to make new
//                write_string(1,1,"OOPS--write error1",0x8F);

if((fd =_open(fname,O_WRONLY))<0) // open the file
   if((fd =_creat(fname,_A_NORMAL))<0) // try to make new
   write_string(1,1,"OOPS--write error1",0x8F);

lseek (fd,0,SEEK_END);                          // jump to end of file

//for(y=0;y<25;y++)                               // grab lines 0 to 24
for(y=2+firsttime;y<24;y++)
   {
   //for(x=0;x<80;x++)                       // grab rows 0 through 79
   for(x=1;x<79;x++)                       //cut the bars from msl

   if(_write(fd,(char far *)(VIDMEM+160*y+2*x),1)==-1)
      write_string(1,2,"OOPS--write error2",0x8F);

   if(_write (fd,&cr,1)==-1)               // put a cr and lf at end
      write_string(1,3,"OOPS--write error3",0x8F); // of line

   if(_write (fd,&lf,1)==-1)
      write_string(1,4,"OOPS--write error4",0x8F);
   }

_close(fd);                                     // close the file

setdta(old_dta);
if(firsttime==0)
firsttime=1;
}

Hopefully this will help someone in the distant future, maybe it’ll just serve as a warning on how not to build stuff … lol

Oh and I used Borland C++ 3.1, but compiled this as C for the LARGE memory model.