Skip to content

This repository contains wmake style makefiles and patches to build Lua 5.4.6 on Open Watcom 1.9 or later. This allows Lua scripts to run on DOS systems in real mode.

Notifications You must be signed in to change notification settings

Lethja/lua-watcom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lua for Open Watcom

This repository contains wmake style makefiles an patches to build Lua 5.4.6 on Open Watcom 1.9 or later. The primary goal for these is to allow Lua scripts to be run on DOS systems in real mode.

Runtime Requirements

To run Lua built by Open Watcom you will need the following:

Requirement Sources/Comment
8088 CPU*
*or compatibiles
like the 8086, V20,
286, 386 etc

Machine emulators
provided as an option
for other ISAs
86Box (GitHub)
DOSBox-X (GitHub)
PCem (GitHub)
PC-DOS 2.1 or higher FreeDOS
DOSBox-X (GitHub)
SvarDOS
At least 320 kilobytes
of total system memory
Any memory above
640 kilobytes is
inaccessible to all
real mode DOS programs
At least 600 kilobytes
of hard disk space or x2
360 kilobyte diskettes
Can be ran directly
from a diskette on
machines without a
hard drive

If in doubt, install DOSBox-X

Build Requirements

To build Lua with Open Watcom you will need the following:

Requirement Sources
Lua 5.4.6 source code lua.org (GitHub)
Open Watcom 1.9 (or later) openwatcom.org (GitHub)
FreeDOS Bonus CD (FDIMPLES)
SvarDOS (PKGNET repository)
DOS operating system
(MS-DOS 5.0 compatible)
FreeDOS
DOSBox-X (GitHub)
SvarDOS
80386 compatible processor*
*Any AMD or Intel CPU 
made in the last 3 decades
is compatible.

Machine emulators provided
as an option for other ISAs
86Box (GitHub)
DOSBox-X (GitHub)
PCem (GitHub)
Qemu (GitLab)
A patching utility GNU Patch
DifPat

If in doubt, install DOSBox-X

How to build

  1. Extract Luas source code
  2. Copy all files in this repository to the src folder of the extracted content
  3. Patch the source code for Watcom:
GNU Patch DifPat
patch luaconf.h luaconf.pat pat luaconf.pat luaconf.h
patch lopcodes.h lopcodes.pat pat lopcodes.pat lopcodes.h
patch lutf8lib.c lutf8lib.pat pat lutf8lib.pat lutf8lib.c

If no patching program is available mimic the changes in each .pat file manually. Patch changes are minimal

  1. Build Lua for real mode DOS with wmake -f watcom_l.mak
    • If successful dist/bin/dos16.exe and dist/bin/dosc16.exe will be created
  2. Clean up object files with wmake -f watcom_l.mak clean
  3. Build Lua for DOS4GW with wmake -f watcom_f.mak
    • If successful dist/bin/dos4g.exe and dist/bin/dosc4g.exe will be created
  4. Clean up object files with wmake -f watcom_f.mak clean

Other targets may work but are untested

About

This repository contains wmake style makefiles and patches to build Lua 5.4.6 on Open Watcom 1.9 or later. This allows Lua scripts to run on DOS systems in real mode.

Topics

Resources

Stars

Watchers

Forks