Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 528 → Rev 529

/svarcom/trunk/rmod.asm
26,17 → 26,17
STACKBUF db "XXX SVARCOM RMOD BY MATEUSZ VISTE XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
STACKPTR dw 0
 
; exit code of last application
LEXCODE dw 0 ; +4Ah
 
; offset of the COMSPEC variable in the environment block, 0 means "use
; boot drive". this value is patched by the transient part of COMMAND.COM
COMSPECPTR dw 0 ; +4Ch
COMSPECPTR dw 0 ; +4Ah
 
; fallback COMSPEC string used if no COMPSEC is present in the environment
; drive. drive is patched by the transient part of COMMAND.COM
COMSPECBOOT db "@:\COMMAND.COM", 0 ; +4Eh
COMSPECBOOT db "@:\COMMAND.COM", 0 ; +4Ch
 
; exit code of last application
LEXCODE db 0 ; +5Bh
 
; ExecParamRec used by INT 21h, AX=4b00 (load and execute program), 14 bytes:
; offset size content
; +0 2 segment of environment for child (0 = current)
43,18 → 43,18
; +2 4 address of command line to place at PSP:0080
; +6 4 address of an FCB to be placed at PSP:005c
; +0Ah 4 address of an FCB to be placed at PSP:006c
EXEC_PARAM_REC db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; +5Dh
EXEC_PARAM_REC db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; +5Ch
 
; Program to execute, preset by SvarCOM (128 bytes, ASCIIZ) ; +6Bh
; Program to execute, preset by SvarCOM (128 bytes, ASCIIZ) ; +6Ah
EXECPROG dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
 
; offset within EXECPROG for out and in filenames in case stdin or stdout
; needs to be redirected (0xffff=no redirection)
REDIR_OUTFIL dw 0xffff ; +EBh
REDIR_INFIL dw 0xffff ; +EDh
REDIR_OUTAPPEND dw 0 ; +EFh
REDIR_OUTFIL dw 0xffff ; +EAh
REDIR_INFIL dw 0xffff ; +ECh
REDIR_OUTAPPEND dw 0 ; +EEh
 
skipsig: ; +F1h
skipsig: ; +F0h
 
; set up CS=DS=SS and point SP to my private stack buffer
mov ax, cs
93,8 → 93,7
; collect the exit code of previous application
mov ah, 0x4D
int 0x21
xor ah, ah ; clear out termination status, I only want the exit code
mov [LEXCODE], ax
mov [LEXCODE], al
 
; zero out the exec param block (14 bytes)
mov al, 0 ; byte to write
/svarcom/trunk/rmodinit.h
44,15 → 44,15
};
 
#define RMOD_OFFSET_ENVSEG 0x2C /* stored in rmod's PSP */
#define RMOD_OFFSET_LEXITCODE (0x100 + 0x4A)
#define RMOD_OFFSET_COMSPECPTR (0x100 + 0x4C)
#define RMOD_OFFSET_BOOTDRIVE (0x100 + 0x4E)
#define RMOD_OFFSET_EXECPARAM (0x100 + 0x5D)
#define RMOD_OFFSET_EXECPROG (0x100 + 0x6B)
#define RMOD_OFFSET_STDOUTFILE (0x100 + 0xEB)
#define RMOD_OFFSET_STDINFILE (0x100 + 0xED)
#define RMOD_OFFSET_STDOUTAPP (0x100 + 0xEF)
#define RMOD_OFFSET_ROUTINE (0x100 + 0xF1)
#define RMOD_OFFSET_COMSPECPTR (0x100 + 0x4A)
#define RMOD_OFFSET_BOOTDRIVE (0x100 + 0x4C)
#define RMOD_OFFSET_LEXITCODE (0x100 + 0x5B)
#define RMOD_OFFSET_EXECPARAM (0x100 + 0x5C)
#define RMOD_OFFSET_EXECPROG (0x100 + 0x6A)
#define RMOD_OFFSET_STDOUTFILE (0x100 + 0xEA)
#define RMOD_OFFSET_STDINFILE (0x100 + 0xEC)
#define RMOD_OFFSET_STDOUTAPP (0x100 + 0xEE)
#define RMOD_OFFSET_ROUTINE (0x100 + 0xF0)
 
struct rmod_props far *rmod_install(unsigned short envsize, unsigned char *rmodcore, unsigned short rmodcore_len);
struct rmod_props far *rmod_find(unsigned short rmodcore_len);