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:
parent
f7320f6452
commit
94d0560e7b
@ -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 */
|
||||
/* number pages scaled to bytes plus the remainder and */
|
||||
/* the psp */
|
||||
/* First scale the size and remove the offset */
|
||||
#if 0
|
||||
if (ExeHeader.exPages >= 2048)
|
||||
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
|
||||
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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* Clone the environement and create a memory arena */
|
||||
|
Loading…
Reference in New Issue
Block a user