VICE is provided with a complete stand-alone disk image maintenance
utility, called c1541
.
The syntax is:
c1541 [IMAGE1 [IMAGE2]] [COMMAND1 COMMAND2 ... COMMANDN]
IMAGE1
and IMAGE2
are disk image names that can be
attached before c1541
starts. c1541
can handle up to
two disk images at the same time by using two virtual built-in drives,
numbered 8
and 9
; IMAGE1
(if present) is always
attached to drive 8
, while IMAGE2
is attached to drive
9
.
COMMAND
s specified on the command-line all begin with the minus
sign (-
); if present, c1541
executes them in the same
order as they are on the command line and returns a zero error code if
they were successful. If any of the COMMAND
s fails, c1541
stops and returns a nonzero error code.
If no COMMAND
s are specified at all, c1541
enters
interactive mode, where you can type commands manually. Commands in
interactive mode are the same as commands in batch mode, but do not
require a leading -
.
As with the monitor, file name completion and command line editing with history are provided. Use the command `quit' or press C-d to exit.
When accessing CBM DOS files (i.e. files that reside on disk images),
c1541 uses a special syntax that lets you access files on both drive 8
and 9. If you prepend the file name with @8:
or @9:
, you
will specified that file is to be found or created on drive 8 and 9,
respectively.
For instance,
@8:somefile
will name file named somefile
on unit 8, while
@9:somefile
will name file named somefile
on unit 9.
You can use quotes ("
) in a command to embed spaces into file
names. For instance,
read some file
will read file some
from the disk image and write it into the
file system as file
, while
read "some file"
will copy some file
into the file system, with the name
some file
.
The backslash character (\
) has a special meaning too: it lets
you literally insert the following character no matter what it is. For
example,
read some\ file
will copy file some file
into the file system, while
read some\ file this\"file
will copy some file
into the file system with name
this"file
(with an embedded quote).
This is a list of the c1541
commands. They are shown in their
interactive form, without the leading -
.
Square brackets [] indicate an optional part, and "<COMMAND>" translates
to a disk command according to CBM DOS, like "i0" for example.
@ [<command>]
command
is specified, just print the status.
? [<command>]
attach <diskimage> [<unit>]
diskimage
to unit
(default unit is 8).
bam [<unit>] | <track-min> <track-max> [<unit>]
unit
, optionally displaying only the entries for
track-min
to track-max
bcopy <src-trk> <src-sec> <dst-trk> <dst-sec> [<src-unit> [<dst-unit>]]
bfill <track> <sector> <value> [<unit>]
block <track> <sector> [<offset> [<unit>]]
bpoke [@unit:<unit>] <track> <sector> <offset> <data ...>
data
into a block. The data
can be
specified using prefixes:
0b or %
&
0x or $
bpeek [@unit:<unit>] <track> <sector> [<start> [<end>]]
track,sector
.
bread <filename> <track> <sector> [<unit>]
filename
.
bwrite <filename> <track> <sector> [<unit>]
filename
as input. At most 256
bytes are written to the disk image.
cd <dir>
dir
.
chain <track> <sector> [<unit>] | <filename>
track
, sector
), or alternatively use filename
to show the block chain of a file in the directory. The last number
shown is the number of bytes used in the final block.
copy <source1> [<source2> ... <sourceN>] <destination>
source1
... sourceN
into destination. If N > 1,
destination
must be a simple drive specifier (@n:
).
To copy a REL file, specify the <source> with a ,L
file type suffix.
delete <file1> [<file2> ... <fileN>]
disable-libdebug-output
exit
quit
).
entry [+side] <file1> [<file2> ... <fileN>]
+side
option is present, and it is a RELative file,
it also shows all side sectors.
extract
format <diskname,id> [<type> <imagename>] [<unit>]
unit
is specified, format the disk in unit unit
. If
type
and imagename
are specified, create a new image named
imagename
, attach it to unit 8 and format it. type
is a
disk image type, and must be either x64
, d64
(both VC1541/2031),
g64
(VC1541/2031 but in GCR coding), d71
(VC1571),
g71
(VC1571 but in GCR coding), d81
(VC1581), d80
(CBM8050), d82
(CBM8250/1001),
or d90
(CBM D9090).
Otherwise, format the disk in the current unit, if any.
geosread <source> [<destination>]
geoswrite <source>
geosextract <source>
help [<command>]
info [<unit>]
unit
(if unspecified, use the current
one).
list [<pattern>]
dir [<pattern>]
pattern
(default is all files).
name <diskname>[,<id>] <unit>
p00save <enable> [<unit>]
pwd
quit
exit
).
read <source> [<destination>]
source
from the disk image and copy it into destination
in
the file system. If destination
is not specified, copy it into a
file with the same name as source
.
By default PRG files are copied. To copy SEQ files add ,s
(i.e. the usual DOS file specification syntax).
REL files can be copied by adding ,l
. Don't specify the record length,
c1541
will determine it automatically.
rename <oldname> <newname>
oldname
into newname
. The files must be on the
same drive.
tape <t64name> [<file1> ... <fileN>]
unit <number>
number
the current unit.
unlynx <lynxname> [<unit>]
validate [<unit>]
unit
. If unit
is not specified,
validate the disk in the current unit.
verbose ["off"]
version
write <source> [<destination>]
source
from the file system into destination
on a
disk image.
To create a REL file, you must specify the destination
including the
record length.
As a special convenience, you can give it in decimal.
Example: write fsname imgname,l,100
Note that the size of the file may be rounded up to fill the last sector.
unzip <d64name> <zipname> [<label,id>]
1!zipname
, 2!zipname
, 3!zipname
and
4!zipname
.
If you want to execute a shell command from within c1541
, just
prepend it with an exclamation mark (!
). For example,
!ls -la
will execute the command ls -la
, which will show you all the
files in the current directory.
c1541 -attach test.d64 -list
test.d64
and show directory.
c1541 -attach test.d64 -write test.prg testfile
test.prg
to test.d64
as testfile
.
c1541 -format "name,id" d64 disk.d64
d64
format, format it with the name
and id
and save it to disk.d64
.
c1541 opencbm -list
Go to the first, previous, next, last section, table of contents.