wok rev 24019

syslinux: fix build
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 28 16:32:57 2021 +0000 (6 months ago)
parents 959269cc91c6
children 42b4b9d947f3
files linld/receipt linld/stuff/src/!COMPILE.BAT linld/stuff/src/A20.ASM linld/stuff/src/COMMON.H linld/stuff/src/CRTL.ASM linld/stuff/src/HIMEM.CPP linld/stuff/src/ISO9660.CPP linld/stuff/src/JUMP.ASM linld/stuff/src/LINLD.CPP linld/stuff/src/LOAD.CPP linld/stuff/src/MEMCPY32.ASM linld/stuff/src/MEMTOP.ASM linld/stuff/src/VCPI.ASM linld/stuff/src/XMM.ASM linld/stuff/src/_BEG.ASM linld/stuff/src/_END.ASM linld/stuff/src/pipehole.awk syslinux/stuff/iso2exe/iso2exe.sh tazlito/receipt
line diff
     1.1 --- a/linld/receipt	Sat Feb 27 17:05:52 2021 +0100
     1.2 +++ b/linld/receipt	Sun Feb 28 16:32:57 2021 +0000
     1.3 @@ -27,7 +27,7 @@
     1.4  	unzip $SRC/$EXTRA_TOOL > /dev/null
     1.5  	rm LINLD$SUFFIX/CRTL.CPP LINLD$SUFFIX/INT15_88.ASM
     1.6  	cp $stuff/src/* LINLD$SUFFIX/
     1.7 -	sed -i 's/-3/-DNO386/' LINLD$SUFFIX/BCCOPT.OPT
     1.8 +	sed -i '/-3/d' LINLD$SUFFIX/BCCOPT.OPT
     1.9  	cp -a LINLD$SUFFIX TAZBOOT
    1.10  	unix2dos > MAKE.BAT <<EOT
    1.11  d:
     2.1 --- a/linld/stuff/src/!COMPILE.BAT	Sat Feb 27 17:05:52 2021 +0100
     2.2 +++ b/linld/stuff/src/!COMPILE.BAT	Sun Feb 28 16:32:57 2021 +0000
     2.3 @@ -3,8 +3,7 @@
     2.4  tasm /h > helptasm.log
     2.5  bcc > helpbcc.log
     2.6  tlink > helptlink.log
     2.7 -bcc @bccopt.opt -S -mt -DQUICK_BOOT -DISOHOOK -DMOVE_SETUP *.cpp > cpp.log
     2.8 -#bcc @bccopt.opt -S -mt -DWITH_XMM_ALLOC -DQUICK_BOOT -DISOHOOK -DMOVE_SETUP *.cpp > cpp.log
     2.9 +bcc @bccopt.opt -S -mt *.cpp > cpp.log
    2.10  ren LINLD.ASM LINLD.ASO
    2.11  ren LOAD.ASM LOAD.ASO
    2.12  ren HIMEM.ASM HIMEM.ASO
    2.13 @@ -13,6 +12,6 @@
    2.14  mawk -f pipehole.awk LOAD.ASO > LOAD.ASM
    2.15  mawk -f pipehole.awk HIMEM.ASO > HIMEM.ASM
    2.16  mawk -f pipehole.awk ISO9660.ASO > ISO9660.ASM
    2.17 -tasm /la /m /dQUICK_BOOT /dISOHOOK /dMOVE_SETUP /dNO386 /dLONG_FILENAME *.asm > asm.log
    2.18 -#tasm /la /m /dWITH_XMM_ALLOC /dLARGE_ZIMAGE /dQUICK_BOOT /dISOHOOK /dMOVE_SETUP /dNO386 /dLONG_FILENAME *.asm > asm.log
    2.19 +mawk "{ if (/ptional/) hide=1; if (!hide) { sub(\"//\",\";\");sub(\"#define \",\"\");print $1 \"\t=\t1\t\t;\" $0} }" COMMON.H > COMMON.INC
    2.20 +tasm /la /m *.asm > asm.log
    2.21  tlink /m /s /t @link.cmd > lnk.log
     3.1 --- a/linld/stuff/src/A20.ASM	Sat Feb 27 17:05:52 2021 +0100
     3.2 +++ b/linld/stuff/src/A20.ASM	Sun Feb 28 16:32:57 2021 +0000
     3.3 @@ -8,6 +8,8 @@
     3.4                  %nomacs
     3.5                  p8086
     3.6  
     3.7 +	include	"common.inc"
     3.8 +
     3.9          group   DGROUP  _TEXT,_DATA
    3.10          assume  cs:DGROUP,ds:DGROUP
    3.11  
    3.12 @@ -155,10 +157,12 @@
    3.13  		extrn	_topseg:near
    3.14  		call	near _topseg
    3.15  		mov	[word sssp+2],ax
    3.16 +		ifdef	VCPI
    3.17  		and	ch,0			; vcpi flag
    3.18  		org	$-1
    3.19  		global	_vcpi:byte
    3.20  _vcpi		db	?
    3.21 +		endif
    3.22  		else
    3.23                  p386
    3.24  		movzx	eax,[word _heap_top]
    3.25 @@ -186,14 +190,20 @@
    3.26  		sub	eax,ecx
    3.27  		endif
    3.28  		shr	eax,4
    3.29 +		ifdef	VCPI
    3.30  		mov	ch,0
    3.31 +		endif
    3.32  @bzimage:
    3.33  		xchg	ax,dx
    3.34  		mov	ax,9000h
    3.35 +		ifdef	VCPI
    3.36  		extrn	_vcpi:byte
    3.37  		and	ch,[_vcpi]
    3.38  		endif
    3.39 +		endif
    3.40 +		ifdef	VCPI
    3.41  		add	dh,ch		; 60k room for malloc_bufv_or_die
    3.42 +		endif
    3.43  		cmp	ax,dx
    3.44  		ifdef	LARGE_ZIMAGE
    3.45  		ja	@nooverflow0
     4.1 --- a/linld/stuff/src/COMMON.H	Sat Feb 27 17:05:52 2021 +0100
     4.2 +++ b/linld/stuff/src/COMMON.H	Sun Feb 28 16:32:57 2021 +0000
     4.3 @@ -1,7 +1,45 @@
     4.4 +//#define WITH_XMM_ALLOC	add himem.sys driver
     4.5 +//#define LARGE_ZIMAGE	may load system in high memory temporarily 
     4.6 +//#define INT15_E820	add int15/eax=E820 driver
     4.7 +//#define BASIC_ISO9660	non rockridge support
     4.8 +#define ROCKRIDGE	iso 9660 posix name support
     4.9 +#define ISO9660		iso= support
    4.10 +#define QUICK_BOOT	/q bypass shutdown hack, /v keeps v86
    4.11 +#define ISOHOOK		iso image dos boot helper
    4.12 +#define MOVE_SETUP	spare few Kb in setup location for zImage system
    4.13 +#define NO386		8088 support
    4.14 +#define CPU64		/64 support
    4.15 +#define LONG_FILENAME	look for Win95+ long file name too
    4.16 +#define SHUTDOWN	disable int19 hooked drivers
    4.17 +#define VCPI		v86 mode support with VCPI 4.0+
    4.18 +#define LINUX001	linux 0.01 support
    4.19 +#define ELKS		elks support
    4.20 +#define IPXE		ipxe support
    4.21 +/* End of the optional features */
    4.22 +
    4.23 +#ifdef ISOHOOK
    4.24 +#ifndef ISO9660
    4.25 +#define ISO9660
    4.26 +#endif
    4.27 +#ifndef ROCKRIDGE
    4.28 +#define ROCKRIDGE
    4.29 +#endif
    4.30 +#ifndef CPU64
    4.31 +#define CPU64
    4.32 +#endif
    4.33 +#endif
    4.34 +
    4.35  // This file is distributed under GPL
    4.36  //
    4.37  // Common defs not belonging to CRTL
    4.38  
    4.39 +#if defined(__BORLANDC__) && !defined(NO386)
    4.40 +#pragma option -3
    4.41 +	asm{
    4.42 +		.386p
    4.43 +	}
    4.44 +#endif
    4.45 +
    4.46  #define NL "\n"
    4.47  #define VERSION_STR "0.97"
    4.48  
     5.1 --- a/linld/stuff/src/CRTL.ASM	Sat Feb 27 17:05:52 2021 +0100
     5.2 +++ b/linld/stuff/src/CRTL.ASM	Sun Feb 28 16:32:57 2021 +0000
     5.3 @@ -6,6 +6,9 @@
     5.4                  %crefref
     5.5                  %noincl
     5.6                  %nomacs
     5.7 +
     5.8 +	include	"common.inc"
     5.9 +
    5.10  		ifdef	NO386
    5.11                  p8086
    5.12  		else
    5.13 @@ -19,7 +22,9 @@
    5.14  
    5.15  loaderr		db	"Load failure",0
    5.16  msg_hang	db      "Himem broken",0
    5.17 +		ifdef	VCPI
    5.18  vcpi_alloc_err	db	"VCPI"
    5.19 +		endif
    5.20  		global	overflow:byte
    5.21  overflow	db	"/"
    5.22  msg_malloc      db      "Out of memory"
    5.23 @@ -29,10 +34,12 @@
    5.24  
    5.25          segment _BSS byte public use16 'BSS'
    5.26  
    5.27 +	ifdef ISO9660
    5.28  		include	"isostate.inc"
    5.29  		public	_isostate
    5.30  _isostate	isostate	<?>
    5.31  		org	$-7
    5.32 +	endif
    5.33  	global	buf4k:byte
    5.34  label	buf4k	byte
    5.35  _xfer_buf	db	4096	dup (?)
    5.36 @@ -70,8 +77,24 @@
    5.37          endp	@strcatb$qpxzct1
    5.38  
    5.39  
    5.40 +		ifdef	NO386
    5.41                  p8086
    5.42 +		endif
    5.43  
    5.44 +	ifndef ISO9660
    5.45 +;***************************************************************
    5.46 +;_fastcall int:C open(bx:const char* name, int flags=O_RDONLY);
    5.47 +;_fastcall int:C openargs(bx:const char* name, int flags=O_RDONLY);
    5.48 +;***************************************************************
    5.49 +        global  openargs:near			; openargs(bx)
    5.50 +openargs:
    5.51 +		cmp	[byte bx],'@'
    5.52 +		jne	fail
    5.53 +		inc	bx
    5.54 +
    5.55 +        global  @open$qpxzc:near
    5.56 +@open$qpxzc:
    5.57 +	endif
    5.58  opendos:
    5.59  	ifdef	LONG_FILENAME
    5.60  		;xchg	ax,cx			; attributes
    5.61 @@ -91,6 +114,7 @@
    5.62  	endif
    5.63  		;mov	cl,0			; attribute mask
    5.64  		call	dos
    5.65 +	ifdef ISO9660
    5.66  		jc	catret
    5.67  openok:
    5.68  		xchg	ax,bx
    5.69 @@ -104,12 +128,16 @@
    5.70  		;xor	cx,cx
    5.71  		cwd
    5.72  		call	seeksetpos0		; filepos = 0
    5.73 +	else
    5.74 +openok:
    5.75 +	endif
    5.76  		xchg	ax,bx			; fd
    5.77  		ret
    5.78  
    5.79 +	ifdef ISO9660
    5.80  ;***************************************************************
    5.81 -;_fastcall int open(bx:const char* name, int flags=O_RDONLY);
    5.82 -;_fastcall int openargs(bx:const char* name, int flags=O_RDONLY);
    5.83 +;_fastcall int:C open(bx:const char* name, int flags=O_RDONLY);
    5.84 +;_fastcall int:C openargs(bx:const char* name, int flags=O_RDONLY);
    5.85  ;***************************************************************
    5.86          global  openargs:near			; openargs(bx)
    5.87  openargs:
    5.88 @@ -135,6 +163,7 @@
    5.89  		extrn	@_isoopen$qv:near
    5.90  		mov	[word _isostate.filename2open],bx
    5.91  		jmp	@_isoopen$qv		; filepos = 0
    5.92 +	endif
    5.93  
    5.94  
    5.95  ;***************************************************************
    5.96 @@ -154,8 +183,10 @@
    5.97          global  close:near			; close(ax)
    5.98  close:
    5.99  		mov	bh,3Eh
   5.100 +	ifdef ISO9660
   5.101  		mov	cx,[_isostate.fd]
   5.102  		jcxz	dosbx
   5.103 +	endif
   5.104  		jmp	fail
   5.105  
   5.106          endp    @close$qi
   5.107 @@ -178,6 +209,7 @@
   5.108  		xchg	ax,cx			; sz
   5.109  	global	@read$cxdxbx:near
   5.110  @read$cxdxbx:
   5.111 +	ifdef ISO9660
   5.112  		push	bx
   5.113  		mov	bx,offset _isostate.filepos
   5.114  		push	cx
   5.115 @@ -198,6 +230,7 @@
   5.116  		add	[bx],cx
   5.117  		adc	[(word bx)+2],0
   5.118  		pop	bx
   5.119 +	endif
   5.120  readfd:
   5.121                  mov	ah,3Fh
   5.122                  ;jcxz	fail
   5.123 @@ -221,8 +254,16 @@
   5.124          proc    @rewind$qi near
   5.125  
   5.126  rewind:
   5.127 +	ifdef ISO9660
   5.128  		mov	bx,offset _isostate.fileofs
   5.129  		jmp	lseek
   5.130 +	else
   5.131 +		mov	bl,0
   5.132 +lseek0:
   5.133 +		xor	cx,cx
   5.134 +		xor	dx,dx
   5.135 +		jmp	lseek
   5.136 +	endif
   5.137  
   5.138          endp    @rewind$qi
   5.139  
   5.140 @@ -261,6 +302,7 @@
   5.141          global  @isolseek$qpxul:near
   5.142          proc    @isolseek$qpxul near
   5.143  
   5.144 +	ifdef ISO9660
   5.145  isolseek:
   5.146  		mov	ax,[_isostate.fd]
   5.147  lseek:
   5.148 @@ -270,6 +312,9 @@
   5.149  		xor	bx,bx
   5.150  		mov	[word _isostate.filepos],bx
   5.151  		mov	[(word _isostate.filepos)+2],bx
   5.152 +	else
   5.153 +lseek:
   5.154 +	endif
   5.155  		mov	bh,42h			; bx=fd cx:dx=offset al=whence
   5.156  dosbx:
   5.157  		xchg	ax,bx
   5.158 @@ -277,6 +322,7 @@
   5.159  
   5.160  	endp	@isolseek$qpxul
   5.161  
   5.162 +	ifdef ISO9660
   5.163  ;***************************************************************
   5.164  ;_fastcall int isoreadsector(bx:const unsigned long *offset);
   5.165  ;_fastcall int isoreadrootsector(void);
   5.166 @@ -294,8 +340,10 @@
   5.167  		jmp	@read$dxaxbx		; read(fd,buffer,2560+)
   5.168  
   5.169          endp    @isoreadsector$qpxul
   5.170 +	endif
   5.171  
   5.172  
   5.173 +	ifdef ISO9660
   5.174  		ifdef ISOHOOK
   5.175  ;***************************************************************
   5.176  ;_fastcall int strhead(bx:const char* a, ax:const char* b);
   5.177 @@ -311,6 +359,9 @@
   5.178  		or	dl,dl			; clear C
   5.179  		jz	failifc			; return 0
   5.180                  xor	dl,[bx]			; dl -= *a++
   5.181 +		ifdef BASIC_ISO9660
   5.182 +		and	dl,0dfh			; upcase
   5.183 +		endif
   5.184  		jne	fail			; return -1
   5.185                  inc	bx
   5.186                  jmp	@@loop
   5.187 @@ -354,6 +405,7 @@
   5.188  
   5.189          endp    @strcmp$qpxzct1
   5.190  		endif
   5.191 +	endif
   5.192  
   5.193  ;***************************************************************
   5.194  ;_fastcall const char **argstr(bx:const char *s, ax:const char keywords[], dx:const char **var);
   5.195 @@ -466,8 +518,8 @@
   5.196  		neg	ax
   5.197  		jne	@@end
   5.198  		inc	dx
   5.199 +		endif
   5.200  @@end:
   5.201 -		endif
   5.202  @@setnum:
   5.203  		xchg	ax,si
   5.204  		mov	[di+2],dx
   5.205 @@ -692,6 +744,7 @@
   5.206  		ifndef	NO_CLOSE
   5.207  		mov	[(image_himem si).fd2close],ax
   5.208  		endif
   5.209 +	ifdef ISO9660
   5.210  		ifndef	NO386
   5.211  		mov	eax,[_isostate.filesize]
   5.212  @@end:
   5.213 @@ -703,10 +756,33 @@
   5.214  		mov	[word (image_himem si).chunk_size],ax
   5.215  		mov	[word ((image_himem si).chunk_size)+2],dx
   5.216  		endif
   5.217 +	else
   5.218 +		mov	bl,02h			; SEEK_END
   5.219 +		call	lseek0
   5.220 +		ifndef	NO386
   5.221 +		push	eax
   5.222 +		mov	ax,[(image_himem si).fd]
   5.223 +		call	rewind
   5.224 +		pop	eax
   5.225 +@@end:
   5.226 +		mov	[(image_himem si).chunk_size],eax
   5.227 +		else
   5.228 +		push	ax
   5.229 +		push	dx
   5.230 +		mov	ax,[(image_himem si).fd]
   5.231 +		call	rewind
   5.232 +		pop	dx
   5.233 +		pop	ax
   5.234 +@@end:
   5.235 +		mov	[word (image_himem si).chunk_size],ax
   5.236 +		mov	[word ((image_himem si).chunk_size)+2],dx
   5.237 +		endif
   5.238 +	endif
   5.239  		ret
   5.240  
   5.241          endp    next_chunk
   5.242  
   5.243 +		ifdef	VCPI
   5.244  ;***************************************************************
   5.245  
   5.246  struc   data_himem			;struct data_himem {
   5.247 @@ -801,6 +877,7 @@
   5.248  		endif
   5.249  
   5.250          endp    @malloc_bufv_or_die$qp11image_himem
   5.251 +		endif
   5.252  
   5.253  
   5.254  ;***************************************************************
   5.255 @@ -892,7 +969,7 @@
   5.256  
   5.257          endp    @storepage$qpul
   5.258  
   5.259 -
   5.260 +		ifdef	VCPI
   5.261                  p386
   5.262  ;***************************************************************
   5.263  ;_fastcall void reset_bufv(di:u32 *p);
   5.264 @@ -958,6 +1035,7 @@
   5.265  		ret
   5.266  
   5.267          endp    _prev_bufv
   5.268 +		endif
   5.269  
   5.270  		ifdef	NO386
   5.271                  p8086
     6.1 --- a/linld/stuff/src/HIMEM.CPP	Sat Feb 27 17:05:52 2021 +0100
     6.2 +++ b/linld/stuff/src/HIMEM.CPP	Sun Feb 28 16:32:57 2021 +0000
     6.3 @@ -11,6 +11,7 @@
     6.4  void load_image(struct image_himem *m) {
     6.5      m->remaining = m->size;
     6.6      u32* bufv= &himem_buf;
     6.7 +#ifdef VCPI
     6.8  #ifdef WITH_XMM_ALLOC
     6.9      m->buf = m->fallback;	// set no_exit btw: die() won't return to DOS
    6.10      if(((u16 *)&m->fallback)[1] >= 0x10) { // >= _1m ?
    6.11 @@ -30,11 +31,22 @@
    6.12  	}
    6.13      }
    6.14  #endif
    6.15 +#else
    6.16 +    m->buf = m->fallback;	// set no_exit btw: die() won't return to DOS
    6.17 +#ifdef WITH_XMM_ALLOC
    6.18 +    if(((u16 *)&m->fallback)[1] >= 0x10) { // >= _1m ?
    6.19 +        xmm_alloc(m);			// update m->buf
    6.20 +    }
    6.21 +    himem_buf = m->buf;
    6.22 +#endif
    6.23 +#endif
    6.24      do {
    6.25          u16 size;
    6.26  	if(s16(size = read_image(m)) -1 < 0) break;
    6.27          storepage(bufv);
    6.28 +#ifdef VCPI
    6.29  	if (bufv != &himem_buf) next(bufv);
    6.30 +#endif
    6.31          himem_buf += size;
    6.32      } while (*bufv);
    6.33      if(m->remaining) loadfailure();
    6.34 @@ -58,19 +70,24 @@
    6.35  	pusha
    6.36  # endif
    6.37      }
    6.38 +#ifdef VCPI
    6.39      vm2rm();
    6.40 +#endif
    6.41      struct image_himem *m = &pm;
    6.42  #define KERNEL	0
    6.43  #define INITRD	1
    6.44 -    u32 *q;
    6.45      if(((u16 *)&m[KERNEL].fallback)[1] >= 0x10) // >=	_1m ?
    6.46  	((u16 *)&m[KERNEL].fallback)[1] = 0x10;
    6.47 +#ifdef VCPI
    6.48 +    u32 *q;
    6.49      q = m[KERNEL].bufv;
    6.50      if(q==0) {
    6.51 +#endif
    6.52          // Move kernel
    6.53          memcpy_image_kernel();
    6.54          // Move initrd
    6.55          memcpy_image_initrd();
    6.56 +#ifdef VCPI
    6.57      } else { //vcpi
    6.58  #if defined(__BORLANDC__) && defined(NO386)
    6.59  #pragma option -3
    6.60 @@ -109,6 +126,7 @@
    6.61              } while(q != m[INITRD].bufv);
    6.62          }
    6.63      }
    6.64 +#endif
    6.65      asm {
    6.66  # ifdef NO386
    6.67  	pop	dx
     7.1 --- a/linld/stuff/src/ISO9660.CPP	Sat Feb 27 17:05:52 2021 +0100
     7.2 +++ b/linld/stuff/src/ISO9660.CPP	Sun Feb 28 16:32:57 2021 +0000
     7.3 @@ -1,6 +1,8 @@
     7.4  #include "crtl.h"
     7.5 +#include "common.h"
     7.6  #include "iso9660.h"
     7.7  
     7.8 +#ifdef ISO9660
     7.9  #define setdirpage(to,sec)	((to) = *(int*)&(sec)<<(SECTORBITS-8))
    7.10  #define cpytodirpage(to,from)	((to) = *(int*)((char*)&(from)+1))
    7.11  #define cpyfromdirpage(to,from)	(*(int*)((char*)&(to)+1) = (from))
    7.12 @@ -13,6 +15,9 @@
    7.13  	x->dirsize = filesize2dirsize(* (unsigned long *) (isostate.buffer + 0xA6)); \
    7.14  }
    7.15  
    7.16 +#if !defined(BASIC_ISO9660) && !defined(ROCKRIDGE)
    7.17 +#define  ROCKRIDGE
    7.18 +#endif
    7.19  static int isoreaddir(void)
    7.20  {
    7.21  	char *p;
    7.22 @@ -37,6 +42,7 @@
    7.23  	x->filemod = 0x81ED; if (p[25] & 2) ((char *)&(x->filemod))[1] = 0x41;
    7.24  	p = x->buffer + 34 + ((p[32] + x->curpos) & -2);
    7.25  	x->curpos += x->entrysize;
    7.26 +#ifdef ROCKRIDGE
    7.27  	do {
    7.28  		register len = p[2];
    7.29  		if (* (short *) p == 0x4D4E) {
    7.30 @@ -46,6 +52,20 @@
    7.31  		}
    7.32  		p += len;
    7.33  	} while (x->buffer + x->curpos - 3 >= p);
    7.34 +#endif
    7.35 +#ifdef BASIC_ISO9660
    7.36 +	char *s;
    7.37 +	p = x->buffer + 33; p += x->curpos;
    7.38 +	s = ".."+1-p[0];
    7.39 +	p--;
    7.40 +	if (((* (short *) p) & 0xFEFF) -1 != 0) {
    7.41 +		s = p + 1; p += *p;
    7.42 +		if (* (short *) (p-1) != 0x313B) p+=2; // no ;1 to remove
    7.43 +		if (*p != '.') p++;
    7.44 +		*p = 0;
    7.45 +	}
    7.46 +	x->filename = s;
    7.47 +#endif
    7.48  found:
    7.49  	return 0;
    7.50  }
    7.51 @@ -112,3 +132,4 @@
    7.52  	isolseek(&x->fileofs);
    7.53  	return x->fd;
    7.54  }
    7.55 +#endif
     8.1 --- a/linld/stuff/src/JUMP.ASM	Sat Feb 27 17:05:52 2021 +0100
     8.2 +++ b/linld/stuff/src/JUMP.ASM	Sun Feb 28 16:32:57 2021 +0000
     8.3 @@ -6,6 +6,9 @@
     8.4                  %crefref
     8.5                  %noincl
     8.6                  %nomacs
     8.7 +
     8.8 +	include	"common.inc"
     8.9 +
    8.10  		ifdef	NO386
    8.11                  p8086
    8.12  		else
    8.13 @@ -107,11 +110,16 @@
    8.14  		pop	ss
    8.15  		mov	sp,di
    8.16  
    8.17 +		ifdef	LINUX001
    8.18  		mov	dx,2000h
    8.19  		global	_csip_hilo:word
    8.20  		org	$-2
    8.21  _csip_hilo	dw	?
    8.22  		xchg	al,dh	; 9020 / 9000
    8.23 +		else
    8.24 +		mov	al,20h	; 9020:0
    8.25 +		xor	dx,dx
    8.26 +		endif
    8.27  		push	ax
    8.28  		push	dx	; 0000 / 0042
    8.29  
    8.30 @@ -120,18 +128,27 @@
    8.31  		global	_pm_low:byte
    8.32  _pm_low		db	?
    8.33  		push	cx
    8.34 +		ifdef	IPXE
    8.35  		mov	ax,[word ss:024Ch]
    8.36  		xor	ax,2b30h		; ipxe ?
    8.37  		loopne	@@notipxe
    8.38 +		else
    8.39 +		loop	@@truebzimage
    8.40 +		endif
    8.41  
    8.42  		; finish loading
    8.43  		extrn   @last_ditch$qv:near
    8.44  		push	cs
    8.45  		call	@last_ditch$qv
    8.46 +		ifdef	SHUTDOWN
    8.47  		dos_shutdown			; clear si; ds=0; kill VCPI
    8.48  		push	cs
    8.49  		pop	ds
    8.50 +		else
    8.51 +		xor	si,si
    8.52 +		endif
    8.53  
    8.54 +@@truebzimage:
    8.55  @@notipxe:
    8.56  		pop	cx
    8.57  		loop	@@isbzimage
    8.58 @@ -174,7 +191,16 @@
    8.59  		pop	es
    8.60  		push	es
    8.61  
    8.62 +		ifdef ELKS
    8.63  		call	near @@movsb@jmp	; movsb; pop cs ; ds=es=ss
    8.64 +		elseifdef MOVE_SETUP
    8.65 +		call	near @@movsb@jmp	; movsb; pop cs ; ds=es=ss
    8.66 +		else
    8.67 +		xor	di,di
    8.68 +		rep
    8.69 +		  movsb
    8.70 +		call	near @@isbzimage	; movsb; pop cs ; ds=es=ss
    8.71 +		endif
    8.72  
    8.73  		extrn   memcpy32:near
    8.74  		call	memcpy32
    8.75 @@ -191,7 +217,7 @@
    8.76  		;  movsb
    8.77  		endif
    8.78  
    8.79 -		ifndef  noelks
    8.80 +		ifdef   ELKS
    8.81  		ifdef	MOVE_SETUP
    8.82  		ifndef	NO386
    8.83  		mov	eax,[dword si+1E6h]
    8.84 @@ -232,7 +258,7 @@
    8.85  		rep
    8.86  		  movsb
    8.87  		else
    8.88 -		 ifndef  noelks
    8.89 +		 ifdef   ELKS
    8.90  		xchg	ax,si
    8.91  		mov	ch,7Eh		; 0Ah min, 7Eh max
    8.92  @@movsb@jmp:
    8.93 @@ -257,7 +283,9 @@
    8.94  		assume	cs:DGROUP
    8.95                  retf
    8.96  
    8.97 +		ifdef	SHUTDOWN
    8.98  		step19code
    8.99 +		endif
   8.100  
   8.101          endp    _boot_kernel
   8.102  
     9.1 --- a/linld/stuff/src/LINLD.CPP	Sat Feb 27 17:05:52 2021 +0100
     9.2 +++ b/linld/stuff/src/LINLD.CPP	Sun Feb 28 16:32:57 2021 +0000
     9.3 @@ -16,9 +16,15 @@
     9.4  
     9.5  inline void syntax() {
     9.6      die("Syntax:" NL
     9.7 -        "LINLD [image=file] [initrd=files] [vga=mode] [root=num] [mem=max] [cl=cmdline] [iso=file] ..." NL
     9.8 +        "LINLD [image=file] [initrd=files] [vga=mode] [root=num] [mem=max] [cl=cmdline] "
     9.9 +#ifdef ISO9660
    9.10 +	"[iso=file] "
    9.11 +#endif
    9.12 +	"..." NL
    9.13          "vga mode: ask,extended,normal or dec/oct/hex number" NL
    9.14 +#ifdef CPU64
    9.15          "-64 for cpu64 only" NL
    9.16 +#endif
    9.17          "Defaults:" NL
    9.18          "\timage=bzImage" NL
    9.19          "\tinitrd,vga,root=(void)" NL
    9.20 @@ -50,11 +56,17 @@
    9.21      if (!*++argv) syntax();
    9.22      const char **clp = &cmdline;
    9.23      do {
    9.24 +#ifdef CPU64
    9.25          if ((*(u16 *)*argv|2) == 0x362F) {	// -64 /64
    9.26  	    if (cpuhaslm() != 0) continue;
    9.27  	    exit();
    9.28  	}
    9.29 +#endif
    9.30 +#ifdef ISO9660
    9.31  	if (argstr(*argv,"cl|image|initrd|iso",clp) == (int) clp) continue;
    9.32 +#else
    9.33 +	if (argstr(*argv,"cl|image|initrd",clp) == (int) clp) continue;
    9.34 +#endif
    9.35  #ifdef QUICK_BOOT
    9.36  	if (argnum(*argv,"root|vga|mem|-b|-f~-q~-v~",&root_dev) >= (int) &base_himem) continue;
    9.37  #else
    9.38 @@ -68,7 +80,9 @@
    9.39  	strcatb((const char *) buf_cmdline,*argv);
    9.40      } while (*++argv);
    9.41      puts(*clp);
    9.42 +#ifdef ISO9660
    9.43      if (isofile) setiso(isofile);
    9.44 +#endif
    9.45      set_cmdline(*clp);
    9.46      load_kernel();
    9.47      load_initrd();
    10.1 --- a/linld/stuff/src/LOAD.CPP	Sat Feb 27 17:05:52 2021 +0100
    10.2 +++ b/linld/stuff/src/LOAD.CPP	Sun Feb 28 16:32:57 2021 +0000
    10.3 @@ -137,7 +137,7 @@
    10.4      readrm(m, 0x200);
    10.5      rewind(m->fd);
    10.6      if(kernelparams->setup_sects == 0) {
    10.7 -#if 1
    10.8 +#ifdef LINUX001
    10.9          if(* (int *) &first1k->pad10[0x3F-0x24] == 0x3AE8) {
   10.10  	    extern u16 csip_hilo;
   10.11  	    csip_hilo=0x0042;
    11.1 --- a/linld/stuff/src/MEMCPY32.ASM	Sat Feb 27 17:05:52 2021 +0100
    11.2 +++ b/linld/stuff/src/MEMCPY32.ASM	Sun Feb 28 16:32:57 2021 +0000
    11.3 @@ -6,6 +6,9 @@
    11.4                  %crefref
    11.5                  %noincl
    11.6                  %nomacs
    11.7 +
    11.8 +	include	"common.inc"
    11.9 +
   11.10  		ifdef	NO386
   11.11                  p8086
   11.12  		else
   11.13 @@ -144,6 +147,7 @@
   11.14                  mov     ecx,[sz]
   11.15                  jecxz   @@done
   11.16  
   11.17 +		ifdef	VCPI
   11.18  		smsw	ax
   11.19                  and     al,1	;MSW_PE
   11.20  		jz	@@real_mode
   11.21 @@ -152,6 +156,7 @@
   11.22  		extrn	vcpi_pm_copy_routine:near
   11.23                  call    near vcpi_pm_copy_routine ; Call pm copy routine via vcpi pm
   11.24  		jmp	@@done
   11.25 +		endif
   11.26  @@real_mode:
   11.27                  cli
   11.28  oldGDTR		=	(pword srcseg)	; don't need src seg/ofs anymore
   11.29 @@ -206,7 +211,19 @@
   11.30  
   11.31  ;****** Const data *********************************************
   11.32  
   11.33 +		ifdef	VCPI
   11.34  		extrn	gdt_memcpy
   11.35 +		else
   11.36 +		org	$-8	;save 8 bytes
   11.37 +;0000: unused
   11.38 +gdt_memcpy	dd	?,?
   11.39 +;0008: Data seg [0,FFFFFFFF]
   11.40 +		;	lim_lo              base_lo
   11.41 +		dw	1111111111111111b,  0000000000000000b
   11.42 +		db	00000000b,10010010b,10001111b,00000000b
   11.43 +		;	base_med  P  S D A  G ??l_hi  base_hi
   11.44 +		;	           Pl E W    D
   11.45 +		endif
   11.46  label	GDTR	pword
   11.47  gdt_limit	dw	0ffffh
   11.48  		global	gdt_base_memcpy:word
    12.1 --- a/linld/stuff/src/MEMTOP.ASM	Sat Feb 27 17:05:52 2021 +0100
    12.2 +++ b/linld/stuff/src/MEMTOP.ASM	Sun Feb 28 16:32:57 2021 +0000
    12.3 @@ -6,6 +6,9 @@
    12.4                  %crefref
    12.5                  %noincl
    12.6                  %nomacs
    12.7 +
    12.8 +	include	"common.inc"
    12.9 +
   12.10  		ifdef	NO386
   12.11                  p8086
   12.12  		else
    13.1 --- a/linld/stuff/src/VCPI.ASM	Sat Feb 27 17:05:52 2021 +0100
    13.2 +++ b/linld/stuff/src/VCPI.ASM	Sun Feb 28 16:32:57 2021 +0000
    13.3 @@ -28,6 +28,10 @@
    13.4                  %crefref
    13.5                  %noincl
    13.6                  %nomacs
    13.7 +
    13.8 +	include	"common.inc"
    13.9 +
   13.10 +		ifdef	VCPI
   13.11                  p386
   13.12  
   13.13  ;****** Stuff for declaring descriptors
   13.14 @@ -383,6 +387,17 @@
   13.15          endp    _vm2rm
   13.16  
   13.17          ends    _TEXT
   13.18 +		else
   13.19 +	
   13.20 +        group   DGROUP  _TEXT
   13.21 +        assume  cs:DGROUP,ds:DGROUP
   13.22 +
   13.23 +        segment _TEXT byte public use16 'CODE'
   13.24 +	global	gdt_data:near
   13.25 +gdt_data:
   13.26 +        ends    _TEXT
   13.27 +
   13.28 +		endif
   13.29  
   13.30          end
   13.31  
    14.1 --- a/linld/stuff/src/XMM.ASM	Sat Feb 27 17:05:52 2021 +0100
    14.2 +++ b/linld/stuff/src/XMM.ASM	Sun Feb 28 16:32:57 2021 +0000
    14.3 @@ -6,6 +6,9 @@
    14.4                  %crefref
    14.5                  %noincl
    14.6                  %nomacs
    14.7 +
    14.8 +	include	"common.inc"
    14.9 +
   14.10                  p8086
   14.11  
   14.12          group   DGROUP  _TEXT
    15.1 --- a/linld/stuff/src/_BEG.ASM	Sat Feb 27 17:05:52 2021 +0100
    15.2 +++ b/linld/stuff/src/_BEG.ASM	Sun Feb 28 16:32:57 2021 +0000
    15.3 @@ -6,6 +6,9 @@
    15.4                  %crefref
    15.5                  %noincl
    15.6                  %nomacs
    15.7 +
    15.8 +	include	"common.inc"
    15.9 +
   15.10                  p8086
   15.11  
   15.12          group   DGROUP  _TEXT,_DATA,_BSS
   15.13 @@ -18,10 +21,12 @@
   15.14          ;global  _data_start:byte
   15.15          label   _data_start byte
   15.16  		ifndef	NO386
   15.17 -msg_badcpu      db      "I need 386+ CPU in real mode w/o paging"
   15.18 +msg_badcpu      db      "I need a 386+ in real mode w/o paging"
   15.19 +		ifdef	VCPI
   15.20  		db	" or "
   15.21  msg_badmapping	db	"under VCPI 4.0+ manager with low 640k 1:1 mapping"
   15.22          global  _vcpi:byte
   15.23 +		endif
   15.24  _vcpi		db	0
   15.25  		endif
   15.26  
   15.27 @@ -36,13 +41,15 @@
   15.28          ;global  _bss_start:byte
   15.29          label   _bss_start byte
   15.30          global  stktop:byte
   15.31 -		ifdef	NO386
   15.32          global  _cpu386:byte
   15.33  _cpu386		db	?
   15.34 +		ifdef	CPU64
   15.35  		org	$-1
   15.36  		endif
   15.37 +		ifdef	CPU64
   15.38          global  _cpu_features:dword
   15.39  _cpu_features	dd	?
   15.40 +		endif
   15.41          ends    _BSS
   15.42  
   15.43          segment _TEXT byte public use16 'CODE'
   15.44 @@ -118,6 +125,7 @@
   15.45  ;***************************************************************
   15.46  label   check_vcpi near
   15.47                  p386
   15.48 +		ifdef	VCPI
   15.49  ; Check whether it is safe to call 67h
   15.50  		xor	eax,eax
   15.51                  mov     es,ax
   15.52 @@ -142,8 +150,10 @@
   15.53  		extrn	_vcpi:byte
   15.54  		dec	[byte _vcpi]
   15.55  		endif
   15.56 +		endif
   15.57  no_vcpi:
   15.58  endcpu386:
   15.59 +		ifdef	CPU64
   15.60  		pushfd
   15.61  		pop	dx
   15.62  		pop	ax
   15.63 @@ -168,6 +178,9 @@
   15.64  		mov	[_cpu_features],edx
   15.65  @@no_cpuid:
   15.66  		endif
   15.67 +		else
   15.68 +		dec	[_cpu386]
   15.69 +		endif
   15.70  endcpu86:
   15.71                  p8086
   15.72  
   15.73 @@ -266,6 +279,9 @@
   15.74  		ret
   15.75  
   15.76          endp    _topseg
   15.77 +		else
   15.78 +@ret:
   15.79 +		ret
   15.80  		endif
   15.81  
   15.82  ;***************************************************************
    16.1 --- a/linld/stuff/src/_END.ASM	Sat Feb 27 17:05:52 2021 +0100
    16.2 +++ b/linld/stuff/src/_END.ASM	Sun Feb 28 16:32:57 2021 +0000
    16.3 @@ -5,7 +5,10 @@
    16.4                  %crefref
    16.5                  %noincl
    16.6                  %nomacs
    16.7 -                p386
    16.8 +
    16.9 +	include	"common.inc"
   16.10 +
   16.11 +                p8086
   16.12  
   16.13          segment _TEXT byte public use16 'CODE'
   16.14          ;global  _text_end:byte
   16.15 @@ -23,7 +26,7 @@
   16.16  
   16.17          segment _BSS word public use16 'BSS'
   16.18  ;STACK_SIZE = 128
   16.19 -STACK_SIZE = 512
   16.20 +STACK_SIZE = 256
   16.21  		db	STACK_SIZE dup(?)
   16.22          global  stktop:byte
   16.23          label   stktop byte
    17.1 --- a/linld/stuff/src/pipehole.awk	Sat Feb 27 17:05:52 2021 +0100
    17.2 +++ b/linld/stuff/src/pipehole.awk	Sun Feb 28 16:32:57 2021 +0000
    17.3 @@ -1,4 +1,4 @@
    17.4 -BEGIN { hold=0; is386=0; isload=0; isiso=0; istazboot=0; wascall=0; ishimem=0; label="none"; xlabel=""; file="" }
    17.5 +BEGIN { hold=0; is386=0; isload=0; isiso=0; istazboot=0; wascall=0; ishimem=0; label="none"; xlabel=""; file=""; retc="returnCz:\n" }
    17.6  function isnum(n) { return match(n,/^[0-9+-]/) }
    17.7  {
    17.8  	sub(/segment word public/,"segment byte public")
    17.9 @@ -48,7 +48,7 @@
   17.10  	}
   17.11  	 } # file == "linld.cpp"
   17.12  	 if (file == "himem.cpp") {
   17.13 -	if (/sp,bp/ || /pop	bp/) next
   17.14 +	if (/sp,bp/ || /pop	bp/ || /enter/ || /leave/) next
   17.15  	if (/void load_image/) ishimem=1
   17.16  	if (ishimem == 1 && is386 == 0) {
   17.17  		if (/si\+8\]$/ || /si\+4\]$/ || /si\+16\]$/) next
   17.18 @@ -243,15 +243,30 @@
   17.19  	}
   17.20  	 } # file == "load.cpp"
   17.21  	 if (file == "iso9660.cpp") {
   17.22 -	if (/ptr \[si\+10\],dx/) next
   17.23 -	if (/ptr \[si\+8\],ax/) next
   17.24 -	if (/si\+32/) next
   17.25 -	if (/add	word ptr \[si\],ax/) $0="	add	word ptr [si],cx"
   17.26 +	if (/ptr \[si\+8\],/) { si="si"; di="di" }
   17.27 +	if (/ptr \[di\+8\],/) { si="di"; di="si" }
   17.28 +	if (/leave/ || /enter/) next
   17.29 +	if (/ptr \[.i\+10\],dx/) next
   17.30 +	if (/ptr \[.i\+8\],ax/) next
   17.31 +	if (/ptr \[.i\+8\],eax/) next
   17.32 +	if (/cx,word ptr \[.i\+32\]/) next
   17.33 +	if (/add	word ptr \[.i\],ax/) sub(/ax/,"cx")
   17.34  	if (/ax,word ptr \[si\+24\]/) sub(/mov	ax,/,"les	ax,d")
   17.35  	if (/ax,word ptr \[si\+26\]/) next
   17.36  	if (/word ptr \[si\+29\],ax/) sub(/ax/,"es")
   17.37  	if (/\[si\],-1/) $0="	not	word ptr [si]"
   17.38  	sub(/di,word ptr DGROUP:_isostate\+2/,"di,word ptr [si+2]")
   17.39 +	if (/s = p \+ 1;/ && !/ ;/) isiso=20
   17.40 +	if (isiso == 20) { # ISO9660.LST
   17.41 +		if (/al,byte ptr/) $0="	;inc	ax"
   17.42 +		sub(/\[si-1\]/,"[si]")
   17.43 +		if (/p != .\./) print "	inc	" di "	; see ;inc ax"
   17.44 +		if (/i],0/) sub(/,0/,",ah")
   17.45 +		if (/filename = s;/) {
   17.46 +			print "	stc"
   17.47 +			isiso=0
   17.48 +		}
   17.49 +	}
   17.50  	if (isiso == 19) { # ISO9660.LST
   17.51  		if (/short @2@282/) $0="	jc	restoreC"
   17.52  		if (/bp-2/ || /si\+34/ || /ax,dx/ || /cmp	ax,-1/) next
   17.53 @@ -298,14 +313,12 @@
   17.54  		if (/si\+24/) isiso=1
   17.55  	}
   17.56  	if (/found:/) isiso=15
   17.57 -	if (/short @1@394/) sub(/@1@394/,"@1@422")
   17.58  	if (isiso != 15 && /si,offset DGROUP:_isostate/) $0=";" $0
   17.59  	if (isiso == 15) { # ISO9660.LST
   17.60  		if (/xor/) {
   17.61  			print	"returnNotC:"
   17.62  			print	"	cmc"
   17.63 -			print	"returnC:"
   17.64 -			print	"@1@422:"
   17.65 +			print	retc "returnC:"
   17.66  			print	"	sbb	ax,ax"
   17.67  			print	"return:"
   17.68  			next
   17.69 @@ -316,25 +329,26 @@
   17.70  	if (/short @1@142/) { isiso=14; next }
   17.71  	if (isiso == 14) { # ISO9660.LST
   17.72  		if (/ax,-1/) next
   17.73 -		if (/jmp	@1@422/) sub(/jmp/,"jb")
   17.74 +		if (/jmp/) $0="	jb	returnCz"
   17.75  	}
   17.76  	if (/p = x->buffer \+ 34/) isiso=13
   17.77  	if (isiso == 13) { # ISO9660.LST
   17.78 -		if (/di,si/) $0="	xchg	ax,bx"
   17.79 -		if (/di,ax/) $0="	lea	di,[si+bx+72]"
   17.80 -		if (/di,72/) {
   17.81 -			isiso=0
   17.82 -			next
   17.83 -		}
   17.84 +		if (/i,.i/) $0="	xchg	ax,bx"
   17.85 +		if (/i,ax/) $0="	lea	" di ",[bx+" si "+72]"
   17.86 +		if (/i,72/ || /word ptr \[.i\+32\]/) next
   17.87 +		if (/register len/) isiso=12
   17.88  	}
   17.89 -	if (/register len/) isiso=12
   17.90  	if (isiso == 12) { # ISO9660.LST
   17.91 -		if (/di\+2/) sub(/al/,"bl")
   17.92 +		if (/.i\+2/) sub(/al/,"bl")
   17.93  		if (/cbw/) next
   17.94  		sub(/dx,ax/,"bh,0")
   17.95  		if (/bx,dx/) next
   17.96  		sub(/i,dx/,"i,bx")
   17.97 -		sub(/bx\+di\],0/,"bx+di],bh")
   17.98 +		if (/bx\+.i\],0/) sub(/,0/,",bh")
   17.99 +		if (/jmp/) {
  17.100 +			$0=retc "	jmp	returnC"
  17.101 +			retc=""
  17.102 +		}
  17.103  		if (/while/) isiso=0
  17.104  	}
  17.105  	if (/curpos >= SECT/) isiso=10
  17.106 @@ -370,15 +384,19 @@
  17.107  	if (/entrysize =/) isiso=5
  17.108  	if (isiso == 5) { # ISO9660.LST
  17.109  		if (/ax,ax/) next
  17.110 +		if (/word ptr \[.i\+32\],ax/) next
  17.111  		sub(/ax/,"cx")
  17.112  		sub(/je/,"jcxz")
  17.113  		if (/jcxz/) {
  17.114  			hold=0
  17.115  			print	s
  17.116 -			sub(/@1@114/,"@1@394")
  17.117 +			sub(/@1@114/,"returnNotC")
  17.118  			print
  17.119 -			print "	mov	word ptr [si+10],dx"
  17.120 -			$0="	mov	word ptr [si+8],ax"
  17.121 +			if (is386) $0="	mov	dword ptr [" si "+8],eax"
  17.122 +			else {
  17.123 +				print "	mov	word ptr [" si "+10],dx"
  17.124 +				$0="	mov	word ptr [" si "+8],ax"
  17.125 +			}
  17.126  		}
  17.127  		if (/return/) isiso=0
  17.128  	}
    18.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh	Sat Feb 27 17:05:52 2021 +0100
    18.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh	Sun Feb 28 16:32:57 2021 +0000
    18.3 @@ -43,7 +43,7 @@
    18.4  	TMP=/tmp/iso2exe$$
    18.5  	mkdir -p $TMP/mnt
    18.6  	mount -o loop,ro $1 $TMP/mnt
    18.7 -	if grep -qs rootfs $TMP/mnt/boot/isolinux/isolinux.cfg ; then
    18.8 +	if [ $2 = --array ] || grep -qs rootfs $TMP/mnt/boot/isolinux/isolinux.cfg ; then
    18.9  		$0 --get rootfs.gz > $TMP/rootfs.gz
   18.10  		SIZE=$(wc -c < $TMP/rootfs.gz)
   18.11  		store 24 $SIZE $1
   18.12 @@ -338,7 +338,7 @@
   18.13  	ddq if=/dev/zero bs=32k count=1 of=$DATA
   18.14  	add_win32exe $DATA $2 > /dev/null
   18.15  	HSZ=$OFS
   18.16 -	add_rootfs $DATA > /dev/null
   18.17 +	add_rootfs $DATA --array > /dev/null
   18.18  	add_fdbootstrap $DATA > /dev/null
   18.19  	name=${3:-bootiso}
   18.20  	BOOTISOSZ=$((0x8000 - $OFS + $HSZ))
    19.1 --- a/tazlito/receipt	Sat Feb 27 17:05:52 2021 +0100
    19.2 +++ b/tazlito/receipt	Sun Feb 28 16:32:57 2021 +0000
    19.3 @@ -30,6 +30,7 @@
    19.4  	cp -a $install/* $fs
    19.5  	chown -R root.root $fs
    19.6  	chmod 755 $fs/usr/bin/tazlito*
    19.7 +	sed 's|.*boot/grub|#&|' $fs/usr/bin/tazlito*	# keep splash.xpm.gz for tazinst
    19.8  	# Declare /etc/tazlito/distro-packages.list & /etc/tazlito/tazlito.conf
    19.9  	touch $fs/etc/tazlito/tazlito.conf
   19.10  	touch $fs/etc/tazlito/distro-packages.list