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
Make a real mode OS with C
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!
About the compiler and the parameters - I can't tell you nothing!
I think, I have problems with Bochs. The biggest one: Bochs hates me!
- matias_beretta
- Member
- Posts: 101
- Joined: Mon Feb 26, 2007 3:39 pm
thanks
lots of tanks infinit... i will start "playing" a little...
anyone has more information about the compiler???
anyone has more information about the compiler???
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.
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.
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
- Happy Egghead
- Member
- Posts: 32
- Joined: Thu Oct 19, 2006 5:25 am
- Location: Adelaide, Australia
- Contact:
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)
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)
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
There are other 16bit C compilers, Why does everyone forget Bruce C Compiler? bcc..
http://homepage.ntlworld.com/robert.debath/
http://homepage.ntlworld.com/robert.debath/