Mdasoh Kyappd
2017-02-01 00:23:26 UTC
this patch is a suggestion for the bootsector to boot on older (like my XT) machines
where the drive requires a few retries before loading a sector. The resulting binary
might be too big actually. In this case I would like a bit of help fitting it in there.
yours,
- Mdasoh Kyaeppd
--- boot.ori/boot.asm 2017-01-30 02:08:55.835437500 -0700
+++ boot/boot.asm 2017-01-31 13:06:37.742679500 -0700
@@ -423,7 +423,7 @@
; setup LBA disk block
mov LBA_SECTOR_32,bx ; bx is 0 if extended 13h mode supported
mov LBA_SECTOR_48,bx
-
+ mov si,1
mov ah,042h
jmp short do_int13_read
@@ -472,12 +472,20 @@
inc cx ; make sector 1-based (1-63)
les bx,[LBA_OFF]
+ mov si,5
+do_chs_read:
mov ax, 0x0201
do_int13_read:
mov dl, [drive]
- int 0x13
- jc boot_error ; exit on error
+ int 0x13 ; read data from disk
+ jnc did_int13_read
+ xor ax,ax
+ int 0x13
+ dec si
+ jz boot_error ; exit on error
+ jmp do_chs_read ; prod it a few times
+did_int13_read:
mov ax, word [bsBytesPerSec]
push di
where the drive requires a few retries before loading a sector. The resulting binary
might be too big actually. In this case I would like a bit of help fitting it in there.
yours,
- Mdasoh Kyaeppd
--- boot.ori/boot.asm 2017-01-30 02:08:55.835437500 -0700
+++ boot/boot.asm 2017-01-31 13:06:37.742679500 -0700
@@ -423,7 +423,7 @@
; setup LBA disk block
mov LBA_SECTOR_32,bx ; bx is 0 if extended 13h mode supported
mov LBA_SECTOR_48,bx
-
+ mov si,1
mov ah,042h
jmp short do_int13_read
@@ -472,12 +472,20 @@
inc cx ; make sector 1-based (1-63)
les bx,[LBA_OFF]
+ mov si,5
+do_chs_read:
mov ax, 0x0201
do_int13_read:
mov dl, [drive]
- int 0x13
- jc boot_error ; exit on error
+ int 0x13 ; read data from disk
+ jnc did_int13_read
+ xor ax,ax
+ int 0x13
+ dec si
+ jz boot_error ; exit on error
+ jmp do_chs_read ; prod it a few times
+did_int13_read:
mov ax, word [bsBytesPerSec]
push di