Code: Select all
objdump -b binary -m i386 -h -D -t cls.bin > out.txt
Code: Select all
objdump -b binary -m i386 -h -D -t cls.bin > out.txt
Ugh. disassembly of .data section. Luckily it ended up right in alignment:Zioo wrote: I've never used objdump before, but I hope is done correct
And out.txt can be found here: http://penguinpower.frac.dk/out.txtCode: Select all
objdump -b binary -m i386 -h -D -t cls.bin > out.txt
Code: Select all
0:???48 ???dec %eax
1:???65 ???gs
2:???6c ???insb (%dx),%es:(%edi)
3:???6c ???insb (%dx),%es:(%edi)
4:???6f ???outsl %ds:(%esi),(%dx)
5:???20 57 6f ???and %dl,0x6f(%edi)
8:???72 6c ???jb 0x76
a:???64 32 00 ???xor %fs:(%eax),%al
There's something wrong at a level before the linker, since the .text output in the code file also contains main at 0x10, with "Hello World!" at 0x0.Solar wrote: As Candy said: Your binary file begins with the string "Hello world", which got linked into the .text section somehow. If your bootloader jumps to offset 0 of that binary, you're executing [tt]dec %eax[/tt] as first instruction...
Well... that would explain, since the second objdump showed that it's happened before your data was dumped in with the code.Zioo wrote: Hmm, yes I can see that the file start with Hello World...
I tried to move *(.rodata*) to the data section but without any difference..
Maybe I just should try to implement ELF binaries instead
Code: Select all
char *hello;
<code>
char *hello = "Hello World!";