TSR vs DEVICE= (Announce)
> TSR's are actually "easier" to write. While CONFIG.SYS is being processed,
> many of the DOS services that you generally take for granted (even very
> basic things like writing text to the screen, manipulating files, and
> redirection/piping) are limited or non-existent.
I think this assumption is a bit too pessimistic. When a driver is loaded, DOS usually HAS a current PSP - its value is 84xxh for MS-DOS 7.1, for FreeDOS it's 0060h. So file operations are possible, also screen output. What's probably missing, are environment variables.
Here's the test driver ("testdrv.asm") which I used to display the PSP from within a driver. Create it with "jwasm -mz testdrv.asm".
;--- dummy driver which displays the current PSP
.286
.model small
.386
iodat struc
cmdlen db ? ;+ 0:laenge der struktur
unit db ? ;+ 1:
cmd db ? ;+ 2
status dw ? ;+ 3
db 8 dup (?); reserviert
media db ? ;+ 0d
trans dd ? ;+ 0e
count dw ? ;+ 12 bei init:offset parameterzeile
start dw ? ;+ 14 bei init:segment parameterzeile
drive db ? ;+ 16
iodat ends
ASSUME DS: _TEXT
_TEXT SEGMENT
dw 0ffffh
dw 0ffffh
dw 8000h ;attribute
dw offset devstrat ;device strategy
dw offset devint ;device interrupt
db 'TESTDRV$' ;devicename
befptr dd 1 dup(?)
devstrat proc far
mov cs:word ptr[befptr],bx
mov cs:word ptr[befptr+2],es
ret
devstrat endp
devint proc far
pusha
push ds
push es
lds bx,cs:[befptr]
mov [bx.iodat.status],8103h
cmp [bx.iodat.cmd],00
jnz devi1
mov [bx.iodat.status],0100h
mov word ptr [bx+0eh],0000
mov word ptr [bx+10h],cs
call main
lds bx,cs:[befptr]
mov word ptr [bx+0Eh],0
mov [bx+10h],cs
devi1:
pop ds
pop es
popa
ret
devint endp
dwordout:
push ax
shr eax,16
call wordout
pop ax
wordout:
push ax
mov al,ah
call byteout
pop ax
byteout:
push ax
shr al,4
call nibout
pop ax
nibout:
and al,0Fh
add al,30h
cmp al,'9'
jbe @F
add al,7
@@:
if 1
mov dl,al
mov ah,02h
int 21h
else
mov ah,0Eh
push bx
xor bx,bx
int 10h
pop bx
endif
ret
stringout:
mov ah,09
int 21h
ret
charout:
mov ah,02
mov dl,al
int 21h
ret
dLF db 13,10,'$'
dPSP db "PSP=$"
main PROC NEAR
push cs
pop ds
mov dx,offset dPSP
call stringout
mov ah,51h
int 21h
mov ax,bx
call wordout
mov dx,offset dLF
call stringout
mov cx,8
mov es,bx
xor bx,bx
nextline:
push cx
mov cx,16
nextbyte:
push cx
mov al,es:[bx]
inc bx
call byteout
mov al,' '
call charout
pop cx
loop nextbyte
mov dx,offset dLF
call stringout
pop cx
loop nextline
ret
main endp
exeint proc
call main
mov ax,4C00h
int 21h
exeint endp
_TEXT ENDS
.stack 200h
END exeint
---
MS-DOS forever!
Complete thread:
- "That Will Be ALL!" For UIDE and USB! - Jack, 06.06.2010, 20:37 (Announce)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- "That Will Be ALL!" For UIDE and USB! - Rugxulo, 07.06.2010, 04:20
- Re: UIDE Unloading And Cache-Sizes. - Jack, 07.06.2010, 05:30
- Re: UIDE Unloading And Cache-Sizes. - Rugxulo, 08.06.2010, 01:35
- Re: UIDE Unloading And Cache-Sizes. - marcov, 08.06.2010, 23:18
- Re: UIDE Unloading And Cache-Sizes. - Rugxulo, 09.06.2010, 04:23
- Re: UIDE Unloading And Cache-Sizes. - marcov, 08.06.2010, 23:18
- Re: UIDE Unloading And Cache-Sizes. - Rugxulo, 08.06.2010, 01:35
- Re: UIDE Unloading And Cache-Sizes. - Jack, 07.06.2010, 05:30
- "That Will Be ALL!" For UIDE and USB! - Japheth, 07.06.2010, 07:51
- TSR vs DEVICE= - DOS386, 07.06.2010, 08:01
- TSR vs DEVICE= - RayeR, 08.06.2010, 15:46
- TSR vs DEVICE= - Arjay, 08.06.2010, 19:30
- TSR vs DEVICE= - RayeR, 09.06.2010, 02:00
- TSR vs DEVICE= - Japheth, 09.06.2010, 09:50
- TSR vs DEVICE= - RayeR, 09.06.2010, 16:15
- TSR vs DEVICE= - roytam, 09.06.2010, 18:18
- TSR vs DEVICE= - DOS386, 27.06.2010, 14:30
- TSR vs DEVICE= - Arjay, 08.06.2010, 19:30
- TSR vs DEVICE= - bretjohn, 18.06.2010, 21:50
- TSR vs DEVICE= - Jack, 18.06.2010, 23:29
- TSR vs DEVICE= - bretjohn, 19.06.2010, 01:18
- Nothing Against You! - Jack, 19.06.2010, 01:52
- TSR vs DEVICE= - Japheth, 19.06.2010, 09:02
- TSR vs DEVICE= - Arjay, 19.06.2010, 19:13
- TSR vs DEVICE= - bretjohn, 19.06.2010, 20:33
- TSR vs DEVICE= - Japheth, 20.06.2010, 09:04
- TSR vs DEVICE= - Arjay, 20.06.2010, 12:48
- TSR vs DEVICE= - bretjohn, 20.06.2010, 16:32
- TSR vs DEVICE= - Ninho, 20.06.2010, 17:34
- TSR vs DEVICE= - Japheth, 20.06.2010, 09:04
- TSR vs DEVICE= - Jack, 18.06.2010, 23:29
- TSR vs DEVICE= - RayeR, 08.06.2010, 15:46
- "That Will Be ALL!" For UIDE and USB! - marcov, 08.06.2010, 22:41
- "Capital Letters". - Jack, 08.06.2010, 23:15
- "Capital Letters". - marcov, 08.06.2010, 23:19
- No "Rants", But ... - Jack, 09.06.2010, 00:24
- "Capital Letters". - Arjay, 09.06.2010, 00:37
- "Capital Letters". - Jack, 09.06.2010, 00:48
- Seeking the middle ground: thinking re flexibility+realibity - Arjay, 09.06.2010, 02:29
- Bret's USB driver bugs - I was testing v0.11 by accident - Arjay, 09.06.2010, 02:50
- Seeking the middle ground ... - Jack, 09.06.2010, 04:29
- giving back a block of HMA - Ninho, 10.06.2010, 16:03
- Giving Back HMA ... - Jack, 10.06.2010, 17:03
- Giving Back HMA ... - Ninho, 11.06.2010, 09:48
- Giving Back HMA ... - Jack, 11.06.2010, 16:43
- Giving Back HMA ... - Ninho, 12.06.2010, 20:30
- Giving Back HMA ... - Jack, 11.06.2010, 16:43
- Giving Back HMA ... - Ninho, 11.06.2010, 09:48
- Giving Back HMA ... - Jack, 10.06.2010, 17:03
- Seeking the middle ground ... - Arjay, 11.06.2010, 19:29
- Seeking the middle ground ... - Jack, 11.06.2010, 21:42
- Seeking the middle ground ... - Arjay, 12.06.2010, 01:12
- Combined .com executable/DOS driver - Ninho, 12.06.2010, 14:37
- Combined .com executable/DOS driver - Arjay, 12.06.2010, 15:13
- Combined .com executable/DOS driver - Ninho, 12.06.2010, 15:49
- Combined .com executable/DOS driver - Arjay, 12.06.2010, 16:33
- Combined .com executable/DOS driver - RayeR, 13.06.2010, 10:41
- Combined .com executable/DOS driver - Arjay, 13.06.2010, 16:11
- Combined .com executable/DOS driver - Ninho, 13.06.2010, 13:24
- Combined .com executable/DOS driver - Arjay, 13.06.2010, 18:54
- Combined .com executable/DOS driver - RayeR, 13.06.2010, 10:41
- Combined .com executable/DOS driver - Arjay, 12.06.2010, 16:33
- Combined .com executable/DOS driver - Arjay, 13.06.2010, 20:42
- Combined .com executable/DOS driver - Rugxulo, 14.06.2010, 04:27
- Combined .com executable/DOS driver / RJDUMP - Arjay, 19.06.2010, 15:08
- Combined .com executable/DOS driver - Matjaz, 20.06.2010, 11:58
- Combined .com executable/DOS driver - Turbo pascal example - Arjay, 20.06.2010, 13:06
- Combined .com executable/DOS driver - Turbo pascal example - Arjay, 20.06.2010, 13:39
- Combined .com executable/DOS driver - Turbo pascal example - Arjay, 20.06.2010, 13:06
- Combined .com executable/DOS driver - Rugxulo, 14.06.2010, 04:27
- Combined .com executable/DOS driver - Ninho, 12.06.2010, 15:49
- Combined SYS device drivers - more than 1 driver in a file - Arjay, 21.06.2010, 17:48
- Combined .com executable/DOS driver, multi-header drivers - ecm, 10.08.2010, 18:49
- Combined .com executable/DOS driver, multi-header drivers - Arjay, 10.08.2010, 19:41
- Combined .com executable/DOS driver, multi-header drivers - ecm, 10.08.2010, 20:21
- Combined .com executable/DOS driver, multi-header drivers - Arjay, 10.08.2010, 19:41
- Combined .com executable/DOS driver - Arjay, 12.06.2010, 15:13
- Combined .com executable/DOS driver - Ninho, 12.06.2010, 14:37
- Seeking the middle ground ... - Arjay, 12.06.2010, 01:12
- Seeking the middle ground ... - Jack, 11.06.2010, 21:42
- giving back a block of HMA - Ninho, 10.06.2010, 16:03
- Seeking the middle ground: thinking re flexibility+realibity - Arjay, 09.06.2010, 02:29
- "Capital Letters". - Jack, 09.06.2010, 00:48
- "Capital Letters". - marcov, 08.06.2010, 23:19
- "Capital Letters". - Jack, 08.06.2010, 23:15
- No "Removable" HARD Disks Supported By UIDE! - Jack, 08.06.2010, 23:57
- "That Will Be ALL!" For UIDE and USB! - bretjohn, 15.06.2010, 22:47
- Further Comments ... - Jack, 16.06.2010, 01:35
- "That Will Be ALL!" For UIDE and USB! - Rugxulo, 17.06.2010, 12:07
- "That Will Be ALL!" For UIDE and USB! - bretjohn, 17.06.2010, 16:53
- "That Will Be ALL!" For UIDE and USB! - Rugxulo, 17.06.2010, 17:45
- "That Will Be ALL!" For UIDE and USB! - bretjohn, 17.06.2010, 16:53
- "That Will Be ALL!" For UIDE and USB! - Rugxulo, 07.06.2010, 04:20
Mix view