A poorly written OS for the x86 arch. (WIP)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eOS/src/bootloader_bios_disk.asm

25 lines
450 B

4 years ago
disk_read:
pusha
4 years ago
4 years ago
push dx
4 years ago
mov ah, BIOS_DISK_READ
4 years ago
mov al, dh ; sector count
mov cl, 0x02
mov ch, 0x00 ; read from first cylinder
mov dh, 0x00 ; head
; data pointer: es:bx (standard)
int BIOS_DISK_INT ; do the interrupt
jc disk_error ; if flag is set then jump to error
disk_error:
mov bx, DISK_ERROR
call println
mov dh, ah
DISK_ERROR: db "Disk read error", ASCII_END
SECTORS_ERROR: db "Invalid number of sectors read", ASCII_END