Page 1 of 1

16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 4:00 am
by scsi
what is the best way to produce flat binary from 16 bit c code.

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 4:46 am
by Combuster
Did you read your linker's manual?

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 8:27 am
by scsi
Im asking about are there any usefull tools and how to use them.

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 10:38 am
by Combuster
First of all, there is no such thing as 16-bit C code.
Secondly, if you can not give an explicit reason that you need C code compiled to run real mode, you probably do not want it.

Thirdly, did you actually read my response? I could just copy it over again:
> any usefull tools
"your linker"
> how to use them.
"Did you read [the] manual?"

If that doesn't help, you may also want to read this and this since you failed at least one of them.

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 12:28 pm
by Casm
scsi wrote:what is the best way to produce flat binary from 16 bit c code.
The Watcom compiler and linker can do most things, except produce 64 bit code. (If you are programming in a Windows environment that is.)

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 2:04 pm
by bewing
The only real method, AFAIK, is to use a really old compiler. AFAIK, when the bochs guys compile their BIOS, they use bc. Alternately you could use something like Microsoft QuickC, V2.51.

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 3:50 pm
by scsi
to Combuster:
First of all, there is no such thing as 16-bit C code.

Code: Select all

so what is turbo cpp 3.0 is doing.

[quote]Secondly, if you can not give an explicit reason that you need C code compiled to run real mode, you probably do not want it.[/quote][/quote]
im trying to write real mode kernel thats why i need it.

are you trying to prove yourself.if you are not interested in answering questions kindly dont write anything.no body forces you to write i guess.

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 5:05 pm
by Combuster
There is no 16-bit C code, only 16-bit compilers and compilers that target a 16-bit platform. C as a language is platform independent.

Also, I know that giving the answers only help so much of the time, and the other half needs to be spent on teaching how to solve problems in general. I'm one for the long run, not for your 7-day plan. Ignore me if you think otherwise.

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 6:01 pm
by Casm
scsi wrote: im trying to write real mode kernel thats why i need it.

are you trying to prove yourself.if you are not interested in answering questions kindly dont write anything.no body forces you to write i guess.
If you are only interested in 16 bit, any ancient compiler will do. Turbo C is probably still available for download if you google it.

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 8:21 pm
by Brynet-Inc
bewing wrote:The only real method, AFAIK, is to use a really old compiler. AFAIK, when the bochs guys compile their BIOS, they use bc. Alternately you could use something like Microsoft QuickC, V2.51.
I think you mean bcc, which stands for "Bruce Evans' C compiler".. Bruce was (..perhaps still is?) a FreeBSD developer, sadly no real official page exists for it these days, the source tarball is available online though.

It includes ld86 and as86, it's a full toolchain for compiling C programs for 16-bit real mode, but as has been said there really isn't much of a point in writing real mode code in C.

There is a "fork" called Dev86, as the original "bcc" archived was rolled in 1995.

Re: 16 bit c code to flat binary.

Posted: Thu Dec 02, 2010 10:12 pm
by gerryg400
I think bc is BorlandC.

Re: 16 bit c code to flat binary.

Posted: Fri Dec 03, 2010 10:53 am
by Brynet-Inc
gerryg400 wrote:I think bc is BorlandC.
I'm aware, but it's probably not what Bochs uses for their BIOS images.

Re: 16 bit c code to flat binary.

Posted: Fri Dec 03, 2010 11:10 am
by f2
gerryg400 wrote: I think bc is BorlandC.
bcc both means Bruce's C Compiler and Borland C Compiler. That's a bit confusing.

@scsi: I think bin86 should interest you.
Brynet-Inc wrote: I'm aware, but it's probably not what Bochs uses for their BIOS images.
Nope. They use bin86 and also GCC.

Re: 16 bit c code to flat binary.

Posted: Sat Dec 04, 2010 8:02 am
by Fanael
berkus wrote:Joined: November 26th, 2010, 12:22 pm
vs
Joined: October 18th, 2006, 12:45 pm
I am truly sorry to disappoint you, but this is not a valid argument. Sure, scsi tries his best to piss everyone off, but the fact that he joined the forum later than someone else does not mean he is worse than that person (yet there are other things that make him look just plain stupid).

Re: 16 bit c code to flat binary.

Posted: Sat Dec 04, 2010 3:07 pm
by scsi
to berkus:
are you cumbuster's lawyer.i think cumbuster wasnt able to discuss with me and hired you.joining forum earlier doesnt make you two genius.instead of telling me to read the "smart questions" you should stop talking dumb.

to Fanael:
i agree with your first sentence but if some one is stupid no discussion it is you i think.