Spotlight › WireChat

Chat rooms for a 1981-class PC

WireChat is a chat program for os8088. It has four public rooms, private messages and a list of who is online, and it reaches a server on os8088.com from a 4.77 MHz PC with a network card.

rooms
4, plus private messages
a quiet window asks
once every 50 seconds
whole program in memory
48,875 bytes

Plain HTTP, not HTTPS. Messages are not encrypted. It is in colour on VGA and EGA, and black and white on CGA and Hercules.

WireChat
The WireChat window filling an os8088 desktop, in colour. A grey header shows the nick XTfan and a green Online. The left pane lists four rooms with the lobby selected in blue, a private conversation with RetroAmy marked by a red badge with a 1, and two friends online. The middle pane shows the lobby: a dashed line for Tue Oct 20 over one message from the night before, a line for Wed Oct 21, then six messages, each a time and a nick in its own colour over the text. The right pane lists five members, each with a coloured status mark. A half-typed message sits in the field at the bottom, and a green light in the status bar says Connected.
The lobby, in a window on a VGA desktop. Rooms, private conversations and friends are on the left, the conversation is in the middle, and who is in the room is on the right. A line marks each new day. The red 1 is a private message you have not read yet.

A chat room on an old PC

What WireChat is, and what you need to use it.

A chat room is a shared conversation. Everyone in it sees each message as soon as it is sent, under the name its writer chose, called a nick. People have talked this way on computers since the 1980s: first on bulletin boards and online services, then on internet networks like IRC.

WireChat brings that to os8088. Its server lives on os8088.com and has four rooms: lobby, hardware, development and games. You can also send a private message to anyone who is online. Everyone using WireChat meets in the same four rooms, whatever machine they run os8088 on.

The machine this is built for is the IBM PC of 1981 and the PC/XT that followed it: an Intel 8088 running at 4.77 MHz, with at most 640KB of memory. Network cards were made for these machines in the 1980s, and os8088 has a driver for the most widely copied kind, the NE1000 and NE2000. That card is the one thing WireChat needs that an ordinary os8088 machine does not have.

WireChat is a window like any other program's. It can sit beside a game or the text editor, and it chirps when someone writes to you, or names you, while another window is in front.

To get someone's attention, type @ and their nick. Tab completes a nick from the people online. A message that names you has a yellow header, and one in a room you are not looking at marks that room with @ and says who it was. Every message shows the time it was sent, and a line across the conversation marks each new day.

On a VGA or EGA card WireChat is in colour: each nick has its own colour, unread messages are counted on red badges, and two lights in the status bar show the connection and the traffic on it. On CGA and Hercules, which show black and white on the desktop, it keeps the same layout in black and white.

See it running

Mentions, a private conversation, catching up, flagging, your status, a narrow window, and no card at all.

Mentions
The lobby. The newest message, from RetroAmy, begins @XTfan and its header line is yellow. On the left the hardware room carries a magenta badge with @ in it, and the notice line above the input field reads PCjrPete mentioned you in #hardware.
Someone said your name. RetroAmy's message in the lobby names you, so its header is yellow. PCjrPete named you in the hardware room, which is marked with @ until you go there.
A private conversation
WireChat showing a private conversation titled at RetroAmy. Three messages: RetroAmy asks about an XT-IDE card, XTfan answers that it is in a 5160, and RetroAmy asks whether it boots from the card. The right pane, headed Online, lists seven people.
A private conversation. A message for you puts the sender under MESSAGES on the left; clicking the name opens the conversation. Only the two of you see it. The right pane now lists everyone online, not just one room.
While you were away
The lobby with a dashed line across the conversation reading 3 new messages in red. Below it, the first two of the three: RetroAmy and TandyTom arranging to meet at 9.
Catching up. These three arrived while another window was in front. The line marks where they start, so you can see what you missed. It goes away when you change rooms or send something.
Flag this message?
A message's header line shown inverted in the lobby, and a small dialog over the conversation asking Flag this message as abusive? with Yes and No buttons.
Flagging a message. Pressing the right mouse button on a message selects it and asks first. A room message flagged by two different people is removed for everyone. The message here is only an example; nothing was wrong with it.
Set status
A small menu open under the Set status button in WireChat's header, listing Online, Away and Busy, with the pointer on Away.
Online, Away or Busy. Your status shows as a mark beside your nick in everyone's member list. After ten minutes with no key or click WireChat sets Away by itself, and the next one sets Online again.
A narrower window
WireChat resized to about two thirds of the screen's width. The left pane of rooms and friends remains, the member list is gone, and the lobby's messages are wrapped to the narrower column. The desktop and its drive icons show to the right.
Make room for something else. Drag the window narrower and the member list goes first, then the left pane; the Rooms menu still switches rooms. The messages re-wrap to fit.
No network card
WireChat with empty panes. The header shows the nick XTfan and the status Offline. The notice above the input field reads No network card - see Control Panel, and the status bar reads No network card.
On a machine with no network card. This is the shipped software disk. WireChat still asks for a nick and saves it, then says what is missing and where to fix it. It sends nothing.

How a message gets there

Ask, wait, and never more than one connection.

A modern chat program keeps a connection open and the server pushes messages down it. An 8088 with a network card can do that, but it can only hold a few connections at once, and os8088's network stack shares them with every program on the machine. So WireChat asks instead, one short request at a time, and closes each connection when the answer is in.

The trick is in how the server answers. When WireChat asks "anything new?" and there is nothing, the server does not say no. It holds the question open for up to 50 seconds and answers as soon as a message arrives. A window where nobody is talking costs one request every 50 seconds, and a message still turns up within a couple of seconds of being sent. This is called long polling.

One connection

Sending interrupts the wait

When you press Send while a question is being held, WireChat closes it and sends your message instead. The answer to the send carries everything the held question would have. So there is never more than one connection open.

Changing room or status costs nothing extra either. It rides along on the next request.

Short lines

Answers an 8088 can read

Every answer is plain text: a first line that says whether the request worked, then one line per thing that happened -- a message, a private message, a member coming or going. Nothing has to be decoded or unpacked.

An answer is at most 6,144 bytes, and WireChat's buffer for it is the same size. When there is more, the server leaves out the oldest messages, never a removal or a notice.

Why not HTTPS

Encryption is out of reach

HTTPS starts every connection with arithmetic on numbers hundreds of digits long. The os8088 project's figure for the heaviest such step is minutes on a 4.77 MHz 8088 -- before a single message could be read.

os8088's web browser gets around this with a helper program on a modern computer. WireChat does not need one: its server answers plain HTTP on purpose. The cost is that messages cross the network unencrypted.

Inside the machine

Redraw only what changed

A background task makes the request and knows nothing about chat. The window takes the answer, works out the next request and redraws only the parts that changed. It remembers what each line of the window shows, so a line that did not change is not drawn again. On a Hercules card a new message costs 28 drawing calls, where it used to cost 106.

Every buffer is inside the program itself, so it takes no other memory from the system. Times arrive in UTC with their date and are shown in the machine's own time.

The server's rules

Limits a program on your own machine could simply ignore are kept on the server.

Anyone can change a program on their own computer, so WireChat does not police itself. The server on os8088.com does it instead, for every client alike.

Language

A filter on every message and nick

It uses public lists of offensive words in many languages, plus lists of its own for spellings meant to slip past and for phrases of harassment and hate. It sees through numbers for letters, stretched and spaced-out letters, and asterisks.

A refused message is not sent. It stays in your input field with a short sentence saying why.

Flags and mutes

Two flags take a message down

A room message flagged from two different addresses, neither of them the writer's, is removed from everyone's screen. A private message is removed by one flag from the person it was sent to.

Refused and removed messages count against the sender. Enough of them mute that address for 10 minutes, then an hour, then a day. The server stores addresses only in a scrambled form, never the addresses themselves.

Pace

No flooding

Each address may send 3 messages at once, then one every 8 seconds, and no more than 60 an hour. Everyone together is held to 20 messages a minute, and the server takes 50 people at once.

A daily budget

One server, 40,000 requests a day

The whole chat runs as one small program on Cloudflare's free plan, which gives the whole of os8088.com 100,000 requests a day. WireChat's share is 40,000.

As the day's count climbs, the server tells every client to wait longer between questions. At the limit the chat rests until midnight UTC, and WireChat says so.

What it does not do

Each of these is a choice, made for the machine or for the people on it.

  • No encryption. Messages travel as plain text, and anyone on the network path can read them. A few nicks are reserved and need a code to take; that code is kept in plain text in WireChat's settings file, so anyone with the disk has it.
  • No new rooms. There are four, fixed on the server, so a room list cannot be spammed.
  • A short memory. Opening a room shows its last 30 messages. The server keeps 100 per room and private messages for 24 hours. No conversation is saved on your disk.
  • Short, plain messages. 200 characters at most, in plain ASCII: no accented letters and no other alphabets. Emoticons are the typed kind, like :).
  • No files and no pictures. It carries text and nothing else.
  • Only its own server. WireChat speaks its own simple protocol. It is not a client for IRC or any other chat network.
  • Not on every disk. The 360KB software disk is full, so on a 360KB machine WireChat is on the network disk instead. The small build of os8088 for 128KB machines has no network driver, so it is not there at all. It is also in The Wire, for a machine running v1.0.20261020 or later; an older system disk's Wire shows it as needing a newer Wire.

Join in

A network card, a nick, and the lobby.

  1. Give the machine a network card. On real hardware that is an NE1000 or NE2000 in a spare slot. In QEMU it is two arguments added to the command line:

    -netdev user,id=n0 \
    -device ne2k_isa,netdev=n0,iobase=0x300,irq=3

    The os8088 source also has a networked XT for the 86Box emulator, make xt-wire. Put the network disk in its drive B.

  2. Attach the driver. Open the Control Panel, go to Drivers, and tick Ethernet. The driver asks the network for an address by itself.

  3. Open WireChat. It is WIRECHAT.O88 in the APPS folder of the 1.44MB, 720KB and 1.2MB software disks. On a 360KB machine it is at the top of the network disk, network360.img.

  4. Choose a nick and press Enter. It is 2 to 12 letters, digits, dashes or underscores, starting with a letter. WireChat remembers it, and you land in the lobby.

  5. Find your way around. Click a room on the left, or press Tab for the next one. Type @ and the start of a nick, then Tab, to complete it. Click a name to write to that person privately. A right press on a member adds a friend, and a right press on a message flags it. Notifications in the bottom corner turns the chirp off.

About the screenshots: they were taken against a test server running on the development machine, the same one os8088's own tests use, so every nick and message in them was written for this page. The real server answers in exactly the same way.