Page 1 of 1

Turbo C .bin Compile

Posted: Tue Jan 22, 2002 12:00 am
by Venkatesh Prabu
I Compiled kernel.c using tcc then I used
Tlink /n option(/n - no std. libraries).
Tlink outputs a .exe file, I used exe2bin and
it outputs a .bin file. The offset address of the
variables I used in the program are pointing to
illegal addresses when I debuged the kernel.bin
file using DEBUG.EXE. So I compiled Kernel.c using
tcc -mt (tiny model) and then I used Tlink /t option it
gives an error message 'segment-reloctable items present'
(even though i compiled in tiny model).
How can i solve this problem ?
I want to compile a .bin file which will clearly
execute when i loaded ?
It is possible to use Turbo C (dos) to write
an OS ?

RE:Turbo C .bin Compile

Posted: Wed Jan 23, 2002 12:00 am
by Guest
>On 2002-01-22 12:18:56, Venkatesh Prabu wrote:
>I Compiled kernel.c using tcc then I used
>Tlink /n option(/n - no std. libraries).
>Tlink outputs a .exe file, I used exe2bin and
>it outputs a .bin file. The offset address of the
>variables I used in the program are pointing to
>illegal addresses when I debuged the kernel.bin
>file using DEBUG.EXE. So I compiled Kernel.c using
>tcc -mt (tiny model) and then I used Tlink /t option it
>gives an error message 'segment-reloctable items present'
>(even though i compiled in tiny model).
> How can i solve this problem ?
> I want to compile a .bin file which will clearly
>execute when i loaded ?
> It is possible to use Turbo C (dos) to write
>an OS ?
Why are you using command line to compile...
In order to be able to use EXE2BIN...the EXE must
be compiled in tiny mode...everything will be
taken care of....


Anyway, Id really suggest that you shift to NASM
and the GNU tools!!

RE:Turbo C .bin Compile

Posted: Wed Jan 23, 2002 12:00 am
by Guest
>On 2002-01-22 12:18:56, Venkatesh Prabu wrote:
>I Compiled kernel.c using tcc then I used
>Tlink /n option(/n - no std. libraries).
>Tlink outputs a .exe file, I used exe2bin and
>it outputs a .bin file. The offset address of the
>variables I used in the program are pointing to
>illegal addresses when I debuged the kernel.bin
>file using DEBUG.EXE. So I compiled Kernel.c using
>tcc -mt (tiny model) and then I used Tlink /t option it
>gives an error message 'segment-reloctable items present'
>(even though i compiled in tiny model).
> How can i solve this problem ?
> I want to compile a .bin file which will clearly
>execute when i loaded ?
> It is possible to use Turbo C (dos) to write
>an OS ?
Why are you using command line to compile...
In order to be able to use EXE2BIN...the EXE must
be compiled in tiny mode...everything will be
taken care of....


Anyway, Id really suggest that you shift to NASM
and the GNU tools!!

RE:Turbo C .bin Compile

Posted: Thu Jan 24, 2002 12:00 am
by Guest
>On 2002-01-22 12:18:56, Venkatesh Prabu wrote:
>I Compiled kernel.c using tcc then I used
>Tlink /n option(/n - no std. libraries).
>Tlink outputs a .exe file, I used exe2bin and
>it outputs a .bin file. The offset address of the
>variables I used in the program are pointing to
>illegal addresses when I debuged the kernel.bin
>file using DEBUG.EXE. So I compiled Kernel.c using
>tcc -mt (tiny model) and then I used Tlink /t option it
>gives an error message 'segment-reloctable items present'
>(even though i compiled in tiny model).
> How can i solve this problem ?
> I want to compile a .bin file which will clearly
>execute when i loaded ?
> It is possible to use Turbo C (dos) to write
>an OS ?
Why are you using command line to compile...
In order to be able to use EXE2BIN...the EXE must
be compiled in tiny mode...everything will be
taken care of....


Anyway, Id really suggest that you shift to NASM
and the GNU tools!!

RE:Turbo C .bin Compile

Posted: Thu Jan 24, 2002 12:00 am
by Guest
>On 2002-01-22 12:18:56, Venkatesh Prabu wrote:
>I Compiled kernel.c using tcc then I used
>Tlink /n option(/n - no std. libraries).
>Tlink outputs a .exe file, I used exe2bin and
>it outputs a .bin file. The offset address of the
>variables I used in the program are pointing to
>illegal addresses when I debuged the kernel.bin
>file using DEBUG.EXE. So I compiled Kernel.c using
>tcc -mt (tiny model) and then I used Tlink /t option it
>gives an error message 'segment-reloctable items present'
>(even though i compiled in tiny model).
> How can i solve this problem ?
> I want to compile a .bin file which will clearly
>execute when i loaded ?
> It is possible to use Turbo C (dos) to write
>an OS ?
Why are you using command line to compile...
In order to be able to use EXE2BIN...the EXE must
be compiled in tiny mode...everything will be
taken care of....


Anyway, Id really suggest that you shift to NASM
and the GNU tools!!

Re: Turbo C .bin Compile

Posted: Fri Apr 12, 2013 12:55 pm
by sanjeevsoni6464
i am succeded in making .com file from turbo c++ 3.0 (using tcc(command line compiler))

use this command :- tcc -mt -lt <file name.cpp>

ex:- tcc -mt -lt kernel.cpp
my c++ file name is kernel.cpp(it just print 26 times 'A' and then print what ever you type , untill you press enter)

but when my 1st bootloader load and jump to it................it is not working................

i used turbo debugger to check what is in that file ..........i found that the procedure for printing is called at offset of 254

i don't know y this is so.......i mean main function should be called at offset 0...but it is not like that...........

please some one help me....................

i am attaching kernel.zip having.....1)kernel.cpp and 2)kernel.com file both...........u can check it.......

Re: Turbo C .bin Compile

Posted: Fri Apr 12, 2013 1:16 pm
by Mikemk
You're a bit late.

Re: Turbo C .bin Compile

Posted: Wed Apr 17, 2013 3:20 am
by brain
11 years late in fact... Put down the necronomicon and step away from the internets ;-)

Re: Turbo C .bin Compile

Posted: Sat Apr 20, 2013 2:16 am
by Love4Boobies
With a compiler release from two years after I was born. :)