From: <gb...@di...> - 2000-09-21 09:58:45
|
Hi, So far, I got only two crashes with B2 in real addressing mode under Linux/i386: - the one I told you yesterday - another one related with AppleShare DRVR 41 1) The "Lo3Bytes" bug I determined that the unfriendly code starts at ROMBase + 0xdb9c. Bit 0 of the byte located at 0x1efc (what is it ?) is always tested. Then two branches are possible: one with the address stripped down to 24-bits and the other keeping all the bits of the address. In normal operation, the latter branch is always taken but, for some reason, at the end of the Speedometer Graphics test, the branch with the stripping by AND'ing with Lo3Bytes is taken! My fix that has to be improved: Changing the BNE to a BRA... A little barbarous, isn't it ? ;-) 2) The AppleShare bug This morning I tried to boot with extensions on, it failed at the AppleShare extension from MacOS 8.1 (vers 3.7.4) because it tried to read some data from 0x3fff. I finally found that the unfriendly code is located in resource DRVR 41 (Driver: .AFPTranslator) at address 2372. The problem: A word at 0x28e (ROM85) is sign-extended to an address register. Then, a word at that address is fetched. But as that address turns out to be 0x3fff on my system, so B2 crashes. My fix: Replacing six of its instructions with: movea.w ROM85,%a0 adda.l #RAMBaseMac,%a0 movea.l %a0,%a2 nop In the original code: 0x48e7, 0x1c20, // movem.l d3-d5/a2,-(a7) 0x382e, 0x0008, // move.w $0008(a6), d4 0x3a2e, 0x000a, // move.w $000A(a6),d5 0x554f, // subq #$2,a7 0x3eb8, 0x028e, // move.w ROM85,(a7) 0x301f, // move.w (a7)+,d0 0x48c0, // ext.l d0 0x2440, // movea.l d0,a2 0x2040, // movea.l d0,a0 0x3010, // move.w (a0),d0 0x0c40, 0x3fff, // cmpi.w #$3fff,d0 0x6316 // bls.s #$00000016 Stack seems to be used just as a temporary since a push is immediately followed by a pop. I am therefore assuming the value stored in is not used afterwards and directly move the address in the required address registers. Do you have other ideas ? I will probably commit the changes after I tried real addressing under Solaris. Bye. -- Gwenolé Beauchesne |