Repository navigation
Home

- Introduction
- Modular Architecture and Library Reuse
- A Tutorial On Disk Images
-
os9 - Manipulate OS-9 formatted disk images
- ATTR - Display or modify file attributes
- CMP - Compare the contents of two files
- COPY - Copy one or more files to a target directory
- DCHECK - Verify the file structure of an RBF disk image
- DEL - Delete one or more files
- DELDIR - Delete a directory and its contents
- DIR - Display the contents of a directory
- DSAVE - Copy the contents of a directory or device
- DUMP - Display the contents of a binary file
- FORMAT - Create a disk image of a given size and type
- FREE - Display the amount of free space on an image
- FSTAT - Display the file descriptor sector for a file
- GEN - Prepare a disk image for booting
- ID - Display sector 0 of an image
- IDENT - Display OS-9 module information
- INFO - Report disk image format and track layout, or change write protection
- LIST - Display contents of a text file
- MAKDIR - Create one or more directories
- MODBUST - Bust a single merged file of OS-9 modules into separate files
- PADROM - Pad a file to a specific length
- RENAME - Give a file a new filename
- REVEAL - Explain what lives at a given LSN of a disk image
-
decb - Manipulate RSDOS formatted disk images
- Options - The DECB executive's option
- ATTR - Display or modify file attributes
- BINBUST - Remove ambles from DECB binaries
- COPY - Copy one or more files to a target directory
- DIR - Display the directory of a Disk BASIC image
- DSAVE - Copy the contents of a directory or device
- DSKINI - Create a Disk BASIC image of a given size
- DUMP - Display the contents of a binary file
- FREE - Display the number of free granules
- FSTAT - Display the file descriptor sector for a file
- HDBCONV - Converts an HDB-DOS disk image into a 512-byte sector compatible one
- INFO - Report disk image format and track layout, or change write protection
- KILL - Remove files from a Disk BASIC image
- LIST - Display the contents of a file
- REVEAL - Explain a disk image location
- RENAME - Give a file a new filename
-
cecb - Manipulate Color BASIC and Micro Color BASIC cassette files
- BULKERASE - Create a container for casette data
- DIR - Display the directory of a Cassette BASIC image
- FSTAT - Display the file descriptor for a file
- DUMP - Display the contents of a binary file
- DUMPBLOCK - Scan and print a hex dump of CoCo Cassette blocks
- LIST - Display the contents of a file
- COPY - Copy one or more files to a casette container
- LEADER - Analyse leader in a WAV file
- ar2
- dis68
- lst2cmt - Create MAME comment file
-
dgndos - Manipulate Dragon DOS formatted disk images
- ATTR - Display or change whether files are protected
- COPY - Copy one or more files to a target file or directory
- DIR - Display the contents of a disk's directory
- DSAVE - Copy the contents of a disk or directory
- DSKINIT - Create a Dragon DOS image
- DUMP - Display the contents of a binary file
- FREE - Display the amount of free space on an image
- FSTAT - Display detailed information about a file
- INFO - Report disk image format and track layout, or change write protection
- KILL - Delete one or more files
- LIST - Display the contents of a text file
- REVEAL - Explain a disk image location
- RENAME - Give a file a new filename
Some of the ToolShed Team: Tormod Volden, Tim Lindner, James Jones, Mark Marlette, Boisy Pitre, Roy Justus
Say hello to ToolShed, a free software product which houses a set of utilities designed to help you create programs and applications for several computing platforms for the Color Computer and Dragon systems running BASIC or NitrOS-9.
ToolShed brings you the ease and speed of developing these programs to your modern personal computer running Windows, Mac OS X or Linux. The tools in the shed consist of a relocatable macro assembler/linker and intermediate code analyzer, a stand-alone assembler, an OS-9/Disk BASIC file manager and more.
If you have performed assembly language programming on the CoCo before, you're probably familiar with either EDTASM under Disk BASIC, or the asm, rma and rlink tools under OS-9. ToolShed brings you similar tools that allow you to assemble 6809 and 6309 code efficiently.
ToolShed started out life in the mid-to-late 1990s as a 6809 cross-assembler under Linux developed by Alan DeKok and Boisy Pitre. Specifically designed for assembling the source base to NitrOS-9, the assembler was expanded to include support for the 6309. Later, additional tools to read disk images from OS-9 and Disk BASIC images were created and added to the shed. Now, the tool shed has now been expanded to include a number of useful software tools that can assist greatly in the software development process.
The main task of the these tools is to allow the manipulation, inspection and copying of files from disk and cassette images to your PC's file system, and vice versa. The os9 tool recognizes disk images that contain data in the RBF file format created under OS-9 or NitrOS-9, while the decb tool recognizes disk images formatted under Disk BASIC for the Color Computer. The cecb tool recognizes cassette data in the wave, CAS, and C10 formats, for both Color BASIC and Micro Color BASIC.
The os9, decb, dgndos, and cecb executives also accept two-letter
subcommand codes. Run an executive without arguments (or with -h) to list
each full name, its code in parentheses, and a short description. For example,
decb dr disk.dsk, is equivalent to decb dir disk.dsk,. Shared subcommands
use the same codes across executives; full names remain supported. OS-9's
id command is already two letters and remains id.
Managing a sizable assembly language source file for a complex program can be daunting. It is easy to become confused and lost in lines and lines of source code. rma (relocatable macro assembler) and rlink (relocatable linker) are two tools that are well suited for handling programs large and small, and work together to create both Disk BASIC and NitrOS-9 object files.
The relocatable macro assembler and linker give you the ability to write complex assembly language programs in different source files, then link them together to form a single OS-9 or Disk BASIC object file that can be loaded and executed.
These two command are no longer included in the ToolShed project.
The output of the rma macro assembler is a ROF (relocatable object file). rdump allows the inspection of this intermediate file, and can also act as a disassembler.
This command is no longer included in the ToolShed project. It's functionality has been included into the os9 command.
If you are comfortable with using the asm assembler that was part of OS-9/6809, then you will feel at home with mamou. This tool is more suited for assembly language programs that contain their entire source code in one file.
This assembler is included for historical purposes and should not be used for new development. For example, the NitrOS-9 project has switch to the LWASM assembler.
Carl Kreider is a long time OS-9/6809 user and programmer, and has graciously given us permission to include his archiver utility, ar2, in ToolShed.
This is a tool used to convert lwasm listing files into MAME comment files.
The os9, decb and dgndos tools share an info subcommand to report the format and track layout of DMK, SDF, JVC, VDK and raw disk images.
This is a tool used to manipulate, inspect and copy files on disk images formatted under Dragon DOS.
ToolShed is more than a collection of command-line programs. Its disk, filesystem and cassette operations are implemented in reusable C libraries. The command-line tools provide argument handling and presentation, while the libraries handle image formats, directories, file allocation and data transfer. Another application can call these libraries directly without running the ToolShed commands or parsing their output.
Image formats and filesystems are separate concerns. For example, DMK describes how tracks and sectors are stored in a host file, while Disk BASIC describes how files are organized within those sectors. The same filesystem code can therefore work with several image formats.
The main layers are:
-
Image access:
libdiskimagereads and writes sectors in supported disk-image containers. -
Filesystem and cassette access:
librbf,libdecb,libdragondosandlibcecbinterpret files and directories;libnativeaccesses the host filesystem. -
Common file access:
libcocopresents a shared interface over those backends. -
Shared tool operations:
libtoolshedbuilds higher-level operations on the common interface. -
Supporting routines:
libmiscandlibsyssupply conversions, checksums and other common services.
These are cooperating libraries, not isolated packages: callers must also link the dependencies of the layer they use.
The library source directories are at the project root. Their public headers are in include/; the Unix build produces static archives in the corresponding build/unix/ directories.
| Library | Main headers | Purpose and use |
|---|---|---|
libdiskimage |
diskimage.h |
Identifies, creates and accesses raw, JVC, VDK, DMK and SDF images. Provides geometry queries, sector enumeration, sector reads and writes, and write-protection handling. Used by the disk filesystem libraries and the shared info subcommand; useful independently for image inspectors, sector editors and emulator utilities. |
librbf |
os9path.h, rbfutil.h
|
Implements OS-9/NitrOS-9 RBF filesystems, including directories, allocation bitmaps, file attributes, formatting and file I/O. Supplies the filesystem operations behind os9 and the OS-9 backend of libcoco. |
libdecb |
decbpath.h, decbutil.h
|
Implements Disk BASIC filesystems, FAT/granule allocation, directory entries, formatting and HDB-DOS drive/offset access. Also supplies BASIC token conversion and binary conversion helpers. Used by decb and the Disk BASIC backend of libcoco. |
libdragondos |
dragondospath.h |
Implements Dragon DOS directories, allocation, file access, protection attributes, formatting and BASIC token conversion. Used by dgndos and the Dragon DOS backend of libcoco. |
libcecb |
cecbpath.h |
Implements cassette file access for WAV, CAS and C10 containers, including cassette blocks and BASIC token conversion. Used by cecb and the cassette backend of libcoco; it does not use the disk-sector layer. |
libnative |
nativepath.h |
Wraps host files and directories in a path-based API similar to the image backends. Enables transfers between host files and image contents through libcoco. |
libcoco |
cocopath.h |
Dispatches common open, read, write, seek, directory and metadata operations to native, OS-9, Disk BASIC, Dragon DOS or cassette paths. Also detects possible disk filesystems, including multiple filesystems in one image. Used by shared copy operations and applications that work across several backends. |
libtoolshed |
toolshed.h, cocodump.h
|
Supplies shared operations such as file copying, line-ending conversion, ROM padding, hex dumps and DSAVE command generation/execution. Used by command-line tools to avoid duplicating higher-level behavior. Some routines print output or invoke commands, so use the lower-level file APIs when an application needs full control of presentation and execution. |
libmisc |
cococonv.h, queue.h, util.h
|
Supplies byte-order and string conversions, queues, host-to-CoCo error mapping and miscellaneous utility routines used throughout the libraries and tools. |
libsys |
cocosys.h |
Supplies OS-9-style CRC and pathname-parsing routines used by other ToolShed components. |
Choose the lowest layer that meets the application's needs:
- A sector viewer can use
libdiskimagewithout interpreting any filesystem. - An OS-9 image editor can use the
_os9_*API inos9path.h; a Disk BASIC or Dragon DOS editor can use_decb_*or_dragondos_*respectively. - A file browser or extraction utility supporting several systems can use
_coco_open(),_coco_read(),_coco_readdir()and related calls. Paths such asdisk.dsk,FILE.TXTidentify a file inside an image; host paths identify native files. See Pathname Elements for the syntax. - A build tool can use shared copy or conversion routines to place generated files into images.
For images containing more than one filesystem, _coco_detect_filesystems() returns a bitmask of possible filesystems. Automatic selection is not a substitute for choosing the intended filesystem: use its specific API when that choice matters. Image-format detection and filesystem detection are separate operations.
Build the libraries with make -C build/unix, add include/ to the compiler's header search path, and link the required archives from build/unix/lib*/. With static linking, put dependent libraries before the libraries that supply their dependencies. The application and unit-test Makefiles show working link configurations for the complete file-access stack. The normal Unix install target installs tools and documentation, not a separate library development package.
For example, this small program queries an image's geometry without opening a filesystem. Save it as image_geometry.c:
#include <stdio.h>
#include <cocopath.h> /* FAM_READ */
#include <diskimage.h>
int main(int argc, char **argv)
{
diskimage_id disk;
diskimage_geometry geometry;
error_code ec;
error_code close_ec;
if (argc != 2)
return 1;
ec = _diskimage_open(&disk, argv[1], FAM_READ);
if (ec != 0)
return 1;
ec = _diskimage_query_geometry(disk, &geometry);
if (ec == 0)
printf("%u cylinders, %u sides, %u logical sectors\n",
geometry.cylinders, geometry.sides, geometry.total_sectors);
close_ec = _diskimage_close(disk);
return ec != 0 || close_ec != 0;
}From the ToolShed root, compile and run it on a Unix-like host with:
cc -Iinclude image_geometry.c \
build/unix/libdiskimage/libdiskimage.a \
build/unix/libmisc/libmisc.a \
build/unix/libsys/libsys.a -lm -o image_geometry
./image_geometry disk.dskThe headers describe the APIs and data structures; unittest/ contains examples of opening, creating, reading and modifying images. Most I/O routines return an error_code (0 for success), and read/write calls use an in/out size parameter. Check each call's documented behavior, handle errors and short transfers, and close every successfully opened path. Some routines may also emit diagnostics.
An application can alternatively compile the required library sources into its own build. DiskShed, the wxWidgets GUI in gui/wx/, demonstrates this approach: its CMake configuration builds the filesystem sources into a static library and links a C++ application against it. Use the public headers rather than private implementation headers, retain the applicable license notices, and consult the current source and tests when updating an integration.
One of the most frequent questions that come up in dealing with Color Computer disks is "How do I move the data from my old disks over to my PC?" When discussing the moving of files between a NitrOS-9 or Disk BASIC disk, the physical disk media is of no concern to ToolShed -- in fact, this software does not even know how to extract information from a physical diskette. What ToolShed does understand is the logical underpinnings of the RBF and Disk BASIC file systems, and how to properly manipulate files at that level.
The fact that ToolShed is agnostic to physical media begs the question: how does one transfer the contents of a physical disk to a location where ToolShed can work on the image, and vice versa? The answer is dependent upon the host computer. For Windows systems, utilities exist to extract image data from physical floppy disks and onto a hard drive for use. For Linux and Mac OS X, there are varying approaches, depending on your media, for obtaining an image from a physical diskette.
For the example below, we will assume that the 3.5" 720K floppy drive is A:, and the 5.25" 360K floppy drive is B:
The tool required to transfer DSK images to floppies under DOS/Windows is DSKINI.EXE.
Once DSKINI.EXE has been downloaded and extracted, call up a Command Prompt window under Windows (if you're not using MS-DOS), and insert a blank 5.25" 360K diskette into drive B. Presuming the image being transfered is nos96309l2v030200_ds40_1.dsk, type:
DSKINI /T40 /D B: NOS963~1.DSK
Note the use of the mangled filename form here. If you are running Windows, you can type the full length filename
Once the transfer completes, you should have an exact image of the disk on the floppy, and can now use that floppy on a real CoCo.
For Linux users, you will need to download the fdutils package at http://fdutils.linux.lu/. Once installed, insert a blank floppy into your 5.25" 360K or 3.5" 1.44MB/720K drive. It will be either /dev/fd0 or /dev/fd1 depending on its position in the drive chain. For this example, we will assume /dev/fd1.
You must tell Linux the type of disk in the drive. You must do this EVERY TIME you insert a disk into the floppy drive, as Linux "forgets" the disk type when you take the disk out:
setfdprm /dev/fd1 coco40ds
Now you can format the disk:
fdformat /dev/fd1
Once the format is complete, transfer the image as follows:
dd if=nos96309l2v030200_ds40_1.dsk of=/dev/fd1
Once the command is complete, the disk will contain the image and can be used in a CoCo disk drive system.
Since ToolShed runs on various platforms, then there must be a method to differentiate between host file system pathnames and OS-9/Disk BASIC pathnames within the image itself. This is achieved by mandating the use of the , (comma) character as a delineator between the host path and the OS-9/Disk BASIC path (the path within the disk image). To better understand this, let's take a look at a few examples.
On our theoretical host computer, a file exists that you wished to have copied to an OS-9 disk image. The file to copy, test1, resides on the host file system in the same directory as the disk image file, os9.dsk. To copy test1 to the disk image, you would type:
os9 copy test1 os9.dsk,
Notice the use of the comma at the end of the second parameter. This tells the os9 program that you wish to copy the file test1 over to the root directory of the os9.dsk image.
What happens if you don't put the comma at the end of the second parameter? os9 copy would copy test1 on top of the os9.dsk image, replacing your entire disk image with the contents of test1, so the copy commands refuse to do that. An existing file on the host that is or looks like a disk image is never replaced, even with -r. The copy is refused, and says why. A file looks like one if it has the extension .dsk, .vdk, .dmk, .sdf, .jvc, .os9, .img or .ima, has the header of a disk image format, or is at least a track long (4608 bytes) and a whole number of sectors. This applies to os9, decb, cecb and dgndos copy, and to dsave. To replace such a file, delete it first.
Let's take the example a step further. A file exists in the os9.dsk image file, in RBF format, that you wish to copy to your host file system, in the root directory. The file on the disk image is named test2, and resides in the RBF subdirectory path DIR1/DIR2. How would you copy the file to your host file system's root?
For Mac OS X or Linux:
os9 copy os9.dsk,DIR1/DIR2/test2 /
For Windows/DOS:
os9 copy os9.dsk,DIR1/DIR2/test2 C:\
Once again, the comma is used to differentiate the local file system from the RBF file system that exists in the disk image file.
You can even copy files between disk images. Assume you had a disk image named nuther.dsk and wanted to copy the above file to the root directory of that disk image.
os9 copy os9.dsk,DIR1/DIR2/test2 nuther.dsk,
Note the comma is present in both arguments, indicating that both pathlists point to a file within an RBF disk image. In fact, every command in the ToolShed package recognizes this distinct meaning and use of the comma.
This intelligence allows ToolShed to act differently depending upon whether it is acting on the file on a disk image or host file system. The result is that most commands built into ToolShed also work on the host file system too.
An example of this:
os9 dir os9.dsk, -e
will display the extended root directory on the specified disk image. Similarly:
os9 dir . -e
will display the extended directory on the current directory of the host file system (the -e option behaves similar to ls -l on Unix-based systems).
Toolshed supports specialized path symbols for HDB-DOS hard disk images. A pathlist with a drive number or offset, and decb dskini -h with more than one drive, require a raw disk image; on any other image they fail.
The colon allows you to select which disk image is active:
decb copy disk.dsk,NEW.DAT:3 disk.dsk,OLD.DAT:23
This command will copy "NEW.DAT" on the fourth disk image in disk.dsk to "OLD.DAT" on the 24th disk image on disk.dsk. The disk image count starts at zero.
Another feature of HDB-DOS is an offset to be used for the first disk image. This allows HDB-DOS to share a hard disk with OS-9. Use the '+' to specify an offset.
DECB list -t hd.img,NEW.BAS:3+1348276
The number after the plus is the offset. It can be expressed in decimal or hexadecimal form. Prepend the number with '0x' to use hexadecimal.
The following pages document the commands built into the os9 tool. As the examples above illustrated, the built in commands such as dir, copy, etc. must be executed from the os9 executive, and any parameters for that command follow the command name.
Issuing the os9 command without any parameters will provide a list of available subcommands. Issuing a subcommand without any parameters will display help on using the subcommand.
While many commands will work fine host file systems, some commands are designed to only be run on an RBF disk image or file within that image. The Scope section makes it clear in what context the command should be run.
attr {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for RBF disk image files only.
| -q | quiet mode (suppress output) |
| -e | set execute permission |
| -w | set write permission |
| -r | set read permission |
| -s | set single user bit |
| -p[ewr] | set public execute, write or read permission |
| -n[ewr] | unset execute, write or read permission |
| -np[ewr] | unset public execute, public write or public read permission |
Every file in the RBF file system possesses attributes. These attributes determine how a file can be accessed: whether it can be executed, written or read to by its owner or others, whether it is a directory, and whether or not it can be opened more than once at a time.
The attr command allows you to display the attributes of a file or modify these attributes by specifying the above options. If the attribute for a given file is set, then it appears in its proper position. If the attribute is not set, a dash (-) character appears in its place.
Displaying a file's attributes:
os9 attr os9l2.dsk,startup
----r-wr
Turn off a file's public read attribute:
os9 attr os9l2.dsk,startup -npr
------wr
####Syntax and Scope
cmp {[<opts>]} <file1> <file2> {[<...>]} {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
cmp compares the contents of two files, on a byte-by-byte basis, and displays a summary of the differences, as well as an indication of which file was longer. cmp is not suitable for line by line comparisons, only byte comparisons.
Comparing two files of the same size and content:
os9 cmp file1 file2
Differences
None
Bytes compared: 00027600
Bytes different: 00000000
Comparing two files of different size and content:
os9 cmp image1,shortfile image2,longfile
Differences
byte #1 #2
======== == ==
00000001 6f 61
0000000c 69 61
00000013 0a 20
Bytes compared: 00000014
Bytes different: 00000003
image2,longfile is longer
copy {[<opts>]} <srcfile> {[<...>]} <target> {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
| Option | Description |
|---|---|
-b=size |
Set copy buffer size in bytes or kilobytes (e.g. 512, 4K) |
-l |
Enable end-of-line translation (use for text files only) |
-o=id |
Set file owner ID in the destination file descriptor |
-r |
Overwrite the destination file if it already exists |
-a=erpepr |
Set OS-9 file attributes using ERPEPR permission mask |
The copy command will create an exact copy of a file on either an RBF disk image or on the host file system. If a file already exists on the destination disk image or file system, an error will be returned. If you want to force the copy, use the -r option.
The -l option performs end of line translation when copying between the host file system and the RBF disk image. You should only use the -l option on text files, not binary files. When copying files to a disk image, the user id of the user on the host system is set in the file's ID sector. If you want to override this, you can use the -o option, specifying the ID of the file's owner as it resides on the RBF disk image.
The -a=erpepr option allows explicit control of OS-9 file attribute bits (ERPEPR), which define the file’s access permissions as stored in the file descriptor sector.
Copying a file from an RBF disk image to the host:
os9 copy os9l2.dsk,cmds/procs procs
Copying a file from the host to an RBF disk image:
os9 copy -a=epe binary_file os9l2.dsk,binfile
Copying a text file from the host to an RBF disk image:
os9 copy -l text_file os9l2.dsk,txtfile
dcheck {[<opts>]} {<disk> [<...>]} {[<opts>]}
This command is intended for RBF disk images only.
| -s | check the number of directories and files and display the results. |
| -b | suppress listing of unused clusters |
| -p | print pathlists of questionable clusters |
The dcheck command verifies the integrity of an RBF disk image's structure by running a series of internal tests to determine the veracity of the bitmap to the actual state of the file system.
Using dcheck to verify an RBF disk image:
os9 dcheck l2tools.dsk
Volume - 'Level II Tools' in file: l2tools
$004F bytes in allocation map
1 sector per cluster
$000276 total sectors on media
Sector $000002 is start of root directory file descriptor
Building secondary allocation map...
Comparing primary and secondary allocation maps...
0 previously allocated cluster found
0 clusters in file structure but not in allocation map
0 clusters in allocation map but not in file structure
0 bad file decriptor sector
'Level II Tools' file structure is intact
2 directories
28 files
del {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for RBF disk images only.
del will delete a file from the disk. It does not delete directories (see deldir if you want to delete directories).
Deleting a file on an RBF disk image:
os9 del os9l2.dsk,sys/stdfonts
deldir {[<opts>]} {<directory>} {[<opts>]}
This command is intended for RBF disk image files only.
| -q | quiet mode (suppress interaction) |
deldir will delete a directory from the disk. If the -q option is specified, it will quietly delete any files and subdirectories; otherwise, it will prompt you upon entering each directory that it finds.
Deleting a directory on an RBF disk image:
os9 deldir os9l2.dsk,sys
Deleting directory: os9l2.dsk,sys
List directory, delete directory, or quit? (l/d/q) d
dir {[<opts>]} {<dir> [<...>]} {[<opts>]}
This command is intended for RBF disk images only.
| -a | show all files |
| -e | extended directory |
| -r | recurse directories |
The dir command displays the contents of directories on an RBF disk image or the host file system.
Displaying an extended directory on an RBF disk image:
os9 dir -e l2tools,
Directory of l2tools,.
Owner Last modified Attributes Sector Bytecount Name
------- --------------- ---------- ------ --------- ----
0.0 1988/06/02 2133 d-ewrewr B 864 CMDS
0.0 1988/06/02 2339 -----ewr 115 2003 Install1
0.0 1988/06/02 2338 ------wr E2 1315 Install2
0.0 1988/06/02 2338 ------wr 10F 1316 InstallH
dsave {[<opts>]} {[<source>]} <target> {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
| -b=size | size of copy buffer in bytes or K-bytes |
| -e | actually execute commands |
| -l | perform end of line translation on copy |
| -r | force rewrite on copy |
| -x=path | os9 executable to run the commands with, rather than the one the shell finds |
The dsave command recursively copies files from a directory to another device.
dsave runs os9 copy and os9 makdir to do the copying, and by default the shell finds os9 as it would any command. Use -x to name the one to use, such as the one you just built. Without -e it only shows the commands. If a command fails, dsave stops and exits with its status.
dump {[<opts>]} {<file> [<...>]} {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
| -a | dump output in assembler format (hex) |
| -b | dump output in assembler format (binary) |
| -c | don't display ASCII character data |
| -h | don't display header |
| -l | don't display line label/count |
The dump command allows you to see the contents of any file, including binary files. It does this by displaying the data in hexadecimal format and providing cues such as offset labels and headers so that it is easy to reference the location of a specific byte. By default, the output of a typical dump will look like this:
Addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 2 4 6 8 A C E
-------- ---- ---- ---- ---- ---- ---- ---- ---- ----------------
00000000 0002 7612 004f 0001 0000 0200 00ff 5e12 ..v..O........^.
00000010 0200 1200 0000 0000 0000 5805 0513 004c ..........X....L
00000020 6576 656c 2049 4920 546f 6f6c f300 0000 evel II Tools...
00000030 0000 0000 0000 0000 0000 0000 0000 0001 ................
00000040 0003 2001 0028 0200 0012 0012 0308 0058 .. ..(.........X
00000050 0000 0000 0000 0000 0000 0000 0079 3600 .............y6.
00000060 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000070 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000080 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000090 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000a0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000b0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000c0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000d0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000e0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000f0 0000 0000 0000 0000 0000 0000 0000 0000 ................
Note that the address of the offset on the left column increases by 16 ($10) bytes each line, and the header above shows the position of the byte into that 16 byte line. An additional piece of information provided is the ASCII character table on the right that shows the ASCII representation of the characters on that line.
Additional command line options are provided to omit certain parts of the dump output, including the header and ASCII data. Also, the -a and -b options are provided to allow dumping of a file's contents into a format digestible by certain assemblers.
format {[<opts>]} <disk> {[<...>]} {[<opts>]}
This command is intended to work on the host file system only.
| -bsX | bytes per sector (default = 256) |
| -cX | cluster size |
| -e | format entire disk (make full sized image) |
| -fX | image format: raw, jvc, vdk, dmk or sdf (default from the disk's extension, otherwise raw) |
| -k | make OS-9/68K LSN0 |
| -nX | disk name |
| -q | quiet; do not report format summary |
| -4 | 48 tpi (default) |
| -9 | 96 tpi |
| -sa | sector allocation size (SAS) |
| -sd | single density |
| -dd | double density (default) |
| -ss | single sided (default) |
| -ds | double sided |
| -tX | tracks (default = 35) |
| -stX | sectors per track (default = 18) |
| -iX | interleave (default = 3) |
| -dr | format a Dragon disk |
| -lX | number of logical sectors |
Without -f, the format comes from the disk's extension, and otherwise it is raw. A raw image replaces a file that exists, and any other format does not. Those formats always hold the whole disk, with or without -e, and can't be made with every layout: see the limits of each format in diskimage.h.
The format command creates a file on the host file system which itself is an empty RBF disk image. This image ca then be used to hold files and directories.
Besides the normal options, there are two other groups of options: floppy options and hard drive options. Each set of options are mutually exclusive, and aren't meant to be mixed together.
Floppy options allow an RBF image to be created with certain flags set in LSN0 which identify the physical aspect of the disk (single vs. double density, single or double sided, 48 or 96 tracks per inch, etc.). These options do not affect how files are read or written to the image. They are important, however, if you choose to bring the disk image over to a physical floppy disk. The floppy options should be manipulated to match the physical media to which the image will be transferred.
The hard drive option, -l, lets you specify the size of the RBF image you wish to create in sectors. Combined with the -bs option, you can create a disk image of considerable size with this option. Note that images created with the -l option shouldn't be transferred to floppy disks. Note that in order to create a fully sized disk image, the -e option needs to be used. Otherwise, the disk image will be made only large enough to accommodate the LSN0, bitmap and root directory sectors.
To create an empty disk image that will fit neatly onto a 35 track single-sided 5.25" floppy disk, type:
os9 format ss35.dsk -ss -t35 -e
For a 40 track, double-sided 5.25" floppy disk image, type:
os9 format ds40.dsk -ds -t40 -e
For an 80 track, double-sided 3.5" floppy disk image, type:
os9 format ds80.dsk -ds -t80 -e -9
free {[<opts>]} {<disk> [<...>]} {[<opts>]}
This command is intended for RBF disk image files only.
free displays the amount of free space on an RBF image.
os9 free l2tools
"Level II Tools" created on 05/05/1988
Capacity: 157KB (630 sectors) 1-sector clusters
352 Free sectors, largest block 344 sectors
Free space: 88KB (90112 bytes)
fstat {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for RBF disk image files only.
fstat displays information about a file from the file descriptor sector.
os9 fstat l2tools,cmds/wend
File Information for l2tools,cmds/wend
Attributes : --e-rewr
Owner : 0.0
Last modified date : 02/16/1987 00:09
Link count : 1
File size : 43
Creation date : 02/16/1987 00:01
Segment list:
1. LSN1 ($10D) 1 sector
gen {[<opts>]} {<disk_image>}
This command will work on RBF disk images only.
| -b=bootfile | bootfile to copy and link to the image |
| -c | CoCo disk |
| -d | Dragon disk |
| -e | Extended boot (fragmented) |
| -t=trackfile | kernel trackfile to copy to the image |
The gen command gives a disk image the ability to become a bootable disk for a CoCo, Dragon or MM/1.
-
Local files example:
os9 gen -b=OS9Boot -t=customtrack.bin new.dsk
Copies the standalone boot file (
OS9Boot) and kernel track file (customtrack.bin) from your host system and writes them directly intonew.dsk. -
Files inside an image example:
os9 gen -b=disk.dsk,folder/MyBootFile -t=disk.dsk,folder/ts.bin new.dsk
Extracts the boot file and kernel track file located inside an existing disk image (
disk.dsk), then writes them intonew.dsk. -
Default paths example:
os9 gen -b=disk.dsk, -t=disk.dsk, new.dsk
Uses the standard default boot and track file locations inside
disk.dskto preparenew.dskfor booting.
id {[<opts>]} {<disk> [<...>]} {[<opts>]}
This command is intended for RBF disk images only.
fstat displays information about an image from the identification sector (LSN 0).
os9 id l2tools
LSN0 Information:
Total sectors : 630
Track size : 18
Bytes in bitmap : 79
Sectors/Cluster : 1
Root dir sector : 2
Disk owner : 0.0
Disk attributes : dsewrewr
Disk ID : $5E12
Disk format : $2 (48 TPI, Double Density, Single Sided)
Sectors/track : 18
Boot sector : 0
Bootfile size : 0
Creation date : 05/05/1988 19:00
Disk name : Level II Tools
Bytes/Sector : 256
ident {[<opts>]} {<file> [<...>]} {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
| -s | short output |
The ident command displays a summary of information about one or more OS-9 modules.
os9 ident l2tools,cmds/wcopy
Header for : Wcopy
Module size: $33C #828
Module CRC : $5A42B2 (Good)
Hdr parity : $17
Exec. off : $00D2 #210
Data size : $0500 #1280
Edition : $43 #67
Ty/La At/Rv: $11 $81
Prog mod, 6809 Obj, re-ent, R/O
list {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for RBF disk image files only.
The list command displays the contents of text files.
os9 list l2tools,installh
t
*************************************
* L e v e l I I T o o l s *
* *
* Copyright (C) 1988 *
* Alpha Software Technologies *
* All rights reserved *
* *
* Installation now in progress... *
*************************************
-t
makdir {<dirname> [<...>]}
This command is intended for RBF disk images only.
The makdir command creates directories.
modbust {[<opts>]} {<file> [<...>]} {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
The modbust command will create separate files, each containing an OS-9 module, from a single file that contains one or more merged OS-9 modules. The resulting files are created on the host file system, and the names of the files reflect the name of the module.
padrom {[<opts>]} <padsize> {<file> [<...>]} {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
| -b | place padding at the beginning of the file |
| -c[=]n | character to pad (n=dec, %bin, 0oct or $hex) |
The padrom command extends the size of a file to the passed size with the passed padding character.
rename {<file> <newfilename>}
This command is intended for RBF disk image files only.
The rename command renames a file with a new filename.
reveal {[<opts>]} <disk> <lsn>[:<offset>]
reveal -b <disk> <byte-offset>
This command is intended for RBF disk image files only.
Reveal takes an LSN (and, optionally, a byte offset within that sector) or an absolute byte offset into the image, and explains, in plain English, exactly what lives at that location: a field of LSN0, a bitmap byte and the cluster/LSN range it tracks, a file descriptor and which field of it, a segment entry, a directory entry (and which byte of its name or LSN pointer), or a byte inside a file's data. If the LSN doesn't map to anything reveal recognizes, it reports whether the bitmap marks it allocated or free, and whether it falls within the boot track.
With -b, the offset is a byte position in the actual container file, including image headers and inter-sector data. Reveal recognizes image and track headers, sector ID fields, data address marks, sector data, data CRCs, JVC attribute bytes, and unused raw-image slots on a short track zero. A byte inside a logical sector's data is translated to its filesystem LSN and described as above. Other bytes are described at the container level, without interpreting them as filesystem data. Duplicated single-density bytes map to the same decoded sector byte.
For gaps, reveal reports the distances to the nearest preceding and following sector fields in physical file order, with sector numbers, cylinders and sides. These need not be consecutive sector numbers on an interleaved disk. For example:
Byte 495 is in inter-sector data, 6 bytes after the last byte of sector 1's data CRC (cylinder 0, side 0), and 30 bytes before sector 7's ID field (cylinder 0, side 0).
Distances are measured from the preceding field's last byte and the following field's first byte. Sector numbers in these descriptions are on-disk IDs, not OS-9 LSNs. Missing sectors do not renumber later LSNs. IDs and data belonging to rejected sectors can still be described as container structures, but are not interpreted as live filesystem sectors. Image headers and gaps can be examined even if the container does not hold a readable OS-9 filesystem.
Without -b, LSN[:offset] continues to address filesystem sector data; the optional offset must be smaller than the filesystem's bytes per sector. Numeric inputs accept decimal or a 0x hexadecimal prefix.
Options:
-b Treat <offset> as an absolute byte offset from the start
of the disk image, rather than an LSN[:offset] pair.
Describe container fields and gaps, or filesystem contents
when the byte is inside logical sector data.
-d Dragon disk (used to find the location of a boot track)
os9 reveal 68SDC.VHD -b 88179138
Examining LSN 344,449, byte 194 of '68SDC.VHD'...
This is byte 164,290 of file "/SOURCECODE/ASM/NITROS9/CMDS/grfdrv_older_source.lzh" (the 164,291st byte overall), found in the 2nd segment/extent of this file, which begins at LSN 344,064.
The following pages document the commands built into the decb tool. Its interface is similar to that of the os9 tool discussed in previous pages.
Issuing the decb command without any parameters will provide a list of available subcommands. Issuing a subcommand without any parameters will display help on using the subcommand.
Use decb to copy files to and from Disk BASIC formatted disk images to your host file system. While many commands will work fine host file systems, some commands are designed to only be run on a Disk BASIC disk image or file within that image. The Scope section makes it clear in what context the command should be run.
The DECB executive has one option specified before the sub-command:
| -g | Granule count in FAT (used when writing) |
| 68: 35 track disk (default) | |
| 78: 40 track disk | |
| 156: 80 track disk |
This allows you to specify the number of granules available when writing to a disk image.
attr {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for Disk BASIC disk image files only.
| -0 | BASIC program |
| -1 | BASIC data file |
| -2 | Machine-language program |
| -3 | Text file |
| -a | ASCII file |
| -b | Binary file |
Every file in the Disk BASIC file system possesses attributes. These attributes determine the representation of the file's contents, as well as what application the file is intended for. The attr command allows you to modify these attributes by specifying the above
Change a file's attribute to a text file:
decb attr decb.dsk,TEST.DAT -3
binbust <input file> <output file>
This command is for a file from anywhere.
No options.
DECB binary files are composed of one or more data records, each preceded by a 5-byte header (type, length, load address), followed by a final 5-byte execution record. Binbust removes these record headers and trailers, concatenating the data blocks into a single unadorned binary file.
Process a file:
decb binbust decb.dsk,EPROM.BIN dos.bin
copy {[<opts>]} <srcfile> {[<...>]} <target> {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
| -[0-3] | file type (when copying to a Disk BASIC image) |
| 0 = BASIC program | |
| 1 = BASIC data file | |
| 2 = machine-language program | |
| 3 = text editor source file | |
| -[a|b] | data type (a = ASCII, b = binary) |
| -l | perform end of line translation |
| -r | rewrite if file exists |
| -t | perform BASIC token translation |
| -c | perform segment concatenation on machine language loadables |
The copy command will create an exact copy of a file on either a Disk BASIC disk image or on the host file system. The -l option performs end of line translation when copying between the host file system and the Disk BASIC disk image. You should only use the -l option on text files, not binary files. If a file already exists on the destination disk image or file system, an error will be returned. If you want to force the copy, use the -r option.
Copying a file from a Disk BASIC disk image to the host:
decb copy decb.dsk,TEST.BAS TEST.BAS
Copying a BASIC file from the host to a Disk BASIC disk image with tokenization:
decb copy myprog.bas -t decb.dsk,MYPROG.BAS
Copying a text file from the host to a Disk BASIC disk image:
decb copy -l -3 -a file.txt decb.dsk,file.txt
dir {[<opts>]} {<dir> [<...>]} {[<opts>]}
This command is intended for Disk BASIC disk images only.
The dir command displays the directory of a Disk BASIC disk image or the host file system.
Displaying an extended directory
decb dir decb.dsk,
dsave {[<opts>]} {[<source>]} <target> {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
| -b=size | size of copy buffer in bytes or K-bytes |
| -e | actually execute commands |
| -l | perform end of line translation on copy |
| -r | force rewrite on copy |
| -x=path | decb executable to run the commands with, rather than the one the shell finds |
The dsave command recursively copies files from a directory to another device.
dsave runs decb copy and decb makdir to do the copying, and by default the shell finds decb as it would any command. Use -x to name the one to use, such as the one you just built. Without -e it only shows the commands. If a command fails, dsave stops and exits with its status.
dskini {[<opts>]} <disk> {[<...>]} {[<opts>]}
This command is intended to work on the host file system only.
| -3 | 35 track disk (default) |
| -4 | 40 track disk |
| -8 | 80 track disk |
| -f | image format: raw, jvc, vdk, dmk or sdf (default from the disk's extension, otherwise raw) |
| -h | create HDB-DOS drives |
| -n | HDB-DOS disk name |
| -s | create a "skitzo" disk |
The dskini command creates a file on the host file system which itself is an empty Disk BASIC disk image. This image can then be used to hold files.
To create an empty disk image that will fit neatly onto a 35 track single-sided 5.25" floppy disk, type:
decb dskini ss35.dsk -3
For a 40 track, single-sided 5.25" floppy disk image, type:
decb dskini ss40.dsk -4
For an 80 track, single-sided 3.5" floppy disk image, type:
decb dskini ss80.dsk -8
For a disk image containing 124 HDB-DOS 35 track single-sided virtual drives:
decb dskini hdbdrives.dsk -h124
For a DMK image, by its extension or by asking for it:
decb dskini ss35.dmk
decb dskini -fdmk ss35.img
Without -f, the format comes from the disk's extension, and otherwise it is raw. Only a raw image can hold more than one HDB-DOS drive. An existing disk in another format than the one asked for is left alone.
dump {[<opts>]} {<file> [<...>]} {[<opts>]}
This command will work on Disk BASIC and RBF disk image files as well as host files.
| -a | dump output in assembler format (hex) |
| -b | dump output in assembler format (binary) |
| -c | don't display ASCII character data |
| -e | dump output in C format |
| -t | don't display header |
| -l | don't display line label/count |
| -z | decode DECB binary |
The dump command allows you to see the contents of any file, including binary files. It does this by displaying the data in hexadecimal format and providing cues such as offset labels and headers so that it is easy to reference the location of a specific byte. By default, the output of a typical dump will look like this:
Addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 2 4 6 8 A C E
-------- ---- ---- ---- ---- ---- ---- ---- ---- ----------------
00000000 0002 7612 004f 0001 0000 0200 00ff 5e12 ..v..O........^.
00000010 0200 1200 0000 0000 0000 5805 0513 004c ..........X....L
00000020 6576 656c 2049 4920 546f 6f6c f300 0000 evel II Tools...
00000030 0000 0000 0000 0000 0000 0000 0000 0001 ................
00000040 0003 2001 0028 0200 0012 0012 0308 0058 .. ..(.........X
00000050 0000 0000 0000 0000 0000 0000 0079 3600 .............y6.
00000060 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000070 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000080 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000090 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000a0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000b0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000c0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000d0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000e0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000f0 0000 0000 0000 0000 0000 0000 0000 0000 ................
Note that the address of the offset on the left column increases by 16 ($10) bytes each line, and the header above shows the position of the byte into that 16 byte line. An additional piece of information provided is the ASCII character table on the right that shows the ASCII representation of the characters on that line.
Additional command line options are provided to omit certain parts of the dump output, including the header and ASCII data. Also, the -a and -b options are provided to allow dumping of a file's contents into a format digestible by certain assemblers.
free {[<opts>]} {<disk> [<...>]} {[<opts>]}
This command is intended for Disk BASIC disk image files only.
free displays the number of free granules.
decb free decb.dsk,
Free granules: 1 (2304 bytes)
fstat {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for Disk BASIC disk image files only.
fstat display detailed information about a file.
decb fstat DISK.DSK,FILE.DOC
File Information for DISK.DSK,FILE.DOC
File type : Data
Data type : ASCII
File size : 3769 bytes
First granule : 31
Last sector : 185 bytes
FAT chain : [31:2304] [28:1465]
hdbconv {[<opts>]} <srcfile> {[<...>]} <target> {[<opts>]}
| -2 | go from 512-byte sector to 256-byte sector |
| -5 | go from 256-byte sector to 512-byte sector (default) |
This command converts an HDB-DOS disk image into a 512-byte sector compatible one. The source must be a raw disk image, and an existing target that looks like a disk image is not replaced.
kill {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for Disk BASIC disk images only.
kill will permanently remove a file from the disk.
Killing a file on a Disk BASIC disk image:
decb kill decb.dsk,KILLME.BIN
list {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for Disk BASIC disk image files.
| -t | perform BASIC token translation |
| -s | perform S-Record encoding of binary |
The list command displays the contents of text files. It can list ASCII text files, as well as both ASCII and tokenized BASIC files.
decb list -t games.dsk,start.bas
10 CLS
20 PRINT "START GAME"
30 LOADM "GAME"
40 EXEC
decb reveal <disk> <lsn>[:<offset>]
decb reveal -b <disk> <byte-offset>
Explain a zero-based LSN (track * 18 + sector - 1), optionally with a byte
offset from 0 through 255. Reveal identifies FAT links, directory entry fields,
reserved sectors, file ownership and file byte offsets, allocation space past
EOF, and free or unclaimed granules. The executive's -g option controls the
granule count for extended disks. Disk paths accept the usual ,:drive[+offset]
selection for raw images.
With -b, the offset is absolute within the image file. Reveal describes image
and track headers, sector ID fields, CRCs, attributes and gaps, then explains
the filesystem location if the byte belongs to sector data. Raw, DMK, SDF,
VDK and JVC images are supported. Numbers accept decimal or a 0x hexadecimal
prefix. Missing sectors and unreadable filesystem metadata are reported;
granule chains are bounded to safely inspect damaged images.
rename {<file> <newfilename>}
This command is intended for Disk BASIC disk image files only.
The rename command renames a file with a new filename.
The following pages document the commands built into the cecb tool. Its interface is similar to that of the os9 tool discussed in previous pages.
Issuing the cecb command without any parameters will provide a list of available subcommands. Issuing a subcommand without any parameters will display help on using the subcommand.
Use cecb to copy files to and from Color BASIC and Micro Color BASIC formatted cassette images to your host file system. While many commands will work fine with host file systems, some commands are designed to only be run on a BASIC cassette image or file within that image. The Scope section makes it clear in what context the command should be run.
Cecb can work with WAV, CAS, and C10 cassette file containers.
cecb {[<opts>]} <subcommand>
This command is intended for BASIC cassette and disk image files only.
| -r[real] | Set WAV file FSK aspect ratio for autodetection. Default: 1.85 |
| -t[%] | Set WAV file FSK aspect ratio threshold. Default: 0.3 (30%) |
| -n[%] | Set near-zero threshold for WAV samples. Default: 0.01 (1%) |
| -s [n] | Start at sample/bit [n] in the input file. |
| -z | Suggest MC-10 mode. Use MC-10 WAV files and MicroColor BASIC tokens. |
The MC10 mode give the command hints on when to use MC10 characteristics. It uses different audio wave forms in WAV files. It also uses MC10 (and MCX128) BASIC tokens.
The C10 format defaults to MC10 formats. The WAV and CAS default to CoCo formats.
The aspect ratio mention above is low frequency divided by the high frequency. People normally think the two FSK Color Computer tape format frequencies are 2400 Hz and 1200 Hz. This is an aspect ratio of 2.0. But the actual ratio coming from the Color Computer's circuitry is 1.85. The value is adjustable because aging tapes, and badly configured tape players, can cause the ratio to drift over time.
bulkerase {[<opts>]} <file> {[<...>]} {[<opts>]}
This command is intended to work on the host file system only.
| -s[num] | Sample rate of WAV file (11025, 22050, 44100, etc. Default: 22050). |
| -b[num] | Bits per sample of WAV files (8, 16, 24, 32, default: 16). |
| -l[num] | Length of silence to record in WAV file. (default: 0.5 seconds). |
The bulkerase command creates a file on the host file system which itself is an empty Cassette BASIC image. This image can then be used to hold files.
To create an empty image, type:
cecb bulkerase test.wav
Creating WAV file: test.wav
Sample Rate: 22050
Bits Per Sample: 16
Silence Length: 0.500000
dir {[<opts>]} {<dir> [<...>]} {[<opts>]}
This command is intended for Cassette BASIC images only.
The dir command displays the directory of a BASIC cassette image.
Displaying an extended directory
cecb dir test.wav,
Directory of test.wav:
HELLO 0 B
fstat {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for Cassette and Disk BASIC disk image files only.
fstat display detailed information about a file.
cecb fstat test.wav,HELLO
File Information for test.wav,HELLO
File type : BASIC Program
Data type : Binary
Gap type : No
ML Load Address : 0 (0x0000)
ML Execution Address : 22 (0x0016)
File Size : 22 bytes (0x0016)
dump {[<opts>]} {<file> [<...>]} {[<opts>]}
This command will work on Disk BASIC, RBF disk image files and Cassette files as well as host files.
| -a | dump output in assembler format (hex) |
| -b | dump output in assembler format (binary) |
| -c | don't display ASCII character data |
| -h | don't display header |
| -l | don't display line label/count |
The dump command allows you to see the contents of any file, including binary files. It does this by displaying the data in hexadecimal format and providing cues such as offset labels and headers so that it is easy to reference the location of a specific byte. By default, the output of a typical dump will look like this:
Addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 2 4 6 8 A C E
-------- ---- ---- ---- ---- ---- ---- ---- ---- ----------------
00000000 0002 7612 004f 0001 0000 0200 00ff 5e12 ..v..O........^.
00000010 0200 1200 0000 0000 0000 5805 0513 004c ..........X....L
00000020 6576 656c 2049 4920 546f 6f6c f300 0000 evel II Tools...
00000030 0000 0000 0000 0000 0000 0000 0000 0001 ................
00000040 0003 2001 0028 0200 0012 0012 0308 0058 .. ..(.........X
00000050 0000 0000 0000 0000 0000 0000 0079 3600 .............y6.
00000060 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000070 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000080 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000090 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000a0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000b0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000c0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000d0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000e0 0000 0000 0000 0000 0000 0000 0000 0000 ................
000000f0 0000 0000 0000 0000 0000 0000 0000 0000 ................
Note that the address of the offset on the left column increases by 16 ($10) bytes each line, and the header above shows the position of the byte into that 16 byte line. An additional piece of information provided is the ASCII character table on the right that shows the ASCII representation of the characters on that line.
Additional command line options are provided to omit certain parts of the dump output, including the header and ASCII data. Also, the -a and -b options are provided to allow dumping of a file's contents into a format digestible by certain assemblers.
dumpblock {[<opts>]} <imagefile> {[<opts>]}
This command is intended for Cassette BASIC images (.wav, .cas, .c10) only.
The dumpblock command scans a Color Computer cassette image file sequentially, printing the header details (block type, length, checksum, and exact image position markers) followed by a dump of each raw block's contents. It uses the same formatter as os9 dump, decb dump, and cecb dump, with offsets restarting at zero for each block. It continues through non-fatal checksum warnings and end-of-file blocks (type 0xFF) to scan the entire image.
-
-h,?: Show the help message and exit. -
-a: Dump output in assembler format (hex). -
-b: Dump output in assembler format (binary). -
-e: Dump output in C format. -
-c: Omit ASCII character data. -
-t: Omit the dump column header. -
-l: Omit line labels/counts.
Formatting options may be combined and placed before or after the image name. Block metadata is always displayed. When output is a terminal, all four dump commands show printable ASCII byte values and characters in green; redirected output contains no color codes. Checksum warnings are also colored on a terminal.
Scanning a .cas image and dumping a header block:
Scanning a .wav image file:
cecb dumpblock -t test.wav
Scanning blocks in: test.wav
Format: WAV
------------------------------------------------------------
Block: Type=0x00, Len=15, CKSUM=0x02, End Sample=243200
00000000 4845 4c4c 4f20 2020 0000 0042 4153 49 HELLO ...BASI
list {[<opts>]} {<file> [<...>]} {[<opts>]}
This command is intended for BASIC image files.
| -t | perform BASIC token translation |
| -s | perform S-Record encoding of binary |
The list command displays the contents of text files. It can list ASCII text files, as well as both ASCII and tokenized BASIC files.
cecb list -t games.cas,START
10 CLS
20 PRINT "START GAME"
30 LOADM "GAME"
40 EXEC
copy {[<opts>]} <srcfile> {[<...>]} <target> {[<opts>]}
This command will work on Disk BASIC, RBF disk image files and Cassette image as well as host files.
| -[0-3] | file type (when copying to a Cassette BASIC image) |
| 0 = BASIC program | |
| 1 = BASIC data file | |
| 2 = machine-language program | |
| 3 = text editor source file | |
| -[a|b] | data type (a = ASCII, b = binary) |
| -[g|n] | gap mode (g = gaps, n = no gaps) |
| e[n] | execution address |
| -l | translate line endings |
| -t | entokenize BASIC ASCII text |
| -k | detokenize BASIC program |
| -s | encode as Motorola S-record |
| -f | decode Motorola S-record |
| -c | concatenate machine-language segments |
| -p | honor global start position (may overwrite data) |
The copy command will create an exact copy of a file on either a Disk BASIC disk image or on the host file system. The -l option performs end of line translation when copying between the host file system and the Disk BASIC disk image. You should only use the -l option on text files, not binary files. If a file already exists on the destination disk image or file system, an error will be returned. If you want to force the copy, use the -r option.
Copying a file from a Disk BASIC disk image to the host:
cecb copy cecb.wav,TEST test.bas
Copying a BASIC file from the host to a Disk BASIC disk image with tokenization:
cecb copy myprog.bas -t cecb.wav,MYPROG
Copying a text file from the host to a cassette BASIC image:
cecb copy -l3a file.txt cecb.wav,FILE
leader <wavfile>
This command looks for alternating frequencies with the aspect ratio specified in the cecb executavie options. Staticts are provided for each block found.
During preservation of CoCo cassette tapes, recovering data is essential. There are two known frequencies that are written. But due to a variety of factors the wave formas captured can be shifted in frequency. With this command, you can try different aspect ratios (and threasholds) to see if any leaders are found. You can then use the results to tune further data extraction attempts.
cecb -r1.5 -t0.25 leader file.wav
Leader analysis. Find alternating frequencies.
Target ratio: 1.500000 (1.125000 - 1.875000)
Block length 0.714172 seconds (71685-103180)
Zero crossing count: 515
Average ratio: 1.904762
High frequency average: 2100.0 Hz, max: 2100.0 Hz, min 2100.0 Hz
Low frequency average: 1102.5 Hz, max: 1102.5 Hz, min 1102.5 Hz
The numbers after block length are the start and end samples.
Ar is a utility modeled loosely after the archive utility in "Software Tools" the Kernigan & Plauger book. Its purpose is to gather together files into a common file to save disk space, keep related files together, ease the transmission of files by telephone, and other similar uses. It preserves file attributes such as last-modify date, creation date, owner, and permissions. Ar uses Lempel-Zev compression on text and binary files, so substantial space savings can result. Several versions of the same file can be kept in one archive without file name contention.
Carl Kreider, author of ar and ar2, at the 6th Annual Atlanta CoCo Fest, October 1995
The command line syntax is:
ar <-command>[options] <archive_name> [file_specification(s)]
The items enclosed in <> are required and those in [] are optional.
The commands operate on the archive in some way:
| d | delete file(s) from the archive |
| m | move file(s) to the archive (add and then delete) |
| p | print file(s) to standard output |
| t | print a table of contents for the archive |
| u | update/add file(s) to the archive |
| x | extract file(s) from the archive |
| a | include all versions of specified files (affect p,t,x commands) |
| bnn | set compression to 'nn' bits maximum (affects u command) |
| o | make archives compatible with old ar (affects u command) |
| s | suppress compression of binaries (affects u command) |
| ss | suppress compression of all files (affects u command) |
| z | get names of files to process from standard input |
Ar will normally compress binary modules, but these may not compress well using Lempel-Zev compression. It is possible for files to actually grow, although this is less likely as the number of bits used increases.
A file spec can include the meta characters '?' (matches any single character) and '*' (matches any string of zero or more characters). Thus the following examples are valid file specifications:
*.c matches ar.c, dir.c, but not dir.h or dir.cc
ar.? matches ar.c, ar.h, but not ar.ch
a*z matches az, abz, abcz, abcdz, etc.
*.* matches anything with at least one dot in it
* matches anything and everything
Since the stock OS9 (6809) shell, as well as the MSDOS command.com, does not expand any meta characters, Ar provides internal expansion of same. This is transparent under OSK and UNIX when using Ar for update since it also accepts a list of files on the command line. In the case of extraction, deletion, and printing, we do not want the shell to generate filenames from the current directory. In this case, any file specification containing meta characters must be quoted to protect it from the shell.
Meta characters can be used for files both bound for the archive and for files to be extracted. The p, t, and x commands default to '*' if no explicit file list is given. The u and d commands MUST have a file spec. The file specification can include a path list if it is not absolute. That is, '/d0/work/*.c' will not be accepted, but 'work/*.c' will be. During extraction, if the directory in the path list of the archived file cannot be found, it will be created. Here are some sample command lines.
Print all files, even old versions: ar -pa archfile Print all current files: ar -p archfile Print all current files with '.c' suffix: ar -p archfile *.c Print only 'file.c' : ar -p archfile file.c The x and t commands would work the same way, but the u command is slightly different. Sample command lines follow.
Add all files with '.c' suffix without compression: ar -us archfile *.c Add ALL files; compress all except modules: ar -u archfile * Add only 'command', but don't compress it: ar -us archfile command Add only 'file.c': ar -u archfile file.c
If a file with the same name as the one to be added exists in the archive already, the version number of the existing one is incremented and the new version is added to the end of the archive. The attribute section of the file descriptor is saved in the archive and restored to the file (as much as is possible) on extraction. OS9 limits this to owner, creation date, last modified date, and permissions. Size, of course, will be the same.
Pre-extension is used during extraction to avoid segment table overflow problems, and will be added to update as soon as the mechanism becomes clear.
The concatenation of two '.ar' files is still an archive, with certain limitations. If a duplicate file with duplicate version appears in both archives prior to concatenation, only the last one physically in the archive file will be saved on extraction. (Both version will actually be extracted, but the last one will overwrite earlier versions.) One could, of course, double the size of Ar with all manner of prompting, perusing, and choosing in cases like that but I prefer to rely on the innate ability of the user deal with such problems outside of Ar.
The archive file is opened in update only if necessary, so the last modified date of the archive is not disturbed by extraction or perusal. This should go a long way toward making rational backup of archives possible.
This is a disassembler for OS-9/68K written by Carl Kreider and Dan Poole.
It was written for OS-9/68K on OS-9/68K using the Microware compiler, which was more or less K&R at the time. It has since been updated to compile with a modern compiler on Linux and on macOS.
The dissassembler doesn't really know what to do without a parameter file to direct it. It is not smart enough to figure out the contents of a binary by itself. Normally one examines a hex dump of the binary to figure out what is text, what is code, and what is data. It often takes a couple iterations to sort out. If you see garbage output instead of clean disassembly, it may be data or text instead of code. Fix the parameter file and try again.
The parameter file does not have to be specified on the command line if it's name is the name of the binary with ".prm" tacked on. That is what dis68 will look for unless a name is provided with the -p option. The format of the parm file is a letter specifying what this block should be and a hex address of the last byte of the block. For example, the parm file for the included demonstration binary, bsrl, is this:
l 47
t 4d
c 5f
Since it is an OS-9/68K module and dis68 is not told otherwise, it will first take apart the module header. Next, it will assume long (32 bit) data up to and including address 0x47, text up to and including address 0x4d, and code up to and including address 0x5f.
This is a tool used to convert lwasm listing files into MAME comment files. It was originally written by Eric Canales in PowerBASIC. It was rewritten in C by tim lindner.
lst2cmt {[<opts>]} <srcfile> <destfile> {[<opts>]}
| -nocrc | Writes comment lines with no CRC field |
| -s<system> | Sets the system MAME should apply the comments file to. Default is blank, but this is required be specified. |
| -c<cpu> | Sets the CPU MAME should apply the comments file to. Default is ":maincpu". |
| -nolinenumbers | Remove line numbers. Useful if your debugger has limited space. |
| -o<offset> | Offset the memory locations to place the comments. |
The lwasm assembler can produce a listing file. An assembler listing file will include line number, object code, source code, and comments all in one text file. The MAME emulator has the ability to display comments next to it's dissasembly view. This tool allows you to process lwasm's listing files to produce a file MAME can use to display comments next to the dissasembly.
- Comments in between code lines will not be visible in MAME. Only comments placed after the menemonomic and operand.
- Comments will only be displayed in MAME if the CRC of the object codes matches what is in the comment file.
- MAME comments are automatically loaded. By default, the comment file location is next to the MAME executable in a folder called 'comments'. The name of the comment file must be the MAME driver short name and dot 'cmt'. Inside the comment file, the name of the driver must match the driver you are running. Inside the comment file, the name of the cpu must also match the running driver.
- MAME does not have comments turned on by default. There is a menu item to turn them off.
- MAME display comments very far to the right in the disasembly. You may have to make the window very large to see them.
This shared subcommand reports the format and track layout of disk images, and sets or clears their write protect flag. Each tool accepts every supported image format, regardless of its filesystem.
os9 info {[<opts>]} <file> {<file> ...}
decb info {[<opts>]} <file> {<file> ...}
dgndos info {[<opts>]} <file> {<file> ...}
-p set the write protect flag of a DMK, SDF or VDK image
-u clear the write protect flag of a DMK, SDF or VDK image
-s report one file's possible filesystems in the exit status
For each file, info reports its disk image format, then the sectors on its tracks. Tracks with the same layout are reported together.
test.dsk is a DMK disk image.
Tracks 0 to 16 are 18 sectors (1-18), 256 bytes each.
Track 17 is 1 512 byte sector (4).
Track 18 is 18 sectors (1-18), 256 bytes each. Sector 3 has a deleted data mark. Sector 17 has a CRC error in its data segment.
Tracks 19 to 34 are 18 sectors (1-18), 256 bytes each.
On a two sided image, a run of tracks is reported once if both sides match, and once for each side if not.
Track 0, side 0, is 10 sectors (1-10), 256 bytes each.
Track 0, side 1, is 18 sectors (1-18), 256 bytes each.
Tracks 1 to 34, both sides, are 18 sectors (1-18), 256 bytes each.
A file that is not a disk image is reported as such.
If the image could hold an OS-9, Disk BASIC or Dragon DOS filesystem, info names them. A disk can hold more than one, and Disk BASIC has nothing to identify it, so this is only what could be there.
test.dsk is a raw disk image.
Possible filesystems: OS-9, Disk BASIC
Tracks 0 to 34 are 18 sectors (1-18), 256 bytes each.
os9 dir, decb dir and dgndos dir end their listing by naming any other filesystems the image could hold.
Other possible filesystems: Disk BASIC
With -s, info prints nothing, and its exit status says which filesystems the one file named could hold. A status that isn't 0 isn't a failure here, so scripts using set -e or && need to allow for it.
0 a disk image, with no filesystem found
1 OS-9
2 Disk BASIC
4 Dragon DOS
64 not a disk image, can't be read, or the arguments are wrong
The filesystems add together, so 3 is OS-9 and Disk BASIC. -s takes one file, and can't be used with other options. For example:
os9 info -s disk.dmk; fs=$?
if [ $((fs & 64)) -ne 0 ]; then echo "error"; elif [ $((fs & 1)) -ne 0 ]; then echo "has OS-9"; fi
With -p or -u, info changes the write protect flag instead of reporting the layout. Raw and JVC images have no such flag. os9, decb and dgndos can read a write protected image, but cannot change it.
file.txt is not a DMK, SDF, JVC, VDK, nor raw disk image.
- The exit status is 0 only if every file is a disk image.
- Only sectors a floppy controller could find are reported. On DMK and SDF images, these are not: sectors with a bad CRC in their ID field, an ID whose track number is not the physical track, no data field, a field crossing the end of the track, or the number of an earlier sector on the same track. On JVC images with sector attributes, sectors marked "not found" are not reported either.
- Any file whose size is a multiple of 256 bytes, including an empty file, is a valid raw disk image.
The following pages document the commands built into the dgndos tool. Its interface is similar to that of the decb tool.
Issuing the dgndos command without any parameters will provide a list of available subcommands. Issuing a subcommand without any parameters will display help on using the subcommand.
Use dgndos to copy files to and from Dragon DOS formatted disk images and your host file system. It works on raw, JVC, VDK, DMK and SDF images, and an image can lack any sectors a command doesn't need. A file on a disk is named <disk>,<file>.
Filenames follow the rules of Dragon DOS: up to 8 of A-Z, 0-9 and "-", then optionally "." or "/" and up to 3 more. Lower case is made upper. Extra characters in the first part are ignored, along with all that follows them. Extra characters in the extension are an error.
attr {[<opts>]} {<file> [<...>]} {[<opts>]}
-p protect the file
-u unprotect the file
With no options, each file is reported as protected or not. A protected file can't be written to, renamed or deleted.
copy {[<opts>]} <srcfile> {[<...>]} <target> {[<opts>]}
-l perform end of line translation
-r rewrite if file exists
-t perform BASIC token translation
A target of <disk>, or a host directory takes each file under its own name. Allocation follows the algorithm of the Dragon DOS 1.0 ROM.
An existing file on the host that is or looks like a disk image is never replaced, even with -r. The copy is refused, and says why. A file looks like one if it has the extension .dsk, .vdk, .dmk, .sdf, .jvc, .os9, .img or .ima, has the header of a disk image format, or is at least a track long (4608 bytes) and a whole number of sectors. This guards against dgndos copy file disk.vdk where disk.vdk, was meant. Other host files are replaced without -r.
A file that doesn't fit is removed, and the error reported.
With -t, a file with the header of a saved BASIC program is listed as text, with its lines ending the way the target's system ends them. Anything else is taken to be a program's text, and is tokenized as Dragon BASIC with Dragon DOS would, giving the same file as its SAVE command. Lines must have ascending numbers, and only upper case is recognized as a keyword. Dragon BASIC's tokens differ from those of Color BASIC.
dgndos copy game.bin disk.vdk,GAME.BIN
dgndos copy -l notes.txt readme.txt disk.vdk,
dgndos copy disk.vdk,GAME.BIN game.bin
dgndos copy -t program.txt disk.vdk,PROGRAM.BAS
dgndos copy -t disk.vdk,PROGRAM.BAS program.txt
dir {[<opts>]} {<disk> [<...>]} {[<opts>]}
Each file is listed with its name, extension, a P if it is protected, and its size in bytes.
Directory of: disk.vdk,
HW1 BAS . 41
HW2 BAS P 41
2 files, 682 sectors free (174592 bytes)
Entries in sectors that can't be read don't stop the rest being listed, but the first error is reported afterwards.
dsave {[<opts>]} {[<source>]} <target> {[<opts>]}
This command will work on Dragon DOS disk image files as well as host files.
| -e | actually execute commands |
| -l | perform end of line translation on copy |
| -r | force rewrite on copy |
| -t | perform BASIC token translation |
| -x=path | dgndos executable to run the commands with, rather than the one the shell finds |
The dsave command copies each file from a disk or directory to another. It runs dgndos copy to do the copying, and by default the shell finds dgndos as it would any command. Use -x to name the one to use, such as the one you just built. Without -e it only shows the commands. If a command fails, dsave stops and exits with its status.
Dragon DOS has no directories, so a source directory that holds one is refused when dsave reaches it.
dgndos dsave -e disk.vdk, saved
dgndos dsave -e -x=build/unix/dgndos/dgndos saved disk.vdk,
dskinit {[<opts>]} <disk> {[<...>]} {[<opts>]}
-t<num> = tracks, 21 to 80 (default 40)
-s<num> = sides, 1 or 2 (default 1)
-f<name> = image format: raw, jvc, vdk, dmk or sdf
Without -f, the format comes from the disk's extension, and otherwise it is raw. An existing file is not replaced. Disks are formatted as the DSKINIT command of Dragon DOS does, except that an 80 track single sided disk has all of its sectors free, as SuperDOS makes them. Dragon DOS 1.0 leaves half of such a disk used.
The tracks of a DMK or SDF image are laid out like a disk formatted by Dragon DOS in MAME: each starts with an index mark, and its sectors are numbered 1, 10, 2, 11 and so on around the track.
dgndos dskinit disk.vdk
dgndos dskinit -t80 -s2 -fdmk big.img
dump {[<opts>]} {<file> [<...>]} {[<opts>]}
-a dump output in assembler format (hex)
-b dump output in assembler format (binary)
-c don't display ASCII character data
-e dump output in C format
-t don't display header
-h don't display header (deprecated, use -t)
-l don't display line label/count
-z decode DECB or Dragon DOS binary
This is the same dump command as in the os9 and decb tools. With -z, a file with the header SAVE writes is decoded: its data is shown at its load address, followed by its execution address. Dragon DOS files hold a single block, unlike Disk BASIC's.
free {[<opts>]} {<disk> [<...>]} {[<opts>]}
fstat {[<opts>]} {<file> [<...>]} {[<opts>]}
Extents are listed as [LSN:sectors].
A file saved by the SAVE command starts with a 9 byte header, which holds its type, load address, length and exec address. These are shown for a file that has one. Dragon DOS does not record a file's type anywhere else: its directory has no type or ASCII flag.
File Information for disk.vdk,HW1.BAS
Filename : HW1.BAS
Protected : No
File size : 41 bytes
First entry : 0
Extents : [324:1]
Directory entries : 1
File type : 1 (BASIC program)
Load address : $2401
Data length : 32 bytes
Exec address : $8B8D
Other files show File header : None, and Unreadable if the image lacks the file's first sector.
kill {[<opts>]} {<file> [<...>]} {[<opts>]}
list {[<opts>]} {<file> [<...>]} {[<opts>]}
-t perform BASIC token translation
Carriage returns are shown as the host's line endings. With -t, a saved BASIC program is listed as Dragon BASIC would. A file that isn't one is an error.
dgndos reveal <disk> <lsn>[:<offset>]
dgndos reveal -b <disk> <byte-offset>
Explain a zero-based logical sector number, optionally with a byte offset from 0 through 255. On double-sided disks, each track's side 0 precedes side 1. Reveal describes allocation bitmap bytes and their sector ranges, geometry fields, directory flags, filenames, extent fields, continuation pointers, and last-sector byte counts. It identifies both the primary directory on track 20 and its backup on track 16, using the recorded bytes of the selected copy. File lookup uses the library's normal backup-directory recovery.
For file data, Reveal follows extents and continuation entries to report the filename and byte position, including unused allocation space past EOF. For unclaimed sectors it reports whether the bitmap marks them allocated or free. Missing sectors, unreadable metadata and corrupt continuation chains are reported, and chain traversal is bounded.
With -b, the offset is absolute within the image file. Reveal describes image
and track headers, sector ID fields, CRCs, attributes and gaps, then explains
the filesystem location when the byte belongs to sector data. Raw, DMK, SDF,
VDK and JVC images are supported, with one or two sides. Numbers accept decimal
or a 0x hexadecimal prefix.
rename {<file> <newfilename>}
dgndos rename disk.vdk,OLD.BAS NEW.BAS