Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old Phar-Lap .EXP cannot recognized #1169

Closed
Lutepatious opened this issue Apr 25, 2022 · 8 comments
Closed

Old Phar-Lap .EXP cannot recognized #1169

Lutepatious opened this issue Apr 25, 2022 · 8 comments

Comments

@Lutepatious
Copy link

I'm disassembling old FM TOWNS binaries which use Phar-Lap 386 | DOS-Extender (run386 and any .EXP).
But Reko cannot recognize it.

  1. Reko cannot analysis 512bytes .EXP header.
  2. Then, I've removed header but Reko said "unknown selector".
@gbody
Copy link
Contributor

gbody commented Apr 25, 2022

@Lutepatious are you able to give a link to a file that your trying to load that isn't being recognised.

@Lutepatious
Copy link
Author

A.zip

@uxmal
Copy link
Owner

uxmal commented Apr 26, 2022

Commit 77df0a7 has simple support for EXP file. Thanks for reporting this!

@uxmal uxmal closed this as completed Apr 26, 2022
@Lutepatious
Copy link
Author

Thx for loading support.
But, still remain "Selector xxxx has no known segment." and "Structure analysis stopped making progress".

386 | DOS-extender defined selectors. (from free386/ and EXE386 documents.)

GDTs
Selector base address
0000h 0h for NULL selector
0028h system selector for load LDT
0030h LDT
0038h GDT
0050h IDT
0060h 0h for 1st 1MB

LDTs
0004h PSP
0024h same to 0004h
000Ch code segment
0014h data segment for DS, ES, GS, SS. (base address is equal to 000Ch)
002Ch DOS environment variable
0034h 0h for 1st 1MB
003Ch Weitek 3167 math processor interface for FS (if not exist, then FS must be 0014h). IBM compatible only?

FM TOWNS specific.
GDT
0110h T-BIOS.

@uxmal
Copy link
Owner

uxmal commented May 1, 2022

すみません、日本語が読めません.... :)

Thanks for providing the translated info re: the segments. I'm assuming user programs always run in ring 0, based on the selectors always having their least significant bits set to 0b00.

@uxmal uxmal reopened this May 1, 2022
@uxmal
Copy link
Owner

uxmal commented May 1, 2022

@Lutepatious : do you have documentation on the FM TOWNS segment? In particular, I'm seeing the following indirect calls (in Reko RTL):

     call Mem18[0110:0020:segptr32] (retsize: 4;)
     call Mem18[0110:0080:segptr32] (retsize: 4;)

They seem to be calling into a vector at the beginning of the 0x0110 segment, which you've specified as "T-BIOS". It's unclear what these calls are expected to do, so Reko can do much better than generating:

(tbios->*fn0020)();
(tbios->*fn0080)();

@uxmal
Copy link
Owner

uxmal commented May 2, 2022

You can ignore the warning "Structure analysis stopped making progress". There is a big rewrite of the scanner phase of Reko that should address that warning; for now you will have to "suffer" that a redundant goto statement will not be removed.

@uxmal
Copy link
Owner

uxmal commented May 23, 2022

I'm closing this as the original issue has been resolved. If you have further issues, please feel free to open new issues.

@uxmal uxmal closed this as completed May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants