Reputation: 453
I have a simple bootloader written in AT&T syntax.
[bits 16]
[org 0x7c00]
jmp $
times 510-($-$$) db 0
dw 0xaa55
I use yasm -f bin -o boot.bin loader.s
to compile it, and bochs to run.
dd if=boot.bin bs=512 of=floppy.img
bochs -q
But bochs
said that there is no bootable device
.
So, I have the following questions:
times 510-($-$$) db 0)
?Thanks!
P.S. Bochs
was compiled with x86_64
support, but it doesn't work with bochs
from the official arch repo.
Upvotes: 1
Views: 1677
Reputation: 446
I suggest you stick with the Intel syntax as it is usually more readable than AT&T. For a few basic differences between them you can check this and this.
On Ubuntu, bochs needs bochs-x
and bochs-sdl
in order to run without errors. Then you should be able to boot from your floppy image with:
bochs -q 'display_library: sdl' 'boot:a' 'floppya: 1_44=floppy.img, status=inserted'
Another option is to use qemu
instead of bochs
:
qemu -fda floppy.img
Upvotes: 2
Reputation: 3119
I can't imagine why you're trying to write AT&T syntax if you don't know AT&T syntax! I think the "times" line would be...
.org 0x7DFE
.word 0xAA55
Bochs is probably looking for an entire 1.44M floppy image.
Upvotes: -1