Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 452 → Rev 453

/svarcom/trunk/cmd/ver.c
50,6 → 50,7
unsigned short i;
printf("rmod->rmodseg = 0x%04X\r\n", p->rmod->rmodseg);
printf("rmod->origparent = %04X:%04X\r\n", p->rmod->origparent >> 16, p->rmod->origparent & 0xffff);
printf("rmod->origenvseg = 0x%04X\r\n", p->rmod->origenvseg);
printf("rmod->flags = 0x%02X\r\n", p->rmod->flags);
printf("rmod->echoflag = %u\r\n", p->rmod->echoflag);
printf("[rmod:RMOD_OFFSET_ENVSEG] = 0x%04X\r\n", *rmod_envseg);
/svarcom/trunk/rmodinit.c
38,11 → 38,11
char far *myptr, far *mcb;
unsigned short far *owner;
const unsigned short sizeof_rmodandprops_paras = rmod_len + sizeof(struct rmod_props) + 15 / 16;
unsigned int rmodseg = 0xffff;
unsigned int envseg = 0;
unsigned short rmodseg = 0xffff;
unsigned short envseg = 0, origenvseg = 0;
struct rmod_props far *res = NULL;
 
/* read my current env segment from PSP */
/* read my current env segment from PSP and save it */
_asm {
push ax
push bx
49,6 → 49,7
mov bx, 0x2c
mov ax, [bx]
mov envseg, ax
mov origenvseg, ax
pop bx
pop ax
}
143,6 → 144,7
res->rmodseg = rmodseg; /* rmod segment */
res->inputbuf[0] = 128; /* input buffer for INT 0x21, AH=0Ah*/
res->echoflag = 1; /* ECHO ON */
res->origenvseg = origenvseg; /* original environment segment */
 
/* write env segment to rmod buffer */
owner = MK_FP(rmodseg, RMOD_OFFSET_ENVSEG);
/svarcom/trunk/rmodinit.h
32,6 → 32,7
char inputbuf[130]; /* input buffer for INT 21, AH=0x0A */
unsigned short rmodseg; /* segment where rmod is loaded */
unsigned long origparent; /* original parent (far ptr) of the shell */
unsigned short origenvseg; /* original environment segment */
unsigned char flags; /* command line parameters */
unsigned char echoflag; /* ECHO ON / ECHO OFF */
};
/svarcom/trunk/sayonara.c
38,8 → 38,9
unsigned short rmodenv = *rmodenv_ptr;
 
/* detect "I am the origin shell" situations */
if (rmod->flags & FLAG_PERMANENT) return; /* COMMAND.COM /P */
if (rmod->origparent == 0xffff) return; /* original parent set to 0xffff (DOS-C / FreeDOS) */
if (rmod->flags & FLAG_PERMANENT) return; /* COMMAND.COM /P */
if (rmod->origenvseg == 0) return; /* no original environment (MSDOS 5/6) */
 
/* set my parent back to original value */
*myparent = rmod->origparent;
/svarcom/trunk/todo.txt
32,6 → 32,8
 
"notify pending command" int support: http://www.techhelpmanual.com/741-int_2fh_ae00h__notify_pending_command.html
 
INT 2F,AX=5500 support
 
stdout redirection should not create the output file if command fails
 
when execing an external command make sure to sync local environment (or run the program with a custom environment pointer?)