# HG changeset patch # User maniac # Date 1543222407 -7200 # Node ID 91b11cc25f3d4852caebf2c2f1864ba9d8cf9d14 # Parent 43758773632cec210d26dfd52a59e99ee719f0cb# Parent a8e996b473e025a69fef8e1fe32fdc0a9c4b6ed1 Up smtube (18.11.0) diff -r 43758773632c -r 91b11cc25f3d linld/stuff/src/CRTL.ASM --- a/linld/stuff/src/CRTL.ASM Mon Nov 26 10:47:22 2018 +0200 +++ b/linld/stuff/src/CRTL.ASM Mon Nov 26 10:53:27 2018 +0200 @@ -330,20 +330,22 @@ endp @lseekset$qiul ifdef EXTRA -struc isostate ; struct isostate { -fd dw ? ; 0 int fd; -fileofs dd ? ; 2 unsigned long fileofs; -filesize dd ? ; 6 unsigned long filesize; -filemod dw ? ;10 unsigned short filemod; -filename dw ? ;12 char *filename; -dirofs dd ? ;14 unsigned long dirofs; -dirsize dd ? ;16 unsigned long dirsize; -curdirofs dd ? ;20 unsigned long curdirofs; -curdirsize dd ? ;24 unsigned long curdirsize; -curpos dd ? ;28 unsigned long curpos; -ends ; } isostate; +;typedef unsigned dirsizetype; +struc isostate ; struct isostate { +fd dw ? ; 0 int fd; +filemod dw ? ; 2 unsigned short filemod; +fileofs dd ? ; 4 unsigned long fileofs; +filesize dd ? ; 8 unsigned long filesize; +filename dw ? ;12 char *filename; +curdirsize dw ? ;14 dirsizetype curdirsize; +dirsize dw ? ;16 dirsizetype dirsize; +curdirofs dd ? ;18 unsigned long curdirofs; +dirofs dd ? ;22 unsigned long dirofs; +curpos dw ? ;26 unsigned curpos; +buffer db 2560 dup(?) ;28 char buffer[2048+512]; +ends ; } isostate; ;*************************************************************** -;pascal int isolseek(const unsigned long *offset); +;pascal long isolseek(const unsigned long *offset); ;*************************************************************** global @isolseek$qpxul:near proc @isolseek$qpxul near @@ -351,16 +353,40 @@ pop ax pop bx push ax +isolseek: mov dx,[bx] mov cx,[bx+2] extrn _isostate:isostate mov bx,[_isostate.fd] - call lseekset ; (bx=fd, sz=cx:dx) + jmp lseekset ; (bx=fd, sz=cx:dx) + + endp @isolseek$qpxul + + +;*************************************************************** +;pascal int isoreadsector(const unsigned long *offset); +;*************************************************************** + global @isoreadsector$qpxul:near + proc @isoreadsector$qpxul near + + pop ax + pop bx + push ax + call isolseek and ax,dx inc ax + jz @@fail + mov cx,2560 + mov dx,offset _isostate.buffer + mov bx,[_isostate.fd] + call @read$cxdxbx ; read(fd,buffer,2560) +@@fail: + cmp ax,2048 + sbb ax,ax ret - - endp @isolseek$qpxul + + endp @isoreadsector$qpxul + endif @@ -852,9 +878,14 @@ push cx push di xchg ax,di - mov [(image_himem di).next_chunk],offset next_chunk mov [(image_himem di).state],bx push bx + ifdef EXTRA + xor ax,ax + or ax,[(image_himem di).next_chunk] + jne @@next + endif + mov [(image_himem di).next_chunk],offset next_chunk @@next: call [(image_himem di).next_chunk] ; m->next_chunk() ifndef NO386 diff -r 43758773632c -r 91b11cc25f3d linld/stuff/src/ISO9660.CPP --- a/linld/stuff/src/ISO9660.CPP Mon Nov 26 10:47:22 2018 +0200 +++ b/linld/stuff/src/ISO9660.CPP Mon Nov 26 10:53:27 2018 +0200 @@ -3,17 +3,8 @@ #include "iso9660.h" #define __ROCKRIDGE -#define SECTORSZ 2048 -#define SECTORBITS 11 -static char buffer[SECTORSZ+512]; // RR overflow struct isostate isostate; -static int readsector(const unsigned long *offset) -{ - return (isolseek(offset) != 0 - && read(isostate.fd, buffer, sizeof(buffer)) >= SECTORSZ); -} - int isoreset(char *name) { static const unsigned long root = 16UL * 2048; @@ -21,12 +12,12 @@ if (name) //x->fd = open(name, O_RDONLY); x->fd = open(name); - if (!readsector(&root) || strhead(buffer+1,"CD001")) { + if (isoreadsector(&root) < 0 || strhead(x->buffer+1,"CD001")) { //close(x->fd); return -1; } - x->dirofs = (* (unsigned long *) (buffer + 0x9E)) << SECTORBITS; - x->dirsize = filesize2dirsize(* (unsigned long *) (buffer + 0xA6)); + x->dirofs = (* (unsigned long *) (x->buffer + 0x9E)) << SECTORBITS; + x->dirsize = filesize2dirsize(* (unsigned long *) (x->buffer + 0xA6)); return 0; } @@ -44,16 +35,16 @@ x->curdirofs = x->dirofs; goto restarted; } - if (x->curpos >= SECTORSZ || * (short *) (buffer + x->curpos) == 0) { + if (x->curpos >= SECTORSZ || * (short *) (x->buffer + x->curpos) == 0) { if (x->curdirsize < DIRSECTORSZ) return -1; restarted: - readsector(&x->curdirofs); + isoreadsector(&x->curdirofs); //x->curdirofs += SECTORSZ; *(int *)((char *) &x->curdirofs+1) += SECTORSZ/256; x->curdirsize -= DIRSECTORSZ; x->curpos = 0; } - p = buffer + x->curpos; + p = x->buffer; p += x->curpos; if ((size = * (short *) p) == 0) return -1; x->fileofs = (* (unsigned long *) (p + 2)) << SECTORBITS; @@ -63,7 +54,7 @@ #ifdef __ROCKRIDGE endname = NULL; // p += 34 + (p[32] & -2); ? - p = buffer + 34 + ((p[32] + x->curpos) & -2); + p = x->buffer + 34 + ((p[32] + x->curpos) & -2); do { int len = p[2]; switch (* (short *) p) { @@ -76,13 +67,13 @@ break; } p += len; - } while (buffer + x->curpos + size - p > 2); + } while (x->buffer + x->curpos + size - p > 2); if (endname) *endname = 0; else #endif { - p = x->filename = buffer + x->curpos + 33; + p = x->buffer + 33; x->filename = p += x->curpos; p--; if (((* (short *) p) & 0xFEFF) -1 == 0) { x->filename = ".."; diff -r 43758773632c -r 91b11cc25f3d linld/stuff/src/ISO9660.H --- a/linld/stuff/src/ISO9660.H Mon Nov 26 10:47:22 2018 +0200 +++ b/linld/stuff/src/ISO9660.H Mon Nov 26 10:53:27 2018 +0200 @@ -16,13 +16,17 @@ dirsizetype curdirsize, dirsize; unsigned long curdirofs, dirofs; unsigned curpos; +#define SECTORSZ 2048 +#define SECTORBITS 11 + char buffer[SECTORSZ+512]; // RR overflow } isostate; #define isofd isostate.fd #define isofileofs isostate.fileofs #define isofilesize isostate.filesize #define isofilemod isostate.filemod #define isofilename isostate.filename -extern pascal int isolseek(const unsigned long *offset); +extern pascal long isolseek(const unsigned long *offset); +extern pascal int isoreadsector(const unsigned long *offset); extern int isoreset(char *name); extern int isoopen(const char *name); extern int isoreaddir(int restart); diff -r 43758773632c -r 91b11cc25f3d linld/stuff/src/JUMP.ASM --- a/linld/stuff/src/JUMP.ASM Mon Nov 26 10:47:22 2018 +0200 +++ b/linld/stuff/src/JUMP.ASM Mon Nov 26 10:53:27 2018 +0200 @@ -162,7 +162,8 @@ ;cld pop es ; min 2048 bytes for stack jne @@isbzimage - mov cx,offset movedend + extrn gdt_data + mov cx,offset gdt_data+8 xor si,si ; A000 -9000 -0800(>movedend) rep movsb diff -r 43758773632c -r 91b11cc25f3d linld/stuff/src/LOAD.CPP --- a/linld/stuff/src/LOAD.CPP Mon Nov 26 10:47:22 2018 +0200 +++ b/linld/stuff/src/LOAD.CPP Mon Nov 26 10:53:27 2018 +0200 @@ -152,7 +152,7 @@ if(kernelparams->setup_sects == 0) { #if 1 if(* (int *) &first1k->pad10[0x3F-0x24] == 0x3AE8) { - lseekset(pm.fd,rm_seek=0x200); + lseekset(m->fd,rm_seek=0x200); csip+=0xFFE00042; } else diff -r 43758773632c -r 91b11cc25f3d linld/stuff/src/MEMCPY32.ASM --- a/linld/stuff/src/MEMCPY32.ASM Mon Nov 26 10:47:22 2018 +0200 +++ b/linld/stuff/src/MEMCPY32.ASM Mon Nov 26 10:53:27 2018 +0200 @@ -46,7 +46,7 @@ ;cld pushf push ds es - pushad + pushad ; struct declared in VCPI.ASM mov cl,4 movzx esi,[srcseg] shl esi,cl @@ -73,6 +73,9 @@ and di,cx inc cx sub [sz],ecx + jae @@movpara + add ecx,[sz] +@@movpara: rep movsb ja @@movlp jmp @@done @@ -135,7 +138,7 @@ pop si js @@done16 p386 - pushad + pushad ; struct declared in VCPI.ASM mov esi,[srcofs] mov edi,[dstofs] @@ -149,11 +152,8 @@ jz @@real_mode ; Note: bp points to std stack frame now. bp will be passed to ; pm routine. This allows params to be passed on stack - extrn do_memcpy_vcpi:near - push offset do_memcpy_vcpi - extrn call_pm_routine:near - call near call_pm_routine ; Call pm copy routine via vcpi pm - pop ax + extrn vcpi_pm_copy_routine:near + call near vcpi_pm_copy_routine ; Call pm copy routine via vcpi pm jmp @@done @@real_mode: cmp esi,edi @@ -204,7 +204,7 @@ p8086 @@done16: pop es ds - popf + popf ; restore I & D ifndef NO386 p386 leave diff -r 43758773632c -r 91b11cc25f3d linld/stuff/src/TAZBOOT.CPP --- a/linld/stuff/src/TAZBOOT.CPP Mon Nov 26 10:47:22 2018 +0200 +++ b/linld/stuff/src/TAZBOOT.CPP Mon Nov 26 10:53:27 2018 +0200 @@ -101,7 +101,7 @@ c = x->filename[6]; } - strcatb(buf_cmdline," rw root=/dev/null autologin bootfrom="); + strcatb(buf_cmdline,"rw root=/dev/null autologin bootfrom="); strcat(buf_cmdline,*iso); if (magic < 0x20630) init = ""; // Does not support multiple initramfs @@ -133,9 +133,7 @@ read(x->fd, &x->filemod, 10); // + x->fileofs & x->filesize magic = x->filemod; x->fileofs &= 0xFFFFL; - //x->fileofs -= 0xC0L + (x->filesize &= 0xFFFF); - * ((short *) &x->filesize + 1) = 0; - x->fileofs -= 0xC0L + x->filesize; + x->fileofs -= 0xC0L + (x->filesize &= 0xFFFF); if (((short *) &x->fileofs)[1] == 0) addinitrd(); else init=""; } diff -r 43758773632c -r 91b11cc25f3d linld/stuff/src/VCPI.ASM --- a/linld/stuff/src/VCPI.ASM Mon Nov 26 10:47:22 2018 +0200 +++ b/linld/stuff/src/VCPI.ASM Mon Nov 26 10:53:27 2018 +0200 @@ -72,10 +72,16 @@ endm - group DGROUP _TEXT,_DATA,_BSS + group DGROUP _TEXT,_BSS assume cs:DGROUP,ds:DGROUP - segment _DATA byte public use16 'DATA' + segment _BSS byte public use16 'BSS' + +tss dd ?,? ;enough, we'll never use it anyway + + ends _BSS + + segment _TEXT byte public use16 'CODE' label gdt byte gdt_null descr ;0000 @@ -86,6 +92,7 @@ ;Note: code/data segs must be flagged use16 (i.e. use ip/sp, not eip/esp) ;Note: base addrs will be fixed up in prepare_vcpi() descriptor gdt_code,(code_seg+readable),priv0,is_present,0fffffh,(gran_page+use_16),0 + global gdt_data descriptor gdt_data,(data_seg+writable),priv0,is_present,0fffffh,(gran_page+use_16),0 descriptor gdt_tss ,tss386_avail ,priv0,is_present,0ffh ,gran_byte , SEL_VCPI = (gdt_vcpi - gdt_null) @@ -117,15 +124,6 @@ idt_lim dw 03ffh ;we won't enable ints, idt_base dd 0 ; so let's leave it the same as for rm - ends _DATA - - segment _BSS byte public use16 'BSS' - -tss dd ?,? ;enough, we'll never use it anyway - - ends _BSS - - segment _TEXT byte public use16 'CODE' ;*************************************************************** ;char* prepare_vcpi(void *pagebuf); @@ -229,8 +227,8 @@ ;****** Copies PAGE_SIZE bytes ;****** Uses: Flags ;*************************************************************** - global call_pm_routine:near - proc call_pm_routine near + global vcpi_pm_copy_routine:near + proc vcpi_pm_copy_routine near arg dstofs :dword, \ srcseg :word, \ @@ -238,7 +236,6 @@ struc pm_regs $$retaddr dw ? -$$f dw ? $$edi dd ? $$esi dd ? $$ebp dd ? @@ -284,16 +281,15 @@ lea sp,[bp-9*4] ;else we can do this trick with bp ; Call the routine (bp points to params on stack if any) - mov ax,[(pm_regs bp).$$f] ; ss:bp => struct pm_regs mov bp,[word (pm_regs bp).$$ebp] ;ss:bp => params - call ax + call do_memcpy_vcpi ; Ok, let's return to vm mov ax,0DE0Ch ; maybe we need whole eax? cli ; to be safe clts ; - push SEL_ABS ; vcpi wants ds=all_addrspace - pop ds ; + ;;push SEL_ABS ; vcpi wants ds=all_addrspace + ;;pop ds ; call [pword cs:vcpi_pm_entry] @@vm_ret: ; Now we are in vm86 mode. Sregs, esp, eflags (IF) restored from IRET stack @@ -320,7 +316,7 @@ ; Note: ss:bp => params ; Move data - mov ax,SEL_ABS + mov al,SEL_ABS mov ds,ax mov es,ax assume nothing @@ -365,8 +361,8 @@ vcpi_ret: ret - endp call_pm_routine - assume cs:DGROUP,ds:DGROUP + endp vcpi_pm_copy_routine + assume cs:DGROUP,ds:DGROUP ;*************************************************************** diff -r 43758773632c -r 91b11cc25f3d linld/stuff/src/pipehole.awk --- a/linld/stuff/src/pipehole.awk Mon Nov 26 10:47:22 2018 +0200 +++ b/linld/stuff/src/pipehole.awk Mon Nov 26 10:53:27 2018 +0200 @@ -3,7 +3,7 @@ { if (hold == 0) { s=$0 - if (/^ mov .x,bx$/ || /^ mov .x,.i$/) { + if (/^ mov .[ix],bx$/ || /^ mov .[ix],.i$/) { r=$2 hold=1; split($2,regs,","); next } diff -r 43758773632c -r 91b11cc25f3d util-linux-losetup/description.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/util-linux-losetup/description.txt Mon Nov 26 10:53:27 2018 +0200 @@ -0,0 +1,1 @@ + * `losetup` - configure loop/cloop device diff -r 43758773632c -r 91b11cc25f3d util-linux-losetup/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/util-linux-losetup/receipt Mon Nov 26 10:53:27 2018 +0200 @@ -0,0 +1,26 @@ +# SliTaz package receipt. + +PACKAGE="util-linux-losetup" +VERSION="2.28" +CATEGORY="base-system" +SHORT_DESC="The losetup utility from Util Linux" +MAINTAINER="pankso@slitaz.org" +LICENSE="GPL2" +WEB_SITE="https://en.wikipedia.org/wiki/Util-linux" +HOST_ARCH="i486 arm" + +WANTED="util-linux" +DEPENDS="glibc-base" +SUGGESTED="util-linux-mount linux-cloop" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + cook_copy_files losetup + rm -r $fs/usr/share +} + +post_remove() +{ + ln -s /bin/busybox "$1/sbin/losetup" +} diff -r 43758773632c -r 91b11cc25f3d util-linux/receipt --- a/util-linux/receipt Mon Nov 26 10:47:22 2018 +0200 +++ b/util-linux/receipt Mon Nov 26 10:53:27 2018 +0200 @@ -16,6 +16,7 @@ SPLIT="util-linux-blkid util-linux-blkid-dev util-linux-blockdev \ util-linux-cfdisk util-linux-column util-linux-cramfs util-linux-eject \ util-linux-fdisk util-linux-fdisk-dev util-linux-flock util-linux-getopt \ +util-linux-losetup \ util-linux-minix util-linux-mkfs util-linux-mount util-linux-mount-dev \ util-linux-partx util-linux-setterm util-linux-sfdisk util-linux-smartcols \ util-linux-smartcols-dev util-linux-uuid util-linux-uuid-dev util-linux-whereis"