Page 1 of 1
Make a real mode OS with C
Posted: Sun Apr 08, 2007 2:20 pm
by matias_beretta
Well, i want to make a real mode os with C...
Questions
-----------
1. What compiler can i use ? Maybe Turbo C?
2. What parameteres must i use for compile it?
3. How can i boot it? Can i save it to a sector and then from assembler call it with int 13h and jump to it?
Lots of thanks
Posted: Sun Apr 08, 2007 3:12 pm
by INF1n1t
I think you should do like all the other people do: create a boot code, put it on a floppy diskette and then play with it to load your os. If you want, you can enter protected mode from there, if you don't want - then you don't write code to enter pmode. So, you stay in real mode.
About the compiler and the parameters - I can't tell you nothing!
thanks
Posted: Sun Apr 08, 2007 3:53 pm
by matias_beretta
lots of tanks infinit... i will start "playing" a little...
anyone has more information about the compiler???
Posted: Sun Apr 08, 2007 8:04 pm
by earlz
Turbo C really is the only real mode C compiler out there now..
Though you will probably need TASM, and last time I checked they haven't made the old versions free
anyone heard of a GCC based 16bit C compiler that has been ported to windows?
Posted: Sun Apr 08, 2007 8:34 pm
by mystran
GCC can compile into "16-bits" theoretically.. you can put ".code16" in an inline asm block, and the result will get compiled as 16-bit, though it'll still use 32-bit registers so it'll get prefixed to 32-bit all the way, and it won't obviously understand anything about segments. But it theoretically "works" if you're happy with the small (or is it tiny?) memory model.
The reason that's the best there is for GCC, is that GCC is designed all the way to assume a flat memory model. AFAIK that's the limit of it's portability. As long as memory's flat, GCC can do, but as soon as it's not, you're better off writing another compiler.
Posted: Sun Apr 08, 2007 8:46 pm
by earlz
I heard a Watcom compiler supports segmentation, though I haven't really looked into it, maybe it compiles to 16bit..
Posted: Sun Apr 08, 2007 9:47 pm
by Happy Egghead
Turbo C 2.00 was released into the Public Domain years ago by Borland. I downloaded it off their site once but they ditched it due to it being old.
It's now available from other sources such as
http://www.programmersheaven.com/downlo ... nload.aspx.
The Borland download page links directly to here if you want a bit more info on getting it to work
http://dn.codegear.com/article/20841.
Turbo C 2.00 takes bit of getting used to as some of the menus are non standard and the in-line assembler sucks. If you can find a copy of Turbo C++ 3 or even better Turbo C++ 4 (DOS version), it's a bit more 'standardised' and a lot more functional (386 assembler instructions, support for both 16 bit and 32 bit targets). Version 3 or 4 is not Public Domain though.
TASM is kind of hard to get hold of but MASM (Microsoft Assembler) isn't. Microsoft used to sell this for a packet then began bundling it with their Windows DDK's (which are free!). So you download the windows DDK for Win 95/98, find the wierdly named ml614.exe file and you have a free assembler. See this link for more details and other assemblers/linkers
http://www.thefreecountry.com/compilers ... lers.shtml.
For old software packages - eBay is your friend! (And mostly legal too)
Posted: Sun Apr 08, 2007 9:59 pm
by Brynet-Inc
There are other 16bit C compilers, Why does everyone forget Bruce C Compiler? bcc..
http://homepage.ntlworld.com/robert.debath/