I have a genuine IBM 5160 XT, manufacturing date November 1984. It's equivalent in almost all aspects to the IBM 5150 PC, which is the direct ancestor of the machine I'm writing this on (and, almost certainly, the machine you're reading this on). I've decided to allow anybody who wants to (and who can access this web page) to run programs on this XT.
I suggest writing assembly code and assembling it with yasm (though it other compilers or assemblers capable of targetting 8088/8086 should also work). Use "org 0" and "cpu 8086" at the beginning of your program. The CPU in the XT is an 8088, which uses the same instruction set as the 8086. The bootloader program that loads your code onto the XT loads it as low in memory as possible (right after the bootloader) and starts it with IP=0. The program may be more than 64K, though if it is too long it will stamp on the stack (which is just under the 640K boundary) and crash.
None, except for the standard IBM BIOS and my bootloader. There is no DOS on the machine, so DOS calls cannot be used unless you include a DOS as part of your program.
Any data that you send over COM1 (115200 baud, 8 data bits, 1 stop bit, no parity) will be returned over the web interface to you. I have provided some interrupts to make this easier:
int 0x60
- sends the byte 0x01
, which
will cause the web server to capture an image of the composite CGA screen
and insert it into the output.int 0x61
- send the byte 0x02
, which will
cause the web server to start recording audio from the XT's internal
speaker.int 0x62
- send the byte 0x03
, which will
cause the web server to stop recording audio, convert the recoding to an
MP3 and insert it into the output.int 0x63
- send the value in AX as a 4-digit
hexadecimal number (the value in AX is destroyed, other registers are
preserved).int 0x64
- send CX bytes pointed to by DS:SI (AX, CX and
SI are destroyed, other registers are preserved). The bytes are escaped so
this will cause no audio, screen capture or file capture events.int 0x65
- send the character in AL (AX is destroyed,
other registers are preserved). Some characters have special meanings:
0x00
- escape: send the next byte literally over the
HTTP connection - don't interpret it as an action.0x01
- capture a screen image.0x02
- start recording audio.0x03
- stop recording audio.0x04
- send a file (used by int 0x66
, below).
The 0x04 byte must be followed by three bytes of (escaped) length (least
significant byte first) and then the escaped data.0x05
- reserved for future expansion.0x1a
- terminate the connection.int 0x66
- send a file DL:CX bytes long, starting at
DS:SI. The resulting file will saved on the server and embedded into the
HTTP output as a link.
int 0x67
- send the byte 0x1a
twice, which
terminates the connection (even if a 0x00
escape byte was
accidentally sent first) and causes the machine to be hard reset soon
afterwards. If the connection is not terminated this way after 5 minutes,
it will be terminated automatically to avoid tying up the machine. I might
change the timeout in the future, depending on usage and demand.int 0x69
- increase an internal counter and stop writing
to the screen.int 0x6a
- decrease the internal counter and if it is zero,
start writing to the screen again.0x63
, 0x64
and 0x65
will
write data to the screen as well as the serial port unless int
0x69
is executed first.
Sure:
org 0
cpu 8086
mov ax,cs
mov ds,ax
mov si,message
mov cx,messageEnd-message
int 0x64
int 0x67
message:
db "Hello, World!",10
messageEnd:
The power good line has a pulldown line spliced in and connected to an Arduino, enabling the machine to be remotely power cycled. After a power cycle, the Arduino pretends to be the IBM manufacturing test device connected to the keyboard port. This loads my bootloader code into the XT early in the BIOS boot sequence, allowing the RAM test (which takes ages) to be skipped. Once the bootloader is in place it watches for data from COM1 (i.e. your program), copies it into RAM and executes it.
All the code for this is available on my github, along with many other example programs.
This tutorial seems to be a good start.
HELPPC is an excellent reference, and was the main resource I used when I started learning 8086 assembler, along with the A86 manual.
minuszerodegrees.net has a wealth of excellend technical information and manuals, including the IBM Technical Reference manual which is an excellent hardware reference (including BIOS listings and schematics).
If you have other suggestions for links to add here, let me know and I'll add them.
There is a TV capture card connected to the CGA's composite output.
Sending byte 0x01
over the serial link or executing int
0x60
will cause the current screen image to be captured, saved as a
.png file and embedded into the HTTP output. Note that there may be a
delay between when this command is issued and when the screenshot is
actually taken, so be sure to delay for a few seconds before ending the
program or displaying a different image.
The PC speaker is currently disconnected so that you can't drive me
crazy by making annoying noises with it. However, it is connected to a
sound card. Executing int 0x61
and int 0x62
will
start and stop audio recording respectively, and the latter will cause the
audio to be embedded into the HTTP output.
I don't know of an assembler that is designed to be safe to use with untrusted input. So this will have to wait until I write my own assembler (which may take a while).
Stay tuned, this feature is coming soon.
Maybe, if it's an interesting program, or if it seems be a problem with the server software. I won't do your homework for you, though.
No - see this thread on VCF for details.
Here is a perl script (thanks to Egan Ford) which you can use to automate calls to the API. It may need to be renamed to submit.pl before use.
William Jones (cr1901) has created a Rust binary called `xtpost` to talk to the server. `xtpost` will scrape any serial output, a captured image, a written file, and captured audio from the server and download it locally (See `xtpost cfg -d` for details). You can set an email to use using `xtpost cfg -e`.
Binaries for Linux, OS X, and Windows are provided here. If you want/need to compile it yourself, you can download a toolchain here. Clone the source,and run `cargo build --release` at the root of the tree to compile your binary (available under `target/release`).
No, you keep the copyright on your programs. I will not redistribute them, but I will keep logs and copies of any programs sent so that I can debug if someone manages to send a program that breaks the server. Please don't do anything illegal with this system.
If the web browser becomes disconnected before your program completes, providing your email address will allow you to get the results anyway, without having to re-run the program. I may also want to send you an email if you run a program that breaks something, if I have a question about your program or if it's just a really awesome program and I want to congratulate you on it. I won't send your email address to anyone else without explicitly asking permission first.
Send email to me, andrew@reenigne.org.
The XT server is currently in an unknown state.
Upload it into this form:
Thanks to Free DNS from afraid.org for the dynamic DNS.