DBASE III and friends.

Do you remember the ‘dot’ prompt?

Dbase III

Dbase III

I’m sure most people have never heard, or seen the thing. But this was the wonderful world of dBase, a simple to use database utility that set the world on fire back in the CP/M, MS-DOS days. The cool thing about dBase was that you could program it, and the syntax was very easy to pick up, compared to SQL. And you could save your scripts into these .PRG files which were human readable, and quite capable of doing all kinds of fun things.

As people’s level of complexity grew with dBase, people started to deploy it as an application, which in this day in age isn’t that unheard of, it happens today in the form of the Access 2007 runtime. However back then, the big deal was taking your .PRG script files for dBase, and compiling them with a 3rd party compiler. For some reason the people behind dBase were slow to the market, so Nantucket Corporation, arrived with Clipper, a superset of the dBase language, that could translate the dBase scripts into code for a p-code interpreter (it’s the same thing as a virtual machine, like Sun’s java, or z-machine from Infocom). Naturally once you compiled your .PRG file, it could still access the same database files, that you had created in dBase III, or you could even create your own on the fly within the .PRG file.

Now what’s really cool about Clipper is that, not only could it compile the dBase PRG files, but you could also link in code from MASM (The Microsoft Assembler), and Microsoft C (Other C compilers can work too, but MS C works best, as Clipper seems to have been written in MSC.). So you can be free to write all kinds of strange and interesting things. So far I’ve only written a few things to call the video bios from Microsoft C.

So as a very basic example of this, let’s make a simple .PRG file.. I’m going to name this HI.PRG, and I’m going to call a function hic from the dBase script.

HI.PRG

? “Hello from clipper”
? “”
hic()

Now for the C program. *NOTE* that printf won’t work as the libc stdio isn’t initialized correctly.. However other stuff works fine, I’m sure there is a fix, somewhere, but I didn’t need it so it doesn’t matter. Also this program will work with both the “Summer ’87” compiler, and Clipper 5.3, however the syntax I’m going to give is specific to the Summer ’87 release.

HIC.C

#include <stdio.h>
#define CLIPPER void pascal

CLIPPER hic()
{
putch(‘a’);
}

Now we compiler & link everything like this:

clipper hi.prg -m
cl /c /FPa /AL hic.c
tlink hi.obj hic.obj clipper.lib

And this will now produce a hi.exe, that when executed will produce this output:

C:\TEMP>hi

hello from clipper
a
C:\TEMP

Ok, now this is all fun, however you’ll hit roadblocks eventually as the Summer ’87 compiler & library produces code that is meant for real mode on the 8086/8088 CPU. So if you are adding to an already ‘bloated’ 540kb program, you are going to run into trouble quickly. This is where Clipper 5.x comes into play.

Clipper 5.x introduced the ability to build & link programs for protected mode, provided you have a DOS Extender, that is tailored to Clipper. There were several available at the time, and around Clipper 5.3 they included the exospace product which was wrapped around Tenberry DOS Extender, DOS/16M.

Now you may be wondering, what is ‘real mode’, ‘protected mode’, and a ‘dos extender’, not to mention how they all interact with each other. I’ll try to explain this.

The old 8086/8088 CPU’s could address 1MB of ram on their 20bit address bus (2^20 is 1,048,576) and this memory is chopped up into 64kb segments. The IBM PC reserves the top 384kb for adapters, hardware shared memory, and the ROM BIOS, leaving 640kb for MS-DOS and your user programs. This is where that mis attributed quote 640kb ought to be enough for anyone comes from. This 8086/8088 ‘mode’ is called the ‘real’ mode.

Well remember leaving the old CP/M computers that typically had 48kb or 64kb of ram, 640kb seemed plenty at the time. Naturally it was a matter of time until people were making programs where they ran out of memory.

The solution from Intel was the 80286 processor which was fully backwards compatible with the 8088/8086, however it included a new mode of operation, protected mode, which when activated would supply a virtual address space of 1GB (1,073,741,824), and a 24bit memory bus (2^24 is 16,777,216), allowing users to access 16MB of ram.

Another big feature of protected mode, is that memory is then protected so if a program accesses memory that it shouldn’t, it’ll generate a protection fault. The 80286 also introduced TSS’s to support multitasking in hardware. The idea being with these two features a rouge program wouldn’t crash the entire OS.

Intel’s thinking was that the 8088/8086 software was a fad, and that once people saw the power of protected mode, they’d never want to leave it, so there is *NO* method for switching the 80286 back from protected mode to real mode once it’s been entered.

Naturally this would require a whole new operating system to function in protected mode, and it would be incompatible with old MS-DOS programs as they simply will not function in protected mode. IBM & Microsoft started to collaborate on this new OS, called OS/2. The biggest obstacle that faced the team was that a new operating system that didn’t support the growing ‘legacy’ base of MS-DOS applications would be doomed to fail. The IBM AT had this ‘cheat’ that while doing it’s POST in BIOS, the CPU would be switched to protected mode, to check & detect the memory. Then the instruction pointer would be saved in the start of ram, and the keyboard controller would be used to reset the CPU, allowing the BIOS to continue back in real mode. While this did work, it was far too slow for an operating system to use where you may need to switch several thousand times a second.

Gordon Letwin spent a lot of time on trying to find a way to switch the 80286 from protected mode to real mode, when he hit upon what is known as the triple fault. The idea is that you place your instruction pointer much like the keyboard controller reset method, but you then remove all ‘safety nets’ by clearing the interrupt table for the CPU, and cause it to crash by throwing an interrupt. The CPU can’t process the interrupt because the table is invalid, so it will end up doing a quick reset as the microcode assumes the processor has encountered a critical software problem.

This was a big save for OS/2 as now it could boot up into protected mode, run protected mode programs, and would allow the user to select a special ‘dos box’ that would switch the processor into real mode, and run MS-DOS programs while switching back & forth between real & protected mode to service interrupts, and allow OS/2 programs to continue to execute in the background.

However when the first version of OS/2 was released in 1988, it had a confusing topview like interface, which was full screen text, and didn’t appear to multi task as you could only work on one thing at a time.

So with that the idea of a dos extender was born.

The people behind Tenberry worked with Microsoft, and deiced that they could bring the number one benefit of protected mode, a larger address space, to MS-DOS by writing a special program, the DOS Extender. Since MS-DOS & the PC BIOS are real mode programs, and can’t function in protected mode, what Tenberry did was write a special loader that could load OS/2 programs into protected mode, but every time the program would make a MS-DOS call, the DOS Extender would intercept the call, switch the processor into real mode, make the call, then return to protected mode, and return the result to the program.

The result being that you didn’t have to install a new operating system, just rebuild your applications, link with the DOS Extender and now you could have access to 16MB of RAM!

Ok, so with that in mind, here is me rebuilding the same programs for protected mode.

C:\TEST>clipper hi.prg -m
CA-Clipper (R) 5.3
Copyright (c) 1985-1995, Computer Associates International, Inc.
Microsoft C Floating Point Support Routines
Copyright (c) Microsoft Corp 1984-1993. All Rights Reserved.
267K available
Compiling HI.PRG
Code size 61, Symbols 64, Constants 19

C:\TEST>cl /c /FPa /AL hic.c
Microsoft (R) C Optimizing Compiler Version 5.10
Copyright (c) Microsoft Corp 1984, 1985, 1986, 1987, 1988. All rights reserved.

hic.c

C:\TEST>exospace file hi.obj,hic.obj

ExoSpace for CA-Clipper 5.3
Copyright (c) 1993 – 1995 Computer Associates International Inc.

DOS/16M Copyright (c) Tenberry Software, Inc. 1987 – 1995

EX01 – General Linking Utility (for CA-Clipper ExoSpace). V2.11(w/VMM 6.01)
Copyright (c) Tenberyr Software, Inc. 1987 – 1994

Reading object files and library headers.
Processing library directories.
Extracting library objects.
Assigning selectors.
Preparing GDT image.
Writing code image to .EXP file.
Sorting 1737 relocations.
Building relocation tables.
Writing GDT image to .EXP file.

1044544 bytes used out of 44702592 bytes available.

Generating .\HI.EXE…

EXOSPACE : .\HI.EXE successfully linked

C:\TEST>

And we can now run the program!

DOS/16M Protected Mode Run-Time Version 6.01
Copyright (C) Tenberry Software Inc. 1987 – 1994

hello from clipper
a
C:\TEST>

As you can see, the only visible change to the user is the banner printed by the DOS Extender as the program executes. Now if the program makes a LOT of calls to DOS from protected mode it can get slow. It’s very noticeable say if you have a database that you read a record, parse it, then fetch another record. However if you need lots of ram you don’t have much of a choice… Not to mention that 286 DOS Extenders are limited to 16MB of Ram, very few (if any?!) support swapping, or allow programs to address the 1GB virtual address space.

The solution, again came from intel in the form of the 80386 CPU. The 386 is a superset of the 286, and like it, also supports the 286’s protected mode and the 8088/8086’s real mode. The 80386 also introduces a 32bit protected mode, v86 mode, and a method to quickly switch from protected to real mode.

So what does this mean for DOS Extenders? That a 386 DOS Extender will be significantly faster then a 286 DOS Extender. Also the v86 mode, supports virtual 8086 machines, allowing a 32bit DOS Extender to run MS-DOS in a virtual machine, and make MS-DOS & BIOS calls all from protected mode.

One great free 32bit Dos Extender for Clipper is CauseWay, which is now free!

So using the same object files generated from the DOS/16M extender, I just simply relink with CauseWay’s linker which will also link in the CauseWay extender. I’m not all that good with CauseWay’s syntax so I opted for a ‘response’ file, in the format of something exospace would use.

HI.LNK

FILE hi.obj,hic.obj
OUTPUT hi.exe
LIBRARY clipper.lib

Now running the CauseWay linker:

C:\TEST>wl32 /lc:exospace.def @hi.lnk
CauseWay WL32 for Clipper Version 1.32 Copyright 1993-1999 Michael Devore.
All rights reserved

Link of executable file successfully completed.

C:\TEST>

Then running the exe…

C:\TEST>hi

hello from clipper
a
C:\TEST>

All nice and transparent to the end user. And it feels significantly faster then the 286 extender when it comes to lots of MS-DOS transactions… I’ll have to time it, but right now you’ve only got my observation.

This post is way longer then I had originally thought so I’m going to break this up, but this blog post is an idea of what I’ll cover next time…

PCemu for Windows

Back when Linux was all new and exciting, I used to run this program, called pcemu to run some basic text only MS-DOS programs. The thing was dosemu was cool, but just unstable as hell, and a put software emulator could always be controlled because it was ‘just another process’…

Now the thing about pcemu is that it was meant for X11, and it’d suck for those of us that actually used terminals… Ages ago I ‘fixed’ a lot of the X11 stuff to run over a terminal, but I never did get the scrolling correct.

So years later, trying to remember the programs that I ran circa 1994, I thought I’d dig out pcemu and see how it runs on ‘modern’ machines…

Much to my surprise, David Given & Michael Hope, have updated it somewhat, and included curses support!

So I took the curses portion, then used a little insight from the ‘bounce’ demo from the NT 3.1 SDK, along with this great example of how to work some of the features of the Win32 Console, along with a long night trying to get the timers working, and I’ve managed to produce a copy of pcemu that’ll run on Win32 & Win64…

Now of course I’m sure you’d be saying Why…. But remember the x64 platform has no native way to run MS-DOS, so even a simple text only emulator is a nice thing to have..

pcemu-x64

pcemu-x64

So while it may not look all that exciting, it actually works!

fdisk on pcemu-x64

fdisk on pcemu-x64

Even FDISK renders correctly!

For some reason pcemu had hard disk emulation, but it was disabled by default… So I re-enabled it, and configured it to emulate the ST506 5MB hard disk.. And it works great, other then you can’t boot from it… 😐

Other then that, yes it is totally pointless, but I have to admit, it was pretty cool the first time I saw it booting up.

For the 2 or 3 people that care, my work is currently here. I’ve built it for the x86, x64 & ia64….

partitioning with debug

If you’ve ever decided to use a ‘new’ pc for some old OS’s or whatnot, you’ll probably find partition tables that will NOT clear under MS-DOS…

Well after looking around for a ‘quick’ and easy method of wiping a partition table, I found this neat little script for DEBUG to do the trick….

Don’t try it out on any machines you care about…!

http://support.microsoft.com/kb/106419

—————————————————————-
Debug Enter Debug Comments
Prompts Commands
—————————————————————-
– A 100 Assemble from CS:0100.

nnnn:0100 INT 13 Call interrupt 13.

nnnn:0102 press the (nnnn in the segment address).
ENTER key

– RAX Replace AX register.

AX 0000

: 0301 Write on sector.

– RBX Replace BX register.

BX 0000

: 0200 Start from ES:200.

– F 200 L 200 0 We want to write zeros.

– RCX Replace CX register.

CX 0000

: 0001 Cylinder, 0, sector 1.

– RDX Replace DX register.

DX 0000

: 0080 First physical hard disk, head
0. (Substitute 0081 for this
entry if you are clearing the
table on the second physical
hard disk, 0082 if you are
clearing the third physical
hard disk, and so forth).

– P Proceed (Debug will display
several lines of information).

– Q Quit Debug.
—————————————————————-

MS-DOS lan client for Virtual PC 2007

So while I was going through the motion of making my tradewars more… multi user friendly, I needed to test between all kinds of clients and a server…

Since I’m using MS-DOS, Windows 3.0 as my test bed (if it’ll run there, it’ll run anywhere!) I had MAJOR issues with the 3.0 lan client… But digging around on the NT 4.0 Server CD I tried the lanman.dos client.

Using the lan drivers from here: http://wiki.oldos.org/Downloads/DriversAndBootdisks

It was a snap!

I’ve built an NT 4.0 domain controller with both NetBIOS & TCPIP protocols that way all my machines can map into it…

I wonder if there ever was a ms net requester for MacOS..?

Making bootable ISO images

I know for most people using mkisofs is second nature, but I needed to get a machine running MS-DOS without floppies… and it had to be on the bare metal.. Oh joy.

Now I’ve kind of done this before but I’ve never gotten it to preserve the directory structure.  It seems that it’s important to specify some output…

The ‘fun’ thing is that I was able to use virtual pc to build the boot diskette with IDE cdrom drivers, and make sure it works in that it mounted the CD and set the path there…

So I have extracted my MS-DOS install from the floppies into a directory on my pc and I keep the file dos622_1.img in the same directory so mkisofs can place it in the image.  Then it’s just a matter of running:

..\mkisofs.exe -o ..\x.iso -J -r -v -V test_disk -b dos622_1.img .

And I get an x.iso that can boot MS-DOS, and has all the dos commands in place, I can partition & format the hard disk and copy DOS into place.

It’s not much to see, but if you need legacy stuff it’ll be a life saver.. and I know I’ll end up losing the flags and needing them again!

86-DOS

While I was looking around at fleshing some stuff out on gunkies I came across this little nugget of MS-DOS history.

You can actually download 86-DOS the precursor to MS-DOS!  And it even includes a bunch of SOURCE CODE!  The best part is the awesome emulation suite SIMH can run 86-DOS!

Ok, for the first part of this, I thought I’d try my MS-DOS build of SIMH 3.81 which can be found on the sourceforge pages here.  Because I’m using a 64bit OS there is no 16bit environment to kick start DPMI stuff, so I’m using the most excellent DOSBox emulator.

Thanks to the hard work of Peter Schorn, you can download the run able image for 86-dos right here, then simply point the Altair z80 emulator from SIMH to it, and you’ll be running in no time.

To run it, simply point the z80 emulator to the boostrap file 86dos.  Then just follow the onscreen prompts.

 

Then you’ll be up & running!  Notice how the prompt is different from MS-DOS, and yet how familiar it ‘feels’.  Also check out the commands!

 

Rumor has it that edlin has largely remained the same, up to TODAY on 32 bit versions of Vista!  I haven’t even verified it, but it would prove interesting.

I should also point out that Peter has amassed quite the collection of CP/M images, programming languages and other interesting stuff here.

Minor SIMH fun

Well I updated the packages for SIMH last night, and I’ve included the win32s stuff and MS-DOS builds. This ought to allow some old schoole to have some fun!

The packages should be visable from here: https://sourceforge.net/project/showfiles.php?group_id=154308&package_id=244756

I have also decided that the MS-DOS version (being the lowest common denominator) should include some kind of ‘sampler’ of OS’s so that you can see right out of the gate what simh is capable of. Naturally you can download the MS-DOS version, and simply replace the exe’s with stuff for windows/win32s/linux etc..

SIMH 3.8-0 for MS-DOS

This is a quick survey of SIMH 3.8-0 for MS-DOS. I’ve built these exe’s with Watcom C++ 11.0a.

You can break out of any of the simulators by pressing CONTROL+E.

All of the EXE’s are for the MS-DOS environment, and I’ve built them with DOS/4GW in mind. I will have to say that an initial test shows that running this stuff under a DPMI server like Windows or OS/2 provides better performance then native switching.. It could be my PC, however I’d recommend anyone who uses these EXE’s to try them natively and under Windows 3.1 at a minimum.. Because all of the MS-DOS nature of these programs, no disk files can be over 2 gigabytes. I don’t know if that’ll be an issue but of course you can have multiple files/partitions as I recall MS-DOS 5 having a 2 gigabyte file/partition size limit..

For anyone running this natively I have included only one copy of dos4gw.exe in the root of the zip.

1. Altair
2. Altair Z80
3. The HP2100
4. The Interdata 32b
5. The Nova
6. The PDP-11
7. The PDP-8
8. The MicroVAX II
9. The VAX 11/780

============================
1. Altair 8800
simh\altair\work

This is the Altair 8800 emulator with both AltairDOS and CP/M 2.2

Both CP/M and Altair DOS are from the file ceoaltair.zip

altdos.bat

——8<------8<------8<------8<------8<------8<
C:\simh\altair\work>altdos
C:\simh\altair\work>altair.exe altdos.ini
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

Altair 8800 simulator V3.8-0

MEMORY SIZE? 62
INTERRUPTS? n
HIGHEST DISK NUMBER? 1
HOW MANY DISK FILES? 5
HOW MANY RANDOM FILES? 4

055938 BYTES AVAILABLE
DOS MONITOR VER 1.0
COPYRIGHT 1977 BY MITS INC
.
——8<------8<------8<------8<------8<------8< cpm.bat ——8<------8<------8<------8<------8<------8<
C:\simh\altair\work>cpm
C:\simh\altair\work>altair.exe cpm22.ini
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

Altair 8800 simulator V3.8-0
62K CP/M VERSION 2.2 (ALTAIR 8800)
A>
Simulation stopped, PC: 172052 (JNC 172047)
sim> q
Goodbye
——8<------8<------8<------8<------8<------8< ============================
2. The Altair 8800 z80 emulator.
simh\altairz8\work

This is more full featured then the other Altair emulator, and I’ve found the z80 to have more
software available. I’ve included the CP/M 2.2 that I found cpm2.zip

cpm2.bat

——8<------8<------8<------8<------8<------8<
C:\simh\altairz8\work>cpm2
C:\simh\altairz8\work>altairz8.exe cpm2.ini
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

Altair 8800 (Z80) simulator V3.8-0

64K CP/M Version 2.2 (SIMH ALTAIR 8800, BIOS V1.25, 2 HD, 15-Jan-07)

A>
Simulation stopped, PC: 0F3FA (RRA)
sim> q
Goodbye
——8<------8<------8<------8<------8<------8< ============================
3. The HP2100 emulator.
simh\hp2100\work

I really don’t know much about this machine, but I included a way to run the basic1 program I
found online. It kind of reminds me of the ROMBASIC back ‘in the day’… It’s basic with line
numbers so I know it’s kind of old.. I really don’t know much otherwise about this machine.

basic1.bat

——8<------8<------8<------8<------8<------8<
C:\simh\hp2100\work>basic1
C:\simh\hp2100\work>hp2100.exe basic1.ini
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

HP 2100 simulator V3.8-0

READY

Simulation stopped, P: 17436 (JMP 17435)
sim> q
Goodbye
——8<------8<------8<------8<------8<------8<
============================
4. The Interdata 32b emulator

simh\id32\unix6

Both of these unix’s were taken from the files iu6swre.zip and iu7swre.zip respectively.

This is research Unix v6 ported to the Interdata. I set the batch file to tell you how to
bootstrap the system, as it doesn’t just ‘turn on’.. Otherwise it should be comparable to Unix v6 on the PDP-11 or any other v6. This should be the first port of Unix outside of Western Electric. There is no halt/reboot/init 0, so I just sync the disk a few times, and then interrupt the emulator and quit.

——8<------8<------8<------8<------8<------8<
C:\simh\id32\unix6\unixv6.bat
C:\simh\id32\unix6>id32.exe v6.ini
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

Interdata 32b simulator V3.8-0
at the ? prompt type in:
unix
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

Interdata 32b simulator V3.8-0
v6.ini> d lfc tps 100
Read only argument
?unix
Memory = 182.50 K

login: root
You have mail.
# sync
# sync
# sync
#
Simulation stopped, PC: 2EB5C (EPSR R1,R0)
sim> q
Goodbye
——8<------8<------8<------8<------8<------8<
simh\id32\unix7

This pretty much follows in the steps of the Unix v6 above. This is the research version of UNIX v7.

——8<------8<------8<------8<------8<------8<
C:\simh\id32\unix7>unixv7.bat
At the : prompt type in
dsk(1,0)unix
ECHO is off.
Then at the # prompt hit CONTROL+D
the root password is root
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

Interdata 32b simulator V3.8-0

Boot
: dsk(1,0)unix
Memory = 248.0 K
# Restricted rights: Use, duplication, or disclosure is subject
to restrictions stated in your contracts with Western Electric
Company, Inc. and the University of Wollongong.
Fri Jan 2 18:15:04 EST 1970

login: root
Password:
# sync
# sync
# sync
#
Simulation stopped, PC: 00D20 (EPSR R1,R0)
sim> q
Goodbye
——8<------8<------8<------8<------8<------8< ============================
5. The Nova emulator

simh\nova\work

This is RDOS V7.50, which I honestly don’t know anything about… I retrieved this OS from the archive rdosswre.tgz .

rdos.bat

——8<------8<------8<------8<------8<------8<
C:\simh\nova\work>nova.exe rdos.ini
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

NOVA simulator V3.8-0

Filename?

NOVA RDOS Rev 7.50
Date (m/d/y) ? 10/31/77
Time (h:m:s) ? 10:10:00

R
——8<------8<------8<------8<------8<------8<
============================
6. The PDP-11 Emulator

simh\pdp11\unixv1

This is the Unix v1 restoration project’s latest disk image, that I have retrieved from
http://code.google.com/p/unix-jun72/
Being one of the first versions of Unix it’s super primitive, however I thought it was interesting to include in this SIMH sampler to see just how far UNIX has progressed, and just how much is the same.

unixv1.bat

——8<------8<------8<------8<------8<------8<
C:\simh\pdp11\unixv1>unixv1.bat
C:\simh\pdp11\unixv1>pdp11 simh.cfg
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

PDP-11 simulator V3.8-0
Disabling CR
Disabling XQ
RF: buffering file in memory
TC0: 16b format, buffering file in memory
simh.cfg> att dci 5555
File open error

:login: root
root
#
Simulation stopped, PC: 007332 (MOV (SP)+,25244)
sim> q
Goodbye
RF: writing buffer to file
——8<------8<------8<------8<------8<------8<
============================
7. The PDP-8 Emulator

simh\pdp8\work

This is the PDP-8 emulator with OS8. I really don’t know anything about this other then the
‘list’ command… I retrieved this from the file os8swre.tgz .

os8.bat

——8<------8<------8<------8<------8<------8<
C:\simh\pdp8\work>os8
C:\simh\pdp8\work>pdp8 os8.ini
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

PDP-8 simulator V3.8-0
RX: buffering file in memory

.
——8<------8<------8<------8<------8<------8<
============================
8. The MicroVAX II Emulator

simh\vax\quas

This is the MicroVAX II emulator with a miniroot of Quasijarus 0c. It’s not exactly fully functional in this state, but it’s enough to exercise the emulator, and boot up from disk.
I’ve configured the NVram so it will just boot up by default. I have left the installation tape image as quas.tap. Please note that this is *NOT* enough for a full install, this is just a demo to check that your system works.

quas.bat

——8<------8<------8<------8<------8<------8<
C:\simh\vax\quas>vax.exe quas.ini
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

VAX simulator V3.8-0
NVR: buffering file in memory
Loading boot code from ka655x.bin

KA655-B V5.3, VMB 2.7
Performing normal system tests.
40..39..38..37..36..35..34..33..32..31..30..29..28..27..26..25..
24..23..22..21..20..19..18..17..16..15..14..13..12..11..10..09..
08..07..06..05..04..03..
Tests completed.
Loading system software.
(BOOT/R5:0 DUA0

2..
-DUA0
1..0..

loading boot

Boot
: /vmunix
326312+104440+130352 start 0x23b8
4.3 BSD Quasijarus UNIX #3: Sat Feb 14 20:31:03 PST 2004
[email protected]:/nbsd/usr/src/sys/GENERIC
real mem = 33521664
SYSPTSIZE limits number of buffers to 80
avail mem = 31697920
using 80 buffers containing 655360 bytes of memory
MicroVAX 3000, ucode rev 6
uda0 at uba0 csr 172150 vec 774, ipl 15
uda0: version 3 model 3
uda0: DMA burst size set to 4
ra0 at uda0 slave 0: ra81, size = 891072 sectors
dz0 at uba0 csr 160100 vec 300, ipl 15
dz1 at uba0 csr 160110 vec 310, ipl 15
dz2 at uba0 csr 160120 vec 320, ipl 15
dz3 at uba0 csr 160130 vec 330, ipl 15
Changing root device to ra0a
Automatic reboot in progress…
Tue Feb 3 17:52:10 PST 2004
Can’t open checklist file: /etc/fstab
Automatic reboot failed… help!
erase ^?, kill ^U, intr ^C
# sync
# sync
# sync
#
Simulation stopped, PC: 800029AF (BNEQ 800029C6)
Goodbye
NVR: writing buffer to file
——8<------8<------8<------8<------8<------8<
============================
9. The VAX 11/780 Emulator

simh\vax780\work

The VAX 11/780 is a bit weird in that it cannot run it’s vmb.exe directly, unlike how the
MicrovaxII can run its ROM. I’ve been using extracted boot code to get the 11/780 to run. Again because I’m more familiar with Unix, I chose to include BSD 4.2’s miniroot to test functionality. This is really only suitable for testing the emulator out. I extracted the file bootra from the source code, and I took the miniroot file from the tape.

bsd42.bat

——8<------8<------8<------8<------8<------8<
C:\simh\vax780\work>bsd42
C:\simh\vax780\work>vax780.exe bsd42.ini
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

VAX780 simulator V3.8-0
loading ra(0,0)boot
Boot
: ra(0,0)vmunix
199488+
4.2 BSD UNIX #9: Wed Nov 2 16:00:29 PST 1983
real mem = 8384512
avail mem = 7073792
using 102 buffers containing 835584 bytes of memory
mcr0 at tr1
mcr1 at tr2
uba0 at tr3
hk0 at uba0 csr 177440 vec 210, ipl 15
rk0 at hk0 slave 0
rk1 at hk0 slave 1
uda0 at uba0 csr 172150 vec 774, ipl 15
ra0 at uda0 slave 0
ra1 at uda0 slave 1
zs0 at uba0 csr 172520 vec 224, ipl 15
ts0 at zs0 slave 0
dz0 at uba0 csr 160100 vec 300, ipl 15
dz1 at uba0 csr 160110 vec 310, ipl 15
dz2 at uba0 csr 160120 vec 320, ipl 15
dz3 at uba0 csr 160130 vec 330, ipl 15
root on ra0
WARNING: should run interleaved swap with >= 2Mb
erase ^?, kill ^U, intr ^C
# sync
# sync
# sync
#
Simulation stopped, PC: 8000162E (BRB 80001620)
Goodbye
——8<------8<------8<------8<------8<------8< The entire source is in the ‘source’ directory with projects for all of the SIMH material.
There are a few emulators that *WILL NOT BUILD* for MS-DOS because of a lack of 64bit integers. I suppose if there is any call for the missing emulators with the DJGPP compiler, assuming that it contains 64bit integer support. It’s completely unverified on my part. I’ve also done some preliminary work on networking with packet network drivers, however I am experiencing some weird timeouts. It’s hard to track down at the moment, but I’ll keep plugging away.

I don’t think there is any reason why you would not be able to use OpenWATCOM to build these files.

Some fun networking with MS-DOS & Novell Netware.

Ok I wanted to do this eventually but now I’ve finally done it. I have constructed something a little complex but it works surprisingly well.

Let me draw a picture so it’ll be a little easier to follow:

proxmox Netware diagram

proxmox Netware diagram

 

All of the machines in clouds are virtual…

Ok I’m going to assume you can install & configure OpenVPN on your own. I did a really simple install on Proxmox VE, just be sure to use the e1000 network adapters. All the others gave me tones of errors with any sizable traffic. Also I should point out that I’m using OpenBSD 4.3 which is the latest as of today.

dev tun0
dev-type tap
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
dh /etc/openvpn/dh1024.pem
key /etc/openvpn/server.key
server-bridge 192.168.6.33 255.255.255.224 192.168.6.50 192.168.6.62
push “route 192.168.6.0 255.255.255.0”
push “dhcp-option DNS 192.168.6.34”
client-to-client
duplicate-cn
keepalive 10 120
max-clients 100
persist-key
persist-tun
status /var/log/openvpn-status.log
verb 3
tun-mtu 1500
fragment 1300
mssfix
float

Again I just followed the example from the OpenVPN site to set this up. What makes this different though is the fact that I’m using this in a bridge mode. As you can see I have told OpenVPN that it is to use the tun0 interface as a ‘tap’ driver.

My hostname.tun0 is this:
Link0 up

Likewise the bridgename.bridge0 is:
add em1
add tun0
up

And finally for this example my bridgename.em1 is:
inet 192.168.6.33 255.255.255.224 NONE

So using this setup I have a ‘private’ 192.168.6.32/27 network in which I’ve got a few virtual machines running and space for my laptop to VPN into. Now one of the virtual servers on my Proxmox server is Windows NT 4.0 Terminal Server… Yeah I know I got it cheap on ebay, and I kind of like it. Anyways I’m running Qemu on it, which is running Netware 3.12. I installed the libpcap then I had to find out what my Ethernet devices are called. I used wireshark (it was ethereal) and it’s a cool program to have around. The last version to run under Windows NT 4.0 was 0.99.4 so that’s the one I used. Once I have done this I found my device and was able to setup a string for Qemu (which was \Device\NPF_RTL80291)

Here is what I’m using:

Qemu –had netware.disk –m 16 –M isapc –L pc-bios –net nic –net pcap,devicename=”\Device\NPF_RTL80291”

This sets up an ISA computer with 16 megaybtes of ram and a single ISA nic that will utilize libpcap to send out frames on the rtl80291 that’s being emulated to my NT terminal server by proxmox.

On the ‘client’ side of things, I’m running the 64 bit version of Vista. So I’ve installed the OpenVPN that not only has 64 bit device drivers, but has a nice little GUI to connect & disconnect from the networks. Here is the OpenVPN config that is on my laptop.

dev tap
ca ca.crt
cert client1.crt
key client1.key
client
proto udp
remote 192.168.1.75 1194
resolv-retry infinite
nobind
persist-key
persist-tun
;comp-lzo
mssfix
tun-mtu 1500
fragment 1300

Ok, so far so good. Now I do have Virtual PC 2007 on my laptop, and I have made sure that the “Virtual Machine Network Services” were bound to the “TAP-Win32 Adapter V9” interface.

The it’s a simple matter of connecting to the VPN, then loading up the virtual PC with MS-DOS & the Novell Netware client.

Then you should be able to ‘bind’ to the server & login!

dos netware client

dos netware client

The ‘cool’ thing about this setup is that it will work over things like wifi, and easily allow you to add clients near & far. Oh and the best part for the wifi crowd is that it will use REAL encryption since WEP/WPA have all been shown to be useless. Oh yes, and it should allow you to host your DOOM, Quake 1, Rise of the Triad, Warcraft II, and Descent games…. Along with people playing at home! Using this you too can build your own IPX/Internet network!

I do hope this clears some of the uses & versility of Virtual servers, Qemu & Virtual Networking.

Back to DOS

It’s been a long while, life has been busy. But I figured I ought to try to make a post this year!

Ok, I’ve gotten a new laptop over the last few months & I’m running the 64 bit version of Vista. One or the first things us old people will find is that the MS-DOS & Win16 subsystems have been completely removed.

This of course, poses a massive problem! How to play games!!!!?

Thankfully there exists two really great solutions for Vista 64bit users. The first one I’ll suggest is Virtual PC from Microsoft, and DosBox.

It’s no wonder Microsoft has made Virtual PC a free download since they have crippled the compatibility of the OS. Now I’m personally a little biased for Virtual PC as I’ve been using it since it was owned by Connectix. Virtual PC is a complete PC emulation strategy, allowing you to run MS-DOS or quite a few other operating systems. For this example I’m going to install MS-DOS, but it’s capable of running all kinds of other operating systems.

Now back to my laptop. It of course doesn’t come with floppy drives, so I used an older PC with a drive to create disk images. (it was running OpenBSD so I just ran ‘dd’. Winimage is capable of creating disk images as well). Of course I could use a USB floppy drive and boot my MS-DOS 6.22 floppies from that as well.

The cool thing is that you can setup a virtual machine, boot off either real floppies or virtual disks, and you will need to setup a virtual hard disk. Naturally it will need partitioning, and formatting. As for installing games, again if you have floppies of them, everything is cool. There even is an emulated CD-ROM device, however you will need a device driver to use it! (https://www.google.com/search?q=idecd.sys) Virtual PC emulates an IDE CD-ROM, and you can use just about any driver you can find out there. Once you can read CD-ROM’s under the emulated MS-DOS you can install the ‘extensions’ program, which has an idle program (to stop the emulator from consuming 100% of your CPU, as MS-DOS has no inherent idle loop), and a neat program called fshare. Fshare will allow you to give your emulated PC access to a directory on the host computer.

The plus’s of Virtual PC is that it’s a more accurate emulation, it provides sound blaster pro emulation, and good psudo device emulation. The major downside for me is that it provides no joystick emulation. Of course you’ll need to bring your own DOS, however I imagine that FreeDos ought to work just fine, but I kind of like the real thing.

The second emulator I’d like to mention is DOSBox. Unlike Virtual PC, DOSBox is not a complete system emulator, it’s designed specifically to run MS-DOS programs. So you will not need a copy of MS-DOS, nor will you need to worry about such hassles as media, or emulated hard disks.

To run DOSBox for the most part all I do is add the following lines into my config file:

Mount c: c:\Users\Jason\dos
C:

This will make my C: drive a dos directory in my home directory on Vista, and change the current directory there. From here I can unzip any of the old programs I have, or just copy from CD to my vista directory and just run things. Overall DOSBox has pretty good compatibility. I’ve even run Windows 3.1, and some compiler & development stuff. And yes, it supports Joysticks & the emulation of various sound cards. DOSBox also has various throttle and various video emulation strategies. The other cool thing DOSBox can do is setup a virtual IPX/SPX network, and allow you to play old DOS multiplayer games over the internet. Warcraft 2 & Doom work quite nice under DOSBox. While Virtual PC does provide virtual Ethernet interfaces, it does not provide a way to connect them up over the internet. While it could be done with loopback adapters & PPTP routing, it would be way beyond the average user. DOSBox can listen on a specified TCP port, you can setup your internet router to redirect that port to the host PC, then allow your friends to connect in.

While I can understand Microsoft’s desire to cut all ties with past OS’s in terms of support, It’s a good thing that there still exists an emulation strategy for the two of us. And between DOSBox and Virtual PC hopefully your needs will be met.

*Yes I’m aware of VMWare, however it’s not technically free, and while you can create your own config files, and disk images in Qemu, and install your own OS, it’s not the ‘right’ thing to do according to the EULA.