Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Freepascal, Win98 and realmode DOS (Developers)

posted by Rugxulo Homepage, Usono, 28.07.2026, 23:38

> In 2015, with the release of Free Pascal 3.0.0, support for compiling
> real-mode DOS programs appeared for the first time. It should be noted that
> this has always been, and almost certainly will remain, a cross-compilation
> target from another operating system.

You say that, but with the integrated assembler and linker, it should be easier to build and work with Go32v2 host. Yet nobody needed it badly enough (yet), so I guess it's not properly supported. Last I heard (maybe only rumor), WinXP in VM was used for Go32v2 builds.

> Up to that version, the compiler depended on external utilities borrowed
> from OpenWatcom. Since version 3.2.0, however, no external utilities are
> required anymore.

WLINK, WLIB, and NASM ... if I recall correctly. No longer needed.

> Last week I tested the Win32 cross-compilers targeting the MSDOS platform
> (that is, real-mode DOS). First, you need to install the base package,
> followed by the add-on that enables DOS compilation.

You obviously don't need base binaries or libraries at all, they are incompatible.

> Interestingly, this add-on is about three times larger than the base package itself.

The .PPU files for the generics units take A TON of space (multiply that times six for the various memory models).

> I was unable to use older versions because I could not get the OpenWatcom
> linker (used by those releases) working under HX.

But OpenWatcom (including WLINK) does run under HX, last I heard. Maybe set HDPMI=32

I say that, but I do recall running into LFN troubles and super-long Win32 cmdlines. That could've been solved by JWlink / JWlib and a response file, but nobody was interested. That may have only affected smartlinking (on by default?). Try -CX- . (It was also much slower to compile due to that.)

> Newer version 3.2.2 is not usable either, because it refuses to start under HX,
> complaining about the missing OpenThread function.

Which version of HX? Can't you ignore unsupported imports? Set DPMILDR=128 or 136 .

> This gives you a Pascal compiler for real-mode DOS that surpasses Turbo
> Pascal in many respects.

The code is a bit larger, the memory allocations tend to take a bit more space, but yes there are improvements. {$mode tp} is very good (albeit not default), but there are other modes. Default {$mode fps} gives you structured return types and function overloading. {$H+} gives you heap-allocated strings longer than 255. {$mode $delphi} has heap-based classes. There's also added functions like readstr() and writestr() which are convenient. Oh, and an int64 type. And LFN support. More useful units included. Better {$mode iso} classic ISO 7185 support (lookahead file^ can be helpful).

 

Complete thread:

Back to the forum
Board view  Mix view
23512 Postings in 2224 Threads, 409 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum