I looked at other implementation and the first thing all do is to include systemh.inc, so i do the same:
unit system;
{$MODE FPC}
interface
{$I systemh.inc}
implementation
end.
but this gives me:
Compiling ./rtl/ps1/system.pp
systemh.inc(23,2) Error: Mode switch "OBJFPC" not allowed here
filerec.inc(33,17) Error: Identifier not found "THandle"
filerec.inc(33,24) Error: Error in type definition
textrec.inc(38,17) Error: Identifier not found "THandle"
textrec.inc(38,24) Error: Error in type definition
systemh.inc(867,17) Error: Identifier not found "TThreadID"
systemh.inc(867,26) Error: Error in type definition
mathh.inc(200,53) Fatal: Syntax error, ")" expected but "=" found
Fatal: Compilation aborted