Open castilma opened 12 months ago
Hello @castilma,
after taking one step, it seems the whole file is being executed as code, including the data in the beginning:
Yes, that is exactly what's happening - the "binary" file has a 4096 byte header before the instruction code.
The problem you're having is that the ld
output prog.bin
is in a binary format that isn't in fact compatible with blinkenlights -r
. (Yes, it seems the example given using ld -static --oformat=binary prog.o -o prog.bin
isn't working: you'll notice that that produces a file with 4096 byte header, then the instructions you're looking for at offset 0x1000 (48eb fd
)).
To produce a raw binary file with the two instructions, use the first example on web page:
printf '\100\353\375' >prog.bin
Try that, it will then allow you to observe how blinkenlights operates on raw binary files.
There are other ways of producing 16-bit code for blinkenlight's real mode emulation using the ia16-elf-gcc
toolchain, for example. For basic experimentation, you could use the example method and remove the first 4096 bytes of the file using something like dd bs=4096 skip=1 < prog.bin > out.bin
.
Thank you!
I'm on linux x86_64, trying to follow this example:
after taking one step, it seems the whole file is being executed as code, including the data in the beginning:
Is this wanted? I expected the assembler to create a file with just two instructions. I don't see any jmp instruction.