You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm not sure if this is the right place to ask but I'm struggling with the poor documentation I have, especially regarding SLEIGH and the files around.
Basically I'm making an extension to analyze OS-9 programs but there are some things I don't understand how to do.
First, OS-9 system calls have nearly all their parameters in registers, however error handling is not a single register and I struggle to make Ghidra understand it. When executing a system call:
If it is successful, the result are in the output registers and the carry flag is cleared.
If an error occurred, the carry flag is set and D1.W contains the error number.
How can I indicate that ? The .cspec file of the compiler can't have it.
Second is regarding system call disassembly, what is the correct way of doing it?
Os-9 system calls are with a TRAP #0 (0x4E40) and the system call number immediately after the instruction.
For now I modified the Motorola 68000 SLEIGH to recognize this instruction as a system call, but it's just a generic system call. To make it recognize the arguments and return value (mostly stored in registers and conditional flags), I have two choices:
manually define every system call and its parameters in the SLEIGH so the disassembler knows right aways how to process the syscall and the parameters.
Or I could keep the single generic system call and make a Ghidra analyzer class to remap syscall with their arguments in Java.
What is the most correct way from Ghidra's architecture to do?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm not sure if this is the right place to ask but I'm struggling with the poor documentation I have, especially regarding SLEIGH and the files around.
Basically I'm making an extension to analyze OS-9 programs but there are some things I don't understand how to do.
First, OS-9 system calls have nearly all their parameters in registers, however error handling is not a single register and I struggle to make Ghidra understand it. When executing a system call:
How can I indicate that ? The .cspec file of the compiler can't have it.
Second is regarding system call disassembly, what is the correct way of doing it?
Os-9 system calls are with a
TRAP #0
(0x4E40) and the system call number immediately after the instruction.For now I modified the Motorola 68000 SLEIGH to recognize this instruction as a system call, but it's just a generic system call. To make it recognize the arguments and return value (mostly stored in registers and conditional flags), I have two choices:
What is the most correct way from Ghidra's architecture to do?
Thanks for the help!
Beta Was this translation helpful? Give feedback.
All reactions