Page 1 of 1
[SOLVED] Any 16 bit c compilers for 64 bit windows?
Posted: Thu Jul 09, 2015 2:33 pm
by MeowingOSDev156
I have a 64 bit windows computer and I am developing a 16 bit OS. I would like to use C, but I can't find a 16 bit compiler that runs on 64 bit windows. Does anyone know of one that works on 64 bit?
Re: Any 16 bit c compilers for 64 bit windows?
Posted: Thu Jul 09, 2015 3:14 pm
by Roman
Hi. You can use DOSBox for running a DOS-compatible compiler. But I would discourage you from doing that, real mode is obsolete (32-bit is too actually).
Re: Any 16 bit c compilers for 64 bit windows?
Posted: Thu Jul 09, 2015 3:18 pm
by alexfru
Check out my Smaller C on github.
Re: Any 16 bit c compilers for 64 bit windows?
Posted: Thu Jul 09, 2015 3:52 pm
by iansjack
How about the Open Watcom compiler?
Re: Any 16 bit c compilers for 64 bit windows?
Posted: Thu Jul 09, 2015 5:05 pm
by alexfru
I highly discourage OW because it has serious bugs.
Re: Any 16 bit c compilers for 64 bit windows?
Posted: Thu Jul 09, 2015 6:49 pm
by MeowingOSDev156
Open Watcom doesn't work on 64bit. I could use Dosbox, I think I remember being able to do a startup script for dosbox, so I could tell it to mount the WATCOM folder, compile my files and exit. I'll look into Smaller C, since I don't really want to have dosbox run every time I want to test my os. Also, I would use 32 bit, but the BIOS's interrupts make things a lot easier.
Re: Any 16 bit c compilers for 64 bit windows?
Posted: Thu Jul 09, 2015 8:29 pm
by SpyderTL
MeowingOSDev156 wrote:I would use 32 bit, but the BIOS's interrupts make things a lot easier.
The 1 MB memory limitation will eventually make things a lot more difficult.
You can pretty much forget any audio support, graphics, video, or large data sets. If you want any of these features, you'll at least need to switch to 32-bit protected mode.
But, for now, you should probably stick with 16-bit mode until you get comfortable with the environment and the platform.
Good luck. Let us know if you run into any problems.
Re: Any 16 bit c compilers for 64 bit windows?
Posted: Thu Jul 09, 2015 8:37 pm
by alexfru
MeowingOSDev156 wrote:Open Watcom doesn't work on 64bit.
OW 1.9 works for me on Windows 7 x64.
But like I said earlier, it's buggy.
Re: Any 16 bit c compilers for 64 bit windows?
Posted: Thu Jul 09, 2015 10:27 pm
by MeowingOSDev156
OW works on 64bit and generates 16bit code? I must have an outdated version. Anyways, Smaller C works well. How do you mark this as solved?
Re: Any 16 bit c compilers for 64 bit windows?
Posted: Fri Jul 10, 2015 3:13 am
by alexfru
MeowingOSDev156 wrote:OW works on 64bit and generates 16bit code? I must have an outdated version.
My OW 1.9 is set up like this:
Code: Select all
WATCOM=C:\WATCOM
INCLUDE=%WATCOM%\H;%WATCOM%\H\NT
PATH=...;%WATCOM%\BINNT;...
Suppose, you have a hello-world program in hw.c.
Here's how to make a 16-bit DOS .exe out of hw.c:
Code: Select all
wcl /q /wx /we /k8192 hw.c /fe=hw16.exe
Here's how to make a DPMI/DOS4G .exe out of hw.c:
Code: Select all
wcl386 /q /wx /we /l=dos4g hw.c /fe=hw4g.exe
For some reason I need to copy C:\WATCOM\binw\wstub.exe to the current directory for the last command to succeed (probably, something isn't configured correctly). Otherwise I'm getting this warning:
Code: Select all
Warning! W1093: cannot open wstub.exe
and hw4g.exe only prints
instead of
Code: Select all
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
Hello, World!
But copying wstub.exe to the current directory lets the compiler find this stub.
MeowingOSDev156 wrote:Anyways, Smaller C works well. How do you mark this as solved?
Can't you change the subject of the original post by adding [SOLVED] to it?