Computing: DOS, OS/2 & Windows Programming

Installing and running Artek ADA on FreeDOS.

"Ada is a structured, statically typed, imperative, and object-oriented high-level programming language, inspired by Pascal and other languages. It has built-in language support for design by contract (DbC), extremely strong typing, explicit concurrency, tasks, synchronous message passing, protected objects, and non-determinism. Ada improves code safety and maintainability by using the compiler to find errors in favor of runtime errors."

The paragraph above is how ADA is described in Wikipedia. ADA remounts to the 1980s, but because of its safety-critical support features, it is still used today in military applications, as well as in commercial projects where a software bug can have severe consequences (avionics and air traffic control, rockets and satellites, railway transport and banking, ...). For ADA programming on Windows in the 21th century, cf. my tutorial Modern Ada development using GNAT from AdaCore.

This tutorial is about the installation and usage of Artek ADA 1.25 (released in 1987) on FreeDOS; it should apply to other DOS platforms as well.

You can download the Artek ADA development system from the Vetusware website. The download archive contains the distribution diskettes files. I unpacked the ZIP on my Windows 10 and created a CD ISO to transfer them to my FreeDOS VMware Workstation 16 virtual machine.

Being in the root directory of the C: drive, and F: being my CD-drive, here is how I copied the files from the CDROM to the harddisk:
    mkdir ada125
    cd ada125
    f:
    copy *.* c:

The screenshot shows the content of the installation directory.

Artek ADA on FreeDOS: Content of the installation directory

As you can see on the screenshot, there are several executables:

This sounds complicated. But, you will see that, even if it is unusual, it's not as hard as it seems.

Here is the ADA code of a simple "Hello World" program (I called it hello.ada):
    with TEXT_IO; use TEXT_IO;
    procedure HELLO is
    begin
        PUT ("Hello World from Artek ADA!");
    end HELLO;

Lets see how to open this file in ae.exe. The screenshot shows the editor at start-up. The UI is divided into 2 windows: at the top the editor (for the source code), at the bottom the commands menu. To switch between the two windows use the ESC key.

Artek ADA on FreeDOS: The Artek ADA editor AE.EXE

To load the sources of hello.ada into the editor, switch to the bottom window, and choose F(ile) and then L(oad). You can either enter a filename, or push the "arrow down" key to display a directory listing. This listing appears in the editor window, and you can use the arrow keys to select the file that you want to load. Press ENTER to do so.

Artek ADA on FreeDOS: Loading a source file into the ADA editor

Note: If during file load you get the message "Are you sure you want to lose edits (Y/N)?" (I got it the first time when I loaded a file, no more afterwards), you have to answer with Y to actually load the file.

The screenshot below shows our source file hello.ada, opened in ae.exe. As I said before, there is neither syntax highlighting, nor syntax checking. And to compile the program we have to leave the editor and do it from the command line.

Artek ADA on FreeDOS: ADA source file opened in the AE.EXE editor

To compile the ADA source file, run the command
    ada hello
As you can see on the screenshot, there are no files created by the compiler. The generated output (corresponding to the files hello.adb and hello.ads) will be included in the ADA library (cf. further down in the text).

Artek ADA on FreeDOS: Compiling an ADA source file using ADA.EXE

If there are errors in the source, they will be listed here. In that case, there will also be a file named hello.err created. This file contains the error messages, is however not really useful. In fact the complete messages are output as a single line!

We can use the librarian linklib.exe to view the output of the compiler. Run the command
    linklib /l
to display the content of the default library ada.alb.

Artek ADA on FreeDOS: Display of the content of the default library ada.alb

Note: The "sample1" files are not part of the original library. The reason why they appear on the screenshot is that I compiled sample1.ada before...

The program linklib.exe is a librarian, but it is also a linker. To link the "hello" files in the ada.alb library (creating an A-code file), run the command
    linklib hello

Artek ADA on FreeDOS: Linking some files located in the library ada.alb

The A-code file hello.axe can be run using the ADA interpreter ai.exe:
    ai hello

Artek ADA on FreeDOS: Running an A-code file using the ADA interpreter ai.exe

Note: When using the linker linklib.exe or the interpreter ai.exe, their input file has to be specified without file extension (for the compiler ada.exe, you can, but mustn't specify an extension).

The translator a86.exe should allow to translate an A-code file (.axe file) into a DOS executable (.exe file). As I said before, I did not succeed to do it. With all files, that I tried, I got the error message Error 1. File not found in read_ar_info(large). This is not really tragic. On modern computers the execution speed of the interpreted file should be largely sufficient. And if you want to run the program on another computer, just copy ai.exe (possibly other files, too) to there. It's the same with other interpreted languages (e.g. Perl, or Python).

Artek ADA on FreeDOS: Failure when trying to create a DOS executable

Once the program (.axe file) created, the files in the ada.alb library are (normally) no longer needed. To remove the "hello" files from the library, use the command:
    linklib hello /d

Despite deleting not needed files in the library, the file ada.alb grows over time. You can reorganize the library using the command:
    linklib /r

Except for the readme file, the distribution disks don't contain any documentation. Concerning the ADA programming language, there are several books available on the Internet as downloadable PDF files. Be however aware, that if you use code from them, you might get errors when compiling with the Artek compiler. Have a look at the provided example programs to learn the correct syntax of Artek ADA.


If you find this text helpful, please, support me and this website by signing my guestbook.