Hack for running static elfs
To run a static elf, it needs to be loaded at 0x400000, and the execution is to be started at the entry address, not through libkernel. As an example, SceSysAvControl.elf defined _entry at 0x400080. This makes running static elfs incompatible with Windows IIRC, at least without further major hacks.
It is nowhere near ready to be merged, but I'm looking for any pointers and suggestions. If you could comment and suggest changes to make it more correct, I'd appreciate that.
Very simple thing: Option to run from GUI? Maybe a way to just select a .elf file
In general, this is possible, I have already tested this hack and modified it to something like:
_PROC_AREA_START_0 =QWORD($00000400000);
_PROC_AREA_START_1 =QWORD($00010000000); //(original:0x400000-0x80000000)
ET_SCE_DYNEXEC:
begin
reloc_base:=Pointer(PROC_IMAGE_AREA_START);
//
imgp^.reloc_base :=reloc_base;
imgp^.dyn_vaddr :=reloc_base+QWORD(imgp^.dyn_vaddr );
imgp^.tls_init_addr :=reloc_base+QWORD(imgp^.tls_init_addr );
imgp^.eh_frame_hdr_addr:=reloc_base+QWORD(imgp^.eh_frame_hdr_addr);
imgp^.proc_param_addr :=reloc_base+QWORD(imgp^.proc_param_addr );
end;
ET_SCE_EXEC:
if (PROC_IMAGE_AREA_START=_PROC_AREA_START_1) then
begin
//hack
hdr^.e_type:=ET_SCE_DYNEXEC;
//
reloc_base:=Pointer(_PROC_AREA_START_1);
//
imgp^.reloc_base :=reloc_base;
imgp^.dyn_vaddr :=reloc_base+QWORD(imgp^.dyn_vaddr );
imgp^.tls_init_addr :=reloc_base+QWORD(imgp^.tls_init_addr );
imgp^.eh_frame_hdr_addr:=reloc_base+QWORD(imgp^.eh_frame_hdr_addr);
imgp^.proc_param_addr :=reloc_base+QWORD(imgp^.proc_param_addr );
end;
We probably need to wait for moving the game code to run inside a VM so we don't need a hack.
We are closing this PR due to no any activities in the last 30 days. Feel free to re-open it if you would like to continue working on this.
Shush, bot.
We are closing this PR due to no any activities in the last 30 days. Feel free to re-open it if you would like to continue working on this.
We are closing this PR due to no any activities in the last 30 days. Feel free to re-open it if you would like to continue working on this.
Any progress on this?
We are currently working on a debugger to be able to debug our new kernel. Once we have a working debugger we will continue working on the new kernel. Not much progress on the new kernel since last update.
We will revisit this once we start moving the SELF loading code to the new kernel.
We are closing this PR due to no any activities in the last 30 days. Feel free to re-open it if you would like to continue working on this.