# HG changeset patch # User Pascal Bellard # Date 1614529977 0 # Node ID 61df94a0fa438e92d086f06da376c236cc36f543 # Parent 959269cc91c6a30ea0e5322765c63e67ecaee963 syslinux: fix build diff -r 959269cc91c6 -r 61df94a0fa43 linld/receipt --- a/linld/receipt Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/receipt Sun Feb 28 16:32:57 2021 +0000 @@ -27,7 +27,7 @@ unzip $SRC/$EXTRA_TOOL > /dev/null rm LINLD$SUFFIX/CRTL.CPP LINLD$SUFFIX/INT15_88.ASM cp $stuff/src/* LINLD$SUFFIX/ - sed -i 's/-3/-DNO386/' LINLD$SUFFIX/BCCOPT.OPT + sed -i '/-3/d' LINLD$SUFFIX/BCCOPT.OPT cp -a LINLD$SUFFIX TAZBOOT unix2dos > MAKE.BAT < helptasm.log bcc > helpbcc.log tlink > helptlink.log -bcc @bccopt.opt -S -mt -DQUICK_BOOT -DISOHOOK -DMOVE_SETUP *.cpp > cpp.log -#bcc @bccopt.opt -S -mt -DWITH_XMM_ALLOC -DQUICK_BOOT -DISOHOOK -DMOVE_SETUP *.cpp > cpp.log +bcc @bccopt.opt -S -mt *.cpp > cpp.log ren LINLD.ASM LINLD.ASO ren LOAD.ASM LOAD.ASO ren HIMEM.ASM HIMEM.ASO @@ -13,6 +12,6 @@ mawk -f pipehole.awk LOAD.ASO > LOAD.ASM mawk -f pipehole.awk HIMEM.ASO > HIMEM.ASM mawk -f pipehole.awk ISO9660.ASO > ISO9660.ASM -tasm /la /m /dQUICK_BOOT /dISOHOOK /dMOVE_SETUP /dNO386 /dLONG_FILENAME *.asm > asm.log -#tasm /la /m /dWITH_XMM_ALLOC /dLARGE_ZIMAGE /dQUICK_BOOT /dISOHOOK /dMOVE_SETUP /dNO386 /dLONG_FILENAME *.asm > asm.log +mawk "{ if (/ptional/) hide=1; if (!hide) { sub(\"//\",\";\");sub(\"#define \",\"\");print $1 \"\t=\t1\t\t;\" $0} }" COMMON.H > COMMON.INC +tasm /la /m *.asm > asm.log tlink /m /s /t @link.cmd > lnk.log diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/A20.ASM --- a/linld/stuff/src/A20.ASM Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/A20.ASM Sun Feb 28 16:32:57 2021 +0000 @@ -8,6 +8,8 @@ %nomacs p8086 + include "common.inc" + group DGROUP _TEXT,_DATA assume cs:DGROUP,ds:DGROUP @@ -155,10 +157,12 @@ extrn _topseg:near call near _topseg mov [word sssp+2],ax + ifdef VCPI and ch,0 ; vcpi flag org $-1 global _vcpi:byte _vcpi db ? + endif else p386 movzx eax,[word _heap_top] @@ -186,14 +190,20 @@ sub eax,ecx endif shr eax,4 + ifdef VCPI mov ch,0 + endif @bzimage: xchg ax,dx mov ax,9000h + ifdef VCPI extrn _vcpi:byte and ch,[_vcpi] endif + endif + ifdef VCPI add dh,ch ; 60k room for malloc_bufv_or_die + endif cmp ax,dx ifdef LARGE_ZIMAGE ja @nooverflow0 diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/COMMON.H --- a/linld/stuff/src/COMMON.H Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/COMMON.H Sun Feb 28 16:32:57 2021 +0000 @@ -1,7 +1,45 @@ +//#define WITH_XMM_ALLOC add himem.sys driver +//#define LARGE_ZIMAGE may load system in high memory temporarily +//#define INT15_E820 add int15/eax=E820 driver +//#define BASIC_ISO9660 non rockridge support +#define ROCKRIDGE iso 9660 posix name support +#define ISO9660 iso= support +#define QUICK_BOOT /q bypass shutdown hack, /v keeps v86 +#define ISOHOOK iso image dos boot helper +#define MOVE_SETUP spare few Kb in setup location for zImage system +#define NO386 8088 support +#define CPU64 /64 support +#define LONG_FILENAME look for Win95+ long file name too +#define SHUTDOWN disable int19 hooked drivers +#define VCPI v86 mode support with VCPI 4.0+ +#define LINUX001 linux 0.01 support +#define ELKS elks support +#define IPXE ipxe support +/* End of the optional features */ + +#ifdef ISOHOOK +#ifndef ISO9660 +#define ISO9660 +#endif +#ifndef ROCKRIDGE +#define ROCKRIDGE +#endif +#ifndef CPU64 +#define CPU64 +#endif +#endif + // This file is distributed under GPL // // Common defs not belonging to CRTL +#if defined(__BORLANDC__) && !defined(NO386) +#pragma option -3 + asm{ + .386p + } +#endif + #define NL "\n" #define VERSION_STR "0.97" diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/CRTL.ASM --- a/linld/stuff/src/CRTL.ASM Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/CRTL.ASM Sun Feb 28 16:32:57 2021 +0000 @@ -6,6 +6,9 @@ %crefref %noincl %nomacs + + include "common.inc" + ifdef NO386 p8086 else @@ -19,7 +22,9 @@ loaderr db "Load failure",0 msg_hang db "Himem broken",0 + ifdef VCPI vcpi_alloc_err db "VCPI" + endif global overflow:byte overflow db "/" msg_malloc db "Out of memory" @@ -29,10 +34,12 @@ segment _BSS byte public use16 'BSS' + ifdef ISO9660 include "isostate.inc" public _isostate _isostate isostate org $-7 + endif global buf4k:byte label buf4k byte _xfer_buf db 4096 dup (?) @@ -70,8 +77,24 @@ endp @strcatb$qpxzct1 + ifdef NO386 p8086 + endif + ifndef ISO9660 +;*************************************************************** +;_fastcall int:C open(bx:const char* name, int flags=O_RDONLY); +;_fastcall int:C openargs(bx:const char* name, int flags=O_RDONLY); +;*************************************************************** + global openargs:near ; openargs(bx) +openargs: + cmp [byte bx],'@' + jne fail + inc bx + + global @open$qpxzc:near +@open$qpxzc: + endif opendos: ifdef LONG_FILENAME ;xchg ax,cx ; attributes @@ -91,6 +114,7 @@ endif ;mov cl,0 ; attribute mask call dos + ifdef ISO9660 jc catret openok: xchg ax,bx @@ -104,12 +128,16 @@ ;xor cx,cx cwd call seeksetpos0 ; filepos = 0 + else +openok: + endif xchg ax,bx ; fd ret + ifdef ISO9660 ;*************************************************************** -;_fastcall int open(bx:const char* name, int flags=O_RDONLY); -;_fastcall int openargs(bx:const char* name, int flags=O_RDONLY); +;_fastcall int:C open(bx:const char* name, int flags=O_RDONLY); +;_fastcall int:C openargs(bx:const char* name, int flags=O_RDONLY); ;*************************************************************** global openargs:near ; openargs(bx) openargs: @@ -135,6 +163,7 @@ extrn @_isoopen$qv:near mov [word _isostate.filename2open],bx jmp @_isoopen$qv ; filepos = 0 + endif ;*************************************************************** @@ -154,8 +183,10 @@ global close:near ; close(ax) close: mov bh,3Eh + ifdef ISO9660 mov cx,[_isostate.fd] jcxz dosbx + endif jmp fail endp @close$qi @@ -178,6 +209,7 @@ xchg ax,cx ; sz global @read$cxdxbx:near @read$cxdxbx: + ifdef ISO9660 push bx mov bx,offset _isostate.filepos push cx @@ -198,6 +230,7 @@ add [bx],cx adc [(word bx)+2],0 pop bx + endif readfd: mov ah,3Fh ;jcxz fail @@ -221,8 +254,16 @@ proc @rewind$qi near rewind: + ifdef ISO9660 mov bx,offset _isostate.fileofs jmp lseek + else + mov bl,0 +lseek0: + xor cx,cx + xor dx,dx + jmp lseek + endif endp @rewind$qi @@ -261,6 +302,7 @@ global @isolseek$qpxul:near proc @isolseek$qpxul near + ifdef ISO9660 isolseek: mov ax,[_isostate.fd] lseek: @@ -270,6 +312,9 @@ xor bx,bx mov [word _isostate.filepos],bx mov [(word _isostate.filepos)+2],bx + else +lseek: + endif mov bh,42h ; bx=fd cx:dx=offset al=whence dosbx: xchg ax,bx @@ -277,6 +322,7 @@ endp @isolseek$qpxul + ifdef ISO9660 ;*************************************************************** ;_fastcall int isoreadsector(bx:const unsigned long *offset); ;_fastcall int isoreadrootsector(void); @@ -294,8 +340,10 @@ jmp @read$dxaxbx ; read(fd,buffer,2560+) endp @isoreadsector$qpxul + endif + ifdef ISO9660 ifdef ISOHOOK ;*************************************************************** ;_fastcall int strhead(bx:const char* a, ax:const char* b); @@ -311,6 +359,9 @@ or dl,dl ; clear C jz failifc ; return 0 xor dl,[bx] ; dl -= *a++ + ifdef BASIC_ISO9660 + and dl,0dfh ; upcase + endif jne fail ; return -1 inc bx jmp @@loop @@ -354,6 +405,7 @@ endp @strcmp$qpxzct1 endif + endif ;*************************************************************** ;_fastcall const char **argstr(bx:const char *s, ax:const char keywords[], dx:const char **var); @@ -466,8 +518,8 @@ neg ax jne @@end inc dx + endif @@end: - endif @@setnum: xchg ax,si mov [di+2],dx @@ -692,6 +744,7 @@ ifndef NO_CLOSE mov [(image_himem si).fd2close],ax endif + ifdef ISO9660 ifndef NO386 mov eax,[_isostate.filesize] @@end: @@ -703,10 +756,33 @@ mov [word (image_himem si).chunk_size],ax mov [word ((image_himem si).chunk_size)+2],dx endif + else + mov bl,02h ; SEEK_END + call lseek0 + ifndef NO386 + push eax + mov ax,[(image_himem si).fd] + call rewind + pop eax +@@end: + mov [(image_himem si).chunk_size],eax + else + push ax + push dx + mov ax,[(image_himem si).fd] + call rewind + pop dx + pop ax +@@end: + mov [word (image_himem si).chunk_size],ax + mov [word ((image_himem si).chunk_size)+2],dx + endif + endif ret endp next_chunk + ifdef VCPI ;*************************************************************** struc data_himem ;struct data_himem { @@ -801,6 +877,7 @@ endif endp @malloc_bufv_or_die$qp11image_himem + endif ;*************************************************************** @@ -892,7 +969,7 @@ endp @storepage$qpul - + ifdef VCPI p386 ;*************************************************************** ;_fastcall void reset_bufv(di:u32 *p); @@ -958,6 +1035,7 @@ ret endp _prev_bufv + endif ifdef NO386 p8086 diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/HIMEM.CPP --- a/linld/stuff/src/HIMEM.CPP Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/HIMEM.CPP Sun Feb 28 16:32:57 2021 +0000 @@ -11,6 +11,7 @@ void load_image(struct image_himem *m) { m->remaining = m->size; u32* bufv= &himem_buf; +#ifdef VCPI #ifdef WITH_XMM_ALLOC m->buf = m->fallback; // set no_exit btw: die() won't return to DOS if(((u16 *)&m->fallback)[1] >= 0x10) { // >= _1m ? @@ -30,11 +31,22 @@ } } #endif +#else + m->buf = m->fallback; // set no_exit btw: die() won't return to DOS +#ifdef WITH_XMM_ALLOC + if(((u16 *)&m->fallback)[1] >= 0x10) { // >= _1m ? + xmm_alloc(m); // update m->buf + } + himem_buf = m->buf; +#endif +#endif do { u16 size; if(s16(size = read_image(m)) -1 < 0) break; storepage(bufv); +#ifdef VCPI if (bufv != &himem_buf) next(bufv); +#endif himem_buf += size; } while (*bufv); if(m->remaining) loadfailure(); @@ -58,19 +70,24 @@ pusha # endif } +#ifdef VCPI vm2rm(); +#endif struct image_himem *m = ± #define KERNEL 0 #define INITRD 1 - u32 *q; if(((u16 *)&m[KERNEL].fallback)[1] >= 0x10) // >= _1m ? ((u16 *)&m[KERNEL].fallback)[1] = 0x10; +#ifdef VCPI + u32 *q; q = m[KERNEL].bufv; if(q==0) { +#endif // Move kernel memcpy_image_kernel(); // Move initrd memcpy_image_initrd(); +#ifdef VCPI } else { //vcpi #if defined(__BORLANDC__) && defined(NO386) #pragma option -3 @@ -109,6 +126,7 @@ } while(q != m[INITRD].bufv); } } +#endif asm { # ifdef NO386 pop dx diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/ISO9660.CPP --- a/linld/stuff/src/ISO9660.CPP Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/ISO9660.CPP Sun Feb 28 16:32:57 2021 +0000 @@ -1,6 +1,8 @@ #include "crtl.h" +#include "common.h" #include "iso9660.h" +#ifdef ISO9660 #define setdirpage(to,sec) ((to) = *(int*)&(sec)<<(SECTORBITS-8)) #define cpytodirpage(to,from) ((to) = *(int*)((char*)&(from)+1)) #define cpyfromdirpage(to,from) (*(int*)((char*)&(to)+1) = (from)) @@ -13,6 +15,9 @@ x->dirsize = filesize2dirsize(* (unsigned long *) (isostate.buffer + 0xA6)); \ } +#if !defined(BASIC_ISO9660) && !defined(ROCKRIDGE) +#define ROCKRIDGE +#endif static int isoreaddir(void) { char *p; @@ -37,6 +42,7 @@ x->filemod = 0x81ED; if (p[25] & 2) ((char *)&(x->filemod))[1] = 0x41; p = x->buffer + 34 + ((p[32] + x->curpos) & -2); x->curpos += x->entrysize; +#ifdef ROCKRIDGE do { register len = p[2]; if (* (short *) p == 0x4D4E) { @@ -46,6 +52,20 @@ } p += len; } while (x->buffer + x->curpos - 3 >= p); +#endif +#ifdef BASIC_ISO9660 + char *s; + p = x->buffer + 33; p += x->curpos; + s = ".."+1-p[0]; + p--; + if (((* (short *) p) & 0xFEFF) -1 != 0) { + s = p + 1; p += *p; + if (* (short *) (p-1) != 0x313B) p+=2; // no ;1 to remove + if (*p != '.') p++; + *p = 0; + } + x->filename = s; +#endif found: return 0; } @@ -112,3 +132,4 @@ isolseek(&x->fileofs); return x->fd; } +#endif diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/JUMP.ASM --- a/linld/stuff/src/JUMP.ASM Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/JUMP.ASM Sun Feb 28 16:32:57 2021 +0000 @@ -6,6 +6,9 @@ %crefref %noincl %nomacs + + include "common.inc" + ifdef NO386 p8086 else @@ -107,11 +110,16 @@ pop ss mov sp,di + ifdef LINUX001 mov dx,2000h global _csip_hilo:word org $-2 _csip_hilo dw ? xchg al,dh ; 9020 / 9000 + else + mov al,20h ; 9020:0 + xor dx,dx + endif push ax push dx ; 0000 / 0042 @@ -120,18 +128,27 @@ global _pm_low:byte _pm_low db ? push cx + ifdef IPXE mov ax,[word ss:024Ch] xor ax,2b30h ; ipxe ? loopne @@notipxe + else + loop @@truebzimage + endif ; finish loading extrn @last_ditch$qv:near push cs call @last_ditch$qv + ifdef SHUTDOWN dos_shutdown ; clear si; ds=0; kill VCPI push cs pop ds + else + xor si,si + endif +@@truebzimage: @@notipxe: pop cx loop @@isbzimage @@ -174,7 +191,16 @@ pop es push es + ifdef ELKS call near @@movsb@jmp ; movsb; pop cs ; ds=es=ss + elseifdef MOVE_SETUP + call near @@movsb@jmp ; movsb; pop cs ; ds=es=ss + else + xor di,di + rep + movsb + call near @@isbzimage ; movsb; pop cs ; ds=es=ss + endif extrn memcpy32:near call memcpy32 @@ -191,7 +217,7 @@ ; movsb endif - ifndef noelks + ifdef ELKS ifdef MOVE_SETUP ifndef NO386 mov eax,[dword si+1E6h] @@ -232,7 +258,7 @@ rep movsb else - ifndef noelks + ifdef ELKS xchg ax,si mov ch,7Eh ; 0Ah min, 7Eh max @@movsb@jmp: @@ -257,7 +283,9 @@ assume cs:DGROUP retf + ifdef SHUTDOWN step19code + endif endp _boot_kernel diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/LINLD.CPP --- a/linld/stuff/src/LINLD.CPP Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/LINLD.CPP Sun Feb 28 16:32:57 2021 +0000 @@ -16,9 +16,15 @@ 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] " +#ifdef ISO9660 + "[iso=file] " +#endif + "..." NL "vga mode: ask,extended,normal or dec/oct/hex number" NL +#ifdef CPU64 "-64 for cpu64 only" NL +#endif "Defaults:" NL "\timage=bzImage" NL "\tinitrd,vga,root=(void)" NL @@ -50,11 +56,17 @@ if (!*++argv) syntax(); const char **clp = &cmdline; do { +#ifdef CPU64 if ((*(u16 *)*argv|2) == 0x362F) { // -64 /64 if (cpuhaslm() != 0) continue; exit(); } +#endif +#ifdef ISO9660 if (argstr(*argv,"cl|image|initrd|iso",clp) == (int) clp) continue; +#else + if (argstr(*argv,"cl|image|initrd",clp) == (int) clp) continue; +#endif #ifdef QUICK_BOOT if (argnum(*argv,"root|vga|mem|-b|-f~-q~-v~",&root_dev) >= (int) &base_himem) continue; #else @@ -68,7 +80,9 @@ strcatb((const char *) buf_cmdline,*argv); } while (*++argv); puts(*clp); +#ifdef ISO9660 if (isofile) setiso(isofile); +#endif set_cmdline(*clp); load_kernel(); load_initrd(); diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/LOAD.CPP --- a/linld/stuff/src/LOAD.CPP Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/LOAD.CPP Sun Feb 28 16:32:57 2021 +0000 @@ -137,7 +137,7 @@ readrm(m, 0x200); rewind(m->fd); if(kernelparams->setup_sects == 0) { -#if 1 +#ifdef LINUX001 if(* (int *) &first1k->pad10[0x3F-0x24] == 0x3AE8) { extern u16 csip_hilo; csip_hilo=0x0042; diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/MEMCPY32.ASM --- a/linld/stuff/src/MEMCPY32.ASM Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/MEMCPY32.ASM Sun Feb 28 16:32:57 2021 +0000 @@ -6,6 +6,9 @@ %crefref %noincl %nomacs + + include "common.inc" + ifdef NO386 p8086 else @@ -144,6 +147,7 @@ mov ecx,[sz] jecxz @@done + ifdef VCPI smsw ax and al,1 ;MSW_PE jz @@real_mode @@ -152,6 +156,7 @@ extrn vcpi_pm_copy_routine:near call near vcpi_pm_copy_routine ; Call pm copy routine via vcpi pm jmp @@done + endif @@real_mode: cli oldGDTR = (pword srcseg) ; don't need src seg/ofs anymore @@ -206,7 +211,19 @@ ;****** Const data ********************************************* + ifdef VCPI extrn gdt_memcpy + else + org $-8 ;save 8 bytes +;0000: unused +gdt_memcpy dd ?,? +;0008: Data seg [0,FFFFFFFF] + ; lim_lo base_lo + dw 1111111111111111b, 0000000000000000b + db 00000000b,10010010b,10001111b,00000000b + ; base_med P S D A G ??l_hi base_hi + ; Pl E W D + endif label GDTR pword gdt_limit dw 0ffffh global gdt_base_memcpy:word diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/MEMTOP.ASM --- a/linld/stuff/src/MEMTOP.ASM Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/MEMTOP.ASM Sun Feb 28 16:32:57 2021 +0000 @@ -6,6 +6,9 @@ %crefref %noincl %nomacs + + include "common.inc" + ifdef NO386 p8086 else diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/VCPI.ASM --- a/linld/stuff/src/VCPI.ASM Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/VCPI.ASM Sun Feb 28 16:32:57 2021 +0000 @@ -28,6 +28,10 @@ %crefref %noincl %nomacs + + include "common.inc" + + ifdef VCPI p386 ;****** Stuff for declaring descriptors @@ -383,6 +387,17 @@ endp _vm2rm ends _TEXT + else + + group DGROUP _TEXT + assume cs:DGROUP,ds:DGROUP + + segment _TEXT byte public use16 'CODE' + global gdt_data:near +gdt_data: + ends _TEXT + + endif end diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/XMM.ASM --- a/linld/stuff/src/XMM.ASM Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/XMM.ASM Sun Feb 28 16:32:57 2021 +0000 @@ -6,6 +6,9 @@ %crefref %noincl %nomacs + + include "common.inc" + p8086 group DGROUP _TEXT diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/_BEG.ASM --- a/linld/stuff/src/_BEG.ASM Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/_BEG.ASM Sun Feb 28 16:32:57 2021 +0000 @@ -6,6 +6,9 @@ %crefref %noincl %nomacs + + include "common.inc" + p8086 group DGROUP _TEXT,_DATA,_BSS @@ -18,10 +21,12 @@ ;global _data_start:byte label _data_start byte ifndef NO386 -msg_badcpu db "I need 386+ CPU in real mode w/o paging" +msg_badcpu db "I need a 386+ in real mode w/o paging" + ifdef VCPI db " or " msg_badmapping db "under VCPI 4.0+ manager with low 640k 1:1 mapping" global _vcpi:byte + endif _vcpi db 0 endif @@ -36,13 +41,15 @@ ;global _bss_start:byte label _bss_start byte global stktop:byte - ifdef NO386 global _cpu386:byte _cpu386 db ? + ifdef CPU64 org $-1 endif + ifdef CPU64 global _cpu_features:dword _cpu_features dd ? + endif ends _BSS segment _TEXT byte public use16 'CODE' @@ -118,6 +125,7 @@ ;*************************************************************** label check_vcpi near p386 + ifdef VCPI ; Check whether it is safe to call 67h xor eax,eax mov es,ax @@ -142,8 +150,10 @@ extrn _vcpi:byte dec [byte _vcpi] endif + endif no_vcpi: endcpu386: + ifdef CPU64 pushfd pop dx pop ax @@ -168,6 +178,9 @@ mov [_cpu_features],edx @@no_cpuid: endif + else + dec [_cpu386] + endif endcpu86: p8086 @@ -266,6 +279,9 @@ ret endp _topseg + else +@ret: + ret endif ;*************************************************************** diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/_END.ASM --- a/linld/stuff/src/_END.ASM Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/_END.ASM Sun Feb 28 16:32:57 2021 +0000 @@ -5,7 +5,10 @@ %crefref %noincl %nomacs - p386 + + include "common.inc" + + p8086 segment _TEXT byte public use16 'CODE' ;global _text_end:byte @@ -23,7 +26,7 @@ segment _BSS word public use16 'BSS' ;STACK_SIZE = 128 -STACK_SIZE = 512 +STACK_SIZE = 256 db STACK_SIZE dup(?) global stktop:byte label stktop byte diff -r 959269cc91c6 -r 61df94a0fa43 linld/stuff/src/pipehole.awk --- a/linld/stuff/src/pipehole.awk Sat Feb 27 17:05:52 2021 +0100 +++ b/linld/stuff/src/pipehole.awk Sun Feb 28 16:32:57 2021 +0000 @@ -1,4 +1,4 @@ -BEGIN { hold=0; is386=0; isload=0; isiso=0; istazboot=0; wascall=0; ishimem=0; label="none"; xlabel=""; file="" } +BEGIN { hold=0; is386=0; isload=0; isiso=0; istazboot=0; wascall=0; ishimem=0; label="none"; xlabel=""; file=""; retc="returnCz:\n" } function isnum(n) { return match(n,/^[0-9+-]/) } { sub(/segment word public/,"segment byte public") @@ -48,7 +48,7 @@ } } # file == "linld.cpp" if (file == "himem.cpp") { - if (/sp,bp/ || /pop bp/) next + if (/sp,bp/ || /pop bp/ || /enter/ || /leave/) next if (/void load_image/) ishimem=1 if (ishimem == 1 && is386 == 0) { if (/si\+8\]$/ || /si\+4\]$/ || /si\+16\]$/) next @@ -243,15 +243,30 @@ } } # file == "load.cpp" if (file == "iso9660.cpp") { - if (/ptr \[si\+10\],dx/) next - if (/ptr \[si\+8\],ax/) next - if (/si\+32/) next - if (/add word ptr \[si\],ax/) $0=" add word ptr [si],cx" + if (/ptr \[si\+8\],/) { si="si"; di="di" } + if (/ptr \[di\+8\],/) { si="di"; di="si" } + if (/leave/ || /enter/) next + if (/ptr \[.i\+10\],dx/) next + if (/ptr \[.i\+8\],ax/) next + if (/ptr \[.i\+8\],eax/) next + if (/cx,word ptr \[.i\+32\]/) next + if (/add word ptr \[.i\],ax/) sub(/ax/,"cx") if (/ax,word ptr \[si\+24\]/) sub(/mov ax,/,"les ax,d") if (/ax,word ptr \[si\+26\]/) next if (/word ptr \[si\+29\],ax/) sub(/ax/,"es") if (/\[si\],-1/) $0=" not word ptr [si]" sub(/di,word ptr DGROUP:_isostate\+2/,"di,word ptr [si+2]") + if (/s = p \+ 1;/ && !/ ;/) isiso=20 + if (isiso == 20) { # ISO9660.LST + if (/al,byte ptr/) $0=" ;inc ax" + sub(/\[si-1\]/,"[si]") + if (/p != .\./) print " inc " di " ; see ;inc ax" + if (/i],0/) sub(/,0/,",ah") + if (/filename = s;/) { + print " stc" + isiso=0 + } + } if (isiso == 19) { # ISO9660.LST if (/short @2@282/) $0=" jc restoreC" if (/bp-2/ || /si\+34/ || /ax,dx/ || /cmp ax,-1/) next @@ -298,14 +313,12 @@ if (/si\+24/) isiso=1 } if (/found:/) isiso=15 - if (/short @1@394/) sub(/@1@394/,"@1@422") if (isiso != 15 && /si,offset DGROUP:_isostate/) $0=";" $0 if (isiso == 15) { # ISO9660.LST if (/xor/) { print "returnNotC:" print " cmc" - print "returnC:" - print "@1@422:" + print retc "returnC:" print " sbb ax,ax" print "return:" next @@ -316,25 +329,26 @@ if (/short @1@142/) { isiso=14; next } if (isiso == 14) { # ISO9660.LST if (/ax,-1/) next - if (/jmp @1@422/) sub(/jmp/,"jb") + if (/jmp/) $0=" jb returnCz" } if (/p = x->buffer \+ 34/) isiso=13 if (isiso == 13) { # ISO9660.LST - if (/di,si/) $0=" xchg ax,bx" - if (/di,ax/) $0=" lea di,[si+bx+72]" - if (/di,72/) { - isiso=0 - next - } + if (/i,.i/) $0=" xchg ax,bx" + if (/i,ax/) $0=" lea " di ",[bx+" si "+72]" + if (/i,72/ || /word ptr \[.i\+32\]/) next + if (/register len/) isiso=12 } - if (/register len/) isiso=12 if (isiso == 12) { # ISO9660.LST - if (/di\+2/) sub(/al/,"bl") + if (/.i\+2/) sub(/al/,"bl") if (/cbw/) next sub(/dx,ax/,"bh,0") if (/bx,dx/) next sub(/i,dx/,"i,bx") - sub(/bx\+di\],0/,"bx+di],bh") + if (/bx\+.i\],0/) sub(/,0/,",bh") + if (/jmp/) { + $0=retc " jmp returnC" + retc="" + } if (/while/) isiso=0 } if (/curpos >= SECT/) isiso=10 @@ -370,15 +384,19 @@ if (/entrysize =/) isiso=5 if (isiso == 5) { # ISO9660.LST if (/ax,ax/) next + if (/word ptr \[.i\+32\],ax/) next sub(/ax/,"cx") sub(/je/,"jcxz") if (/jcxz/) { hold=0 print s - sub(/@1@114/,"@1@394") + sub(/@1@114/,"returnNotC") print - print " mov word ptr [si+10],dx" - $0=" mov word ptr [si+8],ax" + if (is386) $0=" mov dword ptr [" si "+8],eax" + else { + print " mov word ptr [" si "+10],dx" + $0=" mov word ptr [" si "+8],ax" + } } if (/return/) isiso=0 } diff -r 959269cc91c6 -r 61df94a0fa43 syslinux/stuff/iso2exe/iso2exe.sh --- a/syslinux/stuff/iso2exe/iso2exe.sh Sat Feb 27 17:05:52 2021 +0100 +++ b/syslinux/stuff/iso2exe/iso2exe.sh Sun Feb 28 16:32:57 2021 +0000 @@ -43,7 +43,7 @@ TMP=/tmp/iso2exe$$ mkdir -p $TMP/mnt mount -o loop,ro $1 $TMP/mnt - if grep -qs rootfs $TMP/mnt/boot/isolinux/isolinux.cfg ; then + if [ $2 = --array ] || grep -qs rootfs $TMP/mnt/boot/isolinux/isolinux.cfg ; then $0 --get rootfs.gz > $TMP/rootfs.gz SIZE=$(wc -c < $TMP/rootfs.gz) store 24 $SIZE $1 @@ -338,7 +338,7 @@ ddq if=/dev/zero bs=32k count=1 of=$DATA add_win32exe $DATA $2 > /dev/null HSZ=$OFS - add_rootfs $DATA > /dev/null + add_rootfs $DATA --array > /dev/null add_fdbootstrap $DATA > /dev/null name=${3:-bootiso} BOOTISOSZ=$((0x8000 - $OFS + $HSZ)) diff -r 959269cc91c6 -r 61df94a0fa43 tazlito/receipt --- a/tazlito/receipt Sat Feb 27 17:05:52 2021 +0100 +++ b/tazlito/receipt Sun Feb 28 16:32:57 2021 +0000 @@ -30,6 +30,7 @@ cp -a $install/* $fs chown -R root.root $fs chmod 755 $fs/usr/bin/tazlito* + sed 's|.*boot/grub|#&|' $fs/usr/bin/tazlito* # keep splash.xpm.gz for tazinst # Declare /etc/tazlito/distro-packages.list & /etc/tazlito/tazlito.conf touch $fs/etc/tazlito/tazlito.conf touch $fs/etc/tazlito/distro-packages.list