xref: /netbsd-src/distrib/amiga/stand/device-streams.README.md (revision 703c4250b99de4ad6656558571a5804bcf37c7f5)
1# device-streams
2Amiga tool for copying between block devices and streams/files, similar to UNIX `dd`.
3Originally released by Christian E. Hopps in 1993, updated to be useful today.
4
5Requires AmigaOS 2.04+.
6
7https://github.com/rvalles/device-streams
8
9## Usage
10Run the command with `-h` parameter to display usage information.
11
12### Examples
13#### Print RDB device and partition information.
14```
155.Ram Disk:> devstreams/rdbinfo
16Device: "scsi.device"  Unit: 0  Capacity: 114473.4 Megs
17DiskVendor: FUJITSU  DiskProduct MHV2120AH        DiskRevision: 0000
18Cylinders: 232581  Heads: 16  Blks-p-Trk: 63 [Blks-p-Cyl: 1008]
19Total Blocks: 234441648  Block Size 512
2064bit
21
22--| Partition: "DH0" Capacity: 1023.7 Megs
23--| Start Block: 3024  End Block: 2099663 Total Blocks: 2096640
24--| Block Size: 512
25
26--| Partition: "DH1" Capacity: 10239.4 Megs
27--| Start Block: 2099664  End Block: 23070095 Total Blocks: 20970432
28--| Block Size: 512
29--| 64bit
30###
31```
32#### Dump a partition into a file.
33```
345.Ram Disk:> devstreams/devtostream --output=DH1:dump.dd --rdb-name=DH0 --verbose
35found new device "scsi.device"
36found drive FUJITSU  MHV2120AH        0000 [capacity:114473M]
37 at unit 0 on device "scsi.device"
38| partition: "DH0" sb: 3024 eb: 2099663 totb: 2096640
39|            Block Size: 512 Capacity: 1023.7
40| partition: "DH1" sb: 2099664 eb: 23070095 totb: 20970432
41|            Block Size: 512 Capacity: 10239.4
42found partition: "DH0" capacity: 1023.7 Megs
43start block: 3024  end block: 2099663 total blocks: 2096640
44block Size: 512
45dumping: start block: 3024 to end block: 2099663 [size: 1048319K]
46
47write from partition "DH0" to file "DH1:dump.dd"? [Ny]:y
48writing: 0x00200950 -> 0x002009cf  [100%]
49```
50## Improvements
51* Cleaned up code.
52* Removed SAS/C-isms and updated to build in modern toolchains.
53* Use of 64bit offsets throughout.
54* Safeguards added against 32bit overflow wraparound.
55* Use dos.library for file I/O.
56* Trackdisk 64 support.
57* NSD support.
58
59## Binaries built
60* rdbinfo: Examines RDB partition tables and lists the partitions.
61* streamtodev: Writes data from a stream into a device.
62* devtostream: Reads data from a device into a stream.
63* xstreamtodev: As streamtodev but with extra options to specify block range.
64* xdevtostream: As devtostream but with extra options to specify block range.
65
66## Building
67The new build process uses GNU Make. Simply review the Makefile and run `make`.
68
69Alternatively,
70* `make clean` will delete all artifacts.
71* `make lint` will format the code to standards.
72* `make dist` will prepare a lha archive with the binaries.
73
74Development is done using the `bebbo/amiga-gcc` crossdev toolchain.
75https://github.com/bebbo/amiga-gcc
76
77With some care so that building with `vbcc` is also supported.
78http://sun.hasenbraten.de/vbcc/
79
80## Authors
81* Roc Vallès Domènech (2022)
82* Christian E. Hopps (1993)
83