Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

DJGPP love Window$ ? (Developers)

posted by Rugxulo Homepage, Usono, 15.09.2013, 20:32

> > OK guys, i understand using djgpp on my dos only pc.
> > So i ask ..i've a puppy lucid linux pc : it's difficult create a cross
> > compiler usind djgpp?

In theory, not difficult. In practice, often yes. That's because of no interest upstream (or even barely downstream), hence it's not really a well-tested setup. Most of the focus is on other platforms, so it probably needs patches (e.g. check GCC481S.ZIP, not the official GNU sources, there's some minor differences).

> > I've make some build with gcc under puppy with full success, so it's not
> a
> > trouble it's possible setting up a cross compiler adding the required
> > files?

I think the compiler proper must be configured for target. Then you need cross-binutils (assembler, linker, etc.) as well as libs, headers, auxiliary tools, etc.

> > The libraries used for build in dos remain the same used for build on
> > linux?

The DJGPP libraries are still needed to (cross-)link DOS binaries atop a Linux host, yes. No, DJGPP doesn't (usually) use Linux ELF, so you can't (usually) mix COFF and ELF.

> > I'ma little confusing regarding this mode of compiling bianries, but i
> 've
> > understand most dos programs are build with cross compiling..

Not all programs are cross-compiled, no. But sadly most people find it easier to just assume LFNs, and for many years the easiest way was to just use NTVDM. However, that is deprecated to hell and back, so it's mostly not relevant nor very useful anymore. Though if you have XP, use it, enjoy, but XP is mostly phased out these days (and successors are worse for DOS).

So you can natively build things, and that is probably (IMHO) a preferred way, but most projects don't. Especially things like "./configure && make" rely on Bash and lots of POSIX utils (grep, awk, sed, coreutils), and ./configure (for whatever reason) doesn't natively work in Bash atop pure DOS, even with LFNs enabled (though DOSEMU is mostly okay).

> I do not think cross compiling will be easier. Also when I make a program
> in a Windows XP DOS box I always have to make additional changes then so it
> will work fine in real mode DOS. So cross compiling for DOS with Linux and
> the result works just fine in real mode DOS - I doubt that.

The DPMI host in Windows is different than that used in DOS. Sometimes that can be a problem, but for normal use it should be fine. DJGPP v2 exclusively uses DPMI (with wrappers around other memory types in pure DOS behind the scenes). If you don't do anything extender specific (and avoid bugs), you'll be okay, hopefully. :-)

You can (in theory) cross-compile bit-exact binaries the same as in pure DOS. Like I said, I build p7zip in several ways, and the md5sum of the .EXE matched exactly since I used the same exact tools and libraries. But often that's not feasible (without lots of patching) because it wasn't directly tested (by design or ignorance) in raw DOS. Well, it's a bit naive to expect a POSIX port of 7-Zip to support much (if any) DOS since DOS really isn't POSIX. I'm just saying, bad assumptions are the bane of portability.

> What you could do is run Qemu on Puppy and have a FreeDOS image with djgpp
> for that - this should work.

You could run DOSEMU with latest DJGPP (but use "dpmi -m 0x7FFFF" first, or similar). Or you can use a cross-compiler. I've used both. There's a slightly older (but still good) prebuilt DJGPP cross-compiler (G++ 3.4.6) for Linux host (and yes, I've used it under Lucid Puppy 5.x) at the Hammer of Thyrion (uhexen2) project, built by Ozkan Sezer:

http://sourceforge.net/projects/uhexen2/files/HoT%20-%20Support%20Files/cross%20compilers/

cross-djgpp-20111002-gcc346.tgz 2011-10-03 16.6 MB

 

Complete thread:

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