Device drivers: Changing the attribute word at install time? (Developers)
> Interesting! Is it really as simple as inserting the device driver in the
> chain?
For a character device, it really is as simple as inserting in the chain. It's not trivial, but is pretty simple. It also doesn't work with some Virtual Machines (like DOSBox and its extensions) since their DOS is not really DOS.
BTW, the way to find the device driver chain is to locate the DOS List of Lists and the NUL device header is stored in the LOL (not a pointer to the NUL device header, the actual NUL device header is stored there). NUL is always the first device driver in the chain.
For a block device, you need to do more than just insert the device into the chain. You also need to insert information into other DOS tables as well, including the Drive Parameter Block (DPB) and Current Directory Structure (CDS) tables.
> I suspect some things like DOS telling you your starting unit
> number get missed, so you have to compute that yourself.
Exactly. You need to manually store all the correct information into the various tables (in addition to the device driver chain) which includes pointers back and forth between the various tables.
If you let DOS load the block driver via CONFIG.SYS, it does all of that for you but you also have no control over how DOS assigns the drive letters (and not all DOS's do it the same way).
> I'm also assuming
> that are putting it last (first?) in the chain (the same way that DOS does
> it) so that you don't disturb drive ordering.
No, it really doesn't matter where it ends up in the chain since you have pointers back and forth between the various tables. E.g., in the table that contains information about the drive letters, DOS creates the table the size based on your LASTDRIVE setting (which can be up to 32 entries in MS-DOS 7). If a drive letter is unused, that particular table entry is empty. You can fill in any of the empty entries with your information, which means you can use any unused driver letter you want (as long as LASTDRIVE was set properly). DOS assigns letters from the bottom up, but you don't necessarily need to do it that way if you don't want to.
For some sample code, you can use my USBDRIVE program or the FreeDOS DEVLOAD program.
As with character devices, of course, it doesn't work with VM's like DOSBox but does work with VM's that use a "real" DOS.
Complete thread:
- Device drivers: Changing the attribute word at install time? - mbbrutman, 02.10.2023, 23:47 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Device drivers: Changing the attribute word at install time? - glennmcc, 03.10.2023, 03:43
- Device drivers: Changing the attribute word at install time? - mbbrutman, 03.10.2023, 20:21
- Device drivers: Changing the attribute word at install time? - ecm, 03.10.2023, 20:56
- Device drivers: Changing the attribute word at install time? - mbbrutman, 03.10.2023, 21:26
- Device drivers: Changing the attribute word at install time? - tkchia, 03.10.2023, 21:32
- Device drivers: Changing the attribute word at install time? - mbbrutman, 03.10.2023, 22:48
- Device drivers: Changing the attribute word at install time? - tom, 04.10.2023, 23:43
- Device drivers: Changing the attribute word at install time? - tkchia, 03.10.2023, 21:32
- Device drivers: Changing the attribute word at install time? - mbbrutman, 03.10.2023, 21:26
- Device drivers: Changing the attribute word at install time? - ecm, 03.10.2023, 20:56
- Device drivers: Changing the attribute word at install time? - tkchia, 03.10.2023, 21:28
- Device drivers: Changing the attribute word at install time? - mbbrutman, 03.10.2023, 22:51
- Device drivers: Changing the attribute word at install time? - bretjohn, 06.10.2023, 21:35
- Device drivers: Changing the attribute word at install time? - mbbrutman, 07.10.2023, 20:42
- Device drivers: Changing the attribute word at install time? - bretjohn, 09.10.2023, 19:17
- Device drivers: Changing the attribute word at install time? - mbbrutman, 02.11.2023, 19:39
- Device drivers: Changing the attribute word at install time? - bretjohn, 09.10.2023, 19:17
- Device drivers: Changing the attribute word at install time? - mbbrutman, 07.10.2023, 20:42
- Device drivers: Changing the attribute word at install time? - bretjohn, 06.10.2023, 21:35
- Device drivers: Changing the attribute word at install time? - mbbrutman, 03.10.2023, 22:51
- Device drivers: Changing the attribute word at install time? - Rugxulo, 23.11.2023, 22:15
Mix view