Combined SYS device drivers - more than 1 driver in a file (Announce)
> snippety-snip... Just an detail which you may or may not remember
>
> >> The reason is that an FFFFFFFFh value denotes the LAST driver in the
> DOS
> >> driver list.
> Actually, when loading a driver, MS-DOS (others ?) check only the
> segment part (high word) of this double word for the special value
> FFFFh. This behaviour (by design?) will allow us to make a dual device
> driver/ dot com executable, using the first two bytes as a short jump over
> the rest of the driver header. Of course, the init routine for the 'sys'
> specific part of the init code should replace FFFF at offset zero before
> giving back control to the DOS system initialisation routines...
>
With the aid of RJDUMP and a single example of such 2 in 1 SYS file. I have established that there exists a multiple SYS device file format (at least on MS-DOS) which is also supported by LOADSYS. This explains why MS-DOS at the least does NOT expect the "Offset To Next Driver" value and indeed "Segment Address of Next Driver" to always be ZERO as sometimes they shouldn't be.
To explain, lets look the following RJDUMP snippet from such a driver:
Offset Address of Next Driver 0012h ( 18d )
Segment Address of Next Driver 0000h ( 0d )
Firstly note that neither value are FFFFh as most people would expect them to be. So effectively the logic here would "appear" to be that if "Segment Address of Next Driver" is set to 0000h and "Offset Address of Next Driver" is non-zero then DOS expects "Offset Address of Next Driver" to point to a another header *within* the same file. Indeed in this example case the value 00012h tells us that a second SYS header "follows" the first header at offset 0012h or 18 in decimal, all of which makes perfect sense since the SYS header structure is 18 bytes long. For those of you unfamiliar with it, here it is:
OfsAddrOfNextDriver : Word; {2 bytes+}
SegAddrOfNextDriver : Word; {2 bytes+}
DeviceAttributes : Word; {2 bytes+}
OfsAddrOfStrategy : Word; {2 bytes+}
OfsAddrOfInterrupt : Word; {2 bytes+}
DeviceName : Array[1..8] of Char; {8 bytes=18 bytes!}
From this I thus now strongly suspect that many multiple SYS files can be combined/daisy chained together with the list ending with $FFFF $FFFF (as happens in memory). I haven't had the time or interest to test this yet but am providing the information here to enable others to investigate. It will also be interesting to see if this SYS logic is "correct" on non MS-DOS's.
Note: I also haven't seen *any* documentation on this and have just worked it out based on a 1 such device driver that I have/Ninho's earlier comments.
I am thus providing this technical information here for those of you who may be interested in testing further. Any info you find out would be appreciated.
Below is a complete RJDUMP for the driver that I have here after I updated RJDUMP to deal with the above logic. Again as you can see all of the driver information (which I haven't altered) makes perfect sense when viewed in this way:
DOS SYS Header
Offset Address of Next Driver 0012h ( 18d )
Segment Address of Next Driver 0000h ( 0d )
DeviceName 'COM5 '
Device attributes 1000100000000000b 8800h ( 34816d )
Bit 15 = 1 Device driver type Character
Bit 14 = 0 Supports functions 03h and 0Ch? No
Bit 13 = 0 Supports function 10h? No
Bit 12 = 0 Reserved
Bit 11 = 1 Supports functions ODh and OEh? Yes
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 0056h ( 86d )
Offset address of Interrupt routine 0061h ( 97d )
DOS SYS Header
Offset Address of Next Driver FFFFh ( 65535d )
Segment Address of Next Driver FFFFh ( 65535d )
DeviceName 'COM6 '
Device attributes 1000100000000000b 8800h ( 34816d )
Bit 15 = 1 Device driver type Character
Bit 14 = 0 Supports functions 03h and 0Ch? No
Bit 13 = 0 Supports function 10h? No
Bit 12 = 0 Reserved
Bit 11 = 1 Supports functions ODh and OEh? Yes
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 0056h ( 86d )
Offset address of Interrupt routine 0078h ( 120d )
Note: The "shared" common strategy routine but separate Interrupt handlers with the first driver pointing to the second and the second starting $FFFF $FFFF thus ending the chain.
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