1
0
Fork 0

move first shell's psp/environment into low dos memory, uses complete MCBs for them (gold aztecs doesn't like it otherwise)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3216
This commit is contained in:
Sebastian Strohhäcker 2008-09-06 14:47:15 +00:00
parent dce428ac54
commit a94ef4eddc
2 changed files with 16 additions and 9 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_inc.h,v 1.75 2008-08-29 19:27:04 c2woody Exp $ */
/* $Id: dos_inc.h,v 1.76 2008-09-06 14:47:02 c2woody Exp $ */
#ifndef DOSBOX_DOS_INC_H
#define DOSBOX_DOS_INC_H
@ -85,7 +85,8 @@ enum { RETURN_EXIT=0,RETURN_CTRLC=1,RETURN_ABORT=2,RETURN_TSR=3};
#define DOS_SDA_SEG 0xb2 // dos swappable area
#define DOS_SDA_OFS 0
#define DOS_CDS_SEG 0x108
#define DOS_MEM_START 0x118 //First Segment that DOS can use
#define DOS_FIRST_SHELL 0x118
#define DOS_MEM_START 0x158 //First Segment that DOS can use
#define DOS_PRIVATE_SEGMENT 0xc800
#define DOS_PRIVATE_SEGMENT_END 0xd000

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: shell.cpp,v 1.92 2008-08-11 12:52:36 qbix79 Exp $ */
/* $Id: shell.cpp,v 1.93 2008-09-06 14:47:15 c2woody Exp $ */
#include <stdlib.h>
#include <stdarg.h>
@ -572,8 +572,8 @@ void SHELL_Init() {
PROGRAMS_MakeFile("COMMAND.COM",SHELL_ProgramStart);
/* Now call up the shell for the first time */
Bit16u psp_seg=DOS_GetMemory(16+3)+1;
Bit16u env_seg=DOS_GetMemory(1+(4096/16))+1;
Bit16u psp_seg=DOS_FIRST_SHELL;
Bit16u env_seg=DOS_FIRST_SHELL+19; //DOS_GetMemory(1+(4096/16))+1;
Bit16u stack_seg=DOS_GetMemory(2048/16);
SegSet16(ss,stack_seg);
reg_sp=2046;
@ -586,11 +586,17 @@ void SHELL_Init() {
/* Set up int 23 to "int 20" in the psp. Fixes what.exe */
real_writed(0,0x23*4,((Bit32u)psp_seg<<16));
/* Setup MCB and the environment */
/* Setup MCBs */
DOS_MCB pspmcb((Bit16u)(psp_seg-1));
pspmcb.SetPSPSeg(psp_seg); // MCB of the command shell psp
pspmcb.SetSize(0x10+2);
pspmcb.SetType(0x4d);
DOS_MCB envmcb((Bit16u)(env_seg-1));
envmcb.SetPSPSeg(psp_seg);
envmcb.SetSize(4096/16);
envmcb.SetPSPSeg(psp_seg); // MCB of the command shell environment
envmcb.SetSize(0x28);
envmcb.SetType(0x4d);
/* Setup environment */
PhysPt env_write=PhysMake(env_seg,0);
MEM_BlockWrite(env_write,path_string,strlen(path_string)+1);
env_write+=strlen(path_string)+1;
@ -626,8 +632,8 @@ void SHELL_Init() {
tail.count=strlen(init_line);
strcpy(tail.buffer,init_line);
MEM_BlockWrite(PhysMake(psp_seg,128),&tail,128);
/* Setup internal DOS Variables */
dos.dta(RealMake(psp_seg,0x80));
dos.psp(psp_seg);