This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gas/ld x86 16-bit 64kb limit and ominous "unreal mode"
- From: Denis Vlasenko <vda at ilport dot com dot ua>
- To: Josef Angermeier <sijoange at cip dot informatik dot uni-erlangen dot de>,binutils at sourceware dot org
- Cc: Denis Vlasenko <vda at ilport dot com dot ua>
- Date: Thu, 30 Jun 2005 09:20:58 +0300
- Subject: Re: gas/ld x86 16-bit 64kb limit and ominous "unreal mode"
- References: <20050629135839.GJ5560@faui00i.informatik.uni-erlangen.de>
On Wednesday 29 June 2005 16:58, Josef Angermeier wrote:
> Hello
>
> 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.
>
> Now, i've by accident read about this ominous "unreal mode" (switching
> from real mode to protected mode, changing the segment limits in the
> cache and switching back) with which you can use 32-bit offset in
> realmode (somehow).
There's more to it
http://www.uwsg.iu.edu/hypermail/linux/kernel/0307.3/1132.html
I was totally blown away how far madness can go :)
> So im not THAT familiar with that mode, i wonder if it might be used to
> execute more than 64kb of gas/gcc-code 16-bit code - circumventing the
> use of far calls/jumps/rets by using 32-bit near offsets in (un-)real
> mode. (gas with .code16gcc truncates offsets to 16-bit, but i guess the
> gnu linker puts 32-bit offsets for the relocated code)
>
> Ok might be a stupid idea, sound bizarre, i haven't found much to read
> about code execution in mode, just about accessing data in the extended
> memory. Though i hope one of you, knows better why this can't work or
> when it could.
--
vda