Do not ABORT if image size is above 1 MB - Instead, handle size

MODULO 1 MB (paras = low_16_bits(pages<<5) ...) because for e.g.
Turbo C++ 3.0 needs this: Their IDE is 1.3 MB BOSS NE style EXE,
the first < 0.3 MB load a DOS ext which loads and runs the rest.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1348 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Eric Auer 2007-08-25 02:37:59 +00:00
parent f7320f6452
commit 94d0560e7b

View File

@ -576,10 +576,15 @@ COUNT DosExeLoader(BYTE FAR * namep, exec_blk * exp, COUNT mode, COUNT fd)
/* compute image size by removing the offset from the */ /* compute image size by removing the offset from the */
/* number pages scaled to bytes plus the remainder and */ /* number pages scaled to bytes plus the remainder and */
/* the psp */ /* the psp */
/* First scale the size and remove the offset */ #if 0
if (ExeHeader.exPages >= 2048) if (ExeHeader.exPages >= 2048)
return DE_INVLDDATA; /* we're not able to get >=1MB in dos memory */ return DE_INVLDDATA; /* we're not able to get >=1MB in dos memory */
image_size = ExeHeader.exPages * 32 - ExeHeader.exHeaderSize; #else
/* TurboC++ 3 BOSS NE stub: image > 1 MB but load only "X mod 1 MB" */
/* ExeHeader.exPages &= 0x7ff; */ /* just let << 5 do the clipping! */
#endif
/* First scale the size and remove the offset */
image_size = (ExeHeader.exPages << 5) - ExeHeader.exHeaderSize;
/* We should not attempt to allocate /* We should not attempt to allocate
memory if we are overlaying the current process, because the new memory if we are overlaying the current process, because the new
@ -593,7 +598,7 @@ COUNT DosExeLoader(BYTE FAR * namep, exec_blk * exp, COUNT mode, COUNT fd)
COUNT rc; COUNT rc;
/* and finally add in the psp size */ /* and finally add in the psp size */
image_size += sizeof(psp) / 16; /*TE 03/20/01 */ image_size += sizeof(psp) / 16; /* TE 03/20/01 */
exe_size = image_size + ExeHeader.exMinAlloc; exe_size = image_size + ExeHeader.exMinAlloc;
/* Clone the environement and create a memory arena */ /* Clone the environement and create a memory arena */