1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
This is a DOS disk driver for the CH375 "USB ISA adapter", mostly designed with the Pocket386/Book386 in mind.
There is already a good number of drivers out there, but as far as I can see they are all derivatives of the original one,
and I got tired of all the obscure hangs and crashes. This driver is in OpenWatcom C and written from scratch
using the datasheets, so it has a (hopefully different) new repertoire of bugs to play with.
Some features:
* *Can support multiple partitions.* You can either show multiple drive letters (the number of drive letters is fixed at boot, though)
and/or dynamically switch a single drive letter to a different partition from the command prompt.
This does wonders to workaround the FAT16 2GG limit, as you can define a dozen FAT16 partitions and switch.
* On DOSes which support FAT32, can optionally *show FAT32 partitions* to the DOS.
* I mostly ignore CHS addressing and focus on LBA. This makes it way more capable of handling non-DOS partitioned USB pendrives,
and is generally less of a pain. In theory this allows disks of up to 2TB (be mindful of partition size limits though).
If DOS asks for geometry, it gives whatever is on the BPB of your current partition.
* Supports just enough IOCTLs to make DOS 6.x format.com "work"
(only to re-format existing partitions, since it will simply re-use geometry from whatever FAT is already there).
Note this is a DOS-level driver, so FDISK won't work (which expects a BIOS/int13-level driver).
* Build is for 386+, tested on pocket386/book386, but source builds on 8086.
* Extensive (not included by default) verbose log over serial port.
As usual, this driver is in OpenWatcom C, do not expect it to beat
any benchmark in speed or memory usage, but it gets around. About 400KB/s on the Book386, which is the same
I get with other drivers anyway; and around 7KiB of memory usage (the official driver sits at 4KiB).
Hopefully much easier to experiment with than with the official one.
# Download
[chu.zip](https://depot.javispedro.com/dos/chu/chu0.zip)
Current version is 0.
# Installation
````
DEVICE=CHUDISK.SYS [options]
````
## CHUDISK.SYS configuration options
Current options:
* /P260 : IO port for CH375 (defaults to 0x260, as on the pocket386)
* /N1 : number of drive letters to allocate (defaults to just 1).
Each drive letter will by default be mapped to a different partition in order.
* /R : read-only mode. Writes to disk will fail.
* /3 : show FAT32 partitions to the OS. Useful for OSes with native FAT32 support like FreeDOS.
# Usage
The program CHUD.EXE can be used to switch a CHUDISK.SYS managed drive letter to a different partition.
E.g.
````
C:\> CHUD D:
Index Type Label Size
[1] fat16 USBPART1 1996 MB
[2] fat16 USBPART2 1996 MB
[3] fat32 USBPARTBIG 4726 MB
Select partition in [1..3] range:
````
Extended partitions, W95/LBA partitions are supported. Of course you can only select FAT16 partitions,
and perhaps FAT32 ones if lucky (DOS7.1, FreeDOS, etc.) or forced with /3.
Note the drive letters <-> partitions mapping is not persistent, and will in fact be reset if you reboot
or disconnect the USB drive.
# Building
Tested with OpenWatcom 2, build from any OS where OpenWatcom runs.
````
wmake all
````
|