|
All from modified SGL_Hello_World (makefile, linker, IP.BIN, binutils)
duk_sgl1.cof
Objdump the .cof file to see the start loading address and change IP.BIN F0 to reflect it.
IP.BIN size (E0): 0x1000
IP.BIN start address (F0): 06004000
IP.BIN (F00) which is loaded to 06002F00: load then jump to start address
*(06002F00 + code + E0 < start address)
In binary: No need for bra since jmp is not coming back and reading address as instruction.
at 06002F00:
D1 01 set r1 to address below
00 09 nop
41 2B jmp to r1
00 09 nop
06 00 address
40 00
sh-coff-objcopy -O binary "duk_sgl1.cof" "DUK_SGL1.BIN" to make this into a raw loadable binary
to include the binary into an iso file, use an assembly file, makefile, and linker.
Make assembly file, mine is SL_BIN.S, with contents
.section _sl_bin
.incbin "DUK_SGL1.BIN"
This puts your raw binary file from above into a section that the linker knows about.
in makefile:
-c -nostartfiles -nodefaultlibs -nostdlib -fno-builtin SL_BIN.S -o SL_BIN.o
this makes an object file that can be linked and objcopy to binary and iso
in linker:
SECTIONS {
SLSTART 0x06004000 : {
___Start = .;
*(SLSTART)
}
.text ALIGN(0x10) :
{
KEEP (*(_sl_bin))
* (.text)
* (.text.*)
*(.strings)
__etext = .;
}
The SLSTART depends on if your using barebones SBL or SGL = IP.BIN start address (F0).
The important part is KEEP(*(_sl_bin)):
This matches how the BIOS is actually loading in the first file
In the "cd" folder add the *.avi file you would like to play before compile.
Use the compile.bat file to load.
This makes the .bin, .coff, .cue, .map, and .iso file set up in makefile.
The .cue or .iso is ready to be run on your choice of emulator.
Posting a video on 5 cubes, 2 sides.
All cubes are movable, rotatable by buttons and directions. |