Using Turbo C++

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.
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Re: Using Turbo C++

Post by DeletedAccount »

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
User avatar
i586coder
Member
Member
Posts: 143
Joined: Sat Sep 20, 2008 6:43 am

Re: Using Turbo C++

Post by i586coder »

Shrek wrote: It is possible to write an OS in Turbo C .
sure, my OS kernel "UNEXT/os" it's completely written under turbo c 3.1
Shrek 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 .
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 access
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.
pcmattman
Member
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++

Post by pcmattman »

You could write a macro to make things portable:

Code: Select all

#ifdef TURBOC // or some other thing ala GNUC
#    define SetAX(a) (_AX = a)
#endif
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.
tantrikwizard
Member
Member
Posts: 153
Joined: Sun Jan 07, 2007 9:40 am
Contact:

Re: Using Turbo C++

Post by tantrikwizard »

TheDragon wrote:Though I confess I haven't done much research on that
Obviously, save yourself some typing and us some reading and do some simple research. Start here:
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
User avatar
TheDragon
Member
Member
Posts: 43
Joined: Mon Aug 25, 2008 8:23 pm
Location: Middle of Nowhere

Re: Using Turbo C++

Post by TheDragon »

GREAT! I can use Turbo C!!!!!! This is a great joy to me, thanks, shrek. :D :D :D :D :D :D . 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.
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Re: Using Turbo C++

Post by DeletedAccount »

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 :D .You can off course tasm or nasm with Turbo C


Regards
Shrek
Post Reply