The IDE64 Project
IDE64
INTERFACE CARTRIDGE
user's guide
2004.Oct.11 preview
IDE64
for versions V2.1, V3.1, V3.4 and V3.4+!
The ATA / ATAPI controller card for Commodore 64 / 128 computers
supporting Hard Disk / CDROM / ZiP drive / LS-120 (A-Drive) / CompactFlash and more

Foreword

This is the official user's guide for the IDE64 interface cartridge V2.1, V3.1, V3.4 and V3.4+ with the upcoming IDEDOS 0.9x. Incomplete but planned parts are marked this way, inserted texts since last version are marked this way, while deleted texts are marked this way.

This document always represents the actual state of development and the facts stated here may or may not apply to future or old versions of IDEDOS or the IDE64 cartridge. Please make sure you have the current version for your software and hardware!

Copyright

Copyright (c) 2003-2004 Kajtár Zsolt (Soci/Singular). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with the no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Disclaimer

All copyrights are held by their by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.

No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies that could be damaging to your system, although any damage is highly unlikely. Proceed with caution; the author(s) do not take any responsibility.



Contents



1 About the IDE64 interface cartridge

The IDE64 cartridge was created to provide the fastest I/O and biggest storage capacity available for the C64 / C128 computers, at cheap price. It's possible to connect and use ATA(PI) devices to a C64 / C128 like hard disks, CDROMs, CompactFlash cards, ZiP drives and LS-120 (A-Drive) just like ordinary disk drives. The IDE64 cartridge contains a 64KiB PEROM (flash EPROM containing IDEDOS, Machine Code Monitor, File Manager and Setup), a 28KiB RAM (used for internal buffers), a realtime clock chip (powered by a battery), two LEDs (to indicate the presence of cartridge and device activity), a Short-BUS for peripherals (like DUART Card, ETH64) and an ispLSI chip.

The IDE64 cartridge is compatible with a wide variety of hardware including (but not limited to):

There are of course incompatible / unsupported hardwares (most notably cracking / fastload cartridges, RamLink, etc.), for more information read the Compatibility at the end of the guide.

The unique architecture of the cartridge allows updating of firmware, so it's possible to be up to date with the latest versions of IDEDOS.

IDEDOS can handle disks / partitions up to 137GB (128GiB). A disk can be divided into a maximal of 16 partitions. Files can be organized into a tree organized directory structure where each directory can contain 1023 files. Maximal file size is 4GiB for regular files and 16MiB for relative files. Filenames can be 16 characters long plus a 3 character file type. Automatic file timestamping is supported.

IDEDOS 0.9x is free software, the source and the tools required to build the firmware are public and available for Linux and Win32. The code is licensed under the GPL-2:


IDEDOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

IDEDOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

You are welcome to review the code and send suggestions / improvements / bugfixes if you want.



IDE64 cartridge

2 Set up and begin using the IDE64 cartridge

Make sure that the computer is powered off. The cartridge must be plugged into the expansion so that the chips are on top as seen on the picture. The ATA(PI) devices are connected with a 40 wire IDE-cable to the port on the end of the cartridge. Make sure that the red line on the cable is at pin 1 on both ends. (pin 1 is usually near the reset button on the cartridge, and on power cord side on the devices) 2 devices can be connected on the cable, one is called master, the other slave. It's important that there's only one master and one slave on a cable, so check the jumper setting of your devices.

The external devices need external power too, so connect them to a pc power supply or something similar. AT-style power supplies will work without problems (some require a minimal load to start, so it may not work alone without any devices). ATX-style supplies require that the green wire is connected to a black one, but do this at your own risk without connecting any devices to the supply to minimize possible damage. (if everything goes well, the cooler must spin up) First test your devices with the supply without connecting to the cartridge to see if everything is ok.

Compact Flash card plugged into the V3.4 or V3.4+ version of the cartridge does not require any external power supply. If you want to use an ATA(PI) device and CompactFlash card at the same time, then configure the device as slave, because the CF card is always master. If using SuperCPU at 20MHz with a slow CF card you may experience 'drive not ready' errors while reading / writing large amount of data (>1000 blocks) in a short time. Either switch to 1MHz or reduce the linear max settings in the CMOS Setup utility.

IDE64 cartridge v3.4

When using a ZiP drive it's important that it's jumpered as Master A or Slave A, otherwise it won't work. (old drives without A marking emulate a hard disk and do not need any special treatment) Note that not every ZiP-drive, cable and cartridge combinations work. It may be necessary to put the drive at the middle of the cable so that the remaining unconnected part of the cable is at least ca. 15cm long.

LS-120 (A-Drive) works fine with regular 720KB / 1.2MB / 1.44MB floppy disks or with the 120MiB superdisk. Disks of CBM1581 / FD2000 / FD4000 are not supported. If disk format is not readable by IDEDOS then use CFSfdisk to create a new filesystem. If using 1.2MB / 1.44MB disk you may experience silent data corruption if multisector write is 12 or more! (see settings in CMOS Setup utility)

Peripherals (duart cartridge, ETH64, etc.) are connected to the other port (called Short Bus) of the cartridge with a 34 wire cable similar to the floppy cable in pcs, but without wire swapping. Peripherals do not require any external power.

There's a battery holder on the back of the cartridge. It's strongly recommended to put a battery into it (3 Volt) otherwise the setup settings can't be permanently stored and the file timestamping won't work. If using accu or super cap instead of battery, then enable recharging in the CMOS Setup utility.

When everything is ready, you may turn on your equipment. It's recommended to first turn on the power supply, then the computer, however if you have devices that do not spin-up until the computer is turned on and your AT-supply does not start without load (giving an annoying noise) you must do this the other way around. If your devices are not detected on power on, try giving HDINIT on the basic prompt. If still nothing, turn off your computer and powersupply, then check the cables and jumper settings. If you suspect that there's some software bug preventing the detection of the device (eg. it works in some other equipment) than contact us on the mailinglist.

If everything is ok the boot screen should come up first (black screen with light-blue characters) with the information on the version of IDEDOS and the connected devices. Then the standard C64 reset screen should appear in less the 30 seconds, depending on the connected devices. Holding down CONTROL will hold the boot up screen, so it can be read. The boot screen only appears on power on, so if you want to auto detect your devices later to see everything is ok use HDINIT. If there's no boot screen just a standard C64 reset screen without the usual "IDE-DOS xxxxx EXPANDED" you may use the wrong version of IDEDOS. (eg. SuperCPU version on C64, C64 version on SuperCPU, config register version on old cartridge) If "30719 BASIC BYTES FREE" appears that means there's no valid IDEDOS burned into the perom of the cartridge. If "CORRUPT PEROM!" message appears instead of regular boot, than consider rewriting your perom using the perom programmer utility.

To use the built in self test of IDEDOS hold down LEFTSHIFT while turning on the computer (or simply use SHIFTLOCK).



3 The CMOS Setup utility

Setup

The IDE64 cartridge has a battery backed up clock with some memory (DS1302) used to store the configuration settings and current time. Of course it works without a battery too using the default settings and no clock. If you do not like the defaults, you can change them here.

The CMOS Setup utility is started by pressing <- + RESTORE while in interactive mode. (like STOP + RESTORE) Moving is done with cursor keys, RETURN selects / changes item, + and - also changes item. C= and STOP exits sub menu, while C= saves setting and STOP discards them in main menu.

Setup does not touch memory range $0800-$FFFF so your work won't lost when need to change some settings.


3.1 Standard setup

Standard setup

General settings.

3.1.1 Date, Time

Here's possible to set the built in clock. This has affect on the DATE command, the file timestamping and on TI$ (see below). The calendar is built in and works in range 1980-2079. (Y2K compatible) The clock ticks while the computer is turned off. (but requires battery)

3.1.2 Start boot file

The file called "1//:BOOT,PRG" can be auto started from the boot drive at power up or always after reset. The file must be executable with RUN. Hold C= if you want to skip auto boot, or hold STOP to skip starting of program.

3.1.3 Boot device

The default drive number (at $BA) after reset can be selected here. (useful for the dos wedge, monitor and auto booting)

3.1.4 Disk fastloader

Use fastloader for the 1541, 1570, 1571 and 1581 floppy drives. (and also fast read and write in manager) If you are using unsupported serial drives then disable this, or ?LOAD ERROR will happen. If drive is capable of JiffyDOS fast protocol then the fastloader is automatically not used.

3.1.5 Set basic clock

Sets TI$ to the time in the built in clock.

3.1.6 Keyboard repeat

Sets keyboard repeat after reset. (at $028A)

3.1.7 Lowercase chars

Upper / lowercase chars after reset or STOP + RESTORE.

3.1.8 Use dos wedge

You may disable it, if you have JiffyDOS installed. For more read the Compatibility!

3.1.9 C128 keyboard

If cartridge has cartconfig register, support is compiled in, and computer is a C128, it makes use of extra keys on keyboard.

Table 1 – C128 extra keys
KeyFunction
ESCCHR$(27)
TABCHR$(9)
ALT-nothing-
HELPEnter monitor
LINE FEEDCHR$(10)
NO SCROLL-nothing-
CURSOR KEYS and NUM PADTheir usual meaning
3.1.10 Direct write

Enables / disables the use of "B=W". Cleared on reset. You may have to enable it when creating filesystem.

3.1.11 Accu charging

Selects accu charging current. Leave it on "Battery" if not using accu or super cap. Charging a battery is useless, and some low quality products may even leak if charged.

3.1.12 CMD emulation

If enabled the returned ROM string for memory-read is different, and "/" is allowed in filenames which makes a difference in path handling. Also the partition listing is changed too.


3.2 Color setup

The default colors of boot screen, manager and monitor can be changed here.

3.3 Device numbers

Drive number setup

Device number mapping to drives. -- means device is disabled.

3.3.1 LCD display

Device number for LCD display connected to short bus.

3.3.2 Serial device x

Device number mapping for serial devices. Selecting 9 for serial device 8, and 8 for serial device 9 will effectively swap them.

3.3.3 IDE x

Useful when programs think device number 8 is the only one.

3.3.4 PC-LINK

Virtual drive. Needs serial / parallel cable and a server program on the PC.


3.4 Advanced setup

Advanced setup

Master / Slave ATA(PI) device configuration.

3.4.1 Power management

Drive spin down time from disabled to 2 hours in 15 steps. Default means do not touch drive's power management settings. (almost all devices support power management) KILL will also spin down the drive if it's enabled.

3.4.2 Retry on error

Tells the device to retry on error.

3.4.3 Write cache

Will speed up writes if supported by device.

3.4.4 Read look-ahead

Will speed up short sequential reads if supported by device. If you set "Linear read max" to it's maximum, this does not affect performance significantly, and it even slows down directory reads. (the look-ahead reads for random positioned directory sectors will flood the drive's cache with unneeded data, and take more time then the single sector reads)

3.4.5 Slow down CDROM

Selects 255 KB/s data transfer rate on CDROMs supporting this. (deactivates the built in jet simulator on 32x or faster CDROMs if enabled) Has no effect on transfer rate, because the cartridge transfers data much slower.

3.4.6 Linear read max

Maximal sequential read allowed by the device. (setting it lower than 128 will degrade the performance of CFS filesystem greatly!) You should decrease it from 128 if you get ?LOAD ERROR when loading a big program. (this is very unlikely)

3.4.7 Linear write max

Same as above but for write operations.

If using LS-120 with 1.2MB / 1.44MB disk then set this less then 12 (eg. 11) or data corruption may happen! (at least it happens on a rev.05 drive with 1.44MB disks, but fortunately 720KB and 120MiB disks are not affected. 1.2MB disk may work with a setting of 12)

3.5 Restore defaults

Does restore the default settings.

3.6 Save & exit

Save changes and exit CMOS setup. (same as pressing C=)

3.7 Discard & exit

Forget changes and exit setup. (same as pressing STOP)



4 Preparing a blank disk

To use a new disk with IDE64 you must first create the filesystem on it. IDEDOS has it's own filesystem called CFS. It allows to use disks up to 128 GiB, files up to 4GiB with holes and fast seeking, relative files up to 16MiB, 16 partitions, unlimited directories and files (only limited by the capacity of disk), customizable file types, and new file permissions.

To create the filesystem on a hard drive or ZiP drive use the provided format utility. It allows to create partitions, change partition flags and create filesystems on them. First set the "Direct write" option in the setup utility to enabled, then start the format utility. Follow the instructions. Don't forget that formatting a partition will erase all data on it permanently!

CDROM device do not need any special treatment, just use ISO9660 / Joliet format CDs to be able to read them. (Rock Ridge Extensions are not supported, these CDs will have short filename unless Joliet extension is also present) Multisession and mixed format disks are both supported. Everything after the last dot or after the last comma will be used as file type.

Floppy disks may require physical format before the creation of the filesystem. Use the format ("N") command described in the Command channel chapter.

4.1 The format utility

The partitioner tool and the CFS filesystem creator is integrated into one executable called CFSfdisk. First it was a prototype utility running on GNU/Linux systems, then it was ported to C64 with the CC65 compiler.

Before partitioning / formatting go into setup and change 'Direct write' to enabled. Then load and start CFSfdisk.
CFSfdisk version 7
Copyright (C) 2001-2004 Kajtar Zsolt
(Soci/Singular)

CFSfdisk comes with ABSOLUTELY NO
WARRANTY; for details see LICENSE.
This is free software, and you are
welcome to redistribute it
under certain conditions; see LICENSE
for details.

Drive number (4-30): 
CFSfdisk is released under the GPL-2, the C source can be downloaded with the IDEDOS source. OK, first it needs to know what the drive's number is you want to format. It's usually 12 or 13, see your setup settings on device number assignment for master / slave device. Remember that there will be no changes made on disk unless you exit with command 'w'.
For LBA disks only the LBA sectors
matters, for CHS ignore LBA sectors.

Cylinders (1-65536, default 1244):
Heads (1-16, default 16):
Sectors (1-255, default 63):
LBA available (Y/N, default Y):
LBA (256-268435456, default 1253952): 
Usually the auto detected defaults are ok, so you can just press enter for these questions. If not, enter the correct values.
Did not found any CFS partition entry in
PC BIOS partition table.
I assume you want to use the whole disk.
If you want to share the disk with other
operating systems, use the fdisk
utility, and make a partition entry
with type 0xCF.

Creating new disklabel.
It's possible to share disk with other (pc) operating systems, and because there was no partition marked for IDEDOS usage, the disk will be repartitioned so that the whole disk will be used by IDEDOS. It you only want to use a part of the disk for IDEDOS first create a partition with type 0xCF. (those familiar with the util-linux fdisk utility will know what I'm talking about for sure...) Anyway if you won't ever use this disk with anything else but a C64 then ignore the crap above ;-)
Creating new partition table.
A new empty C64 partition table was created. (inside the PC BIOS partition entry with type 0xCF)
Command (m for help): m
Command action
   a   select boot partition
   d   delete a partition
   g   set global disklabel
   h   toggle hidden flag
   l   toggle lbamode
   m   print this menu
   n   add new partition
   o   create an empty partition table
   p   print the partition table
   r   toggle writeable flag
   t   change partition's type
   q   quit without saving changes
   w   write table to disk and exit
Typing 'm' list possibilities. There are no partitions yet, so let's create one.
Command (m for help): n
Partition number (1-16): 1
Start (4-1253952, default 4):
End or +x or +xG or +xM or +xK or +x%
(10-1253952, default 1253952): +50%
Partition's name: stuff
This creates partition 1 called 'stuff' beginning on the start of the disk, and it will fill the half of the disk. (~300MiB) It's possible to give the exact start and end position or the size of the partition in sectors (eg. +2342) for power users. For everyday use +1048576K or +1024M or +1G creates an example partition with a size of 1 GiB. (metrics are powers of 1024, not 1000!) +25% means ¼ of the maximal partition size possible in this extent.
After adding some more partitions, the partition table will look like this:
Command (m for help): p

Drive 12: 1253952 sectors
Disklabel: "                "

Nr Boot Flags     Start       End
   Blocks   Id  System  Name
 1   *   --           4    626977
   313487    1  CFS     stuff
 2       --      626978    831777
   102400    1  CFS     work
 3       --      831778    864545
    16384    1  CFS     geos
 4       --      864546   1253952
   194703+   1  CFS     backup
Now let's change the global disklabel, and the default boot partition (I like to start at the work partition after boot). As you can see the listing above is not very readable as this program was designed for 80 column screen... The start and end of partition is displayed in sectors, while the partition size is displayed in KiB.
Command (m for help): g
New disklabel: soci's disk

Command (m for help): a
Partition number (1-16): 2

Command (m for help): p

Drive 12: 1253952 sectors
Disklabel: "soci's disk     "

Nr Boot Flags     Start       End   Blocks   Id  System  Name
 1       --           4    626977   313487    1  CFS     stuff
 2   *   --      626978    831777   102400    1  CFS     work
 3       --      831778    864545    16384    1  CFS     geos
 4       --      864546   1253952   194703+   1  CFS     backup
Partition 3 will be used by GEOS (I hope the correct driver for GEOS will be available someday), so I'll change the partition type for it, and add the hidden flag, because it's not readable by IDEDOS anyway.
Command (m for help): t
Hex code (type L to list codes): l

 0  Empty
 1  CFS
 2  GEOS
Hex code (type L to list codes): 2

Command (m for help): h
Partition number (1-16): 3

Command (m for help): p

Drive 12: 1253952 sectors
Disklabel: "soci's disk     "

Nr Boot Flags     Start       End   Blocks   Id  System  Name
 1       --           4    626977   313487    1  CFS     stuff
 2   *   --      626978    831777   102400    1  CFS     work
 3       H-      831778    864545    16384    2  GEOS    geos
 4       --      864546   1253952   194703+   1  CFS     backup
Now it's ready, let's format (or you can use 'q' to abort):
Command (m for help): w

Formatting partition 1...done.
Formatting partition 2...done.
Formatting partition 4...done.
Done.
The maximal formatting of a 134GB partition takes ca. 28 mins. After filling partition 4 with lot of important stuff, let's mark it read only. Load the CFSfdisk utility and start it.
Command (m for help): r
Partition number (1-16): 4

Command (m for help): p

Drive 12: 1253952 sectors
Disklabel: "soci's disk     "

Nr Boot Flags     Start       End   Blocks   Id  System  Name
 1       --           4    626977   313487    1  CFS     stuff
 2   *   --      626978    831777   102400    1  CFS     work
 3       H-      831778    864545    16384    2  GEOS    geos
 4       -R      864546   1253952   194703+   1  CFS     backup

Command (m for help): w

Done.

CFSfdisk auto detects CHS / LBA disks, so you don't have to worry about this (at least on C64). But if want to change it, use 'l'. The current setting is visible in the ' Drive xx:' line, if there are numbers about cylinders, etc. then the disk is in CHS format.

If you only want to reformat a partition without deleting / re-adding it just change it's type to CFS even if was already in CFS format.



5 Using partitions

When using a new disk at least 1 partition must be created. Partitions provide the highest level of organizing data. Each partition has it's own filesystem, so possible disk / software errors can't destroy the whole data at once. It's also possible to select the default partition on boot, set the global disklabel, partition names and partition attributes (hidden / read only) with the format utility. The read only attribute is useful to prevent accidental changes to a filesystem.

Examples:
Listing available partitions. '*' indicates default partition, '<' indicates read only partition. Hidden partitions are not listed.
@$=P

255 "SOCI'S DISK     " IDE64
1    "STUFF"            CFS
2    "WORK"            *CFS
4    "BACKUP"           CFS<
3 PARTITIONS.
READY.
 
Selecting partition 4 as working partition:
@CP4
02, PARTITION SELECTED,004,000,000,000
READY.
 
Selecting partition 1 as working partition the other way:
OPEN 15,12,15,"C"+CHR$(208)+CHR$(1):CLOSE15
READY.
 
Load a file from partition 2 from the directory '/GT'. More about paths later in chapter Paths.
LOAD"2//GT/:FILE"

SEARCHING FOR 2//GT/:FILE
LOADING $0801-$0932
READY.
 


6 Using directories

A directory is a list of files. To view the directory use LOAD"$" then LIST, DIR, or @$. Of course LOAD will overwrite the current program in memory, while the last 2 methods will preserve your work.

The number before the first line is the partition number, it's followed by the directory's name, finally the ID string like IDE64. The following lines provide informations about the size of each file in 256 byte blocks (so 4 blocks are 1KiB), the name of the file enclosed in quotation marks, and it's file type at the right side. The last line shows the total block count of all files in the list.

Example:
A directory list:
LIST

2 "TEST            " IDE64
0    "PLUGINS"          DIR
40   "BOOT"             PRG
2    "CONFIG EXT"
5    "TOD"              ASM
23   "VIEWER"           PRG
70 BLOCKS USED.
READY.
 

Putting a few thousand files in one long directory is not an optimal way of organizing data, so IDEDOS provides 'subdirectories'. Subdirectories look like normal files with file type DIR in directory listings. Directories are organized into a tree like structure starting from the root directory. The root directory is the top level directory, it's parent directory is itself. After boot this directory is selected as the working directory. The working directory is the directory which is used when no path is given in the filename just like in LOAD"$". Managing directories is done via channel #15 commands, but these examples will use the DOS Wedge to simplify things. (more about the channel #15 commands and the DOS Wedge later)

Examples:
Creating a subdirectory
@MD:DIRNAME
Changing the working directory
@CD:DIRNAME

@/DIRNAME
Changing the working directory to the parent directory
@CD<-

@CD:..

@/..
Removing empty subdirectory
@RD:DIRNAME

6.1 Paths

Each file in the tree structure can be reached with a 'path'. The path is composed from the name of the directories separated by a slash character.

Here's an example directory structure:
    ROOT-DIR
    /  |  \
   /   |   \
  A    B    C
  |        / \
  |       /   \
  F      E     D

Let's say the working directory is 'C' now. To load a file from directory 'E' use the following: LOAD"/E/:FILE". This is a relative path. It's also possible to specify the location of a file from the root directory, it's called absolute path: LOAD"//C/E/:FILE". As it seems the path is enclosed between 2 slashes before a semicolon, after it is the name of file. In the last example the real path was '/C/E' where the slash before C indicates the it's an absolute path.

Now let's compose a relative path, but now our working directory is 'F': LOAD"/../../C/E/:FILE". There's no directory named '..' in the graph, as this is a special directory, and it means the parent directory. That's why 'CD:..' means change to parent directory in some previous example. There's another special directory called '.' which means the directory itself. These 2 special directories always exists.

To embed the partition number into the filename place it before the path, eg. '13/C/:E'.

Examples:
The directory structure above can be created by the following program:
10 OPEN 15,12,15
20 PRINT#15,"CD//"             :REM GOTO ROOT-DIR
30 PRINT#15,"MD:A"             :REM CREATE A
40 PRINT#15,"MD/A/:F"          :REM CREATE F
50 PRINT#15,"MD:B"             :REM CREATE B
60 PRINT#15,"CD:B"             :REM ENTER B JUST FOR FUN
70 PRINT#15,"MD//:C"           :REM CREATE C
80 PRINT#15,"MD//C/:E"         :REM CREATE E
90 PRINT#15,"MD/../C/./E/../:D":REM CREATE D ;-)
100 CLOSE 15
This small program lists all files in the working directory and in it's subdirectories (recursive directory listing). The level of a directory in the tree is illustrated by the amount of tabulation before the file listing.
10 OPEN 15,12,15
20 A=A+1:OPEN A,12,0,"$":GET#A,A$,A$
30 GET#A,A$,A$,A$,B$:A$=A$+CHR$(0):B$=B$+CHR$(0):IF ST THEN 130
40 PRINT TAB(A*2-2);ASC(A$)+ASC(B$)*256;:B=1:D$="":N$=""
50 GET#A,A$:IF A$="" THEN 110
60 PRINT A$;:IF A$=CHR$(34) THEN B=B+1:GOTO 50
70 ON B GOTO 50,80,90
80 N$=N$+A$:GOTO 50
90 IF A$<>CHR$(32) THEN D$=D$+A$
100 GOTO 50
110 PRINT:IF D$="DIR" THEN PRINT:PRINT#15,"CD:"+N$:GOTO 20
120 GOTO 30
130 CLOSE A:A=A-1:IF A THEN PRINT#15,"CD"CHR$(95):PRINT:GOTO 30
140 CLOSE 15

6.2 Wildcards

It's possible to filter directory listings to show only a subset of files in a directory by using wildcards. There are 2 different wildcards: '?' matches exactly one character, while '*' matches any number of characters. These wildcards can be used in path elements or filename too, in this case the first filename will be matched. To filter directory listing by file type append '=TYP' to the filename.

Examples:
List files starting with 'A'.
LOAD"$A*"

SEARCHING FOR $A*
LOADING $0801-$08DF
READY.
LIST

1 "PICTURES        " IDE64
132  "ALIEN BAR BY WEC" FUN
29   "ALIEN-LIFE BY MB" SHI
132  "ALLEY BY MIKE"    FUN
132  "ANGEL BY FZ"      FUN
72   "ARNIE BY AMN"     DRL
497 BLOCKS USED.
READY.
 
List files ending with 'DEPACKER'.
@$*DEPACKER

1 "UTILITIES       " IDE64
9    "DMC 5.0 DEPACKER" PRG
10   "DMC 5.1 DEPACKER" PRG
19 BLOCKS USED.
READY.
 
List files containing 'PLAYER'.
@$*PLAYER*

1 "UTILITIES       " IDE64
0    "MUSIC PLAYER"     DIR
9    "CD PLAYER 1"      PRG
12   "CD PLAYER 3"      PRG
12   "CD PLAYER 4"      PRG
77   "CUBIC PLAYER"     PRG
110 BLOCKS USED.
READY.
 
List 4 character long filenames.
@$????

1 "UTILITIES       " IDE64
0    "DEMO"             DIR
0 BLOCKS USED.
READY.
 
List files starting with 'K' and file type 'D64'
@$K*=D64

1 "DEMOS           " IDE64
683  "KJU"              D64
683  "KRESTAGE 2"       D64
768  "KRESTOLOGY 1"     D64
768  "KRESTOLOGY 2"     D64
683  "KRESTOOLS"        D64
3585 BLOCKS USED.
READY.
 


7 Using files

Files store programs and data on disk. Traditionally files could only be accessed sequentially like on tape, but later relative files appeared with fixed record lengths on disk drives. Using IDEDOS with the CFS filesystem it's now possible to use randomly accessible files up to 4 GiB without the fixed record length limitation. Relative files are also available for compatibility reasons, these are limited to 16 MiB. There's also a special purpose file called link, which can be used to reference other files.

At maximum there can be 32 files open. (this includes all files, even on non-IDE64 drives) IDEDOS has 10 buffers for it's own files, these are shared between the IDE64 devices. IDEDOS supports opening of multiple files for write too, but keep in mind that each file locks a 2MiB part of the partition, which means that on partitions smaller than 2MiB (like on 1.44MB disk) there can be only 1 file opened for write at the same time, and the next opening/creation attempt will fail with a disk full error. This should be no problem on big partitions except the partition is near full.

Opened files are locked, they cannot be removed until they are not closed. This applies to directories too, the current working directory cannot be removed even if it's empty.

In the format description everything between "[" and "]" is optional, and <name> means a parameter.

7.1 Normal files

Normal files are the most common on disk, they can be created by SAVE or OPEN and read back later by LOAD and OPEN, GET#, INPUT#.

7.1.1 SAVE

The basic command SAVE (and also the similar kernal call) has the following format:

SAVE"[[@][<partition>][<path>]:]<filename>[,<type>]"[,<device>]

Wildcards ("?", "*") and the characters ":", "," and "=" are not allowed in filename. The file type has the same limitations plus it can't contain space or "<". The resulting file will be deletable, readable, writable, loadable, and not hidden. The directory, the partition and the disk must be writable where the file is created, and the file must be deletable if replaced.

Examples:
Simple save into current drive, current partition and into working directory, the result is "A" with file type PRG.
SAVE"A"
This will save file B with file type DAT on drive 12 to partition 3 to directory "/A". If it's exists it will be first removed.
SAVE"@3//A/:B,DAT",12
Will overwrite the first file in working directory beginning with A. File type is not changed. Wildcards are only allowed if replace is used! ("@:")
SAVE"@:A*"
7.1.2 LOAD

The basic command LOAD has the following format:

LOAD"[[<part>][<path>]:]<fname>[,<type>]"[,<device>[,<mode>]]

The file must be loadable. (the executable flag must be set) For directory load the directory must be readable.

Examples:
Simple load from current drive, current partition and from working directory. As file type is not specified the first will be loaded. The starting address will be ignored. (no mode specified means mode 0)
LOAD"A"
This will load file B with file type PIC from drive 13 from partition 4 from directory "/A". It will be loaded to the load address included in file (first 2 bytes), because mode is not 0.
LOAD"4//A/:B,PIC",13,1
This will load the directory listing containing only PRG files as a basic program.
LOAD"$*=P",12
7.1.3 OPEN

Unfinished...



8 Direct access

By using direct access commands you can read / write any sector of disk. Common use of direct access commands is to access unknown filesystems, manage the partition table and to create the filesystem. It's also important in disk editor applications.

To use direct access, you need to open 2 channels, one for commands, and one for data. The command channel can be opened with the usual OPEN <lfn>,<device>,15. The data channel is opened similar to opening normal files, except that the file name must be a hash sign. (OPEN <lfn>,<device>,<channel>,"#") The channel number must be greater than 1. This 'file' will be a circular data buffer holding 512 or 2048 bytes depending on the device used. The end of buffer can be found by checking the variable ST.

8.1 BLOCK-READ

The block-read command reads the specified sector into the buffer and sets the buffer pointer to the start of buffer. It can also be used to get the ATA(PI) device identity information to find out the geometry, model number, etc. as described in ATA(PI) standards.

8.1.1 Reading from a CHS-ATA device
PRINT#<command lfn>,"B=R"; CHR$(<data channel>); CHR$(HEAD); CHR$(CYLINDERBITS8TO15); CHR$(CYLINDERBITS0TO7); CHR$(SECTOR)
8.1.2 Reading from a LBA-ATA or ATAPI device
PRINT#<command lfn>,"B=R"; CHR$(<data channel>); CHR$(64 OR (LBABITS24TO27)); CHR$(LBABITS16TO23); CHR$(LBABITS8TO15); CHR$(LBABITS0TO7)
8.1.3 Getting device identity
PRINT#<command lfn>,"B=R"; CHR$(<data channel>); CHR$(0); CHR$(0); CHR$(0); CHR$(0)

8.2 BLOCK-WRITE

The block-write command writes the buffer content to the specified sector and sets the buffer pointer to the start of buffer.

8.2.1 Writing to a CHS-ATA device
PRINT#<command lfn>,"B=W"; CHR$(<data channel>); CHR$(HEAD); CHR$(CYLINDERBITS8TO15); CHR$(CYLINDERBITS0TO7); CHR$(SECTOR)
8.2.2 Writing to a LBA-ATA or ATAPI device
PRINT#<command lfn>,"B=W"; CHR$(<data channel>); CHR$(64 OR (LBABITS24TO27)); CHR$(LBABITS16TO23); CHR$(LBABITS8TO15); CHR$(LBABITS0TO7)

8.3 BUFFER-POINTER

The buffer pointer selects individual bytes in the buffer. Reading and writing will start on the buffer position and the buffer pointer will be incremented by the number of bytes read / written.

8.3.1 Selecting a byte
PRINT#<command lfn>,"B=P"; CHR$(<data channel>); CHR$(POSITIONBITS0TO7); CHR$(POSITIONBITS8TO15)

8.4 TOC-READ

The TOC (Table Of Contents) holds additional information about the disk. The various formats of TOC is not described here, it can be found in the SCSI-MMC standard.

8.4.1 Reading TOC from a CD
PRINT#<command lfn>,"B=T"; CHR$(<data channel>); CHR$(<format>); CHR$(<starting track>)
Table 2 – Bits of TOC format
BitMeaning
6..7Format (00=Formatted TOC, 01=Multi-session info, 10=Raw, 11=Reserved)
2..5Unused
10=LBA, 1=MSF (Minute, Second, Frame)
0Unused
Examples:
This example reads in the boot sector and prints out the CFS identification string. (CHS disk, CFS filesystem). For LBA or ATAPI devices modify line 20:
20 PRINT#15,"B=R"CHR$(4)CHR$(64)CHR$(0)CHR$(0)CHR$(0)
10 OPEN15,12,15:OPEN4,12,4,"#" 
20 PRINT#15,"B=R"CHR$(4)CHR$(0)CHR$(0)CHR$(0)CHR$(1)
30 PRINT#15,"B=P"CHR$(4)CHR$(8)CHR$(0)
40 FORA=0TO15:GET#4,A$:PRINTA$;:NEXT 
50 CLOSE4:CLOSE15
This example prints some information from the device using the device identity.
10 OPEN15,12,15:OPEN4,12,4,"#"
20 PRINT#15,"B=R"CHR$(4)CHR$(0)CHR$(0)CHR$(0)CHR$(0)
30 PRINT#15,"B=P"CHR$(4)CHR$(46)CHR$(0)
40 PRINT"FIRMWARE REVISION:":B=4:GOSUB90
50 PRINT"MODEL NUMBER:":B=20:GOSUB90
60 PRINT#15,"B=P"CHR$(4)CHR$(20)CHR$(0)
70 PRINT"SERIAL NUMBER:":B=10:GOSUB90
80 CLOSE4:CLOSE15:END
90 FORA=1TOB:GET#4,A$,B$:PRINTB$A$;:NEXT:PRINT:RETURN


9 The File Manager

Manager

IDE File Manager is a software for copying, deleting, renaming, making directories, and starting programs. Working with this program is very easy. Start it from BASIC typing command MAN.

The screen is divided into 2 parts called "panel"s, each containing a directory listing, with the maximal number of displayable files of 510/panel. The black line is the file selector, which can be moved by the CRSR and F<x> keys. Selecting the active panel is done by the CONTROL keys. The right side of each panel shows the sum of selected files block count, the number of selected files, the used / free blocks in directory / disk and the drive number with the current partition. The current directory path is displayed on the top of screen, while the drive type and disklabel is on top of each panel. Tagging files for operation on multiple files (eg. copying) in done with the DEL key. Recursive directory copying / deleting is also possible. The current drive for a panel is selected by pressing C= together with a number key, and it will select drives 10, 11, ... , 17, 8, and 9.

9.1 Plugins

Plugins are external programs called by the file manager to extend it's functionality. Plugins show text / various graphic formats, play sid files and animations, extract archives and disk images or just fire up an assembler with the file. Plugins are started by pressing RETURN or 3 on a file. When pressing 3 the file called "1//:VIEWER" is started from the boot drive. The action taken when RETURN is pressed is determined by the file called "1//ETC/:MANPLUGINS".

9.1.1 Plugin format

Plugins are machine code files compiled to $1000. When started at $1000 they should display some kind of prompt for getting the filename. The manager starts the plugins at $1003 with the accumulator loaded with the length of filename, the X register with the lower, the Y with the higher byte of the address to the filename. $BA contains the current device number the file is on. The filename always includes the file type separated by a comma on the end.

Example:
A sample plugin framework
	*= $1000

	jmp printc
	jmp start

txt	.text 13,"FILENAME:",0

printc	lda #<txt
	ldy #>txt
	jsr $ab1e       ; print prompt
	ldy #255
oqu	iny
	jsr $ffcf       ; get input
	sta $200,y
	cmp #13
	bne oqu
	tya             ; setup fake manager start
	ldx #<$200
	ldy #>$200

start	jsr $ffbd       ; setup filename ("SD,MOV")
	lda #filenumber ; file number (1-255)
	ldx $ba         ; actual device number
	ldy #secaddy    ; secondary address
	jsr $ffba
	jsr $ffc0       ; open file
        
        ...             ; play movie

        lda #filenumber ; file number (1-255)
        jsr $ffc3	; close file
        rts             ; done

The plugin must not destroy $0002-$0333 badly and must not modify $0800-$0FFF! Please leave the VIC, SID, CIA, etc. after exit of the plugin in a usable state...

9.2 Manager config file

Not done yet.

9.3 Manager keys

Here's the list of keys and their functions in manager:


Table 3 – Manager keys
KeyFunction
<-Exit
CONTROLChange panel
UP / DOWNMove cursor
F1 or LEFTPage Up
F7 or RIGHTPage Down
1Refresh dir
3Execute viewer plugin
5Copy file(s)
6Rename file or directory
7Create directory
8Delete file(s)
9Send disk command
.Go into parent dir
/Go into root dir
DEL(Un)select file
F2 / HOMEGo on top of listing
F8 / CLRGo to end of listing
RETURNEnter directory or LOAD"file",x RUN or start viewer plugin
SHIFT + RETURNLOAD"file",x,1
^Eject media
*Invert file selection
+Select all files
-Deselect all files
C= + numberSelect drive
C= + SHIFTSelect charset
A...ZQuick jump to filename


10 Using the monitor

Monitor

The monitor is designed to be fast and simple, but still useful for debugging and fixing. It's possible to edit every single byte in memory and I/O space without conflicting with internal variables of the monitor itself. Illegal opcodes, 65816 opcodes (emulation mode only) and wildcard searching is included.
The monitor is started by hitting C= + RESTORE at the same time, or by executing a BRK instruction, or pressing LEFTSHIFT + RESET.

If C128 keyboard is enabled it's possible to use HELP to start the monitor.

To recover from died monitor (not very likely) press LEFTSHIFT + RESET. Memory won't get distorted.

To rip from games, etc. press LEFTSHIFT+RESET while the program is running. (not a real freezer, but at least it's possible to rip IFLI pictures...)

C64 version
A few bytes from stack ($1F3-$1FF), the contents of both CIAs, the memory configuration at $00 / $01 and the processor registers (A, X, Y, SR, SP) will be lost, otherwise the memory is not touched. (PC will not have a valid restart address, instead it contains $FCE2)
SuperCPU version
A few bytes from stack ($1F3-$1FF), the contents of VIC registers $D020-$D02E, and zero page addresses $99, $9A will be lost, otherwise the memory is not touched. Due to end of stack corruption you may have problems with the restarted program. (PC will have a valid restart address!) Use SuperCPU reset button, stopping the program for a short time before freeze may be necessary.

To use the monitor like a real freezer monitor you must make sure that the NMI and BRK vectors won't get overwritten in RAM. If so, press C= + RESTORE to freeze the program. The chip states, processor registers and memory is preserved. In the C64 version it's possible to call the monitor even from configurations like 5. (I/O area must be available)


Table 4 – Monitor commands
CommandFunction
@commandDisk command and status
@$Directory
A xxxx NOPAssemble
B xxMemory configuration
BTBacktrace
C start end start2 Compare memory
D {start {end}}Disassemble
,start xx xx xxWrite hex data to memory and disassemble
EC {start {end}}Edit char (binary)
[start xxxxxxxxWrite binary data to memory
ES {start {end}}Edit sprite (binary)
]start xxxxxxxxWrite binary sprite data to memory
F start end xxFill memory with byte
G xxxxExecute at address
H start end xx ? "txt"Search hex / any / ASCII
I {start {end}}Dump memory in ASCII
'start xxxxxxxWrite ASCII data to memory
J {start {end}}Dump memory in screen code
.start xxxxxxxWrite screen code data to memory
K "name"Defreeze memory
L "name" {start}Load memory
M {start {end}}Dump memory in hex and ASCII
O xxActual drive
:start xx xx xx xxWrite hex / ASCII data to memory
RShow registers
;xxxx xx xxChange registers
S "name"Freeze memory
S "name" start endSave memory
T start end start2Copy memory
V "name" {start}Verify memory
XContinue program
QExit to BASIC warm start
<-(left arrow) Push address(es) to astack.
^(up arrow) Pop address from astack.
*Select RAM / ROM

Everything between "{" and "}" is an optional hexadecimal parameter.

Examples:
Print error channel:
@
00, OK,000,000,000,000
 
Send disk command:
@CD:SOURCE
00, OK,000,000,000,000
 
Display directory:
@$T*
2 "TEST            " IDE64
13105"TRANCEANDACID"
5    "TOD"              ASM
13110 BLOCKS USED.
 
Select drive 12. Drive numbers are in hexadecimal. This drive number is used in all disk access commands, the default is the same as the boot drive selected in setup.
O C
 
Print registers. Modify the registers and flags by overwriting the line beginning with ";". ADDR is the address where the program continues (see X!), AC XR YR SP are the accumulator, x register, y register and stack pointer, BK is the currently edited bank selector (see B!), DR is the drive number used in disk access commands (see O!), NV-BDIZC are the processor flags.
R
 ADDR AC XR YR SP BK DR NV-BDIZC
;E5D1 00 00 0A F3 07 0C 00100010
 
Select bank 4. Banks 0-7 have the same meaning like the first 3 bits of $01, banks 8-1E selects the drive's memory with that device number, bank 1F selects VDC memory (C128 only).
B 4
 
Continue program execution at PC.
IDE64 MONITOR

 ADDR AC XR YR SP BK DR NV-BDIZC
;E5D1 00 00 01 F2 07 08 00100010
X 
Try to exit to basic prompt. Useful after hitting a BRK.
BRK EXCEPTION

 ADDR AC XR YR SP BK DR NV-BDIZC
;1230 10 00 0A C6 07 0D 00110000
Q 
Start program at $080D. When program terminates it trys to return to monitor with a BRK.
G 80D 
Enter assembly instructions. Illegal instructions are supported, 65816 instructions are not.
A 1000 EE 20 D0 INC $D020
A1003 4C 00 10 JMP $1000
A1006 B3 30    LAX ($30),Y
A1008 NOP 
Disassembly from last address: D. Disassembly a few lines: D1234. Disassembly till end of memory: D1234-. Disassembly between addresses: D1234-5678. Pressing RETURN on modified hex bytes or on modified disassembly changes memory. (the cursor position selects what happens) To slow down listing hold CONTROL, to stop press STOP, to pause listing press anything else.
D 1000
,1000 EE 20 D0 INC $D020
,1003 4C 00 10 JMP $1000
,1006 B3 30    LAX ($30),Y
Dump memory in hex and ASCII. Press RETURN to enter the modified hex values / ASCII text into memory. Possible parameters are the same as for D.
M E478
:E478 20 2A 2A 2A 2A 20 43 4F  **** CO
:E480 4D 4D 4F 44 4F 52 45 20 MMODORE
:E488 36 34 20 42 41 53 49 43 64 BASIC
:E490 20 56 32 20 2A 2A 2A 2A  V2 ****
Dump memory in ASCII. Press RETURN to enter the modified text into memory. Some ASCII values have the same screen code, so be careful when editing text mixed with code. Possible parameters are the same as for D.
i a0a0
'a0a0 DfoRnexTdatAinput~inpuTdiMreaDle
'a0c0 TgotOruNiFrestorEgosuBreturNreMs
'a0e0 toPoNwaiTloaDsavEverifYdeFpokEpr
'a100 inT~prinTconTlisTclRcmDsySopeNcl
Dump memory in screen code. Press RETURN to enter the modified text into memory. (I* is available for MK7 addicts) Possible parameters are the same as for D.
J 400
.0400     **** COMMODORE 64 BASIC V2 *
.0428 ***
.0450                  64K RAM SYSTEM
.0478  IDE-DOS BETA! EXPANDED
Dump memory in binary. Press RETURN to enter the modified bytes into memory. "." means 0, anything else (no space) 1. Possible parameters are the same as for D.
B 3
EC D008
[D008 ...##...
[D009 ..####..
[D00A .##..##.
[D00B .######.
[D00C .##..##.
[D00D .##..##.
[D00E .##..##.
[D00F ........
Dump memory as sprite. Press RETURN to enter the modified bytes into memory. "." means 0, anything else (no space) 1. Possible parameters are the same as for D.
ES A00
]0A00 ........................
]0A03 ........................
]0A06 ........................
]0A09 ........................
]0A0C ........................
]0A0F ........................
]0A12 ........................
]0A15 ........................
]0A18 ...........#######......
]0A1B .........##########.....
]0A1E .......############.....
]0A21 ......#######.....#.....
]0A24 .....########.....#.....
]0A27 ....########......#.....
]0A2A ....########..#...#.....
]0A2D ....#######...#..##.....
]0A30 .....##.......#..##.....
]0A33 ......#...........#.....
]0A36 ......#...........##....
]0A39 .......#....#......#....
]0A3C ........##...#....#.....
Copy memory from $400-$7FF to $C00-$FFF. Overlapping areas are supported.
T 400 7FF C00
 
Compare memory from $2000-$3FFF with $E000-$FFFF.
C 2000 3FFF E000
 3FC0 3FC1 3FC2
 
Fill memory $2-$FFFF with $00.
B 4
F 2 FFFF 0
 
Do backtrace. $1237, $1233 and $1230 are the caller JSR addresses, $30 is some pushed data.
A1230 20 33 12 JSR $1233
A1233 20 36 12 JSR $1236
A1236 08       PHP
A1237 20 3A 12 JSR $123A
A123A 00       BRK
A123B

G 1230

BRK EXCEPTION

 ADDR AC XR YR SP BK DR NV-BDIZC
;1230 10 00 0A C6 07 0D 00110000
BT
1237 30 1233 1230 7A E3 1009 050E 10
 
Search memory for instructions accessing $277. (? is a 1 character wildcard matching everything)
H E000 FFFF ? 77 2
 E5B4 E5BC EB3C
D E5B4
,E5B4 AC 77 02 LDY $0277
,E5B7 A2 00    LDX #$00
,E5B9 BD 78 02 LDA $0278,X
Search memory for text.
H E000 FFFF "COMM"
 E47E
 
Save memory to disk.
S"SPRITES" 2000 21FF
OK
 
Load memory to disk.
L"SPRITES"
2000-21FF OK

L"SPRITES" 2200
2200-23FF OK
 
Verify memory from disk.
V"SPRITES"
2000-21FF OK

V"SPRITES" 2200
 2312 2313
2200-23FF OK
 
Freeze (saves 64K RAM + I/O) memory to disk. VDC memory is not saved on C128.
S"MYFREEZE"
OK
 
Defreeze memory from disk. (loads 64K RAM + I/O)
K"MYFREEZE"
0000-FFFF OK
 
Look at screen. Useful for finding the video bank after LEFTSHIFT + RESET.
W 
Using astack. Search for something, then put a leftarrow before the address list, press RETURN (push), then list with D uparrow, or with something else (pop). The address stack is 8 deep only.
H E000 FFFF 20 BA FF
<-E1DD E1F0 E22B E23F E24E
D^
,E24E 20 BA FF JSR $FFBA
,E251 20 06 E2 JSR $E206
,E254 20 0E E2 JSR $E20E
D^
,E23F 20 BA FF JSR $FFBA
,E242 20 06 E2 JSR $E206
,E245 20 00 E2 JSR $E200
D^
,E22B 20 BA FF JSR $FFBA
,E22E 20 06 E2 JSR $E206
,E231 20 00 E2 JSR $E200
D^
,E1F0 20 BA FF JSR $FFBA
,E1F3 20 06 E2 JSR $E206
,E1F6 20 00 E2 JSR $E200
D^
,E1DD 20 BA FF JSR $FFBA
,E1E0 20 06 E2 JSR $E206
,E1E3 20 57 E2 JSR $E257
Using print upwards / downwards. (F1, F3, F5, F7). Type D FCE2 then hold F3 till the code before $FCE2 appears. (other keys work similar)
,FCDD D0 02    BNE $FCE1
,FCDF E6 AD    INC $AD
,FCE1 60       RTS
,FCE2 A2 FF    LDX #$FF
,FCE4 78       SEI
,FCE5 9A       TXS
,FCE6 D8       CLD
,FCE7 20 02 FD JSR $FD02
Quick switch between RAM / ROM (bank 4 / 7)
 ADDR AC XR YR SP BK DR NV-BDIZC
;EAB4 03 03 15 EA 07 08 00100101
*
RAM
R
 ADDR AC XR YR SP BK DR NV-BDIZC
;EAB4 03 03 15 EA 04 08 00100101
 


11 DOS Wedge

These are one or two character long commands to speed up some frequently typed command at the basic prompt. Enable / disable this feature in the setup utility.

11.1 @

It sends the parameter (if any) to the last used device and then prints the command channel.

Examples:
Print error channel:
@
00, OK,000,000,000,000

READY.
 
Delete a file:
@S:MYFILE
01, FILES SCRATCHED,001,000,000,000

READY.
 

11.2 @#

Selects the specified device as last used device.

Example:
Select drive 8:
@#8

READY.
 

11.3 @$

Display directory without affecting memory

Example:
List PRG files beginning with "S" ending with ".DRL".
@$S*.DRL=P

1 "TEST            " IDE64
33   "SHUDDER.DRL"      PRG
33 BLOCKS USED.
READY.
 

11.4 / (slash)

Loads a basic file, like LOAD"FILE",<current device>.

Example:
To load a program from directory listing:
@$

1 "TEST            " IDE64
0    "PLUGINS"          DIR
132  "2 PLANETS BY"     FUN
45   "DRAZPAINT 2.0"    PRG
/1   "DRAZLACE V1.0"    PRG
64   "TASM"             PRG
SEARCHING FOR DRAZLACE V1.0
LOADING $0801-$3023
READY.
 

11.5 % (percent)

Loads an assembly file, like LOAD"FILE",<current device>,1.

Example:
To load a program from directory listing:
LIST

1 "TEST            " IDE64
0    "PLUGINS"          DIR
132  "2 PLANETS BY"     FUN
45   "DRAZPAINT 2.0"    PRG
41   "DRAZLACE V1.0"    PRG
%4   "TASM",8           PRG
33   "SHUDDER.DRL"      PRG
SEARCHING FOR TASM
LOADING $9000-$CF00
READY.
 

11.6 ´ (shift 7)

Verifies an assembly file, like VERIFY"FILE",<current device>,1.

Example:
Verify Drazlace:
´DRAZLACE*

SEARCHING FOR DRAZLACE*
VERIFYING $0801-$3023
OK

READY.
 

11.7 ^ (up arrow)

Loads a basic file, like /, and than starts it with RUN.

Example:
Load Drazlace and start it:
^DRAZLACE*

SEARCHING FOR DRAZLACE*
LOADING $0801-$3023
READY.
Ru:

11.8 <- (left arrow)

Saves a basic file, like SAVE"FILE",<current device>.

Example:
To save a program:
<-MYFILE

SAVING MYFILE $0801-$0932
READY.
 

11.9 £ (pound sign)

Loads an assembly file, like %, and than starts it with JMP at it's load address.

Example:
Load and start TASM:
£TASM

SEARCHING FOR TASM
LOADING $9000-$CF00


12 BASIC extensions

Most basic extensions slow down program execution, but this one has some optimizations to avoid the performance hit. In this chapter the new / changed BASIC commands are described.

12.1 CD

Sends change directory to the last used / specified device. (Same as "@CD:PARAMETER")

Example:
CD"GAMES"

READY.
 

12.2 CDCLOSE

Sends close tray command to the last used / specified device. (Same as "@U0>E0") Not very useful, as the tray will be automatically closed on first media access anyway.

12.3 CDOPEN

Sends eject media command to the last used / specified device. (Same as "@U0>E1")

12.4 CHANGE

Sends change device number to the last used / specified device. (Same as "@S-8" or "@S-D")

Example:
Change device 12 to be device 8:
CHANGE12

READY.
 
Change device 8 back:
CHANGE8

READY.
 

12.5 DATE

Prints the date and time of the last used / specified device. For date format see Reading time from RTC! (Same as "@T-RA")

Example:
DATE
THUR 08/12/04 08:51:18 PM

READY.
 

12.6 DIR

Lists directory of the last used / specified device. (Same as "@$PARAMETER")

Example:
DIR"*=B

3 "ACE             " IDE64
0    "BIN"              DIR
0    "ETC"		DIR
0    "HOME"		DIR
0 BLOCKS USED.
READY.
 

12.7 HDINIT

Trys to auto detect devices connected to the cartridge.

Example:
HDINIT
MASTER:
ST9385AG

READY.
 

12.8 INIT

Fills memory with nulls, then reset. Useful before linking.

12.9 KILL

Switches cartridge off. Useful if you suspect compatibility problems with a program.

Example:
KILL
BYE!

READY.
 

12.10 LL

Pretty verbose directory list for power users. First line is the directory label, same parameters as for command DIR.

Table 5 – LL format
PartMeaning
-. = DEL entry, - = file, R = relative file, D = directory, L = link
CC = Closed
DD = Deletable
RR = Readable
WW = Writable
XX = Loadable
-H = Hidden
363Size of file
2004-08-12Date
16:12:13Time
"LIST"Filename
TXTFile type
568/12/4Disk address (CHS or LBA)
Examples:
Simple listing:
LL

D--RWX-            1980-01-01 00:00:00  "WORK            " DIR 560/5/36
DC-R-XH          0 1980-01-01 00:00:00  "%DELETED  FILES%" DIR 560/5/35
-CDRWX-        363 2004-08-12 16:12:13  "LIST"             TXT 568/12/4
-CDRWX-     820528 2004-08-11 16:32:26  "UTILITIES"        ZIP 560/5/37
-CDRWX-    2234108 2004-08-11 18:46:01  "TXT"              ZIP 562/9/21
-CDRWX-      25513 2004-08-11 19:29:43  "CHANNEL15"        ASM 568/11/9
READY.
 
Redirect listing into file to be able to print or view it later.
OPEN 1,12,1,"LIST,TXT":CMD 1:LL:CLOSE 1

READY.
 
Listing works on 1541 / 1570 / 1571 / 1581 too:
LL"",8

"GEOS 128 V2.0AM " CP 2A
P--              2 1988-08-22 13:00     "GEOS"             PRG 19/15
P--              6 1988-08-22 13:00     "GEOS BOOT"        PRG 19/17
U--            156 1988-08-22 13:00     "GEOS KERNAL"      USR 19/18
U-W            137 1988-10-10 13:06     "128 DESKTOP"      USR 8/20
U-W             79 1988-09-08 16:50     "128 CONFIGURE"    USR 15/6
BREAK
READY.
 

12.11 LOAD

Loads a program file into memory. Using no device number selects last used device. No filename means "*".

Example:
LOAD

SEARCHING FOR *
LOADING $0801-$099E
READY.
 

12.12 MAN

Starts the built in file manager.

12.13 MKDIR

Sends make directory to the last used / specified device. (Same as "@MD:NEWDIR")

Example:
MKDIR"PICS",12

READY.
 

12.14 RM

Sends scratch file to the last used / specified device. (Same as "@S:FILENAME")

Example:
RM"OLDSTUFF",8

READY.
 

12.15 RMDIR

Sends remove directory to the last used / specified device. (Same as "@RD:FILENAME")

Example:
RMDIR"OLDDIR"

READY.
 

12.16 SAVE

Saves program to disk. Using no device number selects last used device. You'll get a "?FILE DATA ERROR" if an error happens during save.

Example:
SAVE"TEST"

SAVING TEST $0801-$1A43
READY.
 

12.17 VERIFY

Verifies that the program in memory matches the on-disk version. Using no device number selects last used device. No filename means "*".

Example:
VERIFY"TEST"

SEARCHING FOR TEST
VERIFYING $0801-$1A43
OK

READY.
 


13 Programming in assembly

This part is not finished...

13.1 $FFB7 - READST

Description:Read status word
Implementation:Standard
Communication registers:None
Preparatory routines:None
Error returns:None
Status:None
Registers affected:A
Example:
Check end of file while reading
	jsr chrin	; read data from file
	sta data,y
	jsr readst	; test status
	and #$40	; end of file flag
	bne endoffile
Table 6 – Device status ($90)
BitMeaning
7Device not present
6End of File
5(Tape CRC error)
4Verify / read error (Tape read error)
3(Tape long block)
2(Tape short block)
1Timeout on receive
0Timeout on send

13.2 $FF90 - SETMSG

Description:Control kernal message printing
Implementation:Standard
Communication registers:A
Preparatory routines:None
Error returns:None
Status:None
Registers affected:A
Example:
Turn off messages to prevent screen distortion
	lda #$00
	jsr setmsg	;turn off messages	
Table 7 – Messages ($9D)
BitMeaning
7Full error messages (LOADING, etc.)
6Kernal error messages (I/O ERROR#x)
5..0Undefined

13.3 $FFE1 - STOP

Description:Check if stop was pressed
Implementation:Standard
Communication registers:A
Preparatory routines:None
Error returns:None
Status:None
Registers affected:A, X
Example:
Check stop key while reading a file (STOP calls CLRCHN if stop was pressed)
	jsr chrin
	sta ($fb),y
	jsr stop
	beq stoped	;stop was pressed

	...

stopped	lda #filenum
	jmp close	;close file and exit

13.4 $FFBA - SETLFS

Description:Sets Logical File Number, Device Number, and Secondary Address
Implementation:Standard
Communication registers:A, X, Y
Preparatory routines:None
Error returns:None
Status:None
Registers affected:None
Example:
Set the first three parameters of BASIC OPEN command. File number is ignored for LOAD / SAVE.
	lda #filenumber	; file number (1-255)
	ldx $ba		; actual device number
	ldy #secaddy	; secondary address
	jsr setlfs
        
        ...

        jsr open
Table 8 – Device numbers ($BA)
Device numberDevice
0Keyboard
1Datassette
2RS-232C device
3CRT display
4..5Serial bus printer
6..7Serial bus plotter
8..11CBM serial bus disk drive
12Primary IDE controller, Master (default)
13Primary IDE controller, Slave (default)
14PC-link serial / parallel (default)
15..30Other
31..255Illegal
Table 9 – Secondary addresses ($B9)
Secondary addressOpen mode
0Read access (load)
1Write access (save)
2..14Data channel
15Status / command channel
16..127Illegal
128..255Illegal (serial bus specific)

13.5 $FFBD - SETNAM

Description:Sets filename for OPEN / LOAD / SAVE routine
Implementation:Standard
Communication registers:A, X, Y
Preparatory routines:None
Error returns:None
Status:None
Registers affected:None
Example:
Set filename for OPEN / LOAD / SAVE
	lda #8		; filename length
	ldx #<name	; pointer to filename, low byte
	ldy #>name	; pointer to filename, high byte
	jsr setnam

	...

        jsr open

name	.text "filename"

13.6 $FFC0 - OPEN

Description:Open a logical file
Implementation:IDE Extended
Communication registers:None
Preparatory routines:SETLFS, SETNAM
Error returns:1, 2, 4, 5, 6, 7, 240 (see error codes)
Status:$00, $80 (see READST)
Registers affected:A, X, Y
Example:
Open a file
	lda #filenumber	; file number (1-255)
	ldx $ba		; actual device number
	ldy #secaddy	; secondary address
	jsr setlfs
	lda #8		; filename length
	ldx #<name	; pointer to filename, low byte
	ldy #>name	; pointer to filename, high byte
	jsr setnam
        jsr open

name	.text "filename"

13.7 $FFC3 - CLOSE

Description:Close a logical file
Implementation:IDE Extended
Communication registers:A
Preparatory routines:None
Error returns:0, 240 (see error codes)
Status:$00, $03, $80 (see READST)
Registers affected:A, X, Y
Example:
Close a file
	lda #filenumber	; opened file number
	jsr close

13.8 $FFC6 - CHKIN

Description:Set standard input
Implementation:IDE Extended
Communication registers:X
Preparatory routines:valid OPEN
Error returns:0, 3, 5, 6 (see error codes)
Status:$00, $03, $80 (see READST)
Registers affected:A, X
Example:
Starts to read from a file
	...
        jsr open	; open file

	ldx #filenumber	; opened file number
	jsr chkin	; set input

	ldx #0
        jsr chrin	; get bytes
        sta $400,x
        ...

13.9 $FFC9 - CHKOUT

Description:Set standard output
Implementation:IDE Extended
Communication registers:X
Preparatory routines:valid OPEN
Error returns:0, 3, 5, 7 (see error codes)
Status:$00, $03, $80 (see READST)
Registers affected:A, X
Example:
Starts to write to a file
	...
        jsr open	; open file

	ldx #filenumber	; opened file number
	jsr chkout	; set output

	ldx #0
	lda $400,x
        jsr chrout	; write out data
        ...

13.10 $FFCF - CHRIN

Description:Get a character from standard input
Implementation:IDE Extended
Communication registers:None
Preparatory routines:valid OPEN, CHKIN
Error returns:6 (see error codes)
Status:$00, $40, $42, $52, $80 (see READST)
Registers affected:A (Y but not for file I/O)
Example:
Get in a byte from standard input
	...
        jsr chkin

	ldy #0
	jsr chrin
	sta data,y
	iny
        ...

13.11 $FFE4 - GETIN

Description:Get a character from standard input
Implementation:IDE Extended
Communication registers:None
Preparatory routines:valid OPEN, CHKIN
Error returns:6 (see error codes)
Status:$00, $40, $42, $52, $80 (see READST)
Registers affected:A (X, Y but not for file I/O)
Example:
Get in a byte from standard input
	...
        jsr chkin

	ldy #0
	jsr getin
	sta data,y
	iny
        ...
Wait until a space is pressed
	...
	jsr clrchn	;keyboard/screen
        ...

wait	jsr getin	;get key
	beq wait	;nothing pressed?
        
        cmp #32		;space pressed?

13.12 $FFD2 - CHROUT

Description:Output a character to standard output
Implementation:IDE Extended
Communication registers:A
Preparatory routines:valid OPEN, CHKOUT
Error returns:7 (see error codes)
Status:$00, $03, $80 (see READST)
Registers affected:None
Example:
Put in a byte to output
	...
        jsr chkout

	lda #$00
	jsr chrout	;write 0
        ...

13.13 $FFE7 - CLALL

Description:Close all files and set standard input / output to keyboard / CRT
Implementation:IDE Extended
Communication registers:None
Preparatory routines:None
Error returns:5 (see error codes)
Status:$00, $03, $80 (see READST)
Registers affected:A, X
Example:
Make sure all files are closed before starting.
	jsr clall	; close all files, set default i/o
	jmp run		; run program

13.14 $FFCC - CLRCHN

Description:Set standard input / output to keyboard / CRT
Implementation:IDE Extended
Communication registers:None
Preparatory routines:None
Error returns:5 (see error codes)
Status:$00, $03, $80 (see READST)
Registers affected:A, X
Example:
Set standard keyboard / screen in / output.
	...
        jsr chkin
        ...

	lda #1
	jsr close
	jsr clrchn	; set default i/o

13.15 $FFD5 - LOAD

Description:Load memory from file
Implementation:IDE Extended
Communication registers:A, X, Y
Preparatory routines:SETLFS, SETNAM
Error returns:0, 4, 5, 8, 9, 16 (see error codes)
Status:$00, $10, $40, $42, $50, $52, $80 (see READST)
Registers affected:A, X, Y
Example:
Load a file. It's possible to load from $0400 to $FFFF (IDE64 switches $01 memory configuration register automatically if needed).
	lda #1		; filename length
	ldx #<dirnam
	ldy #>dirnam	; filename pointer
	jsr setnam

	lda #1		; file number
	ldx $ba		; actual device number
	ldy #0		; sec.address 0=new location, 1=original location
	jsr setlfs

	lda #$00	; load flag (1=verify)
	ldx #<dirbuff
	ldy #>dirbuff	; new start address
	jsr load
	bcc loadok
	...
	rts

loadok	stx $ae		; new end after load/verify
	sty $af
	...
	rts

dirnam	.text "$"

13.16 $FFD8 - SAVE

Description:Save memory to file
Implementation:IDE Extended
Communication registers:A, X, Y
Preparatory routines:SETLFS, SETNAM
Error returns:0, 5, 8, 9, 24 (see error codes)
Status:$00, $03, $80 (see READST)
Registers affected:A, X, Y
Example:
Save a file. It's possible to save RAM from $0200 to $CFFF. For save RAM under the BASIC ROM don't forget to set $01!
databegin = $fb

	lda #1		; file number
	ldx $ba		; actual device number
	ldy #0		; sec.address
	jsr setlfs

	lda #8		; filename length
	ldx #<name
	ldy #>name	; filename pointer
	jsr setnam

	lda #<$1000
	sta databegin	; begin
	lda #>$1000
	sta databegin+1
	lda #databegin
	ldx #<$8000
	ldy #>$8000	; end
	jsr save

name	.text "filename"

13.17 $DEF1 - WRITE

Description:Save data block to IDE device
Implementation:IDE only
Communication registers:A, X, Y
Preparatory routines:valid OPEN, CHKOUT
Error returns:5, 7, 9 (see error codes)
Status:$00, $80 (see READST)
Registers affected:A, X, Y

Note: Not possible to save under I/O. (eg. saving from $D800 will save color RAM) To access RAM under the BASIC and KERNAL ROM, set $01 correctly. Saving RAM under the KERNAL ROM is not supported on SuperCPU.

If you want your application using READ / WRITE make runnable on a not IDE64 equipped machine, check for IDE64 presence before calling these two calls, and use standard routines instead of, as described above. (Imagine what happens at JSR $DEF1 if there's open I/O space at $DE00-$DEFF...)

Example:
Detect IDE64 before write and workaround if not present.
	lda $de60	;check ide64
	cmp #$49
	bne old
	lda $de61
	cmp #$44
	bne old
	lda $de62
	cmp #$45
	bne old
	lda #zp
	jsr $def1
	bcc ok
	cmp #9		;illegal device
	beq old2	;tried to use call on non-ide64 device
ok
	...
	rts

old2	ldx #channel
	jsr chkout
old	...		;old byte by byte routine
	rts

13.18 $DEF4 - READ

Description:Load data block from IDE device
Implementation:IDE only
Communication registers:A, X, Y
Preparatory routines:valid OPEN, CHKIN
Error returns:5, 6, 9 (see error codes)
Status:$00, $40, $42, $52, $80 (see READST)
Registers affected:A, X, Y

Note: This routine does not load under I/O. (e.g. reading to $D800 will overwrite color RAM)

Example:
Copy a file with read and write
	lda #1		; source file number
	ldx $ba		; actual device number
	ldy #0		; secondary address for read
	jsr setlfs
	lda #outputname-inputname
	ldx #<inputname
	ldy #>inputname
	jsr setnam
	jsr open	; open input file

	lda #2		; destination filenumber
	ldx $ba		; actual device number
	ldy #1		; secondary address for write
	jsr setlfs
	lda #status-outputname
	ldx #<outputname
	ldy #>outputname
	jsr setnam
	jsr open	; open output file

	lda #<startadd
	sta $fb
	lda #>startadd	; buffer start address
	sta $fc

	ldx #1		; set input to source file
	jsr chkin

	ldx #2
	jsr chkout	; set output to destination file

loop	lda #$fb	; pointer to zeropage with start address
	ldx #<blocksize
	ldy #>blocksize	; block size
	jsr read	; read
	bit $90		; readst
	php		; status to stack

	lda #$fb
	jsr write	; write
	plp		; status
	bvc loop	; test end of file

	lda #2
	jsr close	; close output file
	lda #1
	jsr close	; close input file
	jsr clall	; set default i/o device
	rts

inputname .text "/bin/input-file"
outputname .text "/tmp/output-file"
status	.byte 0
Table 10 – Error codes returned by kernal
AccuMeaning
0Routine terminated by the STOP key
1Too many open files
2File already open
3File not open
4File not found
5Device not present
6File is not an input file
7File is not an output file
8File name is missing
9Illegal device number
16Out of memory (load)
24File data error (save)
240Top-of-memory change RS-232 buffer (de)allocation


14 PCLink

IDEDOS also supports a virtual drive called as "PCLink". This drive is a network drive, which make file copying possible across computers. Programs can also directly run of a PCLink drive. There are several variations for the connection:

14.1 PCLink on XPClink cable

The slowest method but the easiest if you already have a X1541, XE1541, XM1541 or XA1541 cable. Maximal transfer speed is around 5000 bytes/sec.

Table 11 – X1541 PCLink cable
PinC64
serial port
PinPC
printer port
2GND18...25GND
3ATN1STROBE
4CLK14AUTOFEED
5DATA17SELECT IN

This cable will not work with all printer ports.

14.2 PCLink on parallel cable

This connection is made between the parallel port of a PC and the user port of a C64 using a cable similar to Laplink, however the layout was based on PC64 cable.

Table 12 – Parallel PCLink cable
PinC64
user port
PinPC
printer port
A,1GND18...25GND
CPB0 out15ERROR in
DPB1 out13SELECT in
EPB2 out12PAPER in
FPB3 out10ACK IN in
HPB4 in2D0 out
JPB5 in3D1 out
KPB6 in4D2 out
LPB7 in5D3 out
MPA2 out11BUSY in
N,12GND18...25GND
BFLAG in (not mandatory)9D7 (not mandatory)

Incorrectly built cable can damage the printer and / or userport! Same for plugging the cable while the computers are turned on...

14.3 PCLink on null modem cable

It's using a null modem cable with handshake between your PC's serial port and a port of a duart card. Communication is done at 115200 bit/s resulting in an effective transfer speed of ? bytes/sec.

Table 13 – Serial PCLink cable
9
pin
C64
duart port
9
pin
25
pin
PC
serial port
2RxD32TxD
3TxD23RxD
7RTS85CTS
8CTS74RTS
5GND57GND


15 Command channel

Will write this a bit more verbose later. Some examples use the dos wedge like "@I", of course the @ at the beginning of line is not part of the command.

15.1 File management commands

For more see chapter Using files.

15.1.1 Position

Seek to file position.

Format: PRINT#<command lfn>,"P"; CHR$(<file channel>); CHR$(POSITIONBITS0TO7); CHR$(POSITIONBITS8TO15); CHR$(POSITIONBITS16TO23); CHR$(POSITIONBITS24TO31)

Example:
Seek in file to the 100000th byte and read it. (counting begins at 0)
10 OPEN 15,12,15:OPEN 4,12,4,"FILE"
20 PRINT#15,"P"; CHR$(4); CHR$(159); CHR$(134); CHR$(1); CHR$(0)
30 GET#4,A$:CLOSE 4:CLOSE 15

15.2 Filesystem management commands

15.2.1 Initialize

Redetect filesystem and go into root directory of default partition.

Example:
@I
00, OK,000,000,000,000
15.2.2 Scratch

Delete a file. For empty directories use RD. File must have the DELETABLE flag set, and must be on a writable partition.

Example:
Delete the file called 'FILE'
@S:FILE
01, FILES SCRATCHED,001,000,000,000
15.2.3 Rename

Rename a file or directory. The new and old file must be in the same directory, on a writable partition.

Example:
Rename the file called 'OLD,PRG' to 'NEW,SEQ'
@R:NEW,SEQ=OLD,PRG
00, OK,000,000,000,000

15.3 Partition management commands

15.3.1 Change partition

Partition changing.

Examples:
Select partition 2
@CP2
02, PARTITION SELECTED,002,000,000,000
 
Select partition 3 the other way
OPEN 15,12,15,"C"+CHR$(208)+CHR$(3):CLOSE 15
READY.
 
15.3.2 Get partition info

Get information about a partition. The returned data format is:

Table 14 – G-P data format
ByteMeaning
0Partition type: 0=not available, 1=CFS
1Unused
2Partition number
3-18Partition name
19-26Unused
27-28Size (65535)
Examples:
What's the current partition?
10 OPEN 15,12,15,"G-P"
20 GET#15,A$,B$,C$:CLOSE 15
30 PRINT"CURRENT PARTITION IS:"ASC($C$+CHR$(0))
Is partition 2 there?
10 OPEN 15,12,15,"G-P"+CHR$(2)
20 GET#15,A$,B$,C$:CLOSE 15
30 IF A$="" THEN PRINT"NO SUCH PARTITION!"

15.4 Device management commands

15.4.1 Drive number change

To temporary change the device number (till next reset) send "U0>"+CHR$(new) to the device. If 'new' is 0 then the device is disabled.

Example:
Use device 12 as 8 from now on
OPEN 15,12,15,"U0>"+CHR$(8):CLOSE15

An easier typed variant is the "S-8", "S-9" and "S-D". D means default device number.

Examples:
Use device 12 as 8 from now on
@S-8
00, OK,000,000,000,000
READY.
Revert to default device number
@S-D
00, OK,000,000,000,000
READY.
15.4.2 Identify device

Sending 'UI' or 'U9' on command channel returns the dos version of the device.

Example:
@UI
73, IDE DOS BETA! IDE64,000,000,000,000
15.4.3 Reset device

Sending 'UJ' or 'U:' on command channel resets the device.

Example:
@UJ
73, IDE DOS BETA! IDE64,000,000,000,000
15.4.4 Power management

It's possible to enter / exit power saving mode if the device support it.

Examples:
Spin down drive
@U0>P0
00, OK,000,000,000,000
Spin up drive
@U0>P1
00, OK,000,000,000,000
Get power management state. Returned is 1 byte followed by CHR$(13).
10 OPEN 15,12,15,"U0>"+CHR$(208):GET#15,A$,B$:CLOSE 15:A=ASC(A$+CHR$(0))
20 IF A=0 THEN PRINT"STANDBY"
30 IF A=128 THEN PRINT"IDLE"
40 IF A=255 THEN PRINT"ACTIVE"
15.4.5 Eject / Load media

More useful on CDROM, ZiP drive and LS-120 than on hard disk. Don't forget to unlock the media before eject! (See Lock / Unlock media below)

Examples:
Load media (CDROM only)
@U0>E0
00, OK,000,000,000,000
Eject media
@U0>E1
00, OK,000,000,000,000
15.4.6 Lock / Unlock media

It's possible to prevent media removal on CDROM, ZiP and LS-120 drives.

Examples:
Unlock media
@U0>L0
00, OK,000,000,000,000
Lock media
@U0>L1
00, OK,000,000,000,000
15.4.7 Reading time from RTC

Sending 'T-RA' will read the current time in ASCII, 'T-RB' in BCD, while 'T-RD' in decimal.

Table 15 – T-RB and T-RD data format
ByteMeaning
0Day of week: 0=Sunday, 1=Monday...
1Year 00-99, 00=2000, 79=2079, 80=1980, etc.
2Month 1-12, 1=January
3Date 1-31
4Hour 1-12
5Minute 0-59
6Second 0-59
7AM / PM: 0=AM, else PM
Example:
Get the current time in human readable form (day of week, month, date, year, hour, min, sec, am / pm)
@T-RA
SAT. 08/07/04 07:42:48 PM
15.4.8 Format disk

Formatting of floppy disks is sometimes necessary to eliminate bad sectors, or just bring the media into a usable format. Formatting changes the physical format, it does not create a filesystem on disk. Use CFSfdisk to create a filesystem!

Note that while formatting the drive is not accessible (this can take more than 30mins), fortunately it's possible to use other devices. And of course HDINIT will break formatting, so try to avoid it.

Table 16 – Disk formats
CodeMeaning
720KDouble density disk with 720KB capacity (LS-120)
1.2MHigh density disk with 1200KB capacity (LS-120)
1.44MHigh density disk with 1440KB capacity (LS-120)
120MSuperDisk with 120MiB capacity (LS-120)
Example:
Format a 1.44MB disk
@N=1.44M
00, OK,000,000,000,000

15.5 Direct access commands

For more see chapter Direct access.

15.5.1 Buffer read
Format: PRINT#<command lfn>,"B=R"; CHR$(<data channel>); CHR$(HEAD); CHR$(CYLINDERBITS8TO15); CHR$(CYLINDERBITS0TO7); CHR$(SECTOR)
15.5.2 Buffer position
Format: PRINT#<command lfn>,"B=P"; CHR$(<data channel>); CHR$(POSITIONBITS0TO7); CHR$(POSITIONBITS8TO15)
15.5.3 Buffer write
Format: PRINT#<command lfn>,"B=W"; CHR$(<data channel>); CHR$(HEAD); CHR$(CYLINDERBITS8TO15); CHR$(CYLINDERBITS0TO7); CHR$(SECTOR)

15.6 Directory handling commands

For more see chapter Using directories.

15.6.1 Change working directory
Example:
@CD:NEWDIR
00, OK,000,000,000,000
15.6.2 Make directory
Example:
Create the directory called 'NEWDIR'
@MD:NEWDIR
00, OK,000,000,000,000
15.6.3 Remove directory
Example:
Remove the directory called 'OLDDIR'
@RD:OLDDIR
01, FILES SCRATCHED,001,000,000,000

15.7 CDROM related commands

15.7.1 Read TOC

For more see chapter Direct access.

Format: PRINT#<command lfn>,"B=T"; CHR$(<data channel>); CHR$(<format>); CHR$(<starting track>)
15.7.2 Audio playback

This command will play a part of audio CD. Start and end position is specified in MSF (Minute (0-99), Second (0-59), Frame (0-74)). Note that audio CDs start after 2 seconds.

Format: PRINT#<command lfn>,"U0>CA"; CHR$(<end F>); CHR$(<end S>); CHR$(<end M>); CHR$(<start F>); CHR$(<start S>); CHR$(<start M>)
15.7.3 Pause/resume audio playback
Examples:
Pause playback
@U0>CP0
00, OK,000,000,000,000
Continue playback
@U0>CP1
00, OK,000,000,000,000
15.7.4 Volume control

This command lets control the output volume of CDROM drive. Output / channel 0 is the left side, while output / channel 1 is the right.

Format: PRINT#<command lfn>,"U0>CV"; <8 bytes>
Table 17 – Volume control format
ByteMeaning
0Output port 0 channel selection (0-15)
1Output port 0 volume (0-255)
2Output port 1 channel selection (0-15)
3Output port 1 volume (0-255)
4Output port 2 channel selection (0-15)
5Output port 2 volume (0-255)
6Output port 3 channel selection (0-15)
7Output port 3 volume (0-255)
Table 18 – Output channel selection
ValueMeaning
0Output port muted
1Audio channel 0
2Audio channel 1
3Audio channel 0 and 1 mixed
4Audio channel 2
8Audio channel 3
15All mixed
Examples:
Reverse left and right speakers, and -6dB amplification
OPEN15,12,15
V$=CHR$(2)+CHR$(128)+CHR$(1)+CHR$(128)+CHR$(0)+CHR$(0)+CHR$(0)+CHR$(0)
PRINT#15,"U0>CV"V$
CLOSE15
Mono output on left speaker only, full volume
OPEN15,12,15
V$=CHR$(3)+CHR$(255)+CHR$(0)+CHR$(0)+CHR$(0)+CHR$(0)+CHR$(0)+CHR$(0)
PRINT#15,"U0>CV"V$
CLOSE15
15.7.5 Volume sense

This command returns the current settings from the CDROM drive in the above structure, plus a CHR$(13) at the end.

Example:
Print current volume setting
10 OPEN15,12,15,"U0>C"+CHR$(214)
20 GET#15,A$
30 IF A$>CHR$(15) THEN INPUT#15,B$,C$,D$,E$:PRINTA$B$,C$,D$,E$:GOTO 70
40 GET#15,B$,C$,D$,E$,F$,G$,H$,I$
50 PRINT"LEFT  CHANNEL:"ASC(B$+CHR$(0))
60 PRINT"RIGHT CHANNEL:"ASC(D$+CHR$(0))
70 CLOSE 15
15.7.6 Medium type

This command returns the CDROM media type in one byte, plus a CHR$(13) at the end.

Example:
This small program will display the media type in CDROM drive
10 OPEN15,12,15,"U0>CM":GET#15,A$,B$:CLOSE15
20 T=ASC(A$+CHR$(0)):A=T AND 15:B=INT(T/16)
30 IF B=7 AND A=0 THEN PRINT"NO CD IN DRIVE":END
40 IF B=7 AND A=1 THEN PRINT"TRAY OPEN":END
50 IF B=7 AND A=2 THEN PRINT"FORMAT ERROR":END
60 IF B=1 AND A<9 THEN PRINT"CD-R ";
70 IF B=2 AND A<9 THEN PRINT"CD-E ";
80 IF B=3 AND A=0 THEN PRINT"HD UNKNOWN":END
90 IF B=3 AND A=1 THEN PRINT"HD 120MM":END
100 IF B=3 AND A=5 THEN PRINT"HD 80MM":END
110 IF B>2 OR A>8 THEN PRINT"?":END
120 IF A>0 AND A<5 THEN PRINT"120MM "
130 IF A>4 AND A<9 THEN PRINT"80MM "
140 IF A=0 THEN PRINT"UNKNOWN"
150 IF A=1 OR A=5 THEN PRINT"DATA"
160 IF A=2 OR A=6 THEN PRINT"AUDIO"
170 IF A=3 OR A=7 THEN PRINT"DATA AND AUDIO"
180 IF A=4 OR A=8 THEN PRINT"MULTISESSION"


16 Command channel error messages

These are the possible returned error messages on channel #15 with their short descriptions.

00, OK,000,000,000,000
No error since last action.
01, FILES SCRATCHED,xxx,yyy,000,000
xxx+yyy*256 files where deleted.
02, PARTITION SELECTED,xxx,000,000,000
Partition number #xxx was selected.
20, READ ERROR,dp1,dp2,dp3,dp4
Unrecoverable read error. Maybe a defective disk.
dp1,dp2,dp3,dp4 is drive specific address of sector.
21, READ ERROR,dp1,dp2,dp3,dp4
Timeout during read.
22, READ ERROR,dp1,dp2,dp3,dp4
Data block not found, or unformatted media.
23, READ ERROR,dp1,dp2,dp3,dp4
Problem with data checksum.
25, WRITE ERROR,dp1,dp2,dp3,dp4
Verify error.
26, WRITE PROTECT ON,000,000,000,000
Write protected file / directory / partition / media.
27, ACCESS DENIED,000,000,000,000
Cannot perform operation.
28, WRITE ERROR,dp1,dp2,dp3,dp4
Timeout during write.
29, DISK CHANGED,000,000,000,000
Disk change detected.
30, SYNTAX ERROR,000,000,000,000
Syntax error in command. (something is missing...)
31, UNKNOWN COMMAND,000,000,000,000
Unknown / unimplemented command.
32, SYNTAX ERROR,000,000,000,000
Command buffer overflow.
33, SYNTAX ERROR,000,000,000,000
Illegal character in filename.
34, SYNTAX ERROR,000,000,000,000
Missing filename.
39, PATH NOT FOUND,000,000,000,000
Path not found.
50, SEEK BEYOND END,000,000,000,000
Attempt to seek beyond end of file.
62, FILE NOT FOUND,000,000,000,000
File not found in directory.
63, FILE EXISTS,000,000,000,000
File already exists in directory.
64, FILE TYPE MISMATCH,000,000,000,000
Problems with file's type.
67, ILLEGAL REQUEST,dp1,dp2,dp3,dp4
Sector's address out of range.
70, NO CHANNEL,000,000,000,000
Channel number incorrect for block commands.
71, DIR ERROR,dp1,dp2,dp3,dp4
No directory header found.
72, PARTITION FULL,000,000,000,000
There's no more space left on partition
73, IDE DOS Vx.xx IDE64,000,000,000,000
73, IDE DOS Vx.xx CDROM,000,000,000,000
73, IDE DOS Vx.xx ZIP64,000,000,000,000
73, IDESERV x.xx PCLINK,000,000,000,000
Dos version, and drive type.
74, DRIVE NOT READY,000,000,000,000
No disk in drive.
75, FORMAT ERROR,000,000,000,000
Disk not in known format. Use format command / utility.
77, SELECTED PARTITION ILLEGAL,xxx,000,000,000
Partition number #xxx not found / illegal.


17 Compatibility



18 Updating IDEDOS

[Perom programmer screenshot]

The IDE64 interface cartridge is equipped with 64KiB / 128KiB flash memory (AT29C512 / AT29C010) for the firmware. The content of the flash memory is non-volatile and can be changed anytime, so you can always run the latest firmware with the new features and bug fixes.

Updating IDEDOS is very easy and does not require any special electronic knowledge. The cartridge was designed so that it's always possible to update the firmware even if it was messed up, so you can't render your cartridge unusable by interrupted update or wrong firmware.

If you own a SuperCPU you probably change between the 2 versions of IDEDOS depending on the presence of SuperCPU. Updating firmware every time when you want to use IDE64 with or without SuperCPU can be frustrating. By using a 128KiB flash memory (AT29C010) it's possible to change the firmware fast and avoid time wasting updates. (default for V3.4+ cartridge)

Here's a short guide to updating IDEDOS:

  1. Get the latest Perom programmer and the new firmware and copy both to a serial device. (eg. floppy drive, CMD HD, etc.) If having a XPCLink cable it's also possible to use it for update. (and it's much faster)
  2. Plug your cartridge into the expansion port when the computer is turned off (if not already done so). SuperCPU does not disturb the process, it even speeds up the update (JiffyDOS and 20MHz), however if you are having trouble you may remove it. [PGM pins picture]
  3. There are 2 squares near the big Lattice chip and the 8 pin DS1302 called PGM. By connecting these 2 squares on board together you can enable flash update. (use screwdriver) Newer version of the IDE64 cartridge have pins instead of squares, and you have to use a jumper to connect them. (see picture)
  4. Now you can turn on your computer or press reset if it's already on. The green led should blink now, except if you have your SuperCPU enabled, then it's off. If the led is steady on it means the flash write protect is still enabled, this case retry from the beginning. (it's not easy to connect the 2 squares on older cartridges for the first try...)
  5. The normal C64 screen should appear, the only difference is that there are now only "30719 BYTES FREE". Now you can remove the screwdriver or jumper.
  6. If using a greater then 64KiB flash memory, then select the bank you want to program!
  7. Load the Perom programmer and start it. It should start with the screen shown in the picture. (if using v1.1) Now you may backup your current IDEDOS if you want, and update to the latest from XPCLink or disk. Just select the action with the CRSR keys and hit RETURN. Erasing of perom is not required before programming, so do not select it unless you have reasons to do so!
  8. After selecting one of the update menu items the program will ask for device number and filename. Leaving the filename blank cancels the update. If the program says it cannot find the perom then make sure you removed the jumper! (also it's not recommended using pencil for connecting the squares because the remaining carbon may permanently connect them unless cleane d)
  9. If the filename was correct and the PCLink server was running then the programming should start. A box filled with characters will appear on screen each character representing a 128 byte sector of flash memory. During update the writing should progress from the upper left corner towards the bottom right. If finished you get an "Update successful" message. If hexadecimal numbers appear in the right corner of the screen and you get "Update failed" then it's meaning that you exceeded the typical 10000 rewrites for some sectors, which is very unlikely. (or the flash memory is just failing for some other unknown reason) Also disk errors may interrupt the update, this case get a new disk and retry the update.
  10. Now if ready ("Update successful") you may leave the program and press reset to start the new firmware. If using older versions of the firmware (before 0.9x) then power cycle the computer!


19 Frequently Asked Questions

I copyed some programs from floppy to IDE64, but some of them got shorter by a few blocks. Is this a bug?
No, it's just a difference of block size. Traditional CBM / CMD equiment has a blocksize of 254 bytes, while IDE64 devices have a virtual 256 byte blocksize (in reality it's 512 or 2048 bytes depending on the media used). A program which is 49920 bytes long will be 197 block long on floppy and 195 on IDE64.
Is it true that IDE64 can only be used to store onefiler games?
Unfortunately most multipart games are written too 1541 or serial bus specific. If you want your favourite game fixed for IDE64 then ask someone who is able to do this. Looking at the IDE64 warezsite will give you some hints about these persons ;-) And no, you can use IDE64 for much more!
Will IDE64 read my DOS formatted floppy with LS-120, or my CompactFlash card from my camera?
Currently it won't, you have to reformat them to the native filesystem used by IDEDOS, but then you can't read it on your win32 pc. (unless using Linux or MAC) Due to limited memory there won't be direct support for the FAT filesystem in IDEDOS, however it's not very hard to write external application for reading and writing such medias. (something similar like the BigBlueReader)
How comes all the stuff to a IDE64 HDD / LS-120 / ZIP disk / CompactFlash card?
The easiest way is to get a CDROM and burn all your stuff to CD and then use the builtin filemanager to copy files. Also you can use Star Commander or similar utility with a floppy drive. You can use a virtual serial bus drive emulation program like 64HDD too. Or build / buy a PCLink cable and use that for the transfer. Also it's possible to use Contiki or Wings with an ethernet cartridge and download the stuff from the Internet. The fastest method is to use Linux or MAC to create the filesystem including all the files with CFSutils. Also you can use VICE on Linux to transfer to files when the emulated disk is the blockdevice with the correct geometry.
Ok, now I want to backup my IDE64 device. What are the possibilities?
As the filemanager supports recursive copying it's only a matter of selecting all the directories you want, and then copy it to another device. (like another HDD / ZIP disk / LS-120 disk / CompactFlash card, CMD drive, floppy, 64HDD, etc.) Beware of limited filename / directory support of non-IDE64 devices! Also CFSutils can extract all your files from an IDE64 device on Linux, or PCLink. Of course you can always use 'dd' to create an image on Linux.


20 GNU Free Documentation License

GNU Free Documentation License

Version 1.1, March 2000

   
    Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple Place, Suite
    330, Boston, MA 02111-1307 USA Everyone is permitted to copy and
    distribute verbatim copies of this license document, but changing it is
    not allowed.
   
-----------------------------------------------------------------------------
C.1. PREAMBLE

The purpose of this License is to make a manual, textbook, or other written
document "free" in the sense of freedom: to assure everyone the effective
freedom to copy and redistribute it, with or without modifying it, either
commercially or noncommercially. Secondarily, this License preserves for the
author and publisher a way to get credit for their work, while not being
considered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of
the document must themselves be free in the same sense. It complements the
GNU General Public License, which is a copyleft license designed for free
software.

We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free program
should come with manuals providing the same freedoms that the software does.
But this License is not limited to software manuals; it can be used for any
textual work, regardless of subject matter or whether it is published as a
printed book. We recommend this License principally for works whose purpose
is instruction or reference.
-----------------------------------------------------------------------------

C.2. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work that contains a notice
placed by the copyright holder saying it can be distributed under the terms
of this License. The "Document", below, refers to any such manual or work.
Any member of the public is a licensee, and is addressed as "you".

A "Modified Version" of the Document means any work containing the Document
or a portion of it, either copied verbatim, or with modifications and/or
translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the
Document that deals exclusively with the relationship of the publishers or
authors of the Document to the Document's overall subject (or to related
matters) and contains nothing that could fall directly within that overall
subject. (For example, if the Document is in part a textbook of mathematics,
a Secondary Section may not explain any mathematics.) The relationship could
be a matter of historical connection with the subject or with related
matters, or of legal, commercial, philosophical, ethical or political
position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are
designated, as being those of Invariant Sections, in the notice that says
that the Document is released under this License.

The "Cover Texts" are certain short passages of text that are listed, as
Front-Cover Texts or Back-Cover Texts, in the notice that says that the
Document is released under this License.

A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the general
public, whose contents can be viewed and edited directly and
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or for
automatic translation to a variety of formats suitable for input to text
formatters. A copy made in an otherwise Transparent file format whose markup
has been designed to thwart or discourage subsequent modification by readers
is not Transparent. A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII
without markup, Texinfo input format, LaTeX input format, SGML or XML using a
publicly available DTD, and standard-conforming simple HTML designed for
human modification. Opaque formats include PostScript, PDF, proprietary
formats that can be read and edited only by proprietary word processors, SGML
or XML for which the DTD and/or processing tools are not generally available,
and the machine-generated HTML produced by some word processors for output
purposes only.

The "Title Page" means, for a printed book, the title page itself, plus such
following pages as are needed to hold, legibly, the material this License
requires to appear in the title page. For works in formats which do not have
any title page as such, "Title Page" means the text near the most prominent
appearance of the work's title, preceding the beginning of the body of the
text.
-----------------------------------------------------------------------------

C.3. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially
or noncommercially, provided that this License, the copyright notices, and
the license notice saying this License applies to the Document are reproduced
in all copies, and that you add no other conditions whatsoever to those of
this License. You may not use technical measures to obstruct or control the
reading or further copying of the copies you make or distribute. However, you
may accept compensation in exchange for copies. If you distribute a large
enough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may
publicly display copies.
-----------------------------------------------------------------------------

C.4. COPYING IN QUANTITY

If you publish printed copies of the Document numbering more than 100, and
the Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover Texts:
Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover.
Both covers must also clearly and legibly identify you as the publisher of
these copies. The front cover must present the full title with all words of
the title equally prominent and visible. You may add other material on the
covers in addition. Copying with changes limited to the covers, as long as
they preserve the title of the Document and satisfy these conditions, can be
treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you
should put the first ones listed (as many as fit reasonably) on the actual
cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more
than 100, you must either include a machine-readable Transparent copy along
with each Opaque copy, or state in or with each Opaque copy a
publicly-accessible computer-network location containing a complete
Transparent copy of the Document, free of added material, which the general
network-using public has access to download anonymously at no charge using
public-standard network protocols. If you use the latter option, you must
take reasonably prudent steps, when you begin distribution of Opaque copies
in quantity, to ensure that this Transparent copy will remain thus accessible
at the stated location until at least one year after the last time you
distribute an Opaque copy (directly or through your agents or retailers) of
that edition to the public.

It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give them
a chance to provide you with an updated version of the Document.
-----------------------------------------------------------------------------

C.5. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the
conditions of sections 2 and 3 above, provided that you release the Modified
Version under precisely this License, with the Modified Version filling the
role of the Document, thus licensing distribution and modification of the
Modified Version to whoever possesses a copy of it. In addition, you must do
these things in the Modified Version:

 A. Use in the Title Page (and on the covers, if any) a title distinct from
    that of the Document, and from those of previous versions (which should,
    if there were any, be listed in the History section of the Document). You
    may use the same title as a previous version if the original publisher of
    that version gives permission.
   
 B. List on the Title Page, as authors, one or more persons or entities
    responsible for authorship of the modifications in the Modified Version,
    together with at least five of the principal authors of the Document (all
    of its principal authors, if it has less than five).
   
 C. State on the Title page the name of the publisher of the Modified
    Version, as the publisher.
   
 D. Preserve all the copyright notices of the Document.
   
 E. Add an appropriate copyright notice for your modifications adjacent to
    the other copyright notices.
   
 F. Include, immediately after the copyright notices, a license notice giving
    the public permission to use the Modified Version under the terms of this
    License, in the form shown in the Addendum below.
   
 G. Preserve in that license notice the full lists of Invariant Sections and
    required Cover Texts given in the Document's license notice.
   
 H. Include an unaltered copy of this License.
   
 I. Preserve the section entitled "History", and its title, and add to it an
    item stating at least the title, year, new authors, and publisher of the
    Modified Version as given on the Title Page. If there is no section
    entitled "History" in the Document, create one stating the title, year,
    authors, and publisher of the Document as given on its Title Page, then
    add an item describing the Modified Version as stated in the previous
    sentence.
   
 J. Preserve the network location, if any, given in the Document for public
    access to a Transparent copy of the Document, and likewise the network
    locations given in the Document for previous versions it was based on.
    These may be placed in the "History" section. You may omit a network
    location for a work that was published at least four years before the
    Document itself, or if the original publisher of the version it refers to
    gives permission.
   
 K. In any section entitled "Acknowledgements" or "Dedications", preserve the
    section's title, and preserve in the section all the substance and tone
    of each of the contributor acknowledgements and/or dedications given
    therein.
   
 L. Preserve all the Invariant Sections of the Document, unaltered in their
    text and in their titles. Section numbers or the equivalent are not
    considered part of the section titles.
   
 M. Delete any section entitled "Endorsements". Such a section may not be
    included in the Modified Version.
   
 N. Do not retitle any existing section as "Endorsements" or to conflict in
    title with any Invariant Section.
   

If the Modified Version includes new front-matter sections or appendices that
qualify as Secondary Sections and contain no material copied from the
Document, you may at your option designate some or all of these sections as
invariant. To do this, add their titles to the list of Invariant Sections in
the Modified Version's license notice. These titles must be distinct from any
other section titles.

You may add a section entitled "Endorsements", provided it contains nothing
but endorsements of your Modified Version by various parties--for example,
statements of peer review or that the text has been approved by an
organization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list of
Cover Texts in the Modified Version. Only one passage of Front-Cover Text and
one of Back-Cover Text may be added by (or through arrangements made by) any
one entity. If the Document already includes a cover text for the same cover,
previously added by you or by arrangement made by the same entity you are
acting on behalf of, you may not add another; but you may replace the old
one, on explicit permission from the previous publisher that added the old
one.

The author(s) and publisher(s) of the Document do not by this License give
permission to use their names for publicity for or to assert or imply
endorsement of any Modified Version.
-----------------------------------------------------------------------------

C.6. COMBINING DOCUMENTS

You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified versions,
provided that you include in the combination all of the Invariant Sections of
all of the original documents, unmodified, and list them all as Invariant
Sections of your combined work in its license notice.

The combined work need only contain one copy of this License, and multiple
identical Invariant Sections may be replaced with a single copy. If there are
multiple Invariant Sections with the same name but different contents, make
the title of each such section unique by adding at the end of it, in
parentheses, the name of the original author or publisher of that section if
known, or else a unique number. Make the same adjustment to the section
titles in the list of Invariant Sections in the license notice of the
combined work.

In the combination, you must combine any sections entitled "History" in the
various original documents, forming one section entitled "History"; likewise
combine any sections entitled "Acknowledgements", and any sections entitled
"Dedications". You must delete all sections entitled "Endorsements."
-----------------------------------------------------------------------------

C.7. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in the
collection, provided that you follow the rules of this License for verbatim
copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it
individually under this License, provided you insert a copy of this License
into the extracted document, and follow this License in all other respects
regarding verbatim copying of that document.
-----------------------------------------------------------------------------

C.8. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and
independent documents or works, in or on a volume of a storage or
distribution medium, does not as a whole count as a Modified Version of the
Document, provided no compilation copyright is claimed for the compilation.
Such a compilation is called an "aggregate", and this License does not apply
to the other self-contained works thus compiled with the Document, on account
of their being thus compiled, if they are not themselves derivative works of
the Document.

If the Cover Text requirement of section 3 is applicable to these copies of
the Document, then if the Document is less than one quarter of the entire
aggregate, the Document's Cover Texts may be placed on covers that surround
only the Document within the aggregate. Otherwise they must appear on covers
around the whole aggregate.
-----------------------------------------------------------------------------

C.9. TRANSLATION

Translation is considered a kind of modification, so you may distribute
translations of the Document under the terms of section 4. Replacing
Invariant Sections with translations requires special permission from their
copyright holders, but you may include translations of some or all Invariant
Sections in addition to the original versions of these Invariant Sections.
You may include a translation of this License provided that you also include
the original English version of this License. In case of a disagreement
between the translation and the original English version of this License, the
original English version will prevail.
-----------------------------------------------------------------------------

C.10. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as
expressly provided for under this License. Any other attempt to copy, modify,
sublicense or distribute the Document is void, and will automatically
terminate your rights under this License. However, parties who have received
copies, or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
-----------------------------------------------------------------------------

C.11. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the GNU
Free Documentation License from time to time. Such new versions will be
similar in spirit to the present version, but may differ in detail to address
new problems or concerns. See [http://www.gnu.org/copyleft/] http://
www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the
Document specifies that a particular numbered version of this License "or any
later version" applies to it, you have the option of following the terms and
conditions either of that specified version or of any later version that has
been published (not as a draft) by the Free Software Foundation. If the
Document does not specify a version number of this License, you may choose
any version ever published (not as a draft) by the Free Software Foundation.
-----------------------------------------------------------------------------

C.12. How to use this License for your documents

To use this License in a document you have written, include a copy of the
License in the document and put the following copyright and license notices
just after the title page:

   
      Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute
    and/or modify this document under the terms of the GNU Free Documentation
    License, Version 1.1 or any later version published by the Free Software
    Foundation; with the Invariant Sections being LIST THEIR TITLES, with the
    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. A
    copy of the license is included in the section entitled "GNU Free
    Documentation License".
   
If you have no Invariant Sections, write "with no Invariant Sections" instead
of saying which ones are invariant. If you have no Front-Cover Texts, write
"no Front-Cover Texts" instead of "Front-Cover Texts being LIST"; likewise
for Back-Cover Texts.

If your document contains nontrivial examples of program code, we recommend
releasing these examples in parallel under your choice of free software
license, such as the GNU General Public License, to permit their use in free
software.


21 More information

Document maintained by:

Kajtár Zsolt
Szigliget
Hóvirág u.15.
8264
Hungary
mail: soci at c64.rulez.org