Spotlight › DOS

DOS programs in a window, several at once

Live DOS windows beside the desktop, on an 8088 with no DOS underneath and no hardware to keep a program in its place.

Speed in a window, of full screen
88.8%
Memory for each window
128 KB
With os8088 shut down
586 KB
DOS
Two DOS windows on the os8088 desktop, one above the other, with the Bounce demo's window between them. The back window shows a program printing lines that alternate DWTICK DOS and DWTICK BIOS. The front window shows a second program that has filled its window with lines reading DWFS 0 to DWFS 7. The dock at the bottom shows both DOS windows and Bounce.
Two DOS programs and an os8088 program, all running. Neither DOS program ever gives the processor back: each waits by watching the clock in a loop. os8088 takes it from them on its timer, as it does from its own programs.

What it does

A DOS program sharing a machine it believes it owns.

A DOS program in a window, on an 8088? The processor has no memory protection and no virtual mode. A program can write anywhere in memory, the screen included, and nothing on the chip stops it.

Most programs of the period never need stopping. They print through DOS, or through the video BIOS, the screen routines built into the PC's ROM. os8088 has its own DOS, which answers those calls itself. In a window, their text goes into the window instead of onto the screen.

MS-DOS was the operating system almost every IBM PC ran in the 1980s. A program asks it for a key, a file or some memory through interrupt 21h, a software call to the operating system. os8088's DOS answers the same calls, and reports itself as DOS 3.30. The program cannot tell the difference.

Each DOS window keeps its own set of the addresses a program uses to reach DOS, the BIOS, the timer and the keyboard. os8088 puts that set in place when the program's turn comes and takes it away when the turn ends, so a program sees only its own. That exchange is most of what running in a window costs.

IBM's TopView and Quarterdeck's DESQview ran DOS programs side by side on the same processor in the 1980s. os8088 does it from a graphical desktop, and the DOS programs share the machine with its own programs.

See it

The setting that puts a program in its window, and the ways to start one.

DOS
A DOS window with its Program menu open. The menu lists Run, Setup, Full Screen and Run in Window, which is marked with a star. Behind it the console shows a test program's output, the line doshello.COM ended, exit code 042, Arena 128KB, then a DIR listing of drive B and a new B prompt.
Run in Window is a setting. While it is ticked, every program typed at the prompt runs in the window, one after another, and the prompt comes back there.
DOS
The DOS Setup page for B:\DWTICK.COM. It reads Est DOS Ram (Current Machine): 128KB+, with Inside the OS selected, Hard drives and Network greyed, an empty Limit field, Shut down the OS, and at the bottom a ticked Run in a window box beside a greyed Close when done box.
What a window is given. The plus sign means the figure grows for a program whose header asks for more.
Disk
An os8088 Disk window for drive B with four files: BOUNCE.O88 with its own icon, and DOSHELLO.COM, DWFS.COM and DWTICK.COM, each drawn with a small DOS icon.
DOS programs beside an os8088 program, on one floppy. Each .COM and .EXE gets an icon built from DOS's own. A double-click runs it on the whole screen.
DOS
A DOS window whose path box reads B:\DWTICK.COM. The console says Not started: Shift or Alt was held. Run, or Enter on an empty line, starts it. The prompt reads B:\.
Opened, not run. Holding Alt during the double-click stops at this point, so Run in Window can be ticked before the program starts.

What works in a window

Text programs run live; the rest have somewhere to go.

Several at once

Each DOS window is a separate copy of DOS, with its own program, its own memory and its own keys. Two DOS windows run two programs while the rest of the desktop keeps going. A program waiting for a key gives its time to the others.

Alt+Enter and graphics

Alt+Enter takes a running program to the whole screen without stopping it. Alt+Enter again brings it back to its window, paused on its last screen, and a third resumes it on the whole screen. A program that switches to a graphics mode moves to the whole screen by itself, before it draws anything, and stays there.

The mouse

A DOS program that reads the mouse gets it in its window. The window is its 80-by-25 screen, and a click counts only when the window is already in front. The click that brings a window forward belongs to the desktop.

Programs that write the screen themselves

A program written for TopView asks where to write, and is told the window. WordPerfect 4.1 is one. A program that writes the screen without asking can be caught on a PC with a second display card, whose memory the desktop is not using. Microsoft Works 1.05 runs in a window on a PC with both a Hercules and a CGA card.

Closing a window

Closing a DOS window stops its program through DOS's own exit, so its files are closed. A note left sounding on the PC speaker is turned off, and the timer and interrupt settings the program changed are put back.

Shortcuts with no window

A shortcut saved with Close when done ticked runs its program on the whole screen with no DOS window behind it, only a one-line status while it loads. Leaving the window out gives the program 20 KB more memory. A refusal or a non-zero exit code ends in a short notice on the desktop; a clean exit says nothing.

Three ways to run

A window, the whole screen, or the whole machine.

Run in Window keeps the program on the desktop. It gets a fixed amount of memory rather than the machine, so a second window has room to run. A program too large for that reads its own header: WordPerfect 4.1 gets 144 KB, its requirement rounded up to the next 16 KB. A figure typed in the Limit field always wins.

Run, with the setting cleared, gives the program the screen. The desktop waits until it exits, then resumes. This is the default, and it is how a double-clicked program starts. On a 640 KB IBM 5150 with the 360 KB system disk, a program gets 437 KB this way.

Shut down the OS unloads os8088 and leaves only a disk reader and the code that answers DOS calls. On a machine with a hard disk, the session is saved there first and comes back when the program exits. On a floppy-only machine DOS asks before it goes, because every open window is lost and the machine restarts.

A program that does not fit reports Program too big to fit in memory, as DOS did. In a window, the message suggests raising the Limit instead.

What ran

Twelve of fifteen on the whole screen, and three in a window.

Fifteen real DOS programs were tested on an emulated 8088, a simulated processor running at 4.77 MHz, with VGA graphics. Twelve ran. Aldo, Joust, Rockford, Number Munchers, Star Trek and Boloball ran on the whole screen with os8088 still loaded.

Six needed Shut down the OS for more memory. Commander Keen 2 reached the title level. Tom & Jerry reached level select. Chip 'n Dale reached the high-score table. Battle Chess reached the title screen. Test Drive reached the adapter menu. Test Drive III ran through the intro. These results do not establish that every part of each game works.

The other three did not produce a running result. One required a .BAT batch file, a file containing a sequence of commands, which DOS cannot interpret. Another was slow while unpacking 316 KB of compressed data on the 4.77 MHz machine. The last was not reached because of a limit in the automated test setup.

In a window, on an emulated IBM PC with Hercules graphics, a monochrome card from 1982: WordPerfect 4.1 edits, with a typed letter on the screen 0.20 to 0.35 seconds after the key, against 0.12 to 0.23 on the whole screen. Galaxy Trek, a compiled BASIC game from 1983, plays. Microsoft Works 1.05 runs on the same PC with a CGA card added.

WordPerfect and Galaxy Trek both use DOS 1's file calls, which name a file through a block in the program's own memory, the file control block. os8088's DOS answers that family of calls as well as the newer ones.

A command interpreter with no file behind it

How an installer can copy files through a command interpreter that is not on disk.

COMMAND.COM is the DOS command interpreter, the program that carries out typed commands. DOS programs also ask it to perform jobs such as copying or deleting files. os8088's DOS recognises requests to run this name. It carries out the requested command and returns to the program. There is no COMMAND.COM file on disk and nothing is loaded.

The supported commands are COPY, XCOPY, MOVE, DEL (ERASE), REN (RENAME), MD (MKDIR), RD (RMDIR), CD (CHDIR), TYPE, VER, ECHO and REM. The same commands, and DIR, work at the prompt, where they never leave the window.

Prince of Persia's hard-disk installer asks COMMAND.COM to copy its files. The installer runs to completion. It leaves all 28 game files with sizes matching exactly to the byte. It also deletes itself as intended.

What it does not do

A window helps a program that prints. It does nothing for one that draws.

  • On a PC with one display card, a program that writes the screen memory itself without asking shows nothing in its window. On a CGA desktop it draws over the desktop. Run it on the whole screen.
  • A program in a graphics mode has no text to show in a window. Once it moves to the whole screen it stays there until it exits.
  • Every window takes its program's memory for as long as the program runs. How many fit at once depends on the machine's memory and on what else is open.
  • Two programs that play music at the same time share the PC's one timer, and the first to finish can upset the other's notes.
  • There is no interpreter for .BAT batch files.
  • DOS is not on the 128 KB build of os8088.
  • This is a DOS for DOS programs, not a copy of MS-DOS. A call it does not implement is refused rather than answered wrongly.

If your program is a game that draws its own screen, the window adds nothing to what the whole screen already gave it. If it is a text-mode program, it now runs beside everything else.

Try it

DOS ships in APPS on all four system floppy sizes, and on the live USB image and live CD.

  1. Boot os8088 from the system disk. Put a floppy holding DOS programs in the second drive.

  2. Open the APPS folder on the system disk and double-click DOS. Choose Program > Run in Window; the item is marked with a star while it is on.

  3. Type B: and press Enter, then type a program's name. It runs in the window, and the prompt returns there when it ends.

  4. Open DOS a second time and do the same, to run two programs at once. Press Alt+Enter to take a running program to the whole screen.

  5. To start a program from a Disk window in its window, hold Alt while you double-click it, or Shift while you press Enter on it. Tick the setting, then press Run. Save Shortcut on the Setup page keeps the choice for next time.