Friday, July 23, 2010

Compilation of various source - DRIVER


name driver
page 55,132
title''DRIVER --- installable driver template''

;
; This is a "template" for a MS-DOS installable device driver.
; The actual driver subroutines are stubs only and have
; No effect but to return a non-error "done" status.
;
; Ray Duncan
; Laboratory Microsystems Inc.
; April 1985

code segment public''CODE''

driver proc far

assume cs: code, ds: code, es: code

org 0


Max_Cmd equ 15; MS-DOS command code maximum
; This is 15 for MS-DOS 3.x
; And 12 for MS-DOS 2.x


cr equ 0dh; ASCII carriage return
lf equ 0ah; ASCII line feed
eom equ''$''; end of message signal


page
;
; Device Driver Header
;
Header dd -1; link to next device, -1 = end of list

dw 8000h; attribute word
; Bit 15 = 1 for character devices

dw Strat; device "Strategy" entry point

dw Intr; device "Interrupt" entry point

db''DRIVER''; char device name, 8 char, or
; If block device, no. Of units
; In first byte followed by
; 7 don''t care bytes



; Interpretation of Attribute word:
;
; Bit Significance
;
; 15 = 1 for character drivers
; 14 = 1 if driver can handle IOCTL
; 13 = 1 if block device & non-IBM format
; 12 0
; 11 open / close / RM supported (DOS 3.x)
; 100
; 90
; 80
; 70
; 60
; 50
; 40
; 3 = 1 if CLOCK device
; 2 = 1 if NUL device
; 1 = 1 if Standard Output
; 0 = 1 if Standard Input

page
;
; Local variables for use by driver
;
RH_Ptr dd?; Pointer to request header
; Passed to Strat by BDOS

Ident db cr, lf, lf
db''LMI Example Device Driver 1.0''
db cr, lf
db''Copyright (c) 1985''
db''Laboratory Microsystems Inc.''
db cr, lf, lf, eom
;
; MS-DOS Command Codes dispatch table.
; The "Interrupt" routine uses this table and the
; Command Code supplied in the Request Header to
; Transfer to the appropriate driver subroutine.

Dispatch:
dw Init; 0 = init driver into system
dw Media_Chk; 1 = media check on blk dev
dw Build_Bpb; 2 = build BIOS param block
dw Ioctl_Inp; 3 = I / O ctrl read from dev
dw Input; 4 = normal destructive read
dw Nd_Input; 5 = non-destructive read, no wait
dw Inp_Stat; 6 = return current input status
dw Inp_Flush; 7 = flush device input buffers
dw Output; 8 = normal output to device
dw Outp_Vfy; 9 = output with verify
dw Outp_Stat; 10 = return current output status
dw Outp_Flush; 11 = flush output buffers
dw Ioctl_Outp; 12 = I / O control output
dw Dev_Open; 13 = device open (MS-DOS 3.x)
dw Dev_Close; 14 = device close (MS-DOS 3.x)
dw Rem_Media; 15 = removeable media (MS-DOS 3.x)
page
;
; MS-DOS Request Header structure definition
;
; The first 13 bytes of all Request Headers are the same
; And are referred to as the "Static" part of the Header.
; The number and meaning of the following bytes varies.
; In this "Struc" definition we show the Request Header
; Contents for Read and Write calls.
;
Request struc; request header template structure

; Beginning of "Static" portion
Rlength db?; Length of request header
Unit db?; Unit number for this request
Command db?; Request header''s command code
Status dw?; Driver''s return status word
Reserve db 8 dup (?); Reserved area
; End of "Static" portion

Media db?; Media descriptor byte
Address dd?; Memory address for transfer
Count dw?; Byte / sector count value
Sector dw?; Starting sector value

Request ends; end of request header template

;
; Status word is interpreted as follows:
;
; Bit (s) Significance
; 15 Error
; 10-14 Reserved
; 9 Busy
; 8 Done
; 0-7 Error code if bit 15 = 1

; Predefined BDOS error codes are:
;
; 0 Write protect violation
; 1 Unknown unit
; 2 Drive not ready
; 3 Unknown command
; 4 CRC error
; 5 Bad drive request structure length
; 6 Seek error
; 7 Unknown media
; 8 Sector not found
; 9 Printer out of paper
; 10 Write fault
; 11 Read fault
; 12 General failure
; 13-14 Reserved
; 15 Invalid disk change (MS-DOS 3.x)

page

; Device Driver "Strategy Routine"

; Each time a request is made for this device, the BDOS
; First calls "Strategy routine", then immediately calls
; The "Interrupt routine".

; The Strategy routine is passed the address of the
; Request Header in ES: BX, which it saves in a local
; Variable and then returns to the BDOS.

Strat proc far
; Save address of Request Header
mov word ptr cs: [RH_Ptr], bx
mov word ptr cs: [RH_Ptr +2], es

ret; back to BDOS

Strat endp

page


; Device Driver "Interrupt Routine"

; This entry point is called by the BDOS immediately after
; The call to the "Strategy Routine", which saved the long
; Address of the Request Header in the local variable "RH_Ptr".

; The "Interrupt Routine" uses the Command Code passed in
; The Request Header to transfer to the appropriate device
; Handling routine. Each command code routine is responsible
; For any necessary return information into the Request Header,
; Then transfers to Error or Exit to set the Return Status code.

Intr proc far

push ax; save general registers
push bx
push cx
push dx
push ds
push es
push di
push si
push bp

push cs; make local data addressable
pop ds

les di, [RH_Ptr]; ES: DI = Request Header

; Get BX = Command Code
mov bl, es: [di.Command]
xor bh, bh
cmp bx, Max_Cmd; make sure its legal
jg Unk_Command; too big, exit with error code
shl bx, 1; form index to Dispatch table
; And branch to driver routine
jmp word ptr [bx + Dispatch]

page


; General collection of exit points for the driver routines.


Unk_Command:; Come here if Command Code too big.
mov al, 3; Sets "Unknown Command" error
; Code and "Done" bit.

Error:; Transfer here with AL = error code.
mov ah, 81h; Sets "Error" and "Done" bits.
jmp Exit

Done: mov ah, 1; Come here if I / O complete and
; No error, sets "Done" bit only.


Exit:; General purpose exit point.
; Transfer here with AX =
; Return Status word to be
; Placed into Request Header.

lds bx, cs: [RH_Ptr]; set status
mov ds: [bx.Status], ax

pop bp; restore general registers
pop si
pop di
pop es
pop ds
pop dx
pop cx
pop bx
pop ax
ret; back to BDOS

page


; Function 1 Media Check

; Block devices only. Should be a NOP for character devices.
;
; This routine is called first by BDOS for a block device transfer,
; Passing current media descriptor byte at Request Header +
;
; Media Check routine sets status word and in addition passes back
; Return byte at Request Header + 14 as follows:

; -1 Media has been changed
; 0 Don''t know if media changed
; 1 Media has not been changed
;
; If driver can return 1 or -1, performance is improved because
; MS-DOS does not need to reread the FAT for each directory access.


Media_Chk:

jmp Done

page

;
; Function 2 Build BIOS Parameter Block
;
; Block devices only. Should be a NOP for character devices.
;
; This routine is called by MS-DOS when Media-Changed code is
; Returned by Media Check routine, or if Not Sure code is returned
; And there are no dirty buffers.
;
; Build BPB call receives pointer to one-sector buffer in Address
; Field of Request Header (offset 14). If "Non-IBM-Format" bit
; In attribute word is zero, the buffer contains the first sector
; Of the FAT including the media identification byte and should not
; Be altered by the driver. If the "Non-IBM-Format" bit is set,
; The buffer mabe used as scratch space.;; The Build BPB routine sets status and returns a DWORD pointer to; the new Bios Parameter Block at Request Header + 18.; Build_Bpb: jmp Done page;; Function 3 I / O Control Read ;; Only called if IOCTL bit set in Device Header Attribute word.;; Called with:;; Request Header + 13 BYTE Media descriptor byte from DPB; Request Header + 14 DWORD Transfer address; Request Header + 18 WORD byte / sector count; Request Header + 20 WORD starting sector no. (block dev.);; Returns the Return Status word set appropriately, and; Request Header + 18 WORD actual bytes or sectors transferred;; No error check is performed on IOCTL I / O calls. Ioctl_Inp: jmp Done page;; Function 4 Read from Device;; Called with;; Request Header + 13 BYTE Media descriptor byte from DPB; Request Header + 14 DWORD Transfer address; Request Header + 18 WORD byte / sector count; Request Header + 20 WORD starting sector no. (block dev.);; Returns the Return Status word set appropriately, and; Request Header + 18 WORD actual bytes or sectors transferred Input: jmp Done page;; Function 5 Non-destructive Read from Device;; Character devices only.;; If Input Status request returns Busy bit = 0 (characters; waiting),; the next character that would be read is returned; at Request Header + 13. This character is not removed from; the Input Buffer. This basically provides the capability to; "look-ahead" by one character. Nd_Input: jmp Done page;; Function 6 Input Status;; Character devices only.;; Sets the Returned Status word:; Done bit = 1; Busy bit = 1 read request would go to physical device; = 0 characters already in device buffer, read request; would return quickly.;; MS-DOS assumes all character devices have type-ahead buffer.; If device does not have type-ahead buffer, should always; return Busy bit = 0 so MS-DOS will not hang. Inp_Stat: jmp Done page;; Function 7 Flush Input Buffers;; Character devices only.;; Terminate all pending requests, ie the Input buffer is; emptied. Inp_Flush : jmp Done page;; Function 8 Write to Device;; Called with;; Request Header + 13 BYTE Media descriptor byte from DPB; Request Header + 14 DWORD Transfer address; Request Header + 18 WORD byte / sector count; Request Header + 20 WORD starting sector no. (block dev.);; Returns the Return Status word set appropriately, and; Request Header + 18 WORD actual bytes or sectors transferred Output: jmp Done page;; Function 9 Write with Verify to Device;; Called with ;; Request Header + 13 BYTE Media descriptor byte from DPB; Request Header + 14 DWORD Transfer address; Request Header + 18 WORD byte / sector count; Request Header + 20 WORD starting sector no. (block dev.);; Returns the Return Status word set appropriately, and; Request Header + 18 WORD actual bytes or sectors transferred Outp_Vfy: jmp Done page;; Function 10 Output Status;; Character devices only.;; Sets the Returned Status word:; Done bit = 1; Busy bit = 1 write request would wait for completion of; current request; = 0 device idle, write request would start immediately.; Outp_Stat: jmp Done page;; Function 11 Flush Output Buffers;; Character devices only.;; Terminate pending requests. The output buffer, if any,; is emptied. Outp_Flush: jmp Done page;; Function 12 I / O Control Write;; Only called if IOCTL bit in Device Header Attribute word is set.;; Called with;; Request Header + 13 BYTE Media descriptor byte from DPB; Request Header + 14 DWORD Transfer address; Request Header + 18 WORD byte / sector count; Request Header + 20 WORD starting sector no. (block dev.);; Returns the Return Status word set appropriately, and; Request Header + 18 WORD actual bytes or sectors transferred;; No error check is performed on IOCTL calls. Ioctl_Outp: jmp Done page;; Function 13 Device Open;; MS-DOS version 3.0 and above only.; Only called if OPEN / CLOSE / RM bit set in Attribute word.; May be used to manage local buffering. Reference count; is incremented keeping track of number of open files on; the device. On character devices can be used to send; device initialization string, which can be set by IOCTL; Write. Note that CON AUX and PRN devices are always open.;; Returns the Return Status word set to "Done".; Dev_Open: jmp Done page;; Function 14 Device Close;; MS-DOS version 3.0 and above only.; Only called if OPEN / CLOSE / RM bit set in Attribute word.; May be used to manage local buffering. Reference count; is decremented keeping track of number of open files on; the device; when count reaches zero all files have been closed; and the driver should flush buffers as user may change disks.; On character devices can be used to send device post-I / O; string such as a form feed, which can be set by IOCTL; Write. Note that CON AUX and PRN devices are never closed.;; Returns the Return Status word set to "Done".; Dev_Close: jmp Done page;; Function 15 Removeable Media;; MS-DOS version 3.0 and above only.; Only called if OPEN / CLOSE / RM bit set in Attribute word; and device type is block.;; Returns the Return Status word set to "Done" and; Busy bit = 1 if media is non-removable.; = 0 if media is removable. ; Rem_Media: jmp Done page ; This Initialization code for the driver is called only ; once when the driver is loaded. It is responsible for ; initializing the hardware, setting up any necessary ; interrupt vectors, and it must return the address ; of the first free memory after the driver to the BDOS. ; If it is a block device driver, Init must also return the ; address of the Bios Parameter Block pointer array; if all ; units are the same, all pointers can point to the same BPB. ; Only MS-DOS services 01-0CH and 30H can be called by the ; Initialization function. ; ; In this example, Init returns its own address to the DOS as ; the start of free memory after the driver, so that the memory ; occupied by IN99v will be reclaimed after it is finished ; with its work. ; ; Called with: ; ; Request Header + 18 DWORD pointer to the character after the "=" ; on the CONFIG.SYS line that loaded ; driver; this information is read only. ; 22 BYTE drive letter for first unit of a ; block driver (0=A 1=B etc) ; (MS-DOS 3.x only) ; ; Returns: ; ; Request Header + 13 BYTE Number of units (block devices only) ; + 14 DWORD address of first free memory above driver ; + 18 DWORD BPB pointer array (block devices only) ; Init: ; Function 0 ; initialize device driver push es ; push Request Header addr push di mov ah,9 ; print sign-on message mov dx,offset Ident int 21h pop di ; restore Request Header addr pop es ; set first usable memory addr. mov word ptr es:[di.Address],offset Init mov word ptr es:[di.Address+2],cs jmp Done Intr endp Driver endp code ends end






Recommended links:



Three 3G licenses which Zhang's most "money" way?



New worm Floodnet (cute) little files



Alibaba IPO Made To Decrypt The Rich Mythology Behind The Movement



LasVegas PS3 Converter



Digital CD-R Midi Music to MP2 Player



Recommend Audio Rippers And Converters



Waste cartridge up to 5 times the false profit Canon ink cartridge recycling difficult



mp4 to mpeg converter free DOWNLOAD



Dealer how to identify the manufacturer with the money trap?



converting avi to Mp4



How-to Pocket PC Converter



SuperBurner DVD to Flash



Brief Firewall And Proxy Servers



flv to mp3 converter free DOWNLOAD



video file formats



Comparison Java And JavaScript



Friday, July 9, 2010

Youtube Video to DAT Home

Hot popluar youtube video Converter + download + player tool. With YouTube tool you can also convert downloaded YouTube videos to a format compatible with your favorite portable device; including - iPod Video, iPod Touch, iPod Nano, iPhone, Zune, PSP, as well as video capable MP3 players, video capable mobile phones, and Pocket PC, And finally... YouTube tool's embedded player will allow you to watch all your favorite YouTube videos off-line. So now you can enjoy any .flv and .swf videos anytime!
Supports customize or create user's own profile for any new (portable) device. The video conversion supports preview. About Playing Features. Embedded YouTube Video (Offline) Player is available, it supports offline play YouTube video, .flv video and .swf video. Supports "Drag and Drop" video files direct to the main window. Easy to select the source files. Cool UI skin available. - is the most powerful YouTube assistant on the planet.



Recommand Link:



ValeSoft DVD To Apple TV Video Converter



Youtube to Treo Value



Infomation Cursors And Fonts



mp4 converter



Youtube Movie To Zune Value



Convert 3gp To Wmv



X-Cloner SWF to DVD



Explosion XviD Converter



how to convert mp3 to wav



Youtube Video to Xbox 360 Today



Hot Remote COMPUTING



Articles About Help Tools



Video and Music to iPhone Converter



Mkv



AllRipper Xbox 360 Converter



Vacations iPod CONVERTER



Swift DAT To DVD



Monday, July 5, 2010

X-Cloner Flash Converter


X-Cloner Flash Converter is a All-in-One powerful tool. Convert all popular video and audio formats, swf or flv to video, such as avi, mpeg, 3gp, mp4, mov, it offers the solutions to problems that many other flash to video converting tools cannot solve, such as video and audio asynchronization, loss of frames, audio distortion, the process of alpha channel, and the process of both internal and external Flash video(flv). With the leading audio and video codec, X-Cloner Flash Converter lets you easily and fully enjoy the original effects of your Flash files on your PC, iPod, PSP, Zune, iPhone, DVD players and other portable devices. In conclusion, with easy-to-use interface, fast converting speed, powerful functions.



Recommand Link:



Happiness DVD To M4V PSP AOL Video



Movkit DVD Pack



video to iPod Nano conversion tool



Directory Desktop



Youtube to Laptops Suite



Youtube Movie To DAT Home



Leawo DVD to 3GP Converter



EXPLOSION DVD to M4V



Health And Nutrition for you



avchd to Xbox 360



How to Convert HD to Cowon S9



Bluesea DVD DAT Maker



Hot Java And JavaScript



Youtube Save + Player Freeware



Youtube Movie to Wii Tools



YouTube Downloader



Friday, June 25, 2010

How-to DVD Ripper Platinum

How-to DVD Ripper Platinum is all-in-one, 400% fast rip DVD to all popular video and audio formats such as rip DVD to MP4, AVI, DivX, MPEG, WMV, MP3, WMA, etc with great quality.

How-to DVD Ripper Platinum is easy rip DVD to AVI (DivX, XviD, etc.), MP4 (inc. Sony PSP and Apple iPod), WMV, 3GP, 3G2, QuickTime (MOV), SWF, DVD, VOB, VRO, MPEG 1,2,4, MPG, DAT, VCD, SVCD, MJPEG, Real Video (RM, RMVB). All formats video editing software. Edit video and burn your video collections onto a CD-R/RW, DVD+/-R, DVD+/-RW, DVD-RAM, Double/Dual Layer using flexible and convenient menu options and individual menu styles. DVD, VCD and SVCD formats are supported. rip DVD to all popular audio formats including MP3, WAV, WMA, AAC, AC3, M4A, MP2, OGG. Compared with other DVD ripper, How-to DVD Ripper Platinum full functionality, easy to use and multiple options, allows you to rip DVD by custom file size, rip DVD's any segment, select target subtitle and audio track. DVD editing is easy!



Recommand Link:



M4v



Convert HD to iPod Classic6



SuperBurner Apple TV Converter



Youtube Movie To Blackberry Live



Compare FTP Clients



Wondershare Pocket DVD Ripper



Youtube Movie to Xbox 360 Program



Mobile Phone M3U to Zune



Abee MP3 Duplicates Finder



Picked Newsgroup Clients



Top WEB Servers



MovKit DVD Ripper Pro



Christmasgift AVI Converter



Friday, June 18, 2010

SuperBurner DVD to PDA

SuperBurner DVD to PDA is a professional DVD movie to PDA video converter software. SuperBurner DVD to PDA directly converts DVD movies to your PDA. All you need do is to connect PDA to your PC and start Super DVD to PDA Converter. When the conversion is completed. SuperBurner DVD to PDA is an innovative Windows application that transcodes your favorite DVD movies to SONY PDA directly. You can easily convert both PAL/NTSC DVDs for optimized video playback on PDA. Integrated world-class MPEG4 encoder make it possible to transcode whole DVD disc with the time half of playback time of DVD. You can select any audio track, subtitle, chapters of the DVD as you want.



Recommand Link:



WorldCup DVD to Pocket PC



HAPPINESS AVI to MPEG



Swift XBOX 360 BlackBerry Encode



Ever CD AAC M4A to WMA Editor



HD to iAudio 9 software



Lohan Blackberry CONVERTER



How-to Xbox 360 Converter



LANwriter



high quality software download



Softstunt Video to iPod Converter



News about News Servers



Converting DVD to iAudio 9



Apple DivX QT Encode



ARTICLES about Languages Education



Youtube Video to AVI Guide



Shop Access Control



Friday, May 28, 2010

Youtube to VHS Products

Hot popluar youtube video Converter + download + player tool. With YouTube tool you can also convert downloaded YouTube videos to a format compatible with your favorite portable device; including - iPod Video, iPod Touch, iPod Nano, iPhone, Zune, PSP, as well as video capable MP3 players, video capable mobile phones, and Pocket PC, And finally... YouTube tool's embedded player will allow you to watch all your favorite YouTube videos off-line. So now you can enjoy any .flv and .swf videos anytime!
Easily Convert all popular video formats. Provides the highest speed to download YouTube video. Support unlimited simultaneous downloading tasks. Supports auto-name your downloaded video title as the YoutTube page shows. Offers you the most convenient task management and the easiest control capability. About Conversion Features. - is the most powerful YouTube assistant on the planet.



Recommand Link:



Specialist Games Card



Cartoons - Screen Savers Expert



4Leaf FLV Video Converter



Youtube Video to AVI Top Rated



MP3 WAVE Pack



Swift Flash to PS2 PDA Pocket PC



Bluesea DAT DVD SVCD to iPod



Best utility software review



Youtube To TV Program



Youtube to Apple TV Popular



Youtube to M4V Box



MPC AMR To APE



Youtube to Cell Phone DELUXE



Shell Tools BRIEF



Audio Video CONVERTER



SuperBurner MOV To DVD



Merry MP3 Midi Music To AMR Burner



Saturday, May 22, 2010

How-to MOV Converter


How-to MOV Converter is a All-in-One powerful tool, is easy convert MOV video to AVI, DivX, Xvid, MPEG1, MPEG2, VCD, SVCD, DVD video converter. The main features include: Batch convert MOV, QT files to AVI, MPEG, VCD,SVCD,DVD,WMV formats; Support different AVI video Codecs, such as DivX, Xvid, MPEG4; NTSC/PAL setting options for DVD, VCD, SVCD exporting; Change the framerate, image size etc as you like. Very user-friendly interface and easy to use. Very quick in conversion speed and no quality is lost! Key Features: Convert MOV to AVI, MOV to DivX, MOV to Xvid Convert MOV to MPEG1, MOV to MPEG2 Convert MOV to VCD, MOV to SVCD, MOV to DVD Convert MOV to WMV, MOV to ASF Support .mov, .qt files Support Batch convert NTSC/PAL setting option Support large video files, even large then 2GB Very fast and without any quality loss Very user-friendly interface.



Recommand Link:



Graphic CAD Report



Happiness DVD Converter



Eztoo RM Video Converter



Power Audio Editor



My favorite Web Servers



Happiness SWF Flash to DVD



Youtube FLV to Treo Online



Youtube Movie to VOB Program



Best Encryption TOOLS



OnlineTV



best programs REVIEW



Cool Video Converter



Youtube FLV to Xbox 360 Platinum



Uloysoft Ultimate DVD Converter