ffdda5eaca
The filesystem image is the same before and after this commit: $ sha256sum fox32os-orig.img fox32os.img abc77bd6310b8eb6bcde0a8a442ca8bab071307a6cf5155ea606578435f77d27 fox32os-orig.img abc77bd6310b8eb6bcde0a8a442ca8bab071307a6cf5155ea606578435f77d27 fox32os.img The conversion was performed with a few sed commands: find -name '*.asm' | xargs sed -i -e 's/data.str \("[^"]*"\) data.8 0$/data.strz \1/g' find -name '*.asm' | xargs sed -i -e 's/data.str \("[^"]*"\) data.8 0 /data.strz \1 /g' find -name '*.asm' | xargs sed -i -e 's/data.str \("[^"]*"\) data.8 0x00 /data.strz \1 /g'
29 lines
538 B
NASM
29 lines
538 B
NASM
; FXF routines
|
|
|
|
; parse and relocate an FXF binary loaded in memory
|
|
; inputs:
|
|
; r0: pointer to memory buffer containing an FXF binary
|
|
; outputs:
|
|
; r0: relocation address or 0 on error
|
|
parse_fxf_binary:
|
|
push r1
|
|
mov r1, [r0]
|
|
cmp r1, [fxf_magic]
|
|
ifnz pop r1
|
|
ifnz mov r0, 0
|
|
ifnz ret
|
|
pop r1
|
|
|
|
call fxf_reloc
|
|
|
|
ret
|
|
|
|
fxf_magic: data.strz "FXF"
|
|
|
|
#include "fxf/reloc.asm"
|
|
|
|
const FXF_CODE_SIZE: 0x00000004
|
|
const FXF_CODE_PTR: 0x00000008
|
|
const FXF_RELOC_SIZE: 0x0000000C
|
|
const FXF_RELOC_PTR: 0x00000010
|