Subversion Repositories SvarDOS

Rev

Rev 460 | Rev 463 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 460 Rev 461
Line 19... Line 19...
19
SIG1 dw 0x1983   ;  +0
19
SIG1 dw 0x1983   ;  +0
20
SIG2 dw 0x1985   ;  +2
20
SIG2 dw 0x1985   ;  +2
21
SIG3 dw 0x2017   ;  +4
21
SIG3 dw 0x2017   ;  +4
22
SIG4 dw 0x2019   ;  +6
22
SIG4 dw 0x2019   ;  +6
23
 
23
 
24
; offset where a program name to be executed is awaiting (0=none)
-
 
25
; this is set by SvarCOM, after it presets the ExecParamRec struct and
-
 
26
; stores the command to be executed somewhere within rmod's segment.
-
 
27
EXECPROG dw 0    ;  +8
24
FFU_UNUSED dw 0  ;  +8
28
 
25
 
29
; exit code of last application
26
; exit code of last application
30
LEXCODE  dw 0    ; +0Ah
27
LEXCODE  dw 0    ; +0Ah
31
 
28
 
32
; offset of the COMSPEC variable in the environment block, 0 means "use
29
; offset of the COMSPEC variable in the environment block, 0 means "use
Line 43... Line 40...
43
;     +2     4   address of command line to place at PSP:0080
40
;     +2     4   address of command line to place at PSP:0080
44
;     +6     4   address of an FCB to be placed at PSP:005c
41
;     +6     4   address of an FCB to be placed at PSP:005c
45
;    +0Ah    4   address of an FCB to be placed at PSP:006c
42
;    +0Ah    4   address of an FCB to be placed at PSP:006c
46
EXEC_PARAM_REC db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0   ; +1Dh
43
EXEC_PARAM_REC db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0   ; +1Dh
47
 
44
 
-
 
45
; Program to execute, preset by SvarCOM (128 bytes, ASCIIZ)  ; +2Bh
-
 
46
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
-
 
47
 
48
skipsig:         ; +2Bh
48
skipsig:         ; +ABh
49
 
49
 
50
; set up CS=DS=SS and point SP to my private stack buffer
50
; set up CS=DS=SS and point SP to my private stack buffer
51
mov ax, cs
51
mov ax, cs
52
mov ds, ax
52
mov ds, ax
53
mov es, ax
53
mov es, ax
Line 56... Line 56...
56
 
56
 
57
; should I executed command.com or a pre-set application?
57
; should I executed command.com or a pre-set application?
58
or [EXECPROG], byte 0
58
or [EXECPROG], byte 0
59
jz EXEC_COMMAND_COM
59
jz EXEC_COMMAND_COM
60
 
60
 
61
; TODO: most probably I should call the DOS SetPSP function here
61
; TODO: perhaps I should call the DOS SetPSP function here? But if I do, the
-
 
62
;       int 21h, ah=50h call freezes...
-
 
63
;mov ah, 0x50           ; DOS 2+ -- Set PSP
-
 
64
;mov bx, cs
-
 
65
;int 0x21
62
 
66
 
63
; exec an application preset (by SvarCOM) in the ExecParamRec
67
; exec an application preset (by SvarCOM) in the ExecParamRec
64
mov [EXECPROG], byte 0 ; make sure to spawn command.com after app exits
-
 
65
mov ax, 0x4B00         ; DOS 2+ - load & execute program
68
mov ax, 0x4B00         ; DOS 2+ - load & execute program
66
mov dx, [EXECPROG]     ; DS:DX  - ASCIZ program name (preset at PSP[already)
69
mov dx, EXECPROG       ; DS:DX  - ASCIZ program name (preset at PSP[already)
67
mov bx, EXEC_PARAM_REC ; ES:BX  - parameter block pointer
70
mov bx, EXEC_PARAM_REC ; ES:BX  - parameter block pointer
68
int 0x21
71
int 0x21
-
 
72
mov [EXECPROG], byte 0 ; make sure to spawn command.com after app exits
69
 
73
 
70
EXEC_COMMAND_COM:
74
EXEC_COMMAND_COM:
71
 
75
 
72
; collect the exit code of previous application
76
; collect the exit code of previous application
73
mov ah, 0x4D
77
mov ah, 0x4D