This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
gas/ld x86 16-bit 64kb limit and ominous "unreal mode"
- From: Etienne Lorrain <etienne_lorrain at yahoo dot fr>
- To: Josef Angermeier <sijoange at cip dot informatik dot uni-erlangen dot de>, binutils at sources dot redhat dot com
- Date: Thu, 30 Jun 2005 11:51:05 +0200 (CEST)
- Subject: gas/ld x86 16-bit 64kb limit and ominous "unreal mode"
> Using gcc/gas to generate a pc-bios for a virtual machine, i face now
> the problem, that gas/gcc just knows about the small memory modell and
> so my code is restricted to 64kb somehow.
If you are using .code16gcc and GCC, you are probably using only 32 bits
pointers and not only 16 bits pointers. The trick is that the upper 16 bits
have to be null and you are restricted to 16 bits values.
It is possible to go to "unreal" mode and use 32 bits pointers for data
access once the segment limits have been set to their max value. You could
have a look to http://gujin.org compilation switch BIG_MALLOC to see how
to do that.
It is possible to use "far" pointer for the code using segment:offset pair
and transforming all call and ret by calll and retl, but your executable
will no more be relocatable - you have to create a linker section to handle
relocation at load time.
You can also use 32 bits code address, but _only_ with interrupt disabled,
and without any exception (like division by 0 or division overflow)
possible: such an interrupt will save on the stack a 16 bits segment and
a 16 bits offset, so no return possible to the interrupted treatment
because the MSB of the offset is lost...
Etienne.
___________________________________________________________________________
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com