# HG changeset patch # User Pascal Bellard # Date 1614250614 0 # Node ID 14ca5e18cfd9df3a2129f1c2cb69e12f0b8a310d # Parent c1844f1c49545de7987075c2b5bab903230d9770 Up tazinst (112) diff -r c1844f1c4954 -r 14ca5e18cfd9 cookutils/receipt --- a/cookutils/receipt Fri Feb 19 18:33:17 2021 +0000 +++ b/cookutils/receipt Thu Feb 25 10:56:54 2021 +0000 @@ -55,7 +55,7 @@ post_install() { MD5="$(sed '/^SETUP_MD5/!d;s|.*="\(.*\)".*|\1|' \ - $1/etc/slitaz/cook.conf.old)" + $1/etc/slitaz/cook.conf.old 2> /dev/null)" sed -i "s|^SETUP_MD5=\"\"|SETUP_MD5=\"$MD5\"|" $1/etc/slitaz/cook.conf [ -z "$MD5" ] && case "$(cat "$1/etc/hostname" 2> /dev/null)" in tank*) diff -r c1844f1c4954 -r 14ca5e18cfd9 linld/stuff/src/CRTL.ASM --- a/linld/stuff/src/CRTL.ASM Fri Feb 19 18:33:17 2021 +0000 +++ b/linld/stuff/src/CRTL.ASM Thu Feb 25 10:56:54 2021 +0000 @@ -33,6 +33,8 @@ public _isostate _isostate isostate org $-7 + global buf4k:byte +label buf4k byte _xfer_buf db 4096 dup (?) filecnt db ? ; in fact 0 minus file count... nextfilename dw ? @@ -57,14 +59,12 @@ db 0b8h,20h ; mov ax,??20h @@cpylp: lodsb -@@cpyhead: mov [bx],al inc bx or al,al jne @@cpylp -strend: pop si -@ret: +catret: ret endp @strcatb$qpxzct1 @@ -74,7 +74,7 @@ opendos: ifdef LONG_FILENAME - xchg ax,cx ; attributes + ;xchg ax,cx ; attributes mov ax,716Ch push bx si mov si,bx @@ -91,7 +91,7 @@ endif ;mov cl,0 ; attribute mask call dos - jc openret + jc catret openok: xchg ax,bx mov ax,4202h @@ -105,7 +105,6 @@ cwd call seeksetpos0 ; filepos = 0 xchg ax,bx ; fd -openret: ret ;*************************************************************** @@ -120,10 +119,15 @@ global @open$qpxzc:near @open$qpxzc: + ifdef LONG_FILENAME + mov cx,[_isostate.fd] + jcxz opendos + xchg ax,cx + else mov ax,[_isostate.fd] or ax,ax je opendos -openiso: + endif ifdef ISOHOOK cmp [byte bx],'!' je @readmenu$qv @@ -225,7 +229,7 @@ ifdef ISOHOOK ;*************************************************************** -;_fastcall void readmenu(void); +;_fastcall int:bx readmenu(void); ;*************************************************************** proc @readmenu$qv near @@ -269,7 +273,7 @@ mov bh,42h ; bx=fd cx:dx=offset al=whence dosbx: xchg ax,bx - jmp dos + jmp dos ; bx = fd endp @isolseek$qpxul @@ -393,20 +397,77 @@ cmp al,20h ; EOS or 20h jne @@loop ; assume [bx] = '|' @@notsw: - mov ax,-1 + mov al,-1 jne @@notopt jmp @@setnum @@testal: - inc ax + cmp al,-1 jz @@loop @@lastal: - cmp al,'='+1 + cmp al,'=' xchg ax,cx ; return s if failure jne @@nokeyword dec dx dec dx je @@done - call @strtol$qpxzc +@strtol$qpxzc: + ifndef NO386 + xor ecx,ecx + xor ebx,ebx + else + xor bx,bx + xor cx,cx + xor dx,dx + endif + lodsb + or al,20h + cmp al,'a' + jb @@notvga + sub al,'o' +@@vgaloop: + dec cx + add al,6 + jnb @@vgaloop ; vga=normal,extended,ask +@@vga: + xchg ax,cx + ;cwd + jmp @@end +@@endstrtol: + mov cl,10 + cmp al,'k'-'a'+10 + je @@shift + mov cl,20 + cmp al,'m'-'a'+10 + je @@shift + mov cl,30 + cmp al,'g'-'a'+10 + ifndef NO386 + jne @@noshift +@@shift: + shl ebx,cl +@@noshift: + popf + jnc @@end2 + neg ebx +@@end2: + push ebx + pop ax + pop dx + else +@@shift: + xchg ax,bx + jne @@noshift + extrn N_LXLSH@:near + call N_LXLSH@ +@@noshift: + popf + jne @@end + not dx + neg ax + jne @@end + inc dx +@@end: + endif @@setnum: xchg ax,si mov [di+2],dx @@ -417,6 +478,54 @@ pop di si bx ret +@@notvga: + mov cl,10 ; radix + cmp al,'-' + jne @@radixkeep + lodsb +@@radixkeep: + pushf + cmp al,'0' + jne @@radixok + mov cl,8 + lodsb + or al,20h + cmp al,'x' + jne @@radixok + mov cl,16 +@@strtollp: + lodsb +@@radixok: + or al,20h + sub al,'0' + jb @@endstrtol + cmp al,9 + jbe @@digitok + cmp al,'a'-'0' + jb @@endstrtol + sub al,'a'-'0'-10 +@@digitok: + cmp al,cl + jae @@endstrtol + cbw + ifndef NO386 + cwde + xchg eax,ebx + mul ecx + add ebx,eax + else + push ax + xchg ax,dx + mul cx + xchg ax,bx + mul cx + add dx,bx + pop bx + add bx,ax + adc dx,0 + endif + jmp @@strtollp + endp @argstr$qpxzcxt1ppxzc ;*************************************************************** @@ -636,25 +745,21 @@ mov bx,offset vcpi_alloc_err jnz jmpdie ; for (i = cnt-1; i >= 0; i--) +; if (edx < pm.fallback+pm.size) again + mov bx,offset _imgs.fallback+size image_himem + mov eax,[bx-2+6-size image_himem] ; pm.size + add eax,[bx-2+2-size image_himem] + cmp eax,edx ; pm.fallback+pm.size <= edx ? + ja @@vcpi_alloc mov eax,ecx dec eax shl eax,12 ; i*_4k -; if (edx < pm.fallback+i*_4k && edx >= pm.fallback) again - mov bx,offset _imgs.fallback - push eax - add eax,[bx-2+2] - cmp eax,edx ; pm.fallback+i*_4k <= edx ? - pop eax ; i*_4k - jbe @@pmok - cmp edx,[bx-2+2] ; edx >= pm.fallback ? - jae @@vcpi_alloc -@@pmok: ; if (edx >= initrd.fallback+i*_4k && edx < initrd.fallback+initrd.size) again - add eax,[bx-2+2+size image_himem] ; +initrd.fallback + add eax,[bx-2+2] ; +initrd.fallback cmp eax,edx ; initrd.fallback+i*_4k > edx ? ja @@initrdok - mov eax,[bx-2+6+size image_himem] ; initrd.size - add eax,[bx-2+2+size image_himem] ; +initrd.fallback + mov eax,[bx-2+6] ; initrd.size + add eax,[bx-2+2] ; +initrd.fallback cmp eax,edx ; initrd.fallback+initrd.size > edx ? @@ja_vcpi_alloc: ja @@vcpi_alloc @@ -680,10 +785,10 @@ lea cx,[(data_himem si).cache] ifdef NO386 push edx - pop ax ; to dx:ax - pop dx + pop ax ; to es:ax + pop es endif - call storepage ; storepage(edx,cx) + call storepage ; storepage(edx/es:ax,cx) pop cx or ecx,ecx ; clear C jnz @@ja_vcpi_alloc @@ -718,41 +823,37 @@ cmp eax,edx ; if (m->fallback != m->buf) jz @@skip ; memcpy32(m->fallback,0,m->buf,m->size) mov ecx,[(image_himem bx).size] -memcpy_imagez: ; memcpy_imagez(edx,eax,ecx) - push ecx - push eax - push 0 -call_memcpy32: - push edx else - les ax,[dword ((image_himem bx).fallback)] + les cx,[((image_himem bx).buf)] mov dx,es - les cx,[dword ((image_himem bx).buf)] + les ax,[((image_himem bx).fallback)] cmp ax,cx ; if (m->fallback != m->buf) jnz @@do - cmp dx,[word ((image_himem bx).buf)+2] + cmp dx,[word ((image_himem bx).fallback)+2] jz @@skip ; memcpy32(m->fallback,0,m->buf,m->size) @@do: - push [word ((image_himem bx).size)+2] - push [word ((image_himem bx).size)] - push es ; [word ((image_himem bx).buf)+2] + push [((image_himem bx).size)] + xor bx,bx +call_memcpy32: ; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size) + push dx ; [word ((image_himem bx).buf)+2] push cx ; [word ((image_himem bx).buf)] - xor cx,cx - push cx -call_memcpy32: - push dx ; push dx:ax + push bx + push es ; push es:ax push ax jmp @@memcpy + endif memcpy_imagez: ; memcpy_imagez(edx,eax,ecx) p386 push ecx push eax push 0 + ifndef NO386 +call_memcpy32: ; call_memcpy32(to=edx,fromseg,fromofs,size) + endif push edx ifdef NO386 p8086 endif - endif @@memcpy: extrn memcpy32:near call near memcpy32 @@ -771,7 +872,6 @@ mov edx,[di] else les ax,[dword di] - mov dx,es ; to dx:ax endif mov cx,offset _xfer_buf storepage: ; storepage(edx,cx) @@ -779,16 +879,15 @@ push 0 push 4096 push 0 + push cx + push ds ; call_memcpy32(to=edx,fromseg,fromofs,size) else - xor bx,bx - push bx - mov bh,4096/256 - push bx - xor bx,bx - push bx + xor dx,dx + push dx ; 0 + mov bx,4096 + push bx ; 4096 + mov bx,ds ; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size) endif - push cx - push ds jmp call_memcpy32 endp @storepage$qpul @@ -939,173 +1038,6 @@ endp @read_image$qp11image_himem -;*************************************************************** -;_fastcall unsigned long strtol(const char *s); -;*************************************************************** - proc @strtol$qpxzc near - - ifndef NO386 - xor ecx,ecx - xor eax,eax - xor ebx,ebx - lodsb - or al,20h - cmp al,'a' - jb @@notvga - sub al,'o' -@@vgaloop: - dec cx - add al,6 - jnb @@vgaloop ; vga=normal,extended,ask -@@vga: - dec cx - xchg ax,cx - cwd - jmp @@popsiret -@@notvga: - mov cl,10 ; radix - cmp al,'-' - jne @@radixkeep - lodsb -@@radixkeep: - pushf - cmp al,'0' - jne @@radixok - mov cl,8 - lodsb - or al,20h - cmp al,'x' - jne @@radixok - mov cl,16 -@@strtollp: - lodsb -@@radixok: - or al,20h - sub al,'0' - jb @@endstrtol - cmp al,9 - jbe @@digitok - cmp al,'a'-'0' - jb @@endstrtol - sub al,'a'-'0'-10 -@@digitok: - cmp al,cl - jae @@endstrtol - cbw - cwde - xchg eax,ebx - mul ecx - add ebx,eax - jmp @@strtollp -@@endstrtol: - mov cl,10 - cmp al,'k'-'a'+10 - je @@shift - mov cl,20 - cmp al,'m'-'a'+10 - je @@shift - mov cl,30 - cmp al,'g'-'a'+10 - jne @@noshift -@@shift: - shl ebx,cl -@@noshift: - popf - jnc @@end - neg ebx -@@end: - push ebx - pop ax - pop dx -@@popsiret: - else - xor bx,bx - xor cx,cx - xor dx,dx - lodsb - or al,20h - cmp al,'a' - jb @@notvga - sub al,'o' -@@vgaloop: - dec cx - add al,6 - jnb @@vgaloop ; vga=normal,extended,ask -@@vga: - xchg ax,cx - ;cwd - jmp @@end -@@notvga: - mov cl,10 ; radix - cmp al,'-' - jne @@radixkeep - lodsb -@@radixkeep: - pushf - cmp al,'0' - jne @@radixok - mov cl,8 - lodsb - or al,20h - cmp al,'x' - jne @@radixok - mov cl,16 -@@strtollp: - lodsb -@@radixok: - or al,20h - sub al,'0' - jb @@endstrtol - cmp al,9 - jbe @@digitok - cmp al,'a'-'0' - jb @@endstrtol - sub al,'a'-'0'-10 -@@digitok: - cmp al,cl - jae @@endstrtol - cbw - - push ax - xchg ax,dx - mul cx - xchg ax,bx - mul cx - add dx,bx - pop bx - add bx,ax - adc dx,0 - - jmp @@strtollp -@@endstrtol: - mov cl,10 - cmp al,'k'-'a'+10 - je @@shift - mov cl,20 - cmp al,'m'-'a'+10 - je @@shift - mov cl,30 - cmp al,'g'-'a'+10 -@@shift: - xchg ax,bx - jne @@noshift - extrn N_LXLSH@:near - call N_LXLSH@ -@@noshift: - popf - jne @@end - not dx - neg ax - jne @@end - inc dx -@@end: - endif -strtol_ret: - ret - - endp @strtol$qpxzc - - ends _TEXT end diff -r c1844f1c4954 -r 14ca5e18cfd9 linld/stuff/src/LINLD.CPP --- a/linld/stuff/src/LINLD.CPP Fri Feb 19 18:33:17 2021 +0000 +++ b/linld/stuff/src/LINLD.CPP Thu Feb 25 10:56:54 2021 +0000 @@ -16,7 +16,7 @@ inline void syntax() { die("Syntax:" NL - "LINLD [image=file] [initrd=files] [vga=mode] [root=num] [mem=max] [cl=cmdline] [iso=file]" NL + "LINLD [image=file] [initrd=files] [vga=mode] [root=num] [mem=max] [cl=cmdline] [iso=file] ..." NL "vga mode: ask,extended,normal or dec/oct/hex number" NL "-64 for cpu64 only" NL "Defaults:" NL @@ -33,7 +33,7 @@ "-b 64m " "initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz " "\"cl=root=/dev/null video=-32\"" - NL NL "\tLINLD image=memtest" + NL "\tLINLD memtest" #endif ); } diff -r c1844f1c4954 -r 14ca5e18cfd9 linld/stuff/src/LOAD.CPP --- a/linld/stuff/src/LOAD.CPP Fri Feb 19 18:33:17 2021 +0000 +++ b/linld/stuff/src/LOAD.CPP Thu Feb 25 10:56:54 2021 +0000 @@ -208,7 +208,6 @@ // Read initrd if needed void load_initrd() { - struct image_himem *m = &initrd; if ((int)initrd_name == 0) return; #if defined(__BORLANDC__) && defined(NO386) #pragma option -3 @@ -216,6 +215,7 @@ .386p } #endif + struct image_himem *m = &initrd; open_image(m, initrd_name); if ((m->fallback=(memtop()-m->size)&(~PAGE_MASK))-m[-1].fallback < m[-1].size) { diff -r c1844f1c4954 -r 14ca5e18cfd9 linld/stuff/src/MEMTOP.ASM --- a/linld/stuff/src/MEMTOP.ASM Fri Feb 19 18:33:17 2021 +0000 +++ b/linld/stuff/src/MEMTOP.ASM Thu Feb 25 10:56:54 2021 +0000 @@ -23,17 +23,63 @@ ;*************************************************************** proc _memtopz near ;*************************************************************** +;u32 memtop_e820() +;*************************************************************** +; proc _memtop_e820 near + + ifdef INT15_E820 + +struc e820 ;struct e820 { +base dd ?,? ; 0 u64 base; +length dd ?,? ; 8 u64 length; +type db ?,?,?,? ;16 u32 type; 1=available +ends e820 ;}; + + p386 + push ds + pop es + push di + xor ebx,ebx +@@e820lp: + mov eax,0E820h + mov edx,534D4150h ; 'SMAP' + xor ecx,ecx + mov cl,size e820 + extrn buf4k:byte + mov di,offset buf4k + int 15h + jc @@err_e820 + ;cmp eax,534D4150h ; 'SMAP' + ;jne @@err_e820 + cmp [(e820 di).type],1 + jnz @@notavail + mov eax,[(e820 di).base] + add eax,[(e820 di).length] + push eax + pop ax + pop dx + or dh,dh ; > 16M + je @@notavail + pop di + ret +@@notavail: + or bx,bx + jne @@e820lp +@@err_e820: + pop di + endif + +; endp _memtop_e820 + +;*************************************************************** ;u32 memtop_e801() ;*************************************************************** ; proc _memtop_e801 near xor cx,cx ;fix to work around buggy xor dx,dx ; BIOSes which dont clear/set - stc ; carry on pass/error of - mov ax,0E801h - int 15h - jc @@err - + mov ax,0E801h ;ax=1kbs in 1-16M bx=64kbs above 16M extended + int 15h ;cx=1kbs in 1-16M dx=64kbs above 16M configured xchg ax,cx ;kludge to handle BIOSes jcxz @@use_cxdx ; which report their extended ; memory in AX/BX rather than @@ -43,14 +89,14 @@ @@use_cxdx: ;now: dx=64k units above 16m ; ax=1k units above 1m below 16m (max 3c00h) or dx,dx - jz tokb ;dx=0 here, ax=kbs above 1m + jz @@below16M xor ax,ax ;ignore info on low 16M (assume full) - ;add dx,100h ;account for low 16M - inc dh ;account for low 16M (optimized) + inc dh ;account for low 16M ret +@@below16M: + or ax,ax + jnz tokb ;dx=0 here, ax=kbs above 1m @@err: -; xor ax,ax -; cwd ; ret ; endp _memtop_e801 @@ -62,9 +108,7 @@ mov ah,88h int 15h ;ax=kbs above 1m - cmc ; error: cf=1 or ax=0 - sbb dx,dx - and ax,dx ; + test ax,ax ; error: ax=0 jnz tokb ;happens on big mem systems ;*************************************************************** diff -r c1844f1c4954 -r 14ca5e18cfd9 linld/stuff/src/pipehole.awk --- a/linld/stuff/src/pipehole.awk Fri Feb 19 18:33:17 2021 +0000 +++ b/linld/stuff/src/pipehole.awk Thu Feb 25 10:56:54 2021 +0000 @@ -197,6 +197,8 @@ } if (/void load_initrd\(\)/) { isload=3; isload2=0 } if (isload == 3) { # LOAD.LST + if (/bx,offset DGROUP:_imgs\+28/ || /push si/) next + if (/si,offset DGROUP:_imgs\+28/) print " push si" if (/cmdstr\+4,0/) { isload2++ print " mov ax,word ptr DGROUP:_cmdstr+4" @@ -207,7 +209,6 @@ if (/mov ax,word ptr \[si\]/) $0=" lodsw" if( /jmp/) { print "load_initrd_ret:" - print " pop si" print " ret" next } diff -r c1844f1c4954 -r 14ca5e18cfd9 tazinst-gui/receipt --- a/tazinst-gui/receipt Fri Feb 19 18:33:17 2021 +0000 +++ b/tazinst-gui/receipt Thu Feb 25 10:56:54 2021 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="tazinst-gui" -VERSION="110" +VERSION="112" CATEGORY="base-system" SHORT_DESC="SliTaz installer (GUI frontend)" MAINTAINER="domcox@slitaz.org" diff -r c1844f1c4954 -r 14ca5e18cfd9 tazinst/receipt --- a/tazinst/receipt Fri Feb 19 18:33:17 2021 +0000 +++ b/tazinst/receipt Thu Feb 25 10:56:54 2021 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="tazinst" -VERSION="110" +VERSION="112" CATEGORY="base-system" SHORT_DESC="SliTaz installer" MAINTAINER="domcox@slitaz.org"