Igor Kovalenko wrote:
Seems to be no need to go with assembly yet. With the following change you can try executing
elf-entry @ " (go)" evaluate
like ppc implementation of 'go' does. It would start executing elf code. Unfortunately it would crash with unhandled divide by zero trap which I still cannot find a reason for.
This is also assuming that you remove the ofmem_claim() call from elf_loader_init_program()?
The link that Blue sent through for the SPARC OF bindings mentions the following in section 5.1.2 for ELF executables:
The program image immediately follows the header. After recognizing this header, load allocates and maps bf_text + bf_data + bf_bss bytes of memory beginning at the address given by bf_origin, moves the program image, of size bf_text + bf_data, to that address, and zeroes bf_bss bytes of memory beginning at bf_origin + bf_text + bf_data.
This does seem to look roughly what happens in elf_loader_init_program() to my untrained eye. However the document also references various trap table/register setups required as well as interactions between the client image and OF which we may be missing.
ATB,
Mark.