Compiling for Windows 1.0 DR5 - Working toolchain

Discuss MS-DOS, Windows 1, 2 and 3.
Post Reply
jagotu
User avatar
FTP Access
Posts: 517
Joined: Mon Feb 04, 2013 5:03 pm
Location: Czechia
Contact:

Compiling for Windows 1.0 DR5 - Working toolchain

Post by jagotu »

Hi,
I finally got a semi-working toolchain for compiling DR5 apps. It works on DosBox.

There is one major thing you need to take care of when compiling the apps included with DR5 - all of the makefiles specify "-Asnwa" for cc as the parameters. The included cc doesn't support "-Aa", so you have to replace it with just "-Asnw". All the included samples have this change done.

Also, we are completely missing "SWLIBC.LIB". For apps that don't try to use it, you can skip through questions about it just fine. However, apps that use the libc's functions, for example the floating point operations, will not compile. The compiled obj wants to import "__acrtused", which I satisfied by adding it to MC.DAT. If you supply your own working libc, make sure to remove it from there, so that you can initialize your libc properly.

The template compiles fine - just do "path C:\bin", "cd samples\template", "make template" and you're good to go!

Download: https://idgaf.hurrdurr.cz/DR5_toolchain.zip
Image
Windows TEN - Totally Erroneous Numbering
Always watching you...

dfawcus
Posts: 76
Joined: Sat Apr 29, 2017 2:21 pm

Re: Compiling for Windows 1.0 DR5 - Working toolchain

Post by dfawcus »

I was able to use Borland C simply by fixing the windows C startup module (examples/startup/c0w.asm).

Since Windows 1.0 does not support the GetWinFlags API, remove that call and replace with suitable hardcoded values.

jagotu
User avatar
FTP Access
Posts: 517
Joined: Mon Feb 04, 2013 5:03 pm
Location: Czechia
Contact:

Re: Compiling for Windows 1.0 DR5 - Working toolchain

Post by jagotu »

dfawcus wrote:I was able to use Borland C simply by fixing the windows C startup module (examples/startup/c0w.asm).

Since Windows 1.0 does not support the GetWinFlags API, remove that call and replace with suitable hardcoded values.
So you managed to compile apps for DR5 before?
Windows TEN - Totally Erroneous Numbering
Always watching you...

xelloss
User avatar
Donator
Posts: 323
Joined: Sun Aug 18, 2013 7:26 pm
Location: Edinburgh, Scotland

Re: Compiling for Windows 1.0 DR5 - Working toolchain

Post by xelloss »

jagotu wrote:Hi,
I finally got a semi-working toolchain for compiling DR5 apps. It works on DosBox.
Since you have been doing some development tests with DR5, what is your impression of its API?
I remember that the templates seemed to be structured quite differently from the usual message loop style. Overall, how far it is from Windows 1.01 RTM?

DiaoSlime
FTP Access
Posts: 94
Joined: Tue Apr 21, 2015 2:50 pm
Location: Hong Kong

Re: Compiling for Windows 1.0 DR5 - Working toolchain

Post by DiaoSlime »

How do you make the toolchain?

我從使用 Tapatalk 的 LG-D722 發送

dfawcus
Posts: 76
Joined: Sat Apr 29, 2017 2:21 pm

Re: Compiling for Windows 1.0 DR5 - Working toolchain

Post by dfawcus »

jagotu wrote:
dfawcus wrote:I was able to use Borland C simply by fixing the windows C startup module (examples/startup/c0w.asm).

Since Windows 1.0 does not support the GetWinFlags API, remove that call and replace with suitable hardcoded values.
So you managed to compile apps for DR5 before?
Sorry. I meant I was able to use the above scheme to compile a program which then ran on RTM Windows 1 (1.03 or 1.04) I believe.

RubyTuesday
User avatar
Donator
Posts: 76
Joined: Mon Jan 12, 2015 1:33 pm

Re: Compiling for Windows 1.0 DR5 - Working toolchain

Post by RubyTuesday »


jagotu
User avatar
FTP Access
Posts: 517
Joined: Mon Feb 04, 2013 5:03 pm
Location: Czechia
Contact:

Re: Compiling for Windows 1.0 DR5 - Working toolchain

Post by jagotu »

I can't edit the first post, so I just wanted to say that the download was moved here:
https://betawiki.net/files/DR5_toolchain.zip
Windows TEN - Totally Erroneous Numbering
Always watching you...

Post Reply