Hi,
It is possible to write an OS in Turbo C . See FreeDos kernel as an example , also pdos . I used trubo C for writing my first operating system . The only problem is that i got somewhat addicted to bad turbo habits .. like accessing registers with _AX = 5 ; etc and that really leads to non portable code .
Regards
Shrek
Using Turbo C++
Re: Using Turbo C++
sure, my OS kernel "UNEXT/os" it's completely written under turbo c 3.1Shrek wrote: It is possible to write an OS in Turbo C .
i don't see any problem or bad turbo habits if you e.g "accessing registers with _AX = 5", it may an advantage of turbo C to accessShrek wrote: The only problem is that i got somewhat addicted to bad turbo habits .. like accessing registers with _AX = 5 ; etc and that really leads to non portable code .
regs in that simple way, about portable code, also no problem use
external NASM source to code your assembly chunk, & link it to your
C file, that make it 99% protable to other compilers
CheerS,
a.T.d
Distance doesn't make you any smaller,
but it does make you part of a larger picture.
but it does make you part of a larger picture.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Using Turbo C++
You could write a macro to make things portable:
You can then add an #elif too for things like GNU C and other compilers (that might use inline assembly). It'll do the same thing, in a far more portable way.
Code: Select all
#ifdef TURBOC // or some other thing ala GNUC
# define SetAX(a) (_AX = a)
#endif
-
- Member
- Posts: 153
- Joined: Sun Jan 07, 2007 9:40 am
- Contact:
Re: Using Turbo C++
Obviously, save yourself some typing and us some reading and do some simple research. Start here:TheDragon wrote:Though I confess I haven't done much research on that
http://wiki.osdev.org/Getting_Started
next here
http://wiki.osdev.org/Beginner_Mistakes
next here
http://wiki.osdev.org/Rolling_Your_Own_Bootloader
Every answered you seek has been posted numerous times and is quickly found in the wiki or by searching the forum
Re: Using Turbo C++
GREAT! I can use Turbo C!!!!!! This is a great joy to me, thanks, shrek. . Now, the question is, can I use TASM syntax and just tasm whatever into .o and then tcc whatever.o whoever.cpp to get my kernal code? And then I have to put a special header on it to load it with grub, right? That would be awesome. Also, the specs for the header is in the muliboot spec, right? I'm printing that as I type. Also, how exactly would I configure Turbo C++ to output the right format (I think bin is one...)? Thank you so much.
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Re: Using Turbo C++
Hi,
You need to know that turbo C ( versions <= 3) are 16 bit compilers , they only generate 16 bit code . Using grub is not really an option , you need to probably roll your own bootlolader .You can off course tasm or nasm with Turbo C
Regards
Shrek
You need to know that turbo C ( versions <= 3) are 16 bit compilers , they only generate 16 bit code . Using grub is not really an option , you need to probably roll your own bootlolader .You can off course tasm or nasm with Turbo C
Regards
Shrek