Skip to content
forked from SvarDOS/edrdos

Enhanced DR-DOS kernel and command interpreter ported to JWasm and Watcom C

License

Notifications You must be signed in to change notification settings

OpenRakis/edrdos

 
 

Repository files navigation

Enhanced DR-DOS kernel and command interpreter

This project maintains the sources of the Enhanced DR-DOS (EDR) kernel and command interpreter ported to

  • the JWasm assembler, version 2.17 or later, and
  • the OpenWatcom toolchain, version 1.9 or later.

This kernel is used by the SvarDOS distribution as its default kernel.

Kernel flavors

The EDR kernel may be built in different flavors. The historic one consists of two files, DRBIO.SYS and DRDOS.SYS. The new one consists of a single file KERNEL.SYS, which gets built by default.

The kernel is compatible with the FreeDOS load protocol. It can be used as a drop in for the FreeDOS KERNEL.SYS by replacing it with the EDR KERNEL.SYS.

Notice that the EDR and FreeDOS kernels are not 100% compatible, especially regarding the drive letter ordering and the expected format of the config.sys files.

Binary snapshots

Binaries and a 1.44M floppy image are built automatically through Github actions. To download them, go to the actions page, and then click the last successful workflow build job. The files are provided under the artifacts section.

Build instructions

I was able to successfully build the kernel and command interpreter under DOS, Win32, Linux and MacOS.

Requirements

The makefiles expect the following executables to be present:

  • jwasm, for DOS it is jwasmd
  • wmake
  • wlink
  • exe2bin
  • and wcl if building command.com.

Building under UNIX-like operating systems

If you build under a UNIX-like operating system, make sure to build the tools under the ltools/unix directory first by invoking make inside the directory. The default cc (usually GCC or CLANG) should be able to successfully build the binaries.

Also make sure that $WATCOM/h is in your INCLUDE path prior building the command processor, as the owsetenv.sh provided by OpenWatcom v2 puts $WATCOM/lh into the INCLUDE path. However, when building DOS applications this is the wrong include directory. You will encounter the following error message if the path is wrong:

wcc -q -os -s -dFINAL -dPASSWORD -dWATCOMC -i=. -Fobin/com.obj com.c
/opt/watcom/lh/setjmp.h(51): Error! E1185: Invalid register name 'eax' in #pragma

Building single-file kernel

You may build the single-file version of the kernel and the command interpreter by calling the OpenWatcom wmake utility via wmake from the project root directory. The kernel file is named KERNEL.SYS, and the command interpreter is named COMMAND.COM. Both files are placed under the bin directory.

Building dual-file kernel

You may build the historic dual-file version of the kernel consisting of DRBIO.SYS and DRDOS.SYS by invoking wmake SINGLEFILE=0 from the project root directory. The generated kernel binaries and COMMAND.COM will be placed under the bin directory.

Building an uncompressed kernel

You may generate uncompressed kernel binaries by giving COMPRESSED=0 to the wmake calls above.

Version and Git revision

Version and revision information may be given to wmake via VERSION=<YYYYMMDD> and / or GIT_REV=<8-digit commit hash>. This info is shown upon kernel boot. If this information is not provided, ? is displayed instead.

The helper script build.sh can be used under Unix like operating systems to call wmake with VERSION set to the current date and GIT_REV to the current Git revision.

Cleaning the tree

Run wmake clean in the project root directory to remove the files created during build.

Installation

After building, make sure that the bin directory contains

  • DRBIO.SYS and DRDOS.SYS, or KERNEL.SYS
  • COMMAND.COM
  • SYS.COM

Using SYS under DOS

Under DOS, you may use the provided SYS command to make a bootable disk. To make a bootable floppy, insert a freshly formatted disk into drive A: (you may have to substitute the drive letter).

Then invoke:

SYS A:

from within the directory containing the files mentioned above. The SYS command then copies DRBIO.SYS, DRDOS.SYS and COMMAND.COM onto the floppy and installs a boot loader to make the floppy bootable, or KERNEL.SYS and COMMAND.COM if the single-file kernel was built.

You may also manually copy the kernel and command interpreter over to the drive to be booted, like so for the single-file version:

SYS A: /BOOTONLY
COPY KERNEL.SYS A:\
COPY COMMAND.COM A:\

SYS is then only used to install a proper bootloader. If it is already installed, you may skip the first step. But you then have to make sure that the boot loader already installed "speaks" the right protocol. This is the FreeDOS boot protocol for KERNEL.SYS, and the EDR boot protocol for DRBIO.SYS and DRDOS.SYS.

Technically, you can also use DRBIO.SYS with the FreeDOS boot prococol, but then you have to rename it to KERNEL.SYS. Otherwise, the bootloader will not find its kernel.

Using mkimage.sh under UNIX-like operating systems

Under Linux and MacOS you may invoke sh mkimage.sh from the image directory. This generates a bootable 1.44M floppy image edrdos.img including a minimal fileset to get you running: the kernel, command interpreter and the SYS utility.

Make sure to build the binaries prior to running this script.

To build a dual-file image, run sh mkimage.sh dualfile instead.

The script depends on Mtools and dd being installed.

Components provided by the FreeDOS project

The provided SYS command is part of the FreeDOS kernel repository The binary was built from this specific commit.

FreeDOS SYS is distributed under the GNU General Public License, v2 or any later version.

The code for the installed bootsector comes from FreeDOS.

About

Enhanced DR-DOS kernel and command interpreter ported to JWasm and Watcom C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Assembly 75.7%
  • C 23.4%
  • Other 0.9%