Re: x86emu emulation problem

Marc Aurele La France <[email protected]>
Newsgroups gmane.comp.xfree86.devel
Message-ID <[email protected]>
On Fri, 6 Oct 2006, jf simon wrote:

>>> 2- The same code as seen from ndisasm:

>>> 000068DA  A00080            mov al,[0x8000]
>>> 000068DD  04F5              add al,0xf5
>>> 000068DF  0002              add [bp+si],al
>>> 000068E1  C8008015          enter 0x8000,0x15
>>> 000068E5  0E                push cs
>>> 000068E6  0106C800          add [0xc8],ax
>>> 000068EA  80100E            adc byte [bx+si],0xe
>>> 000068ED  0105              add [di],ax
>>> 000068EF  C800800B          enter 0x8000,0xb
>>> 000068F3  0E                push cs
>>> 000068F4  0104              add [si],ax
>>> 000068F6  C8008006          enter 0x8000,0x6
>>> 000068FA  0E                push cs
>>> 000068FB  0102              add [bp+si],ax
>>> 000068FD  E80080            call 0xe900       <<<<<!!!HERE AGAIN

>> This is probably data -- either font data or VGA register tables.  Can
>> you trace backwards any more and figure out how you got to 68DA?

> You are right. I have found that the problem was on  a JMP SHORT which was 
> incorrectly landing in that part of the VGA BIOS. The relative displacement 
> was negative (was 0xBA), but  the JMP was considering it to be a jump to 
> [PC]+0xBA rather than applying the signed arithmetic. Setting  GCC 
> "-fsigned-char " switch made the signed displacemnt correctly applied....and 
> solved the problem. I didn't know that the "char" type was unsigned by 
> default.

I've just committed a change to insulate x86emu against this.

> Lastly, I have found that the VGA bios i use is doing CF8/CFC PCI 
> configuration style accesses. Which doesn't work on my PowerPC plaftorm. (I 
> think it is only to be seen in the x86 world, but not sure). So they need to 
> be translated to whatever the platform is going to use as PCI configuration 
> access. I just mention this for the record in case others are not aware of 
> this.

The generic int10 modules already intercepts such accesses and emulates them 
using PCI accesses appropriate for the platform.

Marc.

+----------------------------------+----------------------------------+
|  Marc Aurele La France           |  work:   1-780-492-9310          |
|  Academic Information and        |  fax:    1-780-492-1729          |
|    Communications Technologies   |  email:  [email protected]         |
|  352 General Services Building   +----------------------------------+
|  University of Alberta           |                                  |
|  Edmonton, Alberta               |    Standard disclaimers apply    |
|  T6G 2H1                         |                                  |
|  CANADA                          |                                  |
+----------------------------------+----------------------------------+
XFree86 developer and VP.  ATI driver and X server internals.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.