prussia icon indicating copy to clipboard operation
prussia copied to clipboard

prussia_bios: Wrapping BIOS calls

Open Ravenslofty opened this issue 5 years ago • 5 comments

Some open questions:

  • Wrap all syscalls? (Even the undocumented ones)
  • Wrap useful syscalls? (Nobody cares about _ExceptionEpilogue, right?)
  • Implement it all in Rust? (as much as I'd like to, this might bloat executables a bit).

Ravenslofty avatar Dec 22 '18 20:12 Ravenslofty

Syscalls by number (as documented in PS2tek):

  • [ ] 0x01: ResetEE
  • [x] 0x02: SetGsCrt - f5ea1b17
  • [x] 0x04: Exit - f77ed8ff
  • [ ] 0x05: _ExceptionEpilogue (useless?)
  • [ ] 0x06: LoadExecPS2
  • [ ] 0x07: ExecPS2
  • [ ] 0x10: AddIntcHandler
  • [ ] 0x11: RemoveIntcHandler
  • [ ] 0x12: AddDmacHandler
  • [ ] 0x13: RemoveDmacHandler
  • [ ] 0x14: _EnableIntc
  • [ ] 0x15: _DisableIntc
  • [ ] 0x16: _EnableDmac
  • [ ] 0x17: _DisableDmac
  • [ ] 0x20: CreateThread
  • [ ] 0x21: DeleteThread
  • [ ] 0x22: StartThread
  • [ ] 0x23: ExitThread
  • [ ] 0x24: ExitDeleteThread
  • [ ] 0x25: TerminateThread
  • [ ] 0x26: iTerminateThread
  • [ ] 0x29: ChangeThreadPriority
  • [ ] 0x2A: iChangeThreadPriority
  • [ ] 0x2B: RotateThreadReadyQueue
  • [ ] 0x2C: _iRotateThreadReadyQueue
  • [ ] 0x2D: ReleaseWaitThread
  • [ ] 0x2E: iReleaseWaitThread
  • [ ] 0x2F: GetThreadId
  • [ ] 0x30/0x31: ReferThreadStatus/iReferThreadStatus
  • [ ] 0x32: SleepThread
  • [ ] 0x33: WakeupThread
  • [ ] 0x34: iWakeupThread
  • [ ] 0x35/0x36: CancelWakeupThread/iCancelWakeupThread
  • [ ] 0x37/0x38: SuspendThread/iSuspendThread
  • [ ] 0x39: ResumeThread
  • [ ] 0x3A: iResumeThread
  • [ ] 0x3B: JoinThread
  • [ ] 0x3C: InitMainThread
  • [ ] 0x3D: InitHeap
  • [ ] 0x3E: EndOfHeap
  • [ ] 0x40: CreateSema
  • [ ] 0x41: DeleteSema
  • [ ] 0x42: SignalSema
  • [ ] 0x43: iSignalSema
  • [ ] 0x44: WaitSema
  • [ ] 0x45: PollSema
  • [ ] 0x64: FlushCache
  • [ ] 0x70: GsGetIMR
  • [ ] 0x71: GsPutIMR
  • [ ] 0x74: SetSyscall
  • [ ] 0x78: SifSetDChain
  • [ ] 0x7B: ExecOSD
  • [ ] 0x7D: PSMode
  • [ ] 0x7E: MachineType
  • [ ] 0x7F: GetMemorySize

Ravenslofty avatar Dec 22 '18 21:12 Ravenslofty