Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Combined .com executable/DOS driver - Turbo pascal example (Announce)

posted by Arjay, 20.06.2010, 13:39
(edited by Arjay on 21.06.2010, 01:22)

> > If anyone is interested, here is an example of
> > exe driver
> (for
> > config.sys) written in Turbo Pascal. The actual driver is in pasdev.pas.
> It
> > converts text to morse code.
>
> Thanks for sharing.
Secondary thanks also for providing another EXE device driver of the type of which I had not yet implemented for RJDUMP [EDIT: see update below]. In short for anyone interested you can detect an EXE driver by looking for the SYS header ($FFFFFFFF) after the EXE image ("Paragraphs in header" field value * 16). If using HIEW you can just hit [F8] and then [F4] to go there rather than [F8] then [F5] as you would do if interested in the EXE entry.

Likewise in the case of HIEW, you can use [CTRL] + [F5] change the base which is important as SYS drivers start at org 0h. e.g. In the case of PASDEV.EXE if viewing with HIEW you would for example first do [CTRL] + [F4] and then do [CTRL]+[F5] to change the base, type -B0 which will enable you to easily view view PASDEV as SYS driver in HIEW rather than an EXE. I hope this basic info is helpful for anyone interested in using this high-level example to learn.


[EDIT]
I have now added support for identifying/displaying EXE device headers to RJDUMP and have successfully tested it with many EXE based drivers already (e.g. JEMM, JLOAD for example). I hope to be finish coding/testing an initial public version of RJDUMP later on this week. In the meantime for anyone following this thread who may be studying PASDEV as a high-level example, the following partial RJDUMP of PASDEV.EXE may be helpful to you:

RJDUMP v2.00a - (c)Copyright 1996-2010 Richard L. James

Filename                                              'pasdev.exe'
DOS File Size                                         1240h  ( 4672d )

EXE Signature                                         5A4Dh  ( 'MZ' )
Load Image Size                                       FF90h  ( 65424d )
Relocation Table entry count                          0022h  ( 34d )
Relocation Table address                              001Ch  ( 28d )
Size of header record      (in paragraphs)            000Bh  ( 11d )
Minimum Memory Requirement (in paragraphs)            00E6h  ( 230d )
Maximum Memory Requirement (in paragraphs)            00E6h  ( 230d )
File load checksum                                    0000h  ( 0d )
Overlay Number                                        0000h  ( 0d )

Initial Stack Segment  (SS:SP)                  013Fh:0400h
Program Entry Point    (CS:IP)                  0000h:02C8h

DOS relocation table entries

0000:0021  0000:0085  0000:00C5  0000:00ED  0000:00F8  0000:00FD  0000:0106
0000:0117  0000:0137  0000:01EC  0000:01F1  0000:01F4  0000:0235  0000:023E
0000:024B  0000:025C  0000:0274  0000:02AF  0000:02CB  0000:02D0  0000:02D9
0000:0307  0000:030F  0032:0009  0032:0024  0032:0037  0032:013B  0096:0001
0096:011B  0096:02B5  0096:0676  0096:0691  0096:06A7  0096:06C6

Secondary device driver header detected

DOS SYS Header
Offset Address of Next Driver                         FFFFh  ( 65535d )
Segment Address of Next Driver                        FFFFh  ( 65535d )
DeviceName                                            'MORSE   '
Device attributes          1110000000000000b          E000h  ( 57344d )
   Bit 15  =  1    Device driver type                 Character
   Bit 14  =  1    Supports functions 03h and 0Ch?    Yes
   Bit 13  =  1    Supports function 10h?             Yes
   Bit 12  =  0    Reserved                           
   Bit 11  =  0    Supports functions ODh and OEh?    No
   Bit 10  =  0    Reserved                           
   Bit  9  =  0    Reserved                           
   Bit  8  =  0    Reserved                           
   Bit  7  =  0    Reserved                           
   Bit  6  =  0    Reserved                           
   Bit  5  =  0    Reserved                           
   Bit  4  =  0    Reserved                           
   Bit  3  =  0    Current clock$ device?             No
   Bit  2  =  0    Current NUL driver?                No
   Bit  1  =  0    Current standard output driver?    No
   Bit  0  =  0    Current standard output driver?    No
Offset address of strategy routine                    0015h  ( 21d )
Offset address of Interrupt routine                   0268h  ( 616d )

 

Complete thread:

Back to the forum
Board view  Mix view
22779 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum