wok diff BootProg/stuff/bootex.asm @ rev 25037

Up glza (0.11.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 21 21:38:29 2022 +0000 (2022-05-21)
parents 584e67527789
children 65784e875d45
line diff
     1.1 --- a/BootProg/stuff/bootex.asm	Fri Apr 22 16:00:56 2022 +0000
     1.2 +++ b/BootProg/stuff/bootex.asm	Sat May 21 21:38:29 2022 +0000
     1.3 @@ -169,7 +169,7 @@
     1.4          pop     ds
     1.5  
     1.6          xor     ebx, ebx
     1.7 -        mov     [bx], dx                ; store BIOS boot drive number
     1.8 +        mov     [bx], dl                ; store BIOS boot drive number
     1.9  
    1.10          mov     esi, [bx(bpbRootDirCluster)] ; esi=cluster # of root dir
    1.11  
    1.12 @@ -213,7 +213,7 @@
    1.13          mov     al, [es:di+bx]
    1.14          mov     [bx], al
    1.15          dec     bx
    1.16 -        jnz     CopyInfo
    1.17 +        jnz     CopyInfo		; keep BIOS boot drive number
    1.18  
    1.19  NotFileInfo:
    1.20          mov     al, 0c1h                ; EXFAT_ENTRY_FILE_NAME ?
    1.21 @@ -232,7 +232,7 @@
    1.22          popf                            ; restore carry="not last sector" flag
    1.23          jc      RootDirReadContinue     ; continue to the next root dir cluster
    1.24  FindNameFailed:                         ; end of root directory (dir end reached)
    1.25 -        mov     dx, [bx]                ; restore BIOS boot drive number
    1.26 +        mov     dl, [bx]                ; restore BIOS boot drive number
    1.27          call    Error
    1.28          db      "File not found."
    1.29  FindNameFound:
    1.30 @@ -252,7 +252,7 @@
    1.31          call    ReadCluster             ; read one more sector of the boot file
    1.32          sub     [bx+FileSize], ebp
    1.33          ja      FileReadContinue
    1.34 -        mov     dx, [bx]                ; restore BIOS boot drive number
    1.35 +        mov     dl, [bx]                ; restore BIOS boot drive number
    1.36          xor     ax, ax
    1.37          pop     bp
    1.38  
    1.39 @@ -370,11 +370,10 @@
    1.40  
    1.41          mov     esi, [es:si]                    ; esi=next cluster #
    1.42  
    1.43 -        xor     eax, eax
    1.44 -        inc     ax
    1.45 +        inc     dx
    1.46          mov     cl, [bx(bpbSectorPerClusterBits)]
    1.47 -        shl     eax, cl                         ; 10000h max (32MB cluster)
    1.48 -        xchg    eax, ecx
    1.49 +        shl     edx, cl                         ; 10000h max (32MB cluster)
    1.50 +        mov     ecx, edx
    1.51          xchg    eax, edi                        ; get cluster #-2
    1.52          mul     ecx
    1.53  
    1.54 @@ -408,18 +407,19 @@
    1.55          push    es
    1.56          push    bx
    1.57          push    bp                      ; sector count word = 1
    1.58 -        push    byte 16                 ; packet size byte = 16, reserved byte = 0
    1.59 +        mov     cx, 16
    1.60 +        push    cx                      ; packet size byte = 16, reserved byte = 0
    1.61  ReadSectorRetry:        
    1.62          mov     si, sp
    1.63          mov     ah, 42h                 ; ah = 42h = extended read function no.
    1.64 -        mov     dx, [bx]                ; restore BIOS boot drive number
    1.65 +        mov     dl, [bx]                ; restore BIOS boot drive number
    1.66          int     13h                     ; extended read sectors (DL, DS:SI)
    1.67  
    1.68          jnc     ReadSuccess
    1.69  
    1.70          xor     ax, ax
    1.71          int     13h                     ; reset drive (DL)
    1.72 -        loop    ReadSectorRetry         ; sector count retries (8 .. 65536)
    1.73 +        loop    ReadSectorRetry         ; up to 16 retries
    1.74  
    1.75          call    Error
    1.76          db      "Read error."