Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

RAWDISK Utility
Purpose: To read or write a number of blocks of a formatted disk, or transfer raw disk data to/from a named file.
Format: RAWDISK FROM <source> TO <destination> [options]
Template: FROM/K/A, TO/K/A, SC=STARTCYL/N, NC=NUMCYLS/N, SB=STARTBLOCK/N, NB=NUMBLOCKS/N, MODE/K, QUIET/S
Path: SYS:Utilities/RawDisk
RawDisk reads or writes a given number of cylinders or blocks to or from a disk, transferring the data to or from a named file. The data is read or written in raw format, i.e. the disk filesystem (if any) is ignored and data is addressed absolutely.

The utility can be used on any disk present in the Dos List, ie mounted. It can be run from Workbench by clicking on the icon, or from a Shell.

Disk data can be addressed by cylinders or blocks, as start + number. When reading from disk to a file, the file can be written as pure binary, hexadecimal longwords or hexadecimal bytes. When writing from file to a disk, only binary input is supported.

The FROM <source> parameter is mandatory and specifies the source device or filename.

The TO <destination> parameter is mandatory and specifies the destination disk or filename.

The SC/STARTCYL=<number> parameter is optional and specifies the first cylinder on the disk. If omitted, the first cylinder on the disk will be used. If the disk has space reserved for boot blocks and filesystems, or has multiple partitions, this value might not be zero.

The NC/NUMCYLS=<number> parameter is optional and specifies the number of cylinders to transfer. If omitted, a number of cylinders reaching from the first cylinder (if specfied) to the end of the disk will be assumed. If writing to disk and the input file is too small, the transfer will be zero-filled. If writing to disk and the file is too big, only part of its contents will be written to the disk.

The SB/STARTBLOCK=<number> parameter is optional and specifies the first block to be transferred. This is simply a means of specifying a start address with smaller granularity than whole cylinders. See "SC/STARTCYL" for explanation.

The NB/NUMBLOCKS=<number> parameter is optional and the number of blocks to be transferred. This is simply a means of specifying a data length with smaller granularity than whole cylinders.

If the MODE optional is specified, the mode of the output file (if used). The options are BIN, HEXB and HEXL. Option BIN (binary) is the default. Option HEXB writes the data in human-readable form, as strings of hexadecimal bytes followed by the printed string (if printable). Option HEXL prints the data as strings of longwords followed by the printed string.

If the QUIET option is specified, this suppresses warning messages to Shell.

Example 1:

3.OS4:> RAWDISK FROM DF0: STARTCYL=0 NUMCYLS=1 TO "FirstCyl.dat" reads the first 36 sectors (two tracks/one cylinder) of a floppy disk in device DF0: and writes the data to the file "FirstCyl.dat". Any previous file of that name is over-written. The floppy disk contents are not changed. Equivalent command: RawDisk FROM DF0: SB=0 NB=36 TO "FirstTrack.dat".

Example 2:

3.OS4:> RawDisk TO DF1: FROM "Boot.img" NUMBLOCKS=18 reads one track's worth of data from "Boot.img" and writes it to the first track of DF1:.
Equivalent command: RawDisk TO DF1: FROM "Boot.img" NB=18

Example 3:

3.OS4:> RawDisk FROM DH0: TO RAM:DH0.hex STARTBLOCK=0 NUMBLOCKS=1 MODE=HEXB reads the first block on DH0: (which may not be the first block on the disk if DH0: is not the first partition) and writes it to the file "RAM:DH0.hex" as a human-readable ASCII file.

Example 4:

3.OS4:> RawDisk FROM ZIP: TO "ZIPContents.img" reads the entire contents of the ZIP disk and writes the data to the file "ZIPContents.img". The file will be the same size as the disk, namely 95 MB.

NOTES

When a disk partition is selected from the disk requester, the LowCyl value represents the start of that partition, not the start of the disk. If the LowCyl value is less than 100 cylinders, RawDisk assumes that it is the first partition on the disk and allows the StartCylinder value to be set to zero. The initial (default) value of StartCylinder is still the LowCyl value.

When a disk file is selected as the source for a write-to-disk operation, RawDisk reads the size of the file and fills in the required number of blocks and cylinders. The number of blocks may represent more than the actual size, since the last block on the disk will be automatically null-filled to the end. The number of cylinders will be rounded up to the next integer, but only the required number of blocks will be written. No warning will be issued unless the number of blocks or cylinders is explicitly entered.

The disk is temporarily removed from the control of any filesystems while the R/W operation is carried out. At the end of a write operation, the disk may no longer be a valid filesystem volume.

A warning is issued and confirmation is required before:

  1. a fixed (hard) disk is written to;
  2. an output file (HEXB or HEXL) is created that would exceed 5 MB.
To abort an operation in progress from the Shell, use Ctrl+C (^C). To abort an operation in progress from WB, click the Cancel button or the CloseWindow gadget. If you click Cancel, the operation will stop and the GUI will remain on the screen so that you can make changes and try again.

Keyboard shortcuts (to GUI, before copying is started):

  • RightAmiga+C to Cancel
  • RightAmiga+Q or to Exit
  • RightAmiga+S to Start
Keyboard shortcuts (to GUI, once copying has started):

None (click "Cancel" or "Close Window" gadget to stop copying)


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.