[SOLVED] Any 16 bit c compilers for 64 bit windows?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
MeowingOSDev156
Posts: 3
Joined: Wed Jul 08, 2015 7:20 pm
Libera.chat IRC: MeowingOSDev156
Contact:

[SOLVED] Any 16 bit c compilers for 64 bit windows?

Post 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?
Last edited by MeowingOSDev156 on Fri Jul 10, 2015 8:10 pm, edited 1 time in total.
~Gabriel, developer of Meowing OS
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: Any 16 bit c compilers for 64 bit windows?

Post 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).
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: Any 16 bit c compilers for 64 bit windows?

Post by alexfru »

Check out my Smaller C on github.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Any 16 bit c compilers for 64 bit windows?

Post by iansjack »

How about the Open Watcom compiler?
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: Any 16 bit c compilers for 64 bit windows?

Post by alexfru »

I highly discourage OW because it has serious bugs.
User avatar
MeowingOSDev156
Posts: 3
Joined: Wed Jul 08, 2015 7:20 pm
Libera.chat IRC: MeowingOSDev156
Contact:

Re: Any 16 bit c compilers for 64 bit windows?

Post 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.
~Gabriel, developer of Meowing OS
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Any 16 bit c compilers for 64 bit windows?

Post 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.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: Any 16 bit c compilers for 64 bit windows?

Post 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.
User avatar
MeowingOSDev156
Posts: 3
Joined: Wed Jul 08, 2015 7:20 pm
Libera.chat IRC: MeowingOSDev156
Contact:

Re: Any 16 bit c compilers for 64 bit windows?

Post 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?
~Gabriel, developer of Meowing OS
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: Any 16 bit c compilers for 64 bit windows?

Post 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

Code: Select all

This is a DOS/4G executable
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?
Post Reply