wok rev 25449

BootProg/boot32.asm: floppy chs support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Sep 12 16:35:46 2022 +0000 (20 months ago)
parents 03fa4e9f1f0b
children 62d43c1b8453
files BootProg/stuff/boot32.asm coccinella/receipt pwsafe/receipt python-pygame-dev/receipt python-pygame/receipt tsclient/receipt xz/receipt
line diff
     1.1 --- a/BootProg/stuff/boot32.asm	Fri Sep 09 09:27:07 2022 +0000
     1.2 +++ b/BootProg/stuff/boot32.asm	Mon Sep 12 16:35:46 2022 +0000
     1.3 @@ -78,6 +78,13 @@
     1.4  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     1.5  
     1.6  %define bx(label)       bx+label-boot
     1.7 +%define si(label)       si+label-boot
     1.8 +ClusterMask             equ     1               ; +9 bytes
     1.9 +NullEntryCheck          equ     1               ; +5 bytes
    1.10 +ReadRetry               equ     1               ; +7 bytes
    1.11 +LBA48bits               equ     1               ; +13 bytes
    1.12 +CHSsupport              equ     1               ; +27 bytes
    1.13 +CHShardDisk             equ     0               ; +11 bytes
    1.14  
    1.15  [BITS 16]
    1.16  
    1.17 @@ -92,7 +99,6 @@
    1.18  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    1.19  
    1.20  boot:
    1.21 -HiLBA                   equ     boot+0
    1.22          jmp     short   start                   ; MS-DOS/Windows checks for this jump
    1.23          nop
    1.24  bsOemName               DB      "BootProg"      ; 0x03
    1.25 @@ -130,6 +136,12 @@
    1.26  bsBackupBootSectorNo            DW      0               ; 0x32
    1.27  bsreserved             times 12 DB      0               ; 0x34
    1.28  bsDriveNumber                   DB      0               ; 0x40
    1.29 +%if LBA48bits != 0
    1.30 +HiLBA                   equ     boot+0
    1.31 +DriveNumber             equ     bsDriveNumber+0
    1.32 +%else
    1.33 +DriveNumber             equ     boot+0
    1.34 +%endif
    1.35  bsreserved1                     DB      0               ; 0x41
    1.36  bsExtendedBootSignature         DB      0               ; 0x42
    1.37  bsVolumeSerialNumber            DD      0               ; 0x43
    1.38 @@ -172,29 +184,32 @@
    1.39          mov     si, 7C00h
    1.40          xor     di, di
    1.41          mov     ds, di
    1.42 +        push    es
    1.43 +        push    byte main
    1.44 +        mov     [si(DriveNumber)], dx  ; store BIOS boot drive number
    1.45          rep     movsw
    1.46  
    1.47  ;;;;;;;;;;;;;;;;;;;;;;
    1.48  ;; Jump to the copy ;;
    1.49  ;;;;;;;;;;;;;;;;;;;;;;
    1.50  
    1.51 -        push    es
    1.52 -        push    byte main
    1.53          retf
    1.54  
    1.55  main:
    1.56          push    cs
    1.57          pop     ds
    1.58  
    1.59 -        xor     bx, bx
    1.60 -        mov     [bx(bsDriveNumber)], dx  ; store BIOS boot drive number
    1.61 +        xor     ebx, ebx
    1.62  
    1.63 +%if ClusterMask != 0
    1.64          and     byte [bx(bsRootDirectoryClusterNo+3)], 0Fh ; mask cluster value
    1.65 +%endif
    1.66          mov     esi, [bx(bsRootDirectoryClusterNo)] ; esi=cluster # of root dir
    1.67  
    1.68 -RootDirReadContinue:
    1.69          push    byte ImageLoadSeg
    1.70          pop     es
    1.71 +
    1.72 +RootDirReadContinue:
    1.73          call    ReadCluster             ; read one cluster of root dir
    1.74          pushf                           ; save carry="not last cluster" flag
    1.75  
    1.76 @@ -209,16 +224,15 @@
    1.77  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    1.78  ;; Input:  DS:SI -> file name (11 chars) ;;
    1.79  ;;         ES:DI -> root directory array ;;
    1.80 -;;         DX = number of root entries   ;;
    1.81  ;;         BP = paragraphs in sector     ;;
    1.82  ;; Output: ESI = cluster number          ;;
    1.83  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    1.84  
    1.85 -FindName:
    1.86  FindNameCycle:
    1.87 +%if NullEntryCheck != 0
    1.88          cmp     byte [es:di], bh
    1.89          je      ErrFind                 ; end of root directory (NULL entry found)
    1.90 -FindNameNotEnd:
    1.91 +%endif
    1.92          pusha
    1.93          mov     cl, 11
    1.94          mov     si, ProgramName         ; ds:si -> program name
    1.95 @@ -339,7 +353,7 @@
    1.96  ReadCluster:
    1.97          mov     bp, [bx(bpbBytesPerSector)]
    1.98          shr     bp, 4                           ; bp = paragraphs per sector
    1.99 -        add     eax, byte 1                     ; adjust LBA for next sector
   1.100 +        mov     dx, 1                           ; adjust LBA for next sector
   1.101          inc     cx
   1.102          loop    ReadSectorLBA
   1.103  
   1.104 @@ -352,36 +366,41 @@
   1.105  ;;         BP -> para / sector  ;;
   1.106  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   1.107  
   1.108 +        mul     ebx                             ; edx:eax = 0
   1.109          imul    ax, bp, byte 4                  ; ax=# of FAT32 entries per sector
   1.110 -        cwde
   1.111          lea     edi, [esi-2]                    ; esi=cluster #
   1.112          xchg    eax, esi
   1.113 -        cdq
   1.114          div     esi                             ; eax=FAT sector #, edx=entry # in sector
   1.115  
   1.116          imul    si, dx, byte 4                  ; si=entry # in sector, clear C
   1.117 -        mov     word [bx(HiLBA)], bx
   1.118 +%if LBA48bits != 0
   1.119 +        xor     dx, dx                          ; clear C
   1.120 +%endif
   1.121          call    ReadSectorLBAabsolute           ; read 1 FAT32 sector
   1.122  
   1.123 +%if ClusterMask != 0
   1.124          and     byte [es:si+3], 0Fh             ; mask cluster value
   1.125 +%endif
   1.126          mov     esi, [es:si]                    ; esi=next cluster #
   1.127  
   1.128          movzx   eax, byte [bx(bpbNumberOfFATs)]
   1.129          mul     dword [bx(bsSectorsPerFAT32)]
   1.130 -        mov     word [bx(HiLBA)], dx
   1.131  
   1.132          xchg    eax, edi
   1.133          movzx   ecx, byte [bx(bpbSectorsPerCluster)]
   1.134          mul     ecx                             ; edx:eax=sector number in data area
   1.135 -
   1.136          add     eax, edi
   1.137 -        adc     word [bx(HiLBA)], dx
   1.138  
   1.139  ReadSectorLBAabsolute:
   1.140 +%if LBA48bits != 0
   1.141 +        adc     dx, bx
   1.142 +        mov     word [bx(HiLBA)], dx
   1.143 +%endif
   1.144 +        add     eax, [bx(bpbHiddenSectors)]
   1.145 +%if LBA48bits != 0
   1.146 +        adc     word [bx(HiLBA)], bx
   1.147 +%endif
   1.148          mov     dx, word [bx(bpbReservedSectors)]
   1.149 -        add     eax, edx
   1.150 -        adc     word [bx(HiLBA)], bx
   1.151 -        add     eax, [bx(bpbHiddenSectors)]
   1.152  
   1.153  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   1.154  ;; Reads a sector using BIOS Int 13h fn 42h ;;
   1.155 @@ -393,29 +412,87 @@
   1.156  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   1.157  
   1.158  ReadSectorLBA:
   1.159 +        add     eax, edx
   1.160 +%if LBA48bits != 0
   1.161          adc     word [bx(HiLBA)], bx
   1.162 -        mov     dx, [bx(bsDriveNumber)] ; restore BIOS boot drive number
   1.163 +%endif
   1.164 +        mov     dx, [bx(DriveNumber)]   ; restore BIOS boot drive number
   1.165          pusha
   1.166  
   1.167          push    bx
   1.168 +%if LBA48bits != 0
   1.169          push    word [bx(HiLBA)]        ; 48-bit LBA
   1.170 +%else
   1.171 +        push    bx
   1.172 +%endif
   1.173          push    eax
   1.174          push    es
   1.175          push    bx
   1.176          push    byte 1 ; sector count word = 1
   1.177          push    byte 16 ; packet size byte = 16, reserved byte = 0
   1.178  
   1.179 +%if CHSsupport != 0
   1.180 +%if CHShardDisk != 0
   1.181 +        push    eax
   1.182 +        pop     cx                      ; save low LBA
   1.183 +        pop     ax                      ; get high LBA
   1.184 +        cwd                             ; clear dx (assume LBA offset <1TB)
   1.185 +        idiv    word [bx(bpbSectorsPerTrack)] ; up to 8GB disks, avoid divide error
   1.186 +
   1.187 +        xchg    ax, cx                  ; restore low LBA, save high LBA / SPT
   1.188 +        div     word [bx(bpbSectorsPerTrack)]
   1.189 +%else
   1.190 +; Busybox mkdosfs creates fat32 for floppies.
   1.191 +; Floppies may support CHS only.
   1.192 +        cwd                             ; clear dx (LBA offset <16MB)
   1.193 +        idiv    word [bx(bpbSectorsPerTrack)]
   1.194 +        xor     cx, cx
   1.195 +%endif
   1.196 +                ; ax = LBA / SPT
   1.197 +                ; dx = LBA % SPT         = sector - 1
   1.198 +        inc     dx
   1.199 +
   1.200 +        xchg    cx, dx                  ; restore high LBA / SPT, save sector no.
   1.201 +        div     word [bx(bpbHeadsPerCylinder)]
   1.202 +                ; ax = (LBA / SPT) / HPC = cylinder
   1.203 +                ; dx = (LBA / SPT) % HPC = head
   1.204 +
   1.205 +        mov     ch, al
   1.206 +                ; ch = LSB 0...7 of cylinder no.
   1.207 +%if CHShardDisk != 0
   1.208 +        shl     ah, 6
   1.209 +        or      cl, ah
   1.210 +                ; cl = MSB 8...9 of cylinder no. + sector no.
   1.211 +%endif
   1.212 +        mov     dh, dl
   1.213 +                ; dh = head no.
   1.214 +        mov     dl, [bx(DriveNumber)]   ; restore BIOS boot drive number
   1.215 +%endif
   1.216 +
   1.217  ReadSectorLBARetry:
   1.218          mov     si, sp
   1.219          mov     ah, 42h                 ; ah = 42h = extended read function no.
   1.220          int     13h                     ; extended read sectors (DL, DS:SI)
   1.221          jnc     ReadSuccess             ; CF = 0 if no error
   1.222  
   1.223 +%if CHSsupport != 0
   1.224 +        mov     ax, 201h                ; al = sector count = 1
   1.225 +                                        ; ah = 2 = read function no.
   1.226 +        int     13h                     ; read sectors (AL, CX, DX, ES:BX)
   1.227 +
   1.228 +        jnc     ReadSuccess             ; CF = 0 if no error
   1.229 +%endif
   1.230 +%if ReadRetry != 0
   1.231 +%if CHSsupport != 0
   1.232 +        cbw                             ; ah = 0 = reset function
   1.233 +%else
   1.234          xor     ax, ax                  ; ah = 0 = reset function
   1.235 +%endif
   1.236          int     13h                     ; reset drive (DL)
   1.237  
   1.238          dec     bp
   1.239          jnz     ReadSectorLBARetry
   1.240 +%endif
   1.241  
   1.242          call    Error
   1.243          db      "Read error."
   1.244 @@ -466,7 +543,7 @@
   1.245  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   1.246  
   1.247  ProgramName     db      "STARTUP BIN"   ; name and extension each must be
   1.248 -                                        ; padded with spaces (11 bytes total)
   1.249 +                times (510-($-$$)) db ' ' ; padded with spaces (11 bytes total)
   1.250  
   1.251  ;;;;;;;;;;;;;;;;;;;;;;;;;;
   1.252  ;; End of the sector ID ;;
     2.1 --- a/coccinella/receipt	Fri Sep 09 09:27:07 2022 +0000
     2.2 +++ b/coccinella/receipt	Mon Sep 12 16:35:46 2022 +0000
     2.3 @@ -7,7 +7,7 @@
     2.4  SHORT_DESC="Cross-platform communication tool with a built-in whiteboard."
     2.5  MAINTAINER="pascal.bellard@slitaz.org"
     2.6  LICENSE="GPL3"
     2.7 -WEB_SITE="https://thecoccinella.org/"
     2.8 +WEB_SITE="http://thecoccinella.org/"
     2.9  TARBALL="$SOURCE-${VERSION}Src.tar.gz"
    2.10  WGET_URL="$SF_MIRROR/project/$PACKAGE/$PACKAGE/$VERSION/$TARBALL"
    2.11  
     3.1 --- a/pwsafe/receipt	Fri Sep 09 09:27:07 2022 +0000
     3.2 +++ b/pwsafe/receipt	Mon Sep 12 16:35:46 2022 +0000
     3.3 @@ -7,7 +7,7 @@
     3.4  MAINTAINER="rocky@slitaz.org"
     3.5  LICENSE="GPL2"
     3.6  TARBALL="$PACKAGE-$VERSION.tar.gz"
     3.7 -WEB_SITE="https://sourceforge.net/projects/pwsafe"
     3.8 +WEB_SITE="https://github.com/nsd20463/pwsafe/"
     3.9  WGET_URL="https://fossies.org/linux/privat/old/$TARBALL"
    3.10  
    3.11  DEPENDS="readline ncurses xorg-libSM xorg-libICE xorg-libXmu xorg-libX11 \
    3.12 @@ -17,14 +17,13 @@
    3.13  # What is the latest version available today?
    3.14  current_version()
    3.15  {
    3.16 -	wget -O - https://github.com/pwsafe/pwsafe/releases 2>/dev/null | \
    3.17 +	wget -O - https://github.com/nsd20463/pwsafe/releases 2>/dev/null | \
    3.18  	sed '/archive.*tar/!d;s|.*/v*\(.*\).tar.*|\1|;q'
    3.19  }
    3.20  
    3.21  # Rules to configure and make the package.
    3.22  compile_rules()
    3.23  {
    3.24 -    cd $src
    3.25      ./configure --prefix=/usr \
    3.26          --infodir=/usr/share/info \
    3.27          --mandir=/usr/share/man \
     4.1 --- a/python-pygame-dev/receipt	Fri Sep 09 09:27:07 2022 +0000
     4.2 +++ b/python-pygame-dev/receipt	Mon Sep 12 16:35:46 2022 +0000
     4.3 @@ -6,7 +6,7 @@
     4.4  SHORT_DESC="Python game development files."
     4.5  MAINTAINER="claudinei@slitaz.org"
     4.6  LICENSE="LGPL"
     4.7 -WEB_SITE="https://www.pygame.org/"
     4.8 +WEB_SITE="https://pypi.org/project/pygame/"
     4.9  WANTED="python-pygame"
    4.10  
    4.11  # Rules to gen a SliTaz package suitable for Tazpkg.
     5.1 --- a/python-pygame/receipt	Fri Sep 09 09:27:07 2022 +0000
     5.2 +++ b/python-pygame/receipt	Mon Sep 12 16:35:46 2022 +0000
     5.3 @@ -8,8 +8,8 @@
     5.4  MAINTAINER="claudinei@slitaz.org"
     5.5  LICENSE="LGPL"
     5.6  TARBALL="$SOURCE-$VERSION.tar.gz"
     5.7 -WEB_SITE="https://www.pygame.org/"
     5.8 -WGET_URL="$WEB_SITE/ftp/$TARBALL"
     5.9 +WEB_SITE="https://pypi.org/project/pygame/"
    5.10 +WGET_URL="https://github.com/pygame/pygame/archive/refs/tags/release_${VERSION//./_}.tar.gz"
    5.11  
    5.12  DEPENDS="python libsdl libsdl-image libsdl-mixer libsdl-ttf python-numpy \
    5.13  libsmpeg gcc-lib-base"
     6.1 --- a/tsclient/receipt	Fri Sep 09 09:27:07 2022 +0000
     6.2 +++ b/tsclient/receipt	Mon Sep 12 16:35:46 2022 +0000
     6.3 @@ -7,7 +7,7 @@
     6.4  MAINTAINER="pankso@slitaz.org"
     6.5  LICENSE="GPL2"
     6.6  TARBALL="$PACKAGE-$VERSION.tar.gz"
     6.7 -WEB_SITE="https://sourceforge.net/projects/tsclient/"
     6.8 +WEB_SITE="https://remmina.org/"
     6.9  WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    6.10  TAGS="remote-desktop"
    6.11  
     7.1 --- a/xz/receipt	Fri Sep 09 09:27:07 2022 +0000
     7.2 +++ b/xz/receipt	Mon Sep 12 16:35:46 2022 +0000
     7.3 @@ -10,7 +10,7 @@
     7.4  WEB_SITE="https://tukaani.org/xz"
     7.5  
     7.6  TARBALL="$PACKAGE-$VERSION.tar.xz"
     7.7 -WGET_URL="$WEB_SITE/$TARBALL"
     7.8 +WGET_URL="$SF_MIRROR/lzmautils/$TARBALL"
     7.9  
    7.10  DEPENDS="liblzma"
    7.11  BUILD_DEPENDS=""