Page 1 of 1
OS without linking
Posted: Wed Mar 30, 2005 12:00 am
by Hery
i make my os in real mode (16 bits) i compile it using as and gcc, but i don't link it:
Does it run in real mode (like normal binary file) ?? I don't want to link it if I don't have to do it. [/code]
Re: OS without linking
Posted: Wed Mar 30, 2005 12:00 am
by DruG5t0r3
I'm fairly sure that you need to tell gcc that your code will be running in 16bit mode at compile time first. How? Don't ask me... man gcc
Re: OS without linking
Posted: Wed Mar 30, 2005 12:00 am
by rexlunae
Hery Sasta wrote:I don't want to link it if I don't have to do it.
Why not?
Re: OS without linking
Posted: Thu Mar 31, 2005 12:00 am
by Hery
DruG5t0r3 wrote:I'm fairly sure that you need to tell gcc that your code will be running in 16bit mode at compile time first. How? Don't ask me... man gcc
ok, but what format of executable file i get if I only use gcc -c and as?? does it format run like binary file
Re: OS without linking
Posted: Thu Mar 31, 2005 12:00 am
by Legend
No, it won't run like a binary file. If you use Linux, you'll get an ELF object(!) file, if use DJGPP, you will get a COFF object file ...
Those NEED to be relocated if you have more then one file, if there are no two files, then there should be no relocation necessary.
Re: OS without linking
Posted: Thu Mar 31, 2005 12:00 am
by Hery
ok, I need answer like your
now i must read man gcc
Re: OS without linking
Posted: Thu Mar 31, 2005 12:00 am
by Legend
You could try gcc -Xlinker --oformat -Xlinker binary -o qex.s qi.c ...
Then you have a binary, but that invokes the linker
Perhaps objcopy can do what you need in a second step!
Re: OS without linking
Posted: Thu Mar 31, 2005 12:00 am
by Hery
i'll try lot of options and configurations
don't worry
PS. i have got nasty linker errors and i ask about binary file without ld (i know i'm lazy), but now...
Re: OS without linking
Posted: Thu Mar 31, 2005 12:00 am
by Hery
i have problem with my nasty bug :/ when i link os i get lot of errors: "relocation trunaced to fit" this error are connected to variables from heading files, what's wrong?? maybay i must write everywhere:
, it also i connected to $0001 in instruction like this:
!!
Re: OS without linking
Posted: Thu Mar 31, 2005 12:00 am
by Legend
You are using the 16 bit ld, don't you?
Re: OS without linking
Posted: Fri Apr 01, 2005 12:00 am
by Hery
heh, thanks, i don't know which ld i used (now, i'm sure that i used 32 bits ld), heh, i don't khow that 16 bits ld exist ;D
UPDATE: i search in google.com and i can't find 16 bits ld, on gnu.org i also can't find it. Where is 16 bits ld?? (yes, iknow i'm so lazy, but i'm really search it)
Re: OS without linking
Posted: Fri Apr 01, 2005 12:00 am
by Legend
After finding some links I'm not that sure if this was a good hint from me :Z
http://lists.debian.org/debian-user/199 ... 00314.html
Re: OS without linking
Posted: Fri Apr 01, 2005 12:00 am
by Hery
now, i don't know what i should do, thank you very much, i'll check many configurations & options
UPDATE:
when i try ld86 qi.o i've got message qi.o: has got bad magic number, i know that i must use as86, but:
as86 qi.s make lot of errors, in Intel syntax and in AT&T syntax are errors, what's the problem? does ld86 help me??
UPDATE2:
ok, i read som texts, now i've got problem. I'm using bcc and i've got error in instruction like this:
Code: Select all
#if ! defined INCLUDE
..............
#endif
i've got error after word include (sign of new line) does "bcc syntax" need something like { or maybay it's strange error which is only on my computer and i should put computer behind window??
Re: OS without linking
Posted: Sat Apr 02, 2005 12:00 am
by Hery
i searched informations about bcc but i don't found it :/