🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.asm
Article #344

Writing a device driver in TASM or A86?

#344
From: Pavel.Srubar
Date: Tue, 22 Jun 1999 00:00
61 lines
2527 bytes
> For that matter, any info on how to compile/link to a .sys file

  This is how one of my old and simple dos device drivers look,
I hope it will help you:


;*********************************************************
;*                    NUMB              (c) 1994 vit$oft
;*  This device will disable keyboard until an application
;*  sends a value of 0F4h to port 60h.
*;
;*  Compile:   TASM NUMB
;*             TLINK /t NUMB, NUMB.SYS
;**********************************************************

IDEAL
MODEL           TINY
INCLUDE         "DOS.MAC"
INCLUDE         "KBD.MAC"
SEGMENT         SYS
ASSUME          CS:SYS, DS:SYS, ES:SYS, SS:SYS
ORG             0
DeviceChain     DD -1
DeviceAttr      DW 8000h
DeviceStrategy  DW OFFSET Strategy
DeviceInterrupt DW OFFSET Interrupt
DeviceName      DB 'NUMB    '
Queue           DD 00000H
Title$          DB $CR,$LF,'Keyboard is NUMB until an application
locks.'
                DB '    (c) 1994 vit$oft',0

PROC        Strategy FAR
            MOV [WORD LOW  CS:Queue],BX
            MOV [WORD HIGH CS:Queue],ES
            RETF
ENDP        Strategy

PROC        Interrupt FAR
            PUSH AX BX CX DX DS ES
             LDS BX,[CS:Queue]
             MOV [WORD BX+3],8102h ; status:done,not ready
             MOV [WORD BX+14],0  ; offset TSR
             MOV [WORD BX+16],CS ; segment TSR
             PUSH CS
             POP DS
             PUSH CS
             POP ES
             WriteLn ,Title$,
             MOV AL,0F5h ; disable keyboard
             OUT 60h,AL
            POP ES DS DX CX BX AX
            RETF
ENDP            Interrupt
ENDS            SYS
END


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Technical Details
Message-ID: <7kocsl$d0g$1@nnrp1.deja.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <MPG.11d6cf082292f3989681@news.earthlink.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f7d8d,dfa48bdd83ffb923
X-Google-Attributes: gidf7d8d,public
X-Google-Thread: feaef,dfa48bdd83ffb923
X-Google-Attributes: gidfeaef,public
From: Pavel.Srubar@post.cz
Subject: Writing a device driver in TASM or A86?
Date: 1999/06/22
Message-ID: <7kocsl$d0g$1@nnrp1.deja.com>
X-Deja-AN: 492541353
References: <MPG.11d6cf082292f3989681@news.earthlink.net>
X-Http-Proxy: 1.0 P-WWW-PROXY:8080, 1.0 x39.deja.com:80 (Squid/1.1.22) for client 195.47.31.12
Organization: Deja.com - Share what you know. Learn what you don't.
X-Article-Creation-Date: Tue Jun 22 16:16:34 1999 GMT
Newsgroups: alt.lang.asm,borland.public.tasm
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0b2; Windows NT)