Turbo C .bin Compile

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.
Post Reply
Venkatesh Prabu

Turbo C .bin Compile

Post 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 ?
Guest

RE:Turbo C .bin Compile

Post 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!!
Guest

RE:Turbo C .bin Compile

Post 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!!
Guest

RE:Turbo C .bin Compile

Post 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!!
Guest

RE:Turbo C .bin Compile

Post 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!!
sanjeevsoni6464
Posts: 1
Joined: Fri Apr 12, 2013 12:41 pm

Re: Turbo C .bin Compile

Post 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.......
Attachments
kernel.zip
(2.85 KiB) Downloaded 57 times
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: Turbo C .bin Compile

Post by Mikemk »

You're a bit late.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: Turbo C .bin Compile

Post by brain »

11 years late in fact... Put down the necronomicon and step away from the internets ;-)
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Turbo C .bin Compile

Post by Love4Boobies »

With a compiler release from two years after I was born. :)
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Post Reply