comp.lang.ada
 help / color / mirror / Atom feed
* FreeDOS, Janus/Ada and GNAT
@ 2019-07-04  9:04 joakimds
  2019-07-04 13:09 ` joakimds
  2019-07-05 20:09 ` Randy Brukardt
  0 siblings, 2 replies; 5+ messages in thread
From: joakimds @ 2019-07-04  9:04 UTC (permalink / raw)


FreeDOS is an open source implementation of MS-DOS and in June 2019 celebrated 25 years in existence. In it there is an application called DIMPLES that is the package manager for FreeDOS. DIMPLES is like pip for Python, apt (aptitude) for Debian systems, and so on. To compile Ada applications in FreeDOS one can use the DJGPP compiler which is a port of gcc (GNAT) to FreeDOS (and one can use DIMPLES to install it if it is not already installed). It works well except that it cannot create an executable from Ada code that uses tasks. So if one wants to make Ada applications for FreeDOS there can be no tasking. This has to do with how tasking in GNAT is implemented. On Windows, Mac OS X and Linux the tasks are
mapped in a one-to-one correspondance to OS-threads (at least my understanding).
FreeDOS does not support or provide threads and is a single thread/task operating system. It has therefore not been a trivial exercise to port the standard GNAT-Runtime support for tasks to FreeDOS.

There is another Ada compiler called Janus/Ada where tasks are not mapped by the Ada-Runtime to OS-threads and an Ada application built with Janus/Ada is effectively a single thread application no matter how many tasks are used in the Ada code. Considering the task implementation by Janus/Ada, it sounds like a perfect fit for FreeDOS. Of course Janus/Ada produces win32 applications and not DOS application but there is a DOS Extender called HX DOS which can execute many win32 applicatins on FreeDOS. Trying it out reveals that there are three win32 calls which HX DOS could not emulate:

import not found: InitializeSListHead
import not found: GetModuleHandleExW
import not found: FindFirstFileExW

If HX DOS could be extended to emulate these calls then Janus/Ada can *probably* be used to build multi-task executables for FreeDOS. Jim Hall (creator of the FreeDOS project) wrote in April 2009 on the subject of multi-tasking in DOS:
"People sometimes ask me what I'd love to see in a future version of DOS.
I would like to see some level of running multiple applications at once.
...
True multitasking would be ideal, but I'd be happy if we supported
the simpler "task switching" - this would be a huge leap forward for FreeDOS.
..."

One area where FreeDOS can be used today is in embedded systems (and it has been used there). The implementation of FreeDOS requires the CPU to be x86 and many embedded systems are nowadays ARM based (which rules out FreeDOS). Any known hard-ware vendors where it is known one can run FreeDOS?

To summarize: It is possible today to use the DJGPP (GNAT) compiler to develop single task applications on FreeDOS. It is *almost* possible to run multi-task Ada applications on FreeDOS using the Janus/Ada compiler. AdaCore may have an Ada-Runtime that can support tasking on FreeDOS, but outside the scope of what I know.

Best regards,
Joakim


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-01 21:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-04  9:04 FreeDOS, Janus/Ada and GNAT joakimds
2019-07-04 13:09 ` joakimds
2019-07-05 20:09 ` Randy Brukardt
2019-07-08 12:47   ` joakimds
2021-01-01 21:41     ` Joakim Strandberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox