Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simso — DOS / Turbo C++ 3.0 build

The original MS-DOS operating-system simulator: a round-robin scheduler with Banker's-style deadlock avoidance, drawn with Borland's BGI graphics through the LIBREGRA widget library and driven by a mouse (int 33h) via RATON. This folder builds and runs it under DOSBox with the original toolchain.

There's also a modern Linux/ncurses port of the same simulator that builds with GCC/Clang or Fil-C, no emulator needed. This README is for the period DOS build.

Contents

File Purpose
simso.c The original program (build target)
LIBREGRA.H / LIBREGRA.LIB BGI UI widgets (boxes, buttons, panels, 3D text, checkboxes, images)
RATON.H / RATON.LIB Mouse driver wrappers (int 33h)
LIBTEST.C Optional toolchain smoke test (build first to verify the pipeline)
Disk01.img ... Disk05.img Turbo C++ 3.0 install floppies (720 KB each)
install.conf DOSBox config to install the compiler from the floppy images
dosbox-simso.conf DOSBox config to build & run
BUILD.BAT Makes EGAVGA.OBJ, then compiles + links (run inside DOSBox)

Toolchain facts (confirmed from the repo)

  • Compiler: Turbo C++ 3.0 (disk 1 identifies itself as such; the .LIB files were built with the sibling Borland C++ 3.1 core - same OMF, same BGI). Installs to C:\TC.
  • Memory model: MEDIUM (-mm): far code, near data. The libraries use per-module code segments with all data in DGROUP and no FAR_DATA/AHINCR. simso.c must be compiled -mm or the link fails with segment/fixup errors.
  • BGI driver is linked, not loaded: LIBREGRA references _registerbgidriver / _EGAVGA_driver, so the final link needs EGAVGA.OBJ (made with BGIOBJ) plus GRAPHICS.LIB. BUILD.BAT does the BGIOBJ step.
  • Install disks: five 720 KB floppies (512,9,2,80), INSTALL.EXE on disk 1.

Runtime assets (missing)

simso.c loads two saved BGI images while drawing the CPU box: imagen("CPU.IMG", ...) and imagen("EJEMPLO.IMG", ...). Neither file is in the repo. imagen() returns an error code rather than crashing, so the program still runs - those two inset bitmaps just stay blank. Drop CPU.IMG and EJEMPLO.IMG next to simso.c if you have the originals.

Requirements

  • DOSBox (or DOSBox-X).
  • The Turbo C++ 3.0 floppy images (already in this folder).

1. Install the compiler (once)

Launch DOSBox from this folder so the relative paths in the config resolve:

cd /path/to/simso-dos
dosbox -conf install.conf

At A:\>:

  1. Type INSTALL.
  2. Source drive A:, install to C:\TC, accept the default components.
  3. On each "insert next disk" prompt, press Ctrl+F4 to swap the mounted floppy image to the next one, then continue. Repeat through disk 5.
  4. When it finishes: D: then BUILD (you can build in the same session).

The compiler lands in extras/TC on the host (mounted as C:\TC). One-time only.

2. Build & run

cd /path/to/simso-dos
dosbox -conf dosbox-simso.conf

At D:\>:

BUILD          rem makes EGAVGA.OBJ once, then compiles simso.c (-mm) + links
SIMSO          rem run it

To sanity-check the toolchain before the real build, set MAIN=LIBTEST.C at the top of BUILD.BAT, run BUILD, then LIBTEST - a titled box + text that closes on a mouse click means compiler + BGI + libs + mouse all work.

Build by hand / from the IDE

cd C:\TC\BGI
BGIOBJ EGAVGA
copy EGAVGA.OBJ D:\
d:
BCC -mm -IC:\TC\INCLUDE -LC:\TC\LIB simso.c LIBREGRA.LIB RATON.LIB EGAVGA.OBJ GRAPHICS.LIB

From the IDE (TC): make a project with simso.c, LIBREGRA.LIB, RATON.LIB, EGAVGA.OBJ, GRAPHICS.LIB, and set Options -> Compiler -> Code generation -> Model = Medium.

Troubleshooting

  • Segment / "pointer types" / fixup errors -> wrong model; confirm -mm.
  • BGI Error: Graphics not initialized / blank screen -> EGAVGA.OBJ not linked; re-run the BGIOBJ EGAVGA step.
  • Unable to open 'GRAPHICS.LIB' -> add -LC:\TC\LIB.
  • imgmount complains about the image -> geometry is -size 512,9,2,80 (already set); make sure the filenames/paths match.
  • Mouse does nothing -> give the DOSBox window focus; no host driver needed.
  • CPU box images blank -> add CPU.IMG / EJEMPLO.IMG (see Runtime assets).

Credits

Original DOS / Turbo C++ 3.0 project and the LIBREGRA / RATON libraries by Eduard Garcia and Lloren Llado. LIBTEST.C is a new test harness, not part of the original.

About

Original Operating System Simulation - DOS/Turbo-C

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages