read sector from disk

This commit is contained in:
dzwdz 2021-08-19 22:37:38 +02:00
parent 61d466a8c0
commit 55d7045b33
2 changed files with 13 additions and 1 deletions

View File

@ -7,7 +7,7 @@ boot.o: boot.s
floppy.bin: boot.bin floppy_base.bin
rm -vf $@
cp floppy_base.bin $@
dd if=boot.bin of=$@
dd if=boot.bin of=$@ conv=notrunc
.PHONY: boot disasm hexdump
boot: floppy.bin

12
boot.s
View File

@ -1,4 +1,6 @@
.code16
# the currently viewed sector gets put at 0x7c00
# we move to 0x7000 to make space
.global _start # the linker needs to find it
_start:
@ -88,6 +90,16 @@ palette_loop:
mov $0x7c0, %ax # ES = the bootsector
mov %ax, %es
mov $1, %al # read only one sector
mov $2, %cx # sector/track
xor %dx, %dx # head / drive number
xor %bx, %bx # write to es:bx
# mov $0, %ah # reset disk system
# int $0x13
mov $2, %ah # actual read
int $0x13 # TODO error checking
update_screen_vgay:
mov $0, %dh