fix bug with skipping over sectors

This commit is contained in:
dzwdz 2021-08-22 20:08:04 +02:00
parent 23c6be10fa
commit 3de45fe1e5
1 changed files with 3 additions and 2 deletions

5
boot.s
View File

@ -223,7 +223,7 @@ digit_loop:
incw %cs:_sector_num+1
read_sector:
_sector_num:
movw $1, %ax # sector num
movw $0, %ax # sector num (0indexed)
movb $18, %ch # divide by 18 (sectors / track)
div %ch
# %ah - sector
@ -233,8 +233,9 @@ _sector_num:
and %al, %dh
sar $1, %al
mov %al, %ch # track
mov %al, %ch # track
mov %ah, %cl # sector
inc %cl # sectors are 1indexed
mov $1, %al # read only one sector
xor %bx, %bx # write to es:bx