read sector from disk
This commit is contained in:
parent
61d466a8c0
commit
55d7045b33
2
Makefile
2
Makefile
|
@ -7,7 +7,7 @@ boot.o: boot.s
|
||||||
floppy.bin: boot.bin floppy_base.bin
|
floppy.bin: boot.bin floppy_base.bin
|
||||||
rm -vf $@
|
rm -vf $@
|
||||||
cp floppy_base.bin $@
|
cp floppy_base.bin $@
|
||||||
dd if=boot.bin of=$@
|
dd if=boot.bin of=$@ conv=notrunc
|
||||||
|
|
||||||
.PHONY: boot disasm hexdump
|
.PHONY: boot disasm hexdump
|
||||||
boot: floppy.bin
|
boot: floppy.bin
|
||||||
|
|
12
boot.s
12
boot.s
|
@ -1,4 +1,6 @@
|
||||||
.code16
|
.code16
|
||||||
|
# the currently viewed sector gets put at 0x7c00
|
||||||
|
# we move to 0x7000 to make space
|
||||||
|
|
||||||
.global _start # the linker needs to find it
|
.global _start # the linker needs to find it
|
||||||
_start:
|
_start:
|
||||||
|
@ -88,6 +90,16 @@ palette_loop:
|
||||||
mov $0x7c0, %ax # ES = the bootsector
|
mov $0x7c0, %ax # ES = the bootsector
|
||||||
mov %ax, %es
|
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:
|
update_screen_vgay:
|
||||||
mov $0, %dh
|
mov $0, %dh
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue