I'm trying to make a 2 stage bootloader. I'm using gas and bochs.
The code is supposed to read sectors of the floppy (image), to load it to memory
The floppy image is created with bximage, and is written to over a loopback device.
I hope that someone can help me, I've been using a lot of time...
Code: Select all
.code16
.section .text
.globl _start
_start:
mov $0x7c0,%ax
mov %ax,%ds
mov $0,%dl
mov $0,%ah
int $0x13
jc _start
read:
mov $2,%ah
mov $18,%al
mov $0,%ch
mov $2,%dh
mov $1,%cl
mov $0x8000,%ax
mov %ax,%es
xor %bx,%bx
int $0x13
jc read
jmp succes
jmp idle
succes:
mov $0xb800, %ax
mov %ax, %ds
movb $'O', 0
movb $0x1e, 1
movb $'K', 2
movb $0x1e, 3
idle:
jmp idle