wok rev 24945

fix BootProg
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Apr 22 16:00:56 2022 +0000 (2022-04-22)
parents 27c5a4be1423
children c145e26c3fc5
files BootProg/stuff/boot16.asm BootProg/stuff/boot32.asm BootProg/stuff/bootex.asm drupal/receipt memtest-serial/receipt memtest/receipt
line diff
     1.1 --- a/BootProg/stuff/boot16.asm	Fri Apr 22 16:44:33 2022 +0100
     1.2 +++ b/BootProg/stuff/boot16.asm	Fri Apr 22 16:00:56 2022 +0000
     1.3 @@ -64,12 +64,12 @@
     1.4  ;;                                                                          ;;
     1.5  ;;                   Boot Image Startup (register values):                  ;;
     1.6  ;;                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  ;;
     1.7 -;;  dl = BIOS boot drive number (e.g. 0, 80H)                               ;;
     1.8 +;;  ax = 0ffffh (both FCB in the PSP don't have a valid drive identifier),  ;;
     1.9 +;;  bx = cx = 0, dl = BIOS boot drive number (e.g. 0, 80H)                  ;;
    1.10  ;;  cs:ip = program entry point                                             ;;
    1.11  ;;  ss:sp = program stack (don't confuse with boot sector's stack)          ;;
    1.12  ;;  COM program defaults: cs = ds = es = ss = 50h, sp = 0, ip = 100h        ;;
    1.13  ;;  EXE program defaults: ds = es = EXE data - 10h (fake MS-DOS psp),       ;;
    1.14 -;;  ax = 0ffffh (both FCB in the PSP don't have a valid drive identifier),  ;;
    1.15  ;;  cs:ip and ss:sp depends on EXE header                                   ;;
    1.16  ;;  Magic numbers:                                                          ;;
    1.17  ;;    si = 16381 (prime number 2**14-3)                                     ;;
    1.18 @@ -78,6 +78,7 @@
    1.19  ;;  The magic numbers let the program know whether it has been loaded by    ;;
    1.20  ;;  this boot sector or by MS-DOS, which may be handy for universal, bare-  ;;
    1.21  ;;  metal and MS-DOS programs.                                              ;;
    1.22 +;;  The command line contains no arguments.                                 ;;
    1.23  ;;                                                                          ;;
    1.24  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    1.25  
    1.26 @@ -213,7 +214,7 @@
    1.27          mul     bx                      ; dx:ax = 0 = LBA (LBA are relative to FAT)
    1.28          mov     cx, word [bx(bpbSectorsPerFAT)]
    1.29  
    1.30 -        call    ReadCXSectors           ; read fat and clear ax & cx
    1.31 +        call    ReadCXSectors           ; read fat and clear ax & cx; bp = SectorsPerFAT
    1.32  
    1.33  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    1.34  ;; load the root directory in ;;
    1.35 @@ -230,7 +231,7 @@
    1.36          mul     bp                      ; [bx(bpbSectorsPerFAT)], set by ReadCXSectors
    1.37  
    1.38          push    es
    1.39 -        call    ReadCXSectors           ; read root directory; clear ax, cx and di
    1.40 +        call    ReadCXSectors           ; read root directory; clear ax, cx & di; bp = first data sector
    1.41          pop     es
    1.42  
    1.43  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    1.44 @@ -334,6 +335,7 @@
    1.45  ;;         SI = cluster list ;;
    1.46  ;;         DI = file sectors ;;
    1.47  ;;         CH = 0            ;;
    1.48 +;;         BP = 1st data sec ;;
    1.49  ;; Output: BP:0 -> buffer    ;;
    1.50  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    1.51  
     2.1 --- a/BootProg/stuff/boot32.asm	Fri Apr 22 16:44:33 2022 +0100
     2.2 +++ b/BootProg/stuff/boot32.asm	Fri Apr 22 16:00:56 2022 +0000
     2.3 @@ -59,12 +59,12 @@
     2.4  ;;                                                                          ;;
     2.5  ;;                   Boot Image Startup (register values):                  ;;
     2.6  ;;                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  ;;
     2.7 -;;  dl = BIOS boot drive number (e.g. 80H)                                  ;;
     2.8 +;;  ax = 0ffffh (both FCB in the PSP don't have a valid drive identifier),  ;;
     2.9 +;;  bx = cx = 0, dl = BIOS boot drive number (e.g. 0, 80H)                  ;;
    2.10  ;;  cs:ip = program entry point                                             ;;
    2.11  ;;  ss:sp = program stack (don't confuse with boot sector's stack)          ;;
    2.12  ;;  COM program defaults: cs = ds = es = ss = 50h, sp = 0, ip = 100h        ;;
    2.13  ;;  EXE program defaults: ds = es = EXE data - 10h (fake MS-DOS psp),       ;;
    2.14 -;;  ax = 0ffffh (both FCB in the PSP don't have a valid drive identifier),  ;;
    2.15  ;;  cs:ip and ss:sp depends on EXE header                                   ;;
    2.16  ;;  Magic numbers:                                                          ;;
    2.17  ;;    si = 16381 (prime number 2**14-3)                                     ;;
    2.18 @@ -73,6 +73,7 @@
    2.19  ;;  The magic numbers let the program know whether it has been loaded by    ;;
    2.20  ;;  this boot sector or by MS-DOS, which may be handy for universal, bare-  ;;
    2.21  ;;  metal and MS-DOS programs.                                              ;;
    2.22 +;;  The command line contains no arguments.                                 ;;
    2.23  ;;                                                                          ;;
    2.24  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    2.25  
    2.26 @@ -303,8 +304,10 @@
    2.27          dec     word [bx+06h]           ; reloc items, 32768 max (128KB table)
    2.28          jns     ReloCycle
    2.29  
    2.30 -        add     [bx+0Eh], bp
    2.31 -        lss     sp, [bx+0Eh]            ; ss:sp for EXE
    2.32 +        les     si, [bx+0Eh]
    2.33 +        add     si, bp
    2.34 +        mov     ss, si                  ; ss for EXE
    2.35 +        mov     sp, es                  ; sp for EXE
    2.36  
    2.37          lea     si, [bp-10h]            ; ds and es both point to the segment
    2.38          push    si                      ; containing the PSP structure
    2.39 @@ -336,7 +339,7 @@
    2.40  ReadCluster:
    2.41          mov     bp, [bx(bpbBytesPerSector)]
    2.42          shr     bp, 4                           ; bp = paragraphs per sector
    2.43 -        add     eax, byte 1             ; adjust LBA for next sector
    2.44 +        add     eax, byte 1                     ; adjust LBA for next sector
    2.45          inc     cx
    2.46          loop    ReadSectorLBA
    2.47  
    2.48 @@ -349,7 +352,7 @@
    2.49  ;;         BP -> para / sector  ;;
    2.50  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    2.51  
    2.52 -        imul    ax, bp, byte 2                  ; ax=# of FAT32 entries per sector
    2.53 +        imul    ax, bp, byte 4                  ; ax=# of FAT32 entries per sector
    2.54          cwde
    2.55          lea     edi, [esi-2]                    ; esi=cluster #
    2.56          xchg    eax, esi
    2.57 @@ -369,7 +372,7 @@
    2.58  
    2.59          xchg    eax, edi
    2.60          movzx   ecx, byte [bx(bpbSectorsPerCluster)]
    2.61 -        mul     ecx				; edx:eax=sector number in data area
    2.62 +        mul     ecx                             ; edx:eax=sector number in data area
    2.63  
    2.64          add     eax, edi
    2.65          adc     word [bx(HiLBA)], dx
    2.66 @@ -408,7 +411,7 @@
    2.67          int     13h                     ; extended read sectors (DL, DS:SI)
    2.68          jnc     ReadSuccess             ; CF = 0 if no error
    2.69  
    2.70 -        cbw                             ; ah = 0 = reset function
    2.71 +        xor     ax, ax                  ; ah = 0 = reset function
    2.72          int     13h                     ; reset drive (DL)
    2.73  
    2.74          dec     bp
     3.1 --- a/BootProg/stuff/bootex.asm	Fri Apr 22 16:44:33 2022 +0100
     3.2 +++ b/BootProg/stuff/bootex.asm	Fri Apr 22 16:00:56 2022 +0000
     3.3 @@ -58,12 +58,12 @@
     3.4  ;;                                                                          ;;
     3.5  ;;                   Boot Image Startup (register values):                  ;;
     3.6  ;;                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  ;;
     3.7 -;;  dl = BIOS boot drive number (e.g. 80H)                                  ;;
     3.8 +;;  ax = 0ffffh (both FCB in the PSP don't have a valid drive identifier),  ;;
     3.9 +;;  bx = cx = 0, dl = BIOS boot drive number (e.g. 0, 80H)                  ;;
    3.10  ;;  cs:ip = program entry point                                             ;;
    3.11  ;;  ss:sp = program stack (don't confuse with boot sector's stack)          ;;
    3.12  ;;  COM program defaults: cs = ds = es = ss = 50h, sp = 0, ip = 100h        ;;
    3.13  ;;  EXE program defaults: ds = es = EXE data - 10h (fake MS-DOS psp),       ;;
    3.14 -;;  ax = 0ffffh (both FCB in the PSP don't have a valid drive identifier),  ;;
    3.15  ;;  cs:ip and ss:sp depends on EXE header                                   ;;
    3.16  ;;  Magic numbers:                                                          ;;
    3.17  ;;    si = 16381 (prime number 2**14-3)                                     ;;
    3.18 @@ -72,6 +72,7 @@
    3.19  ;;  The magic numbers let the program know whether it has been loaded by    ;;
    3.20  ;;  this boot sector or by MS-DOS, which may be handy for universal, bare-  ;;
    3.21  ;;  metal and MS-DOS programs.                                              ;;
    3.22 +;;  The command line contains no arguments.                                 ;;
    3.23  ;;                                                                          ;;
    3.24  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    3.25  
    3.26 @@ -226,8 +227,8 @@
    3.27          popa                            ; restore ax, cx, si, di
    3.28  
    3.29          add     di, byte 32
    3.30 -        sub     bp, byte 32
    3.31 -        jnz     FindNameCycle           ; next root entry
    3.32 +        cmp     di, bp
    3.33 +        jne     FindNameCycle           ; next root entry
    3.34          popf                            ; restore carry="not last sector" flag
    3.35          jc      RootDirReadContinue     ; continue to the next root dir cluster
    3.36  FindNameFailed:                         ; end of root directory (dir end reached)
    3.37 @@ -242,6 +243,7 @@
    3.38  ;;;;;;;;;;;;;;;;;;;;;;;;;;
    3.39  
    3.40          push    es
    3.41 +        xor     bp, bp
    3.42  FileReadContinue:
    3.43          shr     bp, 4                   ; bytes to paragraphs
    3.44          mov     di, es
    3.45 @@ -298,8 +300,10 @@
    3.46          dec     word [bx+06h]           ; reloc items, 32768 max (128KB table)
    3.47          jns     ReloCycle
    3.48  
    3.49 -        add     [bx+0Eh], bp
    3.50 -        lss     sp, [bx+0Eh]            ; ss:sp for EXE
    3.51 +        les     si, [bx+0Eh]
    3.52 +        add     si, bp
    3.53 +        mov     ss, si                  ; ss for EXE
    3.54 +        mov     sp, es                  ; sp for EXE
    3.55  
    3.56          lea     si, [bp-10h]            ; ds and es both point to the segment
    3.57          push    si                      ; containing the PSP structure
    3.58 @@ -344,16 +348,16 @@
    3.59  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    3.60  
    3.61  ReadCluster:
    3.62 +        add     eax, byte 1
    3.63 +
    3.64          inc     cx                              ; jcxnz
    3.65 -        add     eax, byte 1
    3.66          loop    ReadSectorC
    3.67  
    3.68 +        mul     ebx                             ; edx:eax = 0
    3.69          mov     cl, [bx(bpbSectorSizeBits)]
    3.70          dec     cx
    3.71 -        dec     cx
    3.72 -        mul     ebx                             ; edx:eax = 0
    3.73 -        inc     ax
    3.74 -        shl     eax, cl                         ; eax=# of exFAT entries per sector
    3.75 +        stc
    3.76 +        rcl     eax, cl                         ; eax=# of exFAT entries per sector
    3.77          lea     edi, [esi-2]                    ; edi=cluster #-2
    3.78          xchg    eax, esi
    3.79          div     esi                             ; eax=FAT sector #, edx=entry # in sector
    3.80 @@ -404,8 +408,7 @@
    3.81          push    es
    3.82          push    bx
    3.83          push    bp                      ; sector count word = 1
    3.84 -        mov     cx, 16
    3.85 -        push    cx                      ; packet size byte = 16, reserved byte = 0
    3.86 +        push    byte 16                 ; packet size byte = 16, reserved byte = 0
    3.87  ReadSectorRetry:        
    3.88          mov     si, sp
    3.89          mov     ah, 42h                 ; ah = 42h = extended read function no.
    3.90 @@ -416,7 +419,7 @@
    3.91  
    3.92          xor     ax, ax
    3.93          int     13h                     ; reset drive (DL)
    3.94 -        loop    ReadSectorRetry
    3.95 +        loop    ReadSectorRetry         ; sector count retries (8 .. 65536)
    3.96  
    3.97          call    Error
    3.98          db      "Read error."
     4.1 --- a/drupal/receipt	Fri Apr 22 16:44:33 2022 +0100
     4.2 +++ b/drupal/receipt	Fri Apr 22 16:00:56 2022 +0000
     4.3 @@ -6,7 +6,7 @@
     4.4  SHORT_DESC="PHP content management system."
     4.5  MAINTAINER="slaxemulator@gmail.com"
     4.6  LICENSE="GPL2"
     4.7 -WEB_SITE="https://www.drupal.org/"
     4.8 +WEB_SITE="https://git.drupalcode.org/project/drupal"
     4.9  
    4.10  TARBALL="$PACKAGE-$VERSION.tar.gz"
    4.11  WGET_URL="https://ftp.drupal.org/files/projects/$TARBALL"
    4.12 @@ -17,8 +17,8 @@
    4.13  # What is the latest version available today?
    4.14  current_version()
    4.15  {
    4.16 -	wget -O - ${WGET_URL%/*} 2>/dev/null | \
    4.17 -	sed "/latest/d;/$PACKAGE-[0-9]/!d;/dev/d;/-rc/d;/-beta/d;/-alpha/d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
    4.18 +	wget -O - https://git.drupalcode.org/project/drupal/-/tags?sort=updated_desc 2>/dev/null | \
    4.19 +	sed '/item-title/!d;/alpha/d;s|.*">||;s|<.*||' | sort -Vr | sed q
    4.20  }
    4.21  
    4.22  # Rules to gen a SliTaz package suitable for Tazpkg.
     5.1 --- a/memtest-serial/receipt	Fri Apr 22 16:44:33 2022 +0100
     5.2 +++ b/memtest-serial/receipt	Fri Apr 22 16:00:56 2022 +0000
     5.3 @@ -7,8 +7,8 @@
     5.4  MAINTAINER="pascal.bellard@slitaz.org"
     5.5  LICENSE="GPL2"
     5.6  WEB_SITE="http://www.memtest.org/"
     5.7 +PROVIDE="memtest"
     5.8  WANTED="memtest"
     5.9 -PROVIDE="memtest"
    5.10  
    5.11  # Rules to gen a SliTaz package suitable for Tazpkg.
    5.12  genpkg_rules()
     6.1 --- a/memtest/receipt	Fri Apr 22 16:44:33 2022 +0100
     6.2 +++ b/memtest/receipt	Fri Apr 22 16:00:56 2022 +0000
     6.3 @@ -52,7 +52,7 @@
     6.4  		-e 's/SERIAL_BAUD_RATE 9600/SERIAL_BAUD_RATE 115200/' config.h
     6.5  	make clean
     6.6  	make
     6.7 -	tune_lzma 179,mf=bt2 LC 2
     6.8 +	tune_lzma 179,mf=bt3 LC 2
     6.9  	./pack memtest.bin memtest.packed-115200
    6.10  	mv memtest.bin memtest.bin.serial
    6.11  }