ATADEMO

ATA/ATAPI Demo Program

User Guide

Version 12A1 and 12A2

Copyright 1996-2015 Hale Landis. All rights reserved.

Program Change History
The program Change History has been moved from the HISTORY.TXT file into this User Guide.

Also see:  HISTORY

Note: Also see files CMD-SUM.HTM and SCRIPTS.HTM.

TABLE OF CONTENTS

(Go To TOC)

INTRODUCTION

Use ATADEMO to investigate and understand how the ATA (IDE/EIDE) and the ATAPI interfaces work. This program accepts simple command input from the keyboard to assemble ATA or ATAPI commands and execute those commands.

There are two versions of this program: the commercial/full version and the free/demo version. ATADEMO is NOT shareware or freeware. The commercial/full version of the program supports all command types, including commands that write data, plus a script file facility. The free/demo version of the program will allow you to execute most ATA and ATAPI commands except those commands that write data to a device. The free/demo version does not include advanced functions, such as the script file facility.

ATADEMO is not a "disk utility" or "disk repair" program.

You should read the ATA/ATAPI-4, ATA/ATAPI-5 and/or ATA/ATAPI-6 standards before attempting to use this program. You should also read the SCSI-3 SAM, SPC, SBC and MMC-2 standards before attempting to use the ATAPI Packet commands on your CD-ROM drive.

Generally the ATA devices are hard disk drives (IDE/EIDE/FastATA disk drives). ATAPI devices, such as ATAPI (EIDE) CD-ROM drives, also support some ATA commands. ATADEMO can be used to execute ATA commands, such as the ATAPI Identify command, to an ATAPI device. ATADEMO also supports the ATAPI Packet command (command code A0H).

PCMCIA and CFA PC Card ATA devices are also ATA devices. ATADEMO can also be used on these devices -- see the file PCC.HTM for more information.

(Go To TOC)

FREE/DEMO vs. COMMERCIAL/FULL VERSIONS

Most ATADEMO commands are supported in both the free/demo and commercial/full versions of the program. Built-in variables, user defined variables, expressions and script files are not supported in the free/demo version of the program.

(Go To TOC)

INSTALLATION

Create a bootable DOS floppy with no CONFIG.SYS or AUTOEXEC.BAT files. Place the ATADEMO.EXE and ATADEMO.HLP files on that floppy. ATADEMO.HLP must be in the same directory as the ATADEMO.EXE file.

Boot your system from the floppy. This insures that you are not loading some strange device drivers that may interfere with ATADEMO. ATADEMO does not use the system BIOS -- ATADEMO accesses the ATA controller and device I/O ports directly.

ATADEMO can not be run in a DOS session under Win9x/NT/2K/XP or OS/2. These protected mode operating systems DO NOT allow a DOS program to directly access the disk controller I/O ports.

(Go To TOC)

RUNNING ATADEMO

To run ATADEMO, set up the test system and devices:

Start ATADEMO by entering one of the following commands:


   ATADEMO PCCMODE=mode
   ATADEMO PROMPT
   ATADEMO b:d:f:x
   ATADEMO P0
   ATADEMO P1
   ATADEMO PRI             (same as ATADEMO P0)
   ATADEMO S0
   ATADEMO S1
   ATADEMO SEC             (same as ATADEMO S0)

When using PCCMODE see the file PCC.HTM for more information about using PC Card ATA mode on PCMCIA and CFA devices. DMA commands are not possible in any PC Card ATA mode.

PROMPT will cause ATADEMO to list the PCI bus ATA host controllers available in the system and allow the user to select one to use.

b:d:f:x will cause ATADEMO to list the PCI bus ATA host controllers available. b:d:f:x specifies the PCI bus, device and function number of the ATA controller to use. x is P0 or PRI, P1, S0 or SEC, or S1 for Primary or Secondary device 0 or 1.

P0 or PRI, P1, S0 or SEC, or S1 define the legacy mode ATA host adapter to use and determine the default selected device on that controller. When these options are used DMA commands are not possible. Use these options on older systems that may not be PCI bus systems.

Once ATADEMO starts it will check the controller and device configurations. If there are not problems ATADEMO will stop at its command prompt (or if the SCR= option is used execution of the script file will begin).

If you wish to record all your ATADEMO activities to a file, use the LOG command to open the ATADEMO.LOG file. When the log file is open all keyboard input and program output is recorded in the log file.

(Go To TOC)

COMMAND LINE OPTIONS

The ATADEMO command line syntax is:


   ATADEMO io-mode-options [general-options]

The command line options are processed left to right. If an option is specified more than once, the last (rightmost) specification is used.

One of the following io-mode-options is required:


   PCCMODE=CONTIG
   PCCMODE=CONTIG=xxx
   PCCMODE=MEMORY
   PCCMODE=PRImary
   PCCMODE=SECondary
   PROMPT
   b:d:f:x
   P0
   P1
   PRImary              (same as ATADEMO P0)
   S0
   S1
   SECondary            (save as ATADEMO S0)

I/O Mode Options

These options chose the controller(s) and device(s) to be tested.

(Go To TOC)

[ PCCMODE=x ]


PCCMODE=CONTIG
PCCMODE=CONTIG=xxx
PCCMODE=MEMORY
PCCMODE=PRImary
PCCMODE=SECondary

PCMCIA PC Card ATA (and CompactFlash or CF) devices can be configured to operated in several modes, see the PCC.HTM for more information. xxx is the base I/O address (in hex) to use in CONTIG I/O mode - the default is 200.

(Go To TOC)

[ PROMPT ]


PROMPT

ATADEMO will list all the supported PCI bus ATA host controllers in the system and the user is asked to pick one.

(Go To TOC)

[ b:d:f:x ]


b:d:f:x

Specify the ATA controller and device(s) to be tested.

The b:d:f part of this option specifies the PCI bus, device and function numbers for the ATA controller to be used. The x part is P0, P1, S0 or S1.

(Go To TOC)

[ PRImary ]


PRImary

Same as P0.

(Go To TOC)

[ Px ]


P0
P1

The primary legacy mode ATA host adapter will be used with either device 0 or device 1 as the default selected device (see the DEV command below).

DMA commands are not possible when these options are used.

(Go To TOC)

[ SECondary ]


SECondary

Same as S0.

(Go To TOC)

[ Sx ]


S0
S1

The secondary legacy mode ATA host adapter will be used with either device 0 or device 1 as the default selected device (see the DEV command below).

DMA commands are not possible when these options are used.

Using the PCI b:d:f information

The following table shows how the PCI b:d:f information is used. See the b:d:f:x command line option.

Number of PCI ATA controllers b:d:f is specified Result
n/a no legacy ATA mode
0 yes error
1 no error
1 yes ok if b:d:f matches the controller
>1 no error
>1 yes ok if b:d:f matches one of the controllers

Also see POLLING/INTERRUPT MODES section following the GENERAL OPTIONS section.

General Options

(Go To TOC)

[ BUFSIZE=n ]


BUFSIZE=n

Specify the size of the I/O buffer in bytes. The value n is rounded down to the next multiple of 512 bytes. If n is less than 8192 it will be set to 8192 (16 sectors of 512 bytes). If n is greater than 262144 the value will be set to 262144 (512 sectors of 512 bytes each).

If BUFSIZE is not specified ATADEMO will attempt to allocate an I/O buffer that is a multiple of 8192 bytes (16 sectors) between 262144 and 8192 bytes. If ATADEMO is unable to allocate a buffer of at least 8192 bytes (16 sectors of 512 bytes each) bytes ATADEMO will terminate.

(Go To TOC)

[ DEBUG=xxxx ]


DEBUG=xxxx

xxxx is 1 to 4 hex digits. The following values may be OR'ed together to enable multiple actions:

0002 = Display the PCMCIA PCIC initialization messages. 0010 = Set bit 4 or the PCMCIA Socket and Copy register to 1 (this is the drive# bit and should cause the PC Card ATA device to be configured as device 1).

(Go To TOC)

[ DMA ]


DMA

ATA Read/Write DMA commands will be enabled.

Note that the host adapter and drive(s) to be tested must have been set up in the proper ATA Multiword or Ultra DMA mode before ATADEMO is started.

DMA commands require INTerrupt mode.

See the documentation file DMA.HTM.

Also see:  INTerrupt IRQ=x NODMA POLL

(Go To TOC)

[ INTerrupt ]


INTerrupt

Note: INTerrupt is also a command.

Enable running in interrupt mode. INTerrupt is ignored and polling mode is forced if the PCCMODE=MEMORY option is used. In all other interface modes the default is to enable interrupt mode.

INTerrupt mode is required for DMA commands.

If ATADEMO is unable to determine the IRQ number the IRQ=x option must be used.

See the POLLING/INTERRUPT MODES section below.

Also see:  DMA INTerrupt IRQ=x NODMA POLL

(Go To TOC)

[ IRQ=x ]


IRQ=n
IRQ=Sn

Specify (or override the default) IRQ number (1 to 15) used by the ATA controller.

IRQ=n specifies an IRQ that is not shared. IRQ=Sn specifies an IRQ that is shared.

This option also forces the INTerrupt option.

If IRQ=x is not specified the IRQ number will be default to a not shared IRQ number:

Interrupts must be used in order to perform PCI Bus Mastering ATA DMA transfers.

See the POLLING/INTERRUPT MODES section below.

Also see:  DMA INTerrupt IRQ=x NODMA POLL

(Go To TOC)

[ LOG=fileName ]


LOG=fileName

The default log file name is ".\ATADEMO.LOG". Use this option to specify a different log file name. Use LOG=NUL or LOG=NULL to suppress generation of the log file.

(Go To TOC)

[ NODMA ]


NODMA

ATA Read/Write DMA commands are not enabled.

See the documentation file DMA.HTM.

Also see:  INTerrupt DMA POLL

(Go To TOC)

[ NONSTD=x ]


NONSTD=x

Specify program operation that does not conform to the ATA standards. 'x' is one or more of the following characters:

(Go To TOC)

[ PIO=x ]


PIO=BYTE
PIO=DWORD
PIO=WORD

Specify the width of PIO data transfers. This affects only the ATA Data register reads and writes.

BYTE specifies that 8-bit instructions are used to transfer data (REP INSB and REP OUTSB, or, 8-bit memory access instructions).

Note: 8-bit PIO data transfers should be used only with PCMCIA and CF devices and only after the appropriate SET FEATURES command has been issued to the device to turn on 8-bit mode. 8-bit data transfer is not supported by PCI bus ATA controllers.

WORD specifies that 16-bit instructions are used to transfer data (REP INSW and REP OUTSW, or, 16-bit memory access instructions).

DWORD specifies that 32-bit instructions are used to transfer data in PIO mode (REP INSD and REP OUTSD).

Note: Many ATA host adapters do not implement 32-bit data transfers correctly and will corrupt data passing through the host adapter if DWORD is used.

The default is WORD.

Read the documentation file PIO.HTM before using this option!

Also see:  PIO


PIO=ODR0
PIO=ODR8
PIO=ODR400
PIO=ODRRAND

These options apply only when ATADEMO is running in PCMCIA PC Card ATA Memory mode. These options are ignored at all other times.

In Memory mode the ATA Data register appears at several locations in the Common memory space. These are offsets 0H, 8H and 400H. These options select the offset that will be used by ATADRVR when performing PIO data transfers.

The default is ODRRAND. ODRRAND causes ATADRVR to randonly select one of the three offsets at the start of each DRQ data block.

Also see:  PIO

(Go To TOC)

[ POLL ]


POLL

Note: POLL is also a command.

Run in polling mode. Polling mode is forced if the PCCMODE=MEMORY option is used. In all other modes if POLL is not specified then INTerrupt is the default.

DMA commands are not possible when POLL mode is used.

See the POLLING/INTERRUPT MODES section below.

Also see:  INTerrupt IRQ=x POLL

(Go To TOC)

[ READOnly ]


READOnly

Places ATADEMO into read only mode. In this mode the DPW, DW, PDO, PW, W, W10 and W12 commands are not allowed. This option is in effect for the entire execution of ATADEMO and can not be turned off using the READOnly command.

Warning: While the READOnly option and command can be used to disable write commands, be careful, some Non-Data (ND) commands do write to the device media!

Also see:  READOnly

(Go To TOC)

[ SCR=fileName ]


SCR=fileName

Run the specified script file. See the SCRIPT FILES below.

(Go To TOC)

[ SYSMEM=xxxx ]


SYSMEM=xxxx

Specify the segment address for the PCMCIA system/attribute memory. Valid values are c800, d000 and d800. If not specified system memory between c800:0000 and d8ff:000f will be searched for an unused area. Note that the PCMCIA Card Information Structure (CIS) data and the card configuration registers exist in this memory area.

(Go To TOC)

[ Sn=string ]


Sn=string

Set the corresponding built-in string variable to the string value. The value 'string' can be 0 to 32 characters.

Also see:  ASKSTR STRx str_s*

Polling/Interrupt Modes

When operating in one of the PCMCIA modes (PCCMODE=x options) the following are possible:

When running on a non-PCI system, legacy ATA (ISA ATA) mode is assumed. No DMA is possible in this configuration. The following are possible:

When running on a PCI system with an ATA controller in legacy mode the following are possible:

When running on a PCI system with an ATA controller in native mode the following are possible:

When INTerrupt mode is enabled at ATADEMO startup then the INT command is allowed. ATADEMO starts up in POLL mode even when interrupt mode is enabled. When interrupt mode is enabled both the INTerrupt and POLL commands are valid. When interrupt mode is not enabled then only the POLL command is valid and DMA OFF is forced. See the DMA, INTerrupt and POLL commands.

Command Line Examples

In these examples only the required options are shown. Other options could also appear on these command lines.

On a system with a single primary and/or single secondary ATA host adapter one of the following command lines would be typical:


   ATADEMO P0
   ATADEMO S1

On a system with multiple PCI ATA host adapters, one of the following command lines would be typical:


   ATADEMO 0:7:1:P0
   or
   ATADEMO 0:10:0:S0

When using a PC Card ATA or CFA device, one of the following command lines would be typical:


   ATADEMO PCCMODE=CONTIG
   ATADEMO PCCMODE=CONTIG=280
   ATADEMO PCCMODE=MEMORY

(Go To TOC)

ENVIRONMENT VARIABLES

SET ATADEMO=x

The environment variable ATADEMO is used to control the ATADEMO screen size and the screen colors. This variable is set using the DOS SET command:


   SET ATADEMO=[size];[colors]

where size is the number of screen rows, usually 25, 43, etc, and colors is a list of seven foreground/background colors. There are seven types of messages or areas of the screen:

Each of these can be set to a different color by specifying a pair of characters for the foreground and background colors. The colors are:


   k or K - black
   b or B - blue
   g or G - green
   c or C - cyan
   r or R - red
   m or M - magenta
   y or Y - yellow
   w or W - white

The lower case character results in a low intensity color and a upper case character results in a high intensity color.

The ATADEMO default on a color monitor is:


   SET ATADEMO=25;wkckykgkwkWkMk

The ATADEMO default on a monochrome monitor is:


   SET ATADEMO=25;wkwkwkwkWkWkWk

The following example sets the screen size to 43 lines and changes the screen colors:


   set atademo=43;WkCkYkGkWkkWMk

SET ATAERROR=x

The environment variable ATAERROR is used to enable a trigger signal when an error is detected. This variable is set using the DOS SET command:


   SET ATAERROR=port:v1:v2:v3

where port is an I/O port address and v1, v2 and v3 are values to be written to that port. port must be a hex value in the range 1 to FFFF. v1, v2 and v3 are hex values between 0 and FF.

When this environment variable is in effect, the values v1, v2 and v3 will be written to the I/O port whenever an error is detected (before the error message is displayed.

For example:


   SET ATAERROR=300:0:ff:0

will toggle the data at I/O port 300H from 00H to FFH to 00H.

(Go To TOC)

USER INTERFACE

This section describes the normal user interface of ATADEMO. A script file may use an alternative user interface known as window mode, see the next section.

ATADEMO uses a full screen format for the output. The screen layout is:


   lines      use
   ---------  -----------------------------
    1         program identification line
    2 to n-2  scrolling output area
    n-1       status message
    n         prompt and input area

The user interface operates in one of two modes: normal mode and review mode. Commands are entered and executed in normal mode. In review mode, previous output is displayed.

In normal mode the following keys are used:


   BS    - move the cursor to the left and delete one character
   DEL   - delete the character at the cursor position
   DOWN  - recall commands in the command history buffer
   END   - move the cursor to the end of the line
   ENTER - completes the input
   HOME  - move the cursor to the begining of the line
   INS   - toggle insert/replace mode
   LEFT  - move the cursor left one character
   PGDN  - enter review mode
   PGUP  - enter review mode
   RIGHT - move the cursor right one character
   UP    - recall commands in the command history buffer
   CTRL-END - delete characters to right of cursor position

In review mode the following keys are used:


   DOWN  - scroll down one line
   ESC   - return to normal mode
   PGDN  - scroll down one screen
   PGUP  - scroll up one screen
   UP    - scroll up one line

(Go To TOC)

WINDOW INTERFACE

A script file can place ATADEMO into an alternative user interface mode known as window mode. In window mode the script can control what is displayed in all but the bottom two rows of the screen and the script can display simple menus to retrieve user input. In window mode the script can ask the user to select from a memnu of items and ask the user for numeric and Yes/No input.

When a script presents a menu of items and asks the user to select one of those items the following keys can be used:


   DOWN  - move up one item
   END   - go to the last item
   ENTER - select the item
   HOME  - go to the first item
   UP    - move down one item

In window mode the ASK and ASKYN commands operate the same as in normal mode except the PGUP and PGDN keys are ignored. See the ASK, ASKYN and WINdow command descriptions for more information.

In window mode all program messages continue to be logged to the ATADEMO log file (see the ECHO and LOG commands). The results of executing commands, especially device I/O commands, is not displayed. A script should allow the user to return to normal mode so that the current log file can be seen or so that review mode can be used.

See SCRIPT FILES below and also see the DEMO.DSF and EXAMPLE.DSF files for examples of window mode.

(Go To TOC)

MESSAGE LOGGING

All ATADEMO messages belong to a message level. The ECHO and LOG commands can be used to control the message levels that are displayed and written to the log file.

There are nine message levels:

There are four message level control settings:

The keyboard message levels are controlled using the LOG KML command. The script file message levels are controlled by the LOG SML command. The ECHO, LOG MAXimum and LOG MINimum commands provide a simple way to control the message levels.

Setting a message level off does not affect the execution of a command that produces messages in that message level. For example, turning off informational (M) messages will not affect the result of executing a TAG ON or TAG OFF command but the messages produced by the TAG command will not appear.

(Go To TOC)

COMMAND SUMMARY

Help, Exit/Quit Commands

ATA High Level Commands

ATA Low Level Commands

ATAPI High Level Commands

ATAPI Low Level Commands

Repeating and Automatic Commands

Device and ATADRVR Option Commands

Data Compare and Generation Commands

Data Display and Trace Display Commands

Delay and Timing Commands

Script Commands

Message, Window and Log File Commands

String Commands

Low Level I/O Port Commands

Editor Commands

(Go To TOC)

COMMAND DESCRIPTION FORMAT

In the following command descriptions, words in UPPERCASE are entered as shown. Words in lower case represent variable data that is usually numeric. Words within brackets ([]) are optional. Ellipses (...) indicate that the previous word may be repeated one or more times. Case is ignored in commands ("ABC" is the same as "abc" or "aBc").

Command parameters are literal value, a numeric value, built-in or user defined variables or an expression. For example:


   ON                      - a literal
   COntinue                - a literal
   0                       - a numeric
   -5                      - a numeric
   bytes_xfer              - a built-in variable
   myvar                   - a user defined variable
   (4 + myvar * 3)         - an expression
   ((a1+b2)*(c3/d4)!=10)   - an expression

Numeric Values

Numeric values are entered as follows:

A number starting with a '-' is a negative number, for example, -2 or -0xff.

Recommendation: Use the '0' or '0x' prefix on all hex numbers. This will avoid the problem with certain numeric values being confused with a variable name.

Some ATADEMO commands have an 'lba' parameter. These values are treated as unsigned 32-bit values. LBA values greater than 0x7fffffff should be specified in hex. Be careful when performing arithmetic on large LBA values (arithmetic operators use and produce signed values).

An asterisk (*) can be used in place of any command parameter value. An asterisk leaves the value of the numeric parameter unchanged.

(Go To TOC)

VARIABLES

Variables are supported in the full version of ATADEMO. Variable names may be used as ATADEMO command parameters and may also be used in expressions. There are two basic type of variables:

Variable names are 1 to 10 characters. Variable names over 10 characters are truncated to 10 characters. For example "demo_version" is the same as "demo_versi". Variable names must start with an alphabetic character. Additional characters in a variable name may be alphabetic or numeric characters. Built-in variable names contain one or more underscore (_) characters. Variable names are not case sensitive.

Valid variable name examples:


   abc               (user defined)
   aBc               (same as abc)
   ABC               (same as abc)
   dev_tag           (built-in)
   Dev_Tag           (same as dev_tag)
   DEV_TAG           (same as dev_tag)
   thisisalon        (max length name)
   thisisalongname   (same as thisisalon)
   ThisIsALongOne    (same as thisisalon)

Invalid variable name examples:


   4me               (starts with a numeric character)
   _index            (starts with an underscore)
   loop$count        (invalid character $)

Built-in Variables

Built-in variables contain numeric or string data. These variables contain information describing the current program configuration, device configuration and status, and the results of ATADEMO and I/O commands.

All built-in variables are read-only. Except for the sub_param variables, built-in variables are global variables. The sub_param variables are local to each subroutine. The sub_param variables do not exist in the main part of a script.

Built-in Numeric Variables

The following built-in numeric variables are defined:

 


   addr_as     - I/O address of the Alternate Status register.
   addr_ch     - I/O address of the Cylinder High register.
   addr_cl     - I/O address of the Cylinder Low register.
   addr_cm     - I/O address of the Command register.
   addr_da     - I/O address of the Data register.
   addr_dc     - I/O address of the Device Control register.
   addr_dh     - I/O address of the Device/Head register.
   addr_er     - I/O address of the Error register.
   addr_fr     - I/O address of the Feature register.
   addr_sc     - I/O address of the Sector Count register.
   addr_sn     - I/O address of the Sector Number register.
   addr_st     - I/O address of the Status register.

Note: In PC Card ATA Memory mode the addr_* variables are memory offset values and not I/O port addresses.

       


   bios_timer  - time of day, increments every 55ms, resets
               - to zero at midnight.

   buf_size    - size of the ATADEMO I/O buffer in bytes.

   bmcr_addr   - I/O address of the Bus Master IDE registers.
   bmide_addr  - I/O address of the Bus Master IDE registers.

Note: bmcr_addr/bmide_addr is 0 when a PCI Bus Masting ATA host adapter is not being used.

 


   bytes_xfer  - number of bytes transferred by the
                 last device I/O command.

 


   cmdt_avg    - CMDTime average command time in us (see note).
   cmdt_cnt    - CMDTime number of commands (see note).
   cmdt_cur    - CMDTime time for last command in us (see note).
   cmdt_high   - CMDTime highest command time in us (see note).
   cmdt_low    - CMDTime lowest command time in us (see note).
   cmdt_tot    - CMDTime total time in ms (see note).

Note: The CMDTime variables, except cmdt_cur, are valid only when the command timing feature has been configured and is not enabled and the value of cmdt_cnt is greater than 0. The variable cmdt_cur is valid only when the command timing feature is configured and enabled and the value of cmdt_cur is not a negative number.

 


   demo_version - ATADEMO version.

Note: The ATADEMO version is encoded as three ASCII characters, 0x00xxxxyy where xxxx is the major version and yy is the minor version. For example, version 11A5 is encoded as 0x00313141 (the 5 is not included).

Note: See the pgm_version built-in string variable.

 


   dev_bs      - current device block size.
   dev_chslba  - current device sector addressing mode,
                 0 is CHS, not 0 is LBA.
   dev_num     - current device number, 0 or 1.
   dev_ps      - current ATAPI packet size, 12 or 16.
   dev_tag     - current device TAG ON/OFf state,
                 0 is off, 1 is on.
   dev_type    - current device type,
                 0 = none, 1 = unknown, 2 = ATA, 3 = ATAPI.

         


   drq_packets - number of DRQ packets transfered by last
                 I/O command, see ATADRVR.

   error_code  - ATADRVR error code for the
                 last device I/O command.

   fail_bits   - protocol failure bits for the last
                 I/O command, see ATADRVR.

   fill_num    - current FILLNUM.

   intf_mode   - interface mode being used:
                 1 = PCMCIA Memory mode.
                 2 = PCMCIA Contiguous I/O mode.
                 3 = Primary or PCMCIA Primary I/O mode.
                 4 = Secondary or PCMCIA Secondary I/O mode.

 


   io_am       - current sector/block addressing mode:
                 0 = CHS
                 28 = LBA28
                 32 = LBA32
                 48 = LBA48
   io_lba      - lower 28 or 32 bits of LBA28 or LBA32 value.
   io_lbalo    - same as io_lba
   io_lbahi    - upper 16 bits of LBA48 value
   io_result   - result of last I/O or data compare command,
                 see the commands marked with the symbol [AUTO]:
                 0 = no error
                 1 = I/O error, see error_code
                 2 = data compare error
                 4 = transfer length error, see bytes_xfer
   io_tl       - transfer length (sector/block count)
                 used by the last I/O command.

 


   log_status  - not zero if the log file is full.

 


   max_cyl     - see the ID and CHSIncr commands.
   max_head    - see the ID and CHSIncr commands.
   max_lba     - see the ID and LBAIncr commands.
   max_sect    - see the ID and CHSIncr commands.

 


   num_bytes   - number of bytes.

Note: num_bytes is changed by several commands, the value should be saved in a user defined variable if it is needed. For example, see the READ command.

 


   pci_bus     - PCI bus number (not valid if -1)
   pci_dev     - PCI device number (not valid if -1)
   pci_fun     - PCI function number (not valid if -1)

   


   rand_num    - a 32-bit random number (a new value
                 each time rand_num is used).
   read_only   - current READOnly state,
                 0 = readonly off, not 0 = readonly on.

 


   reg_as      - last read of the Alternate Status register.
   reg_ch      - last read of the Cylinder High register.
   reg_cl      - last read of the Cylinder Low register.
   reg_cm      - last write of the Command register.
   reg_dc      - last write of the Device Control register.
   reg_dh      - last read of the Device/Head register.
   reg_er      - last read of the Error register.
   reg_fr      - last write of the Feature register.
   reg_sc      - last read of the Sector Count register.
   reg_sn      - last read of the Sector Number register.
   reg_st      - last read of the Status register.

 


   rep_num     - current repeat count (1, 2, 3, ... n)
                 during REPeat commands, value is 0 at
                 all other times.
   rep_prev    - ending repeat count for most recent REPeat
                 command.

     


   run_time    - the number of seconds since ATADEMO started.

   script_flag - script execution flag.
   str_result  - result of last STRx command.

 


   sub_param   - same as sub_param1.
   sub_param1  - first subroutine parameter.
   sub_param2  - second subroutine parameter.
   sub_param3  - third subroutine parameter.
   sub_param4  - fourth subroutine parameter.
   sub_param5  - fifth subroutine parameter.
   sub_param6  - sixth subroutine parameter.
   sub_param7  - seventh subroutine parameter.
   sub_param8  - eighth subroutine parameter.
   sub_param9  - nineth subroutine parameter.

Note: The sub_param variables are local to the current subroutine. They do not exist in the main part of a script.

   


   sub_return  - last subroutine's return value, see the RETURN
                 command.

   time_out    - ATADRVR time out flag for the
                 last device I/O command.

Built-in String Variables

Build-in string variables are used in the 'text' parameter of the ASK, ASKYN, ASKSTR, SAY, STRSET, WL and WRITEText commands. The STRx commands can perform various operations on the str_s* variables.

These variables have a numeric value of 0 at all times.

The following built-in string variables are defined:

         


   cur_time    - Current date and time string.
   id_model    - Model number string.
   id_serial   - Serial number string.
   id_version  - Version number string.
   pgm_version - ATADEMO version (see below).
   scr_name    - Full name of the current script file.
   str_s0      - String variable 0
   str_s1      - String variable 1
   str_s2      - String variable 2
   str_s3      - String variable 3
   str_s4      - String variable 4
   str_s5      - String variable 5
   str_s6      - String variable 6
   str_s7      - String variable 7
   str_s8      - String variable 8
   str_s9      - String variable 9

The id_* variables are assigned a new value whenever an ID command is sucessful. This data is kept for each device.

The pgm_version variable contains the ATADEMO version encoded as three ASCII characters, "NNX" where NN is the major version and X is the minor version. For example, version 11A5 is encoded as "11A" (the 5 is not included). Note: See the demo_version built-in variable.

The str_s* can store strings of 0 to 96 characters. These string variables can be assigned values using the Sn=string command line options and by the ASKSTR and STRx commands.

User Defined Numeric Variables

User defined variables are defined and given a value by the following commands:


   ASK
   ASKYN
   COPYBYtes
   FETCHBUF
   FETCHCDB
   INPCIByte and INPCIWord
   INPORTByte and INPORTWord
   LOCAL
   SET
   WINdow ASK

A variable must be defined before it can be used in place of a numeric command parameter or within an expression.

There are two kinds of user defined variables, global and local:

The following rules determine when and how variables are defined:

New global variables are defined by

Existing global variables are updated by

New local variables are defined by

* Existing local variables are updated by

Some commands are able to create new variables or update existing variables. These commands are ASK, ASKYN, COPYBYtes, FETCHx, INPCIx, INPORTx, and WINdow ASK. If the variable used in these commands does not exist then a new global variable is created. If the variable exists, as a local variable in the current subroutine or as a global variable, then the existing variable is updated.

Example of global and local variables used in a script file:


   ; main part begins here
   set a = 1         ; a is a global
   set a = 2         ; global a is updated
   local a = 3       ; global a is updated (warning message)
   fetchbuf a 0 0 1  ; global a is updated
   local b = 1       ; b is a global (warning message)
   local b = 2       ; global b is updated (warning message)
   set b = 3         ; global b is updated
   fetchbuf b 0 0 1  ; global b is updated
   call sub1
   quit
   ; main part ends here
   beginsub sub1
      set a = 4         ; global a is updated
      fetchbuf a 0 0 1  ; global a is updated
      local b = 1       ; local b replaces global b
      local b = 2       ; local b is updated
      set b = 3         ; local b is updated (warning message)
      fetchbuf b 0 0 1  ; local b is updated
      call sub2
      fetchbuf c 0 0 1  ; global c is updated
      local d = 1       ; d is a local
      fetchbuf d 0 0 1  ; local d is updated
   endsub sub1
   beginsub sub2
      set a = 5         ; global a is updated
      fetchbuf a 0 0 1  ; global a is updated
      local b = 1       ; local b replaces global b
      local b = 2       ; local b is updated
      set b = 3         ; local b is updated (warning message)
      fetchbuf b 0 0 1  ; local b is updated
      fetchbuf c 0 0 1  ; c is a global
      local d = 1       ; d is a local
      fetchbuf d 0 0 1  ; local d is updated
   endsub sub2

Variable Names That Look Like Numbers Or Keywords

Special care must be taken with some variable names that can be interpreted as either a numeric variable or variable name. These variables names contain only the characters A, B, C D, E, and/or the character H and X. For example:


   A        - could be the variable "A" or the
              numeric value 10 (0xa).
   f0x      - could be the variable "f0x" or the
              numeric value 240 (0xf0).
   H0       - could be the variable "H0" or the
              numeric value 0 (0x0).

If the variable name is defined, the current value of that variable is used. To avoid this confusion, use the "0" or "0x" prefix on hex numbers.

User defined variable names are not restricted and may be the same as keywords used in some commands, such as, ON, OFf, DEFAULT, etc. This can cause confusion and incorrect execution of script files. To prevent confusion or incorrect execution:


   set on = 0
   tag on      ; turns tagging on ("on" is a keyword)
   tag (on)    ; turns tagging off ("on" is a variable)

   set xyz = 583
   tag xyz     ; "xyz" is an invalid keyword
   tag (xyz)   ; turns tagging on ("xyz" is a variable)

(Go To TOC)

EXPRESSIONS

An expression is enclosed within a pair of parenthesis. All operations within an expression use 32-bit signed integers. There is no error if the expression results in an overflow or underflow. Division by zero is not allowed. The result of an expression is a signed 32-bit integer.

Some ATADEMO commands have an 'lba' parameter. These values are treated as unsigned 32-bit values. LBA values greater than 0x7fffffff should be specified in hex. Be careful when performing arithmetic on large LBA values (arithmetic operators use and produce signed values).

The general format of an expresion is


   ( [operator] token [operator token] ... )

A token is either a constant numeric value or variable name. The valid operators are


   ~ !               - bitwise NOT, logical NOT
   * / %             - multiply, divide, remainder
   + -               - add, subtract
   & | ^             - bitwise AND, OR and XOR
   << >>             - unsigned bit shift left and right
   == != < <= > >=   - comparison
   && ||             - logical AND and OR

Operators are evaluated in the precedence shown above from the top down (~ and ! have the highest precedence). Parentheis can be used to change the order of evaluation.

The ~ and ! operators are valid only as prefix operators. The + and - operators may be used as prefix operators.

An expression that consists of only a variable name or only a numeric value is valid but will evaluate slower than the same variable name or numeric value not coded as an expression. For example:


   (0)     is the same as 0
   (myvar) "  "   "    "  myvar
   (-3)    "  "   "    "  -3

Commands that have ON and OFf parameters, such as the DMA command, also accept an expression that is evaluated (0 equals OFf, not 0 equals ON). In these commands this expression must be enclosed in parentheis (even if the expression is a single token). For example: "(3)" is equivalent to ON.

Examples of valid expressions:


   (a*b+c/d)
   ( (a*b) + (c/d) )
   (!myvar)
   (((-3)+(g)))
   ( (xx<<4) &0x30 != (y*4) || z == -5)

Examples of invalid expressions:


   a*b+c          missing "(" and ")"
   ((3*t)         missing ")"
   (*4)           invalid prefix operator
   ((a+b)(c/d))   missing operator
                  between ")" and "("

(Go To TOC)

TEXT STRING FORMATING

The ASK, ASKYN, SAY, WL and WRITEText commands are able to create formated text strings containing the values of built-in and user defined variables. To include the current value of a variable place the variable name within brace characters in the text string:


   {varName}      - display variable in decimal,
                    or display a string variable.
   {#varName}     - display variable in decimal,
                    pad on left with spaces to a field width of #.
   {*varName}     - display variable in hex.
   {*#varName}    - display variable in hex,
                    pad on left with '0' to a field width of #.

The maximum length of a formated text string is about 200 characters.

Examples:


   set xyz = 127

   say The current value of xyz is ({xyz}) ({*xyz}H).

      Displays the message:

      "The current value of xyz is (127) (7FH)."

   say The current value of xyz is ({5xyz}) ({*5xyz}H).

      Displays the message:

      "The current value of xyz is (  127) (0007FH)."

   say Drive Model: {id_model}

      Displays a message like this:

      "Drive Model: SuperDupper Corp Really Fast Disk"

(Go To TOC)

FILE NAMES

Some ATADEMO commands have a fileName parameter - see the LOG NEW, READ, SCRipt, WRITE and WRITEText commands. The fileName parameter may be specified in three different formats:

For case 3, to include the current value of a variable place the variable name within brace characters in the text string:


   {varName}      - convert the variable to decimal.
   {*varName}     - convert the variable to hex.

See the individual commands for examples.

(Go To TOC)

SCRIPT FILES

The commercial/full version of ATADEMO supports script files. A script file is an easy way to have ATADEMO execute a series of commands in a "batch" mode. Create a script file with your favorite ASCII text editor. Use the SCR= command line option or the SCRipt command at the keyboard to load and execute a script file.

Script files can also be used to defined the equivalent of a new ATADEMO command. This is done by defining a subroutine in a script file and then using the subroutine name as if it was an ATADEMO command. The CAll command from the keyboard can also be used to execute the subroutine.

Most ATADEMO commands can be entered at the keyboard or executed from within a script file. However, many ATADEMO commands are valid only when executed via a script file, such as the IF, ELSE, RETURN and WHILE commands. These commands provide a powerful programming facility within a script file.

Script files are described in detail, with examples, in the documentation file SCRIPTS.HTM.

(Go To TOC)

COMMAND CLASSES

Commands that are supported only in the commercial/full version are marked with the symbol [FULL].

Commands that perform device I/O commands are marked with the symbol [DIO]. These commands can be repeated using the REPeat command and by using the / and // commands.

Commands that may be used with the REPeat command are marked with the symbol [REP].

Commands that invoke the automatic before and after commands are marked with the symbol [AUTO].

Commands that valid only within a script file are marked with the symbol [SCRIPT]. These commands can not be entered at the keyboard.

(Go To TOC)

COMMAND EXECUTION

ATADEMO commands are executed one at a time, however, some commands can be combined using the AFTERx and BEFORE comamnds. This can create powerful combinations of ATADEMO functions. The following commands can be used to set up these combinations of ATADEMO functions:


   AFTERERror           CHSIncr              ONERRor
   AFTERNOerror         EXPEcterror          ONESCkey
   BEFORE               LBAIncr              REPeat

For device I/O commands (see the commands flagged with symbol [DIO]) the following is the sequence of events for the execution of a single command.


   1) Get and process the command parameters. This is performed
      only for the first execution of a repeated command.
   2) If repeating, update the CHS or LBA. This may terminate
      the repeating.
   3) Execute the BEFORE commands in effect.
   4) Execute the device I/O command.
   5) Check the I/O command result and set up the
      AFTERx commands to be processed.
      If there was an I/O error,
         execute the AFTERERror commands in effect
      else
         execute the AFTERNOerror commands in effect.
   6) Apply EXPEcterror to the command result in step 4.
   7) Apply the ONERRor condition in effect. This may
      terminate the repeating.

For the CHKBUF, CHKREG and COMPx commands the following is the sequence of events for the execution of a command. Note that these commands can not be repeated and that the only error reported by these commands is a data compare error.


   1) Get and process the command parameters.
   2) Execute the command.
   3) Check the command result and set up the
      AFTERx commands to be processed.
      If there was an error,
         execute the AFTERERror commands in effect
      else
         execute the AFTERNOerror commands in effect.
   4) Apply EXPEcterror to the command result from step 2.
   5) Apply the ONERRor condition in effect.

(Go To TOC)

COMMAND REFERENCE

(Go To TOC)

[ (QuestionMark) ]


(QuestionMark)

A ? character anywhere on a command line entered from the keyboard is equivalent to using the Help command.

If the ? character is the first non-blank character then this is equivalent to the Help command. If there are non-blank characters before the ? character then this is equivlant to the Help x command where x is the first non-blank character.

Also see:  Help

(Go To TOC)

[ AFTERx ]

See AFTERERror and AFTERNOerror below.

(Go To TOC)

[ AFTERERror ]


AFTERERror

Display the current after error automatic commands (see the commands marked with the symbol [AUTO]).


AFTERERror OFf
AFTERERror ON
AFTERERror (n)

Disable or enable automatic commands following a device I/O command (see the commands marked with the symbol [AUTO]) that ends with an error. These commands do not change the automatic commands that are selected.

For AFTERERror (n), a zero value is the same as OFf and a non zero value is the same as ON.

Warning: See "Variables that look like keywords" above.

The default is AFTERERror ON.

Also see:  AFTERNOerror BEFORE EXPEcterror


AFTERERror [+]command [-]command ...
AFTERERror NONE

Select automatic commands executed following a device I/O command (see the commands marked with the symbol [AUTO]) that ends with an error.

If the automatic command name is prefixed with '+' (for example +Dump), that automatic command is enabled. If the automatic command name is prefixed with '-' (for example, -Dump), that automatic command is disabled.

Valid commands are: SHOWPC, Dump, SHOWCH, SHOWLL, SHOWCB, Clear, RS and RESet. NONE disables all commands.

When enabled the commands are executed in the order shown.

Note: RESet includes SATA port reset (if there was a timeout error on the previous command). See the RESet command description.

Dump does not display any data for PIO or DMA commands that transfer more sectors than fit into the I/O buffer.

Also see:  AFTERNOerror BEFORE EXPEcterror

(Go To TOC)

[ AFTERNOerror ]


AFTERNOerror

Display the current after no error automatic commands (see the commands marked with the symbol [AUTO]).


AFTERNOerror OFf
AFTERNOerror ON
AFTERNOerror (n)

Disable or enable automatic commands following a device I/O command (see the commands marked with the symbol [AUTO]) that ends with no error. These commands do not change the automatic commands that are selected.

For AFTERNOerror (n), a zero value is the same as OFf and a non zero value is the same as ON.

Warning: See "Variables that look like keywords" above.

The default is AFTERNOerror ON.

Also see:  AFTERERror BEFORE EXPEcterror


AFTERNOerror [+]command [-]command ...
AFTERNOerror NONE

Select automatic commands executed following a device I/O command (see the commands marked with the symbol [AUTO]) that ends with no error.

If the automatic command name is prefixed with '+' (for example +Dump), that automatic command is enabled. If the automatic command name is prefixed with '-' (for example, -Dump), that automatic command is disabled.

Valid commands are: SHOWPC, COMPx, Dump, SHOWCH, SHOWLL, SHOWCB, Clear, RS and RESet. NONE disables all commands.

When enabled the commands are executed in the order shown.

COMPx is performed only after read commands (DPR, DR, PDI, PR, R, RCD, R10 and R12).

Note: When COMPx is used with PIO read commands that transfer more sectors than fit into the I/O buffer, only the sector tag data is actually compared. See the COMPTag and TAG commands.

Dump does not display any data for PIO or DMA commands that transfer more sectors than fit into the I/O buffer.

Also see:  AFTERERror BEFORE EXPEcterror

(Go To TOC)

[ ALTER ]


ALTER sectorOffset byteOffset andMask orMask

Alter the value of a byte in the buffer. The byte in the buffer is fetched, AND'ed with the andMask value, OR'ed with the orMask value, and stored back into the buffer.

sectorOffset is 0 to one less than the maximum number of sectors that fit into the buffer.

byteOffset is 0 to one less than the size of a sector.

andMask and orMask are a value from 0 to 255.

Note: The sector/block size of an ATA device can be an even number between 512 and 32768. The sector/block size is determined by the BLOCKSIZE and/or ID commands.

Note: The sector/block size of an ATAPI device can be 1 to 32768. The sector/block size is determined by the BLOCKSIZE or the RCAp commands.

Also see:  BLOCKSIZE ID RCAp STORE

(Go To TOC)

[ ASK ]


ASK varName [text]

[FULL]

See the description of "user defined variables" above.

Ask for input from the keyboard. The input is a single numeric value. The value is assigned to the user defined variable varName.

Either the optional message 'text' is displayed or the following message is displayed when the keyboard input is requested:


   ASK: Enter value for variable varName ? [cur-value]

See the section TEXT STRING FORMATING for the rules on how 'text' strings are used with this command.

Also see:  ASKYN ASKSTR SAYx WL WRITEText

(Go To TOC)

[ ASKSTR ]


ASKSTR strVar [text]

[FULL]

Ask for string input from the keyboard.

The string entered is assigned to the built-in string variable strVar (str_s*). Leading and trailing spaces are removed from the string entered.

str_result is set to the length of the string entered.

Either the optional message 'text' is displayed or the following message is displayed when the keyboard input is requested:


   ASKSTR: Enter value for string strVar ?

See the section TEXT STRING FORMATING for the rules on how 'text' strings are used with this command.

Also see:  ASK ASKYN SAYx STRx WL WRITEText str_s* Sn=string

(Go To TOC)

[ ASKYN ]


ASKYN varName [text]

[FULL]

See the description of "user defined variables" above.

Ask for Yes/No input from the keyboard. If the first character entered is y or Y, the user defined variable varName is set to 1. If the first character entered is n or N, the user defined variable varName is set to 0.

Either the optional message 'text' is displayed or the following message is displayed when the keyboard input is requested:


   ASK: Enter Y or N for variable varName ? [cur-value]

See the section TEXT STRING FORMATING for the rules on how 'text' strings are used with this command.

Also see:  ASK ASKSTR SAYx WL WRITEText

(Go To TOC)

[ ATAPIDelay ]


ATAPIDelay

Display current setting of the special 110ms delay for ATAPI devices.


ATAPIDelay OFf
ATAPIDelay ON
ATAPIDelay (n)

Turn the special 110ms delay for ATAPI devices that don't handle status correctly on and off. The default is off.

For ATAPIDelay (n), a zero value is the same as OFf and a non zero value is the same as ON.

Warning: See "Variables that look like keywords" above.

(Go To TOC)

[ ATAPIRegs ]


ATAPIRegs fr sc sn dh

Sets the values used by ATADRVR when the next Packet (A0H) command is issued. ATADRVR normally places zero into the Feature, Sector Count, Sector Number and Device/Head (bits 3,2,1,0) registers when a Packet command is issued. Use this command before the DPR, DPW, PN, PR, PW or other command that results in a Packet (A0H) command (such as R10).

fr is the value, 0 to 255, that should be used in the Features register.

sc is the value, 0 to 255, that should be used in the Sector Count register.

sn is the value, 0 to 255, that should be used in the Sector Number register.

dh is the value, 0 to 15, that should be used in bits 3, 2, 1 and 0 of the Device/Head register.

These values default to zero and are reset to zero by ATADRVR after issuing the Packet command.

(Go To TOC)

[ BEFORE ]


BEFORE

Display the current before automatic commands (see the commands marked with the symbol [AUTO]).


BEFORE OFf
BEFORE ON
BEFORE (n)

Disable or enable automatic commands prior a device I/O command (see the commands marked with the symbol [AUTO]). These commands do not change the automatic commands that are selected.

For BEFORE (n), a zero value is the same as OFf and a non zero value is the same as ON.

Warning: See "Variables that look like keywords" above.

The default is BEFORE ON.

Also see:  AFTERx EXPEcterror


BEFORE [+]command [-]command ...
BEFORE NONE

Valid commands are: SHOWPC, Dump, SHOWCH, SHOWLL, SHOWCB, CLear, RS, RESet and FILLx. NONE disables all commands.

When enabled the commands are executed in the order shown.

Select automatic commands executed prior to a device I/O command (see the commands marked with the symbol [AUTO]).

Dump displays only the first sector/block in the I/O buffer.

FILLx is performed only before write commands (DPW, DW, PDO, PW, W, W10 and W12).

If the automatic command name is prefixed with '+' (for example +Dump), that automatic command is enabled. If the automatic command name is prefixed with '-' (for example, -Dump), that automatic command is disabled.

Also see:  AFTERx EXPEcterror

(Go To TOC)

[ BEGINSub ]


BEGINSub subName [type]

[FULL] [SCRIPT]

Define the beginning of a script file subroutine.

subName is the name of the subroutine and type is either PRIVate or PUBlic. If type is omitted, type defaults to PUBlic.

PRIVate subroutines can be called only by using a CAll, ONERRor or ONESCkey command within a script file. PUBlic subroutines can be called by a CAll or ONERRor command within a script file and can also be called by entering a CAll command from the keyboard.

Subroutine names can be the same as ATADEMO commands. See the CAll command for an explanation of how a subroutine can replace an ATADEMO command.

Warning: Be careful when selecting subroutine names. Any ATADEMO command, including commands like QUit and Exit, can be replaced by a PUBlic subroutine of the same name.

Also see:  CAll ONERRor ONESCkey

(Go To TOC)

[ BLOCKSIZE ]


BLOCKSIZE

Display the sector/block size for the currently selected device.


BLOCKSIZE n

Specify the size in bytes of sectors/blocks for the currently selected device.

The default for an ATA device is 512. The sector/block size of an ATA device can be an even number between 512 and 32768. The ID command will set the sector/block size of an ATA device using IDENTIFY data words 106 and 117-118.

The default for an ATAPI device is 2048. The sector/block size of an ATAPI device can be 1 to 32768. The ID and RCAp commands will set the sector/block size.

The device sector/block size must be set before using the commands COMPx or FILLx are used and before any media access commands are used (such as R, W, R10, W10, etc). Note that for RCD commands BLOCKSIZE 2352 should be used.

This sector/blocksize does not affect the size of sectors/blocks transferred by non-media access commands (such as ID).

Note: To use sector tagging n must be greater than 64 - see the TAG comand.

Also see:  COMPx DEVice FILLx ID RCAp RCD R10 R12 TAG W10 W12

(Go To TOC)

[ BReak ]


BReak

[FULL] [SCRIPT]

Exit from the current WHILE loop.

(Go To TOC)

[ CAll ]


CAll subName [ n1 n2 n3 n4 n5 n6 n7 n8 n9 ]
subName [ n1 n2 n3 n4 n5 n6 n7 n8 n9 ]

[FULL]

Call a script file subroutine and optionally pass one to nine parameters to the subroutine.

The values n1, n2, ..., n9 are assigned to the built-in variables sub_param1, sub_param2, ..., sub_param9 when the subroutine is entered. Any missing parameter values are set to 0.

The first format of the CAll command must be used within script files. The second format of the CAll command is not valid within a script file.

The first or second formats can be used from the keyboard to call PUBlic subroutines that were defined by the currently loaded script file. The second format makes the a PUBlic subroutine appear to be an ATADEMO command.

Warning: Be careful when selecting subroutine names. Any ATADEMO command, including commands like QUit and Exit, can be replaced by a PUBlic subroutine of the same name.

Also see:  BEGINSub ENDSub DUMPSub SCRipt

(Go To TOC)

[ CHKBUF ]


CHKBUF sectorOffset byteOffset andMask op n ...

[AUTO] [FULL]

The value of a buffer byte is AND'ed with the value andMask and the result is compared to the value n using compare operator op. If the result is false, the CHKBUF command ends with an error. byteOffset is incremented by one and the next buffer byte is compared to the next n value.

sectorOffset is 0 to one less than the maximum number of sectors that fit into the buffer.

byteOffset is 0 to one less than the size of a sector.

andMask must be a value in the range 0 to 255.

op must be ==, !=, <, <=, <, <=.

n must be a value in the range 0 to 255.

Also see:  CHKREG ID ONERRor RCAp

Example:


   chkbuf 0 0 ffh == 80h 40h 20h 10h

   This example checks the first four bytes of the buffer.

(Go To TOC)

[ CHKREG ]


CHKREG reg andMask op n

[AUTO] [FULL]

The contents of register reg is AND'ed with the value andMask and the result is compared to the value n using compare operator op. If the result is false, the CHKREG command ends with an error.

regName must be AS, CH, CL, DH, ER, SC, SN or ST.

andMask must be a value in the range 0 to 255.

op must be ==, !=, <, <=, <, <=.

n must be a value in the range 0 to 255.

Note: ATADRVR reads all of the registers at the end of every command or reset. The SHOWCB command can be used to force a read of the registers.

Also see:  CHKBUF ONERRor

Example:


   chkreg sc ffh <= 80h

   This example checks the Sector Count register for the
   value less than or equal to 80H.

(Go To TOC)

[ CHS ]


CHS

Switch to CHS sector addressing. This is the default sector addressing mode.

Also see:  LBA

(Go To TOC)

[ CHSIncr ]


CHSIncr

[FULL]

Display the current CHSIncr settings.

The CHSIncr command uses the following terms. Some of these values can be read using built-in variables.

curCHS is the CHS used in the current command, see the io_lbalo and io_lbahi built-in variables.

baseCHS is the CHS specified by the ATADEMO command being repeated.

numCyl is the number of cylinders in the current CHS geometry, (max_cyl + 1).

numHead is the number of heads in the current CHS geometry (max_head + 1).

numSect is the number of sectors in the current CHS geometry (max_sect).

numCHS is the number of sectors in the current CHS geometry or (numCyl * numHead * numSect ).

incrCHS is the current CHS increment.

numSect is the number of sectors that the current command will attempt to transfer.

The ID command will set max_cyl (numCyl-1), max_head (numHead-1), max_sect (numSect) and numCHS to the values in ATA Identify data words 54-56 (or if words 54-56 are not valid, to words 1, 3 and 6). Remember that cylinders are numbered from 0 to max_cyl, heads are numbered 0 to (max_head) and sectors are numbered from 1 to max_sect. CHSIncr can be used to override the values set by ID.

In CHS addressing mode the CHSIncr command and the REPeat command use the following rules:

Also see:  ID LBAIncr RCAp REPeat

Examples: See "Using CHSIncr, LBAIncr and REPeat Commands" below.


CHSIncr incrCHS [numCyl numHead numSect]

[FULL]

See the terms and rules defined in the CHSIncr command above.

incrCHS may be a value from -65536 to 65536.

When an ATA command in CHS sector addressing is repeated curCHS of the first command is baseCHS. Starting with the second command, curCHS is increment by incrCHS before each command. A REPeat loop in CHS mode will terminate when (curCHS + incrCHS) is greater than numCHS or less than CHS 0 0 1. When incrCHS is greater than 0, the curCHS of the last command repeated may be adjusted to (numCHS - numSect). When incrCHS is less than 0, the curCHS of the last command repeated may be adjusted to CHS 0 0 1.

The default is


   CHSIncr 0 1024 16 63

so that CHS addresses are not incremented by the REPeat command until either an ID or CHSIncr command is executed.

Warning: See "Variables that look like keywords" above.

Also see:  ID LBAIncr REPeat


CHSIncr Random [numCyl numHead numSect]

[FULL]

See the terms and rules defined in the CHSIncr command above.

When an ATA command in CHS sector addressing is repeated, or when the R, RSVW, S or W commands are repeated, the CHS of the first command is baseCHS. Starting with the second command, the curCHS is randomly generated within the range baseCHS to numCHS + 1 - numSect).

The default is


   CHSIncr 0 1024 16 63

so that CHS addresses are not incremented by the REPeat command until either an ID or CHSIncr command is executed.

Warning: See "Variables that look like keywords" above.

Also see:  ID LBAIncr RCAp REPeat


CHSIncr TL [numCyl numHead numSect]

[FULL]

See the terms and rules defined in the CHSIncr command above.

When an ATA command in CHS sector addressing is repeated, or when the R, RSVW, S or W commands are repeated, the CHS of the first command is baseCHS. Starting with the second command, the curCHS is incremented by the numSect value of the previous command. A REPeat loop in CHS mode will terminate when (curCHS + numSect) is greater than numCHS. The curCHS of the last command repeated may be adjusted to (numCHS - numSect).

The default is


   CHSIncr 0 1024 16 63

so that CHS addresses are not incremented by the REPeat command until either an ID or CHSIncr command is executed.

Warning: See "Variables that look like keywords" above.

Also see:  ID LBAIncr RCAp REPeat

(Go To TOC)

[ Clear ]


Clear

Clear the command history and low level trace buffers.

Also see:  SHOWx

(Go To TOC)

[ CMDTime ]


CMDTime

[FULL]

Displays the current settings for the command timing facility.


CMDTime CONFIG

[FULL]

Configure the timers used by the command timing facility and by the "DELAY US n" command. Several seconds may be required to complete the configuration.

Starting with ATADEMO version 11F the command timing facility is configured during ATADEMO start-up. This command does not need to be used more than once per execution of ATADEMO and is not need when using ATADEMO version 11F or higher.

The command timing facility configuration must be be successful before command timing can be performed or the "DELAY US n" command can be used.

Also see:  DELAY


CMDTime OFf
CMDTime ON
CMDTime (n)

[FULL]

Turn command timing on and off.

The command timing facility keeps four numbers: the number of commands executed, the total time required to perform those commands, the average command time, the minimum command time and the highest command time. The times do not include any ATADEMO command processing overhead (it does include all of the ATADRVR processing time). The execution time of all commands is counted, even comands that end with I/O errors and commands that fail due to an ATADRVR timeout.

CMDTime ON resets the number of command counter and the time values and enables command timing. Command timing remains in effect until a CMDTime OFf comand is executed.

CMDTime OFf displays the command time information and disables command timing.

For CMDTime (n), a zero value is the same as OFf and a non zero value is the same as ON.

Warning: See "Variables that look like keywords" above.

Also see the CMDT_* built-in variables.

Example: Measure the times for 1000 random single sector read commands.


   lbaincr random
   cmdtime on
   repeat 1000 r 1 0
   cmdtime off

(Go To TOC)

[ COMPare ]


COMPare numBytes sectorOffset1 byteOffset1 sectorOffset2 byteOffset2

Compare data at one location in the buffer to another location in the buffer.

numBytes is the number of bytes to compare. numBytes is 0 to the current buffer size.

sectorOffset1 is 0 to one less than the maximum number of sectors that fit into the buffer.

byteOffset1 is 0 to one less than the size of a sector.

sectorOffset2 is 0 to two less than the maximum number of sectors that fit into the buffer.

byteOffset2 is 0 to one less than the size of a sector.

If there is a miscompare, only the first byte that does not compare is displayed.

See the io_result built-in variable.


   onerror cont
   compare 10 0 0 1 0
   if io_result
      say "! Compare Error !"
   endif
   onerror stop

Also see:  BLOCKSIZE COPY ID RCAp

(Go To TOC)

[ COMPx ]

General information for the COMPx commands.

The COMPx commands check the data in the I/O buffer. All data compare is based on the current BLOCKSIZE for the device.

There are three ways to use the COMPx commands:

The best way to perform data compare on data read into the I/O buffer is to use the AFTERNOerror command with the COMPx command. When used with the AFTERNOerror command the COMPx command will compare the data read by a read data I/O command as part of the execution of the read data I/O command.

If used without the 'n' parameter, a COMPx command will compare the data in the I/O buffer if the last device command read data into the I/O buffer.

A 'COMPx n' command forces data compare for the first n sectors in the I/O buffer.

The COMPx commands change the value of the io_result built-in variable.

When the COMPx commands are used with read commands that transfer more data than the size of the ATADEMO I/O buffer the following rules apply:

See COMPIncr, COMPOne, COMPPat, COMPRand, COMPStart, COMPTag, COMPWord and COMPZero below. Also see the FILLx commands (and the examples in the FILLx general description).

Some examples of COMPx commands...

Example 1: These commands show the 'normal' use of the COMPx (and FILLx) commands:


   BEFORE FILLRand         // fill buffer before write
   AFTERNOerror COMPRand   // compare data after read
   W 1 0                   // write a sector
   R 1 0                   // read a sector

Example 2: This is equivalent to example 1.


   FILLRand          // fill buffer
   W 1 0             // write a sector
   R 1 0             // read a sector
   COMPRand          // compare the data

Example 3: Will not compare data because ATADEMO knows that ID, INQ, RCAP, RS, RTOC commands transfer 'special' data that would not compare.


      AFTERNOerror COMPZero
      ID

Example 4: This would most likely generate a data compare error because it is unlikely a device would have Identify data that was 00H in each byte.


      ID
      COMPZero 1

(Go To TOC)

[ COMPIncr ]


COMPIncr [n]

[AUTO]

See the general description of the COMPx commands above.

Compare sectors in the buffer with the incrementing byte pattern (00H, 01H, 02H, ..., FFH, 00H, ...). The last I/O command executed is used to determine the number of sectors and the size of each sector.

If TAG is ON the sector tag data will also be verified.

Specify n (1 to current number of sectors/blocks in the I/O buffer) to force data compare even if the last device I/O command was not a read command.

Also see:  AFTERx BLOCKSIZE COMPx FILLx TAG

(Go To TOC)

[ COMPOne ]


COMPOne [n]

[AUTO]

See the general description of the COMPx commands above.

Compare sectors in the buffer with FFH bytes. The last I/O command executed is used to determine the number of sectors and the size of each sector.

If TAG is ON the sector tag data will also be verified.

Specify n (1 to current number of sectors/blocks in the I/O buffer) to force data compare even if the last device I/O command was not a read command.

Also see:  AFTERx BLOCKSIZE COMPx FILLx TAG

(Go To TOC)

[ COMPPat ]


COMPPat [n]

[AUTO]

See the general description of the COMPx commands above.

Compare sectors in the buffer with the current pattern specified by the FILLPat command. The last I/O command executed is used to determine the number of sectors and the size of each sector.

If TAG is ON the sector tag data will also be verified.

Specify n (1 to current number of sectors/blocks in the I/O buffer) to force data compare even if the last device I/O command was not a read command.

Also see:  AFTERx BLOCKSIZE COMPx FILLx TAG

(Go To TOC)

[ COMPRand ]


COMPRand [n]

[AUTO]

See the general description of the COMPx commands above.

Compare sectors in the buffer with a random data pattern. See the FILLRand command. The first 4 bytes of the sector are used as the expected data pattern. The last I/O command executed is used to determine the number of sectors and the size of each sector.

If TAG is ON the sector tag data will also be verified.

Specify n (1 to current number of sectors/blocks in the I/O buffer) to force data compare even if the last device I/O command was not a read command.

Also see:  AFTERx BLOCKSIZE COMPx FILLx TAG

(Go To TOC)

[ COMPStart ]


COMPStart [n]

[AUTO]

See the general description of the COMPx commands above.

Compare sectors in the buffer with the program start time (a 4 byte value). The last I/O command executed is used to determine the number of sectors and the size of each sector.

If TAG is ON the sector tag data will also be verified.

Specify n (1 to current number of sectors/blocks in the I/O buffer) to force data compare even if the last device I/O command was not a read command.

Also see:  AFTERx BLOCKSIZE COMPx FILLx TAG

(Go To TOC)

[ COMPTag ]


COMPTag [n]

[AUTO]

See the general description of the COMPx commands above.

Compare only the sector tag data of the sectors in the buffer.

When data compare is used with PIO read commands that transfer more sectors than fit into the I/O buffer, only the sector tag data is compared. See the TAG command.

Note: ATACT, ATADEMO and ATAMDT place the LBA part of the sector tag data at the same offset in a sector. This command (used with AFTERNOerror) can be used with read data commands to scan a disk that was written by ATADEMO, ATACT or ATAMDT to look for sectors with incorrect tag data.

Specify n (1 to current number of sectors/blocks in the I/O buffer) to force data compare even if the last device I/O command was not a read command.

Also see:  AFTERx BLOCKSIZE COMPx DUMPCt DUMPTag FILLx TAG

(Go To TOC)

[ COMPWord ]


COMPWord [n]

[AUTO]

See the general description of the COMPx commands above.

Compare sectors in the buffer with the incrementing word pattern (0000H, 0001H, ..., FFFFH, 0000H, ...). The last I/O command executed is used to determine the number of sectors and the size of each sector.

If TAG is ON the sector tag data will also be verified.

Specify n (1 to current number of sectors/blocks in the I/O buffer) to force data compare even if the last device I/O command was not a read command.

Also see:  AFTERx BLOCKSIZE COMPx FILLx TAG

(Go To TOC)

[ COMPZero ]


COMPZero [n]

[AUTO]

See the general description of the COMPx commands above.

Compare sectors in the buffer with 00H bytes. The last I/O command executed is used to determine the number of sectors and the size of each sector.

If TAG is ON the sector tag data will also be verified.

Specify n (1 to current number of sectors/blocks in the I/O buffer) to force data compare even if the last device I/O command was not a read command.

Also see:  AFTERx BLOCKSIZE COMPx FILLx TAG

(Go To TOC)

[ COntinue ]


COntinue

[FULL] [SCRIPT]

Skip the remainder of the current WHILE loop and continue execution at the top of the WHILE.

(Go To TOC)

[ COPY ]


COPY numBytes frSectorOffset frByteOffset toSectorOffset toByteOffset

Copy data from one location in the buffer to another location in the buffer. An overlapping copy gives an undefined result.

numBytes is the number of bytes to copy. numBytes is 0 to the current buffer size.

frSectorOffset is 0 to one less than the maximum number of sectors that fit into the buffer.

frByteOffset is 0 to one less than the size of a sector.

toSectorOffset is 0 to two less than the maximum number of sectors that fit into the buffer.

toByteOffset is 0 to one less than the size of a sector.

Also see:  BLOCKSIZE COMPare ID RCAp

(Go To TOC)

[ COPYBYtes ]


COPYBYtes n1 n2 n3 n4 frVarName toVarName

[FULL]

Creates or updates a user defined variable.

toVarName is the name of the new variable. frVarName is the source of data bytes used to create the value assigned to toVarName. The bytes of frVarName are numbered as follows:


   1 = bits 31-24 (the most significant byte)
   2 = bits 23-16
   3 = bits 15-8
   4 = bits 7-0 (the least significant byte)

n1, n2, n3 and n4 represent the same byte ordering in toVarName. n1, n2, n3 and n4 can have a value of 0, 1, 2, 3 or 4. A value of 0 means to copy a byte of zero into that position of toVarName. A value of 1 to 4 means to copy that byte of frVarName into that position of toVarName.

Example:


   set x = aabbccddH
   copybytes 1 2 3 4 x y
      ; sets y = aabbccddH
   copybytes 4 3 2 1 x y
      ; sets y = ddccbbaaH
   copybytes 0 0 2 1 x y
      ; sets y = 0000bbaaH
   copybytes 3 4 0 0 x y
      ; sets y = ccdd0000H
   copybytes 2 1 4 3 x y
      ; sets y = bbaaddccH

(Go To TOC)

[ COPYCIs ]


COPYCIs
COPYCIs EVEN
COPYCIs ODD

Copy the PCMCIA PC Card ATA Card Information Structure data to the I/O buffer.

Both the even and odd bytes are copied unless the EVEN or ODD parameter is used.

EVEN copies only the even offset bytes. These bytes should contain the CIS data.

ODD copies only the odd offset bytes. These bytes should contain no information (usually they are FFH).

Also see:  SHOWx

(Go To TOC)

[ DAR ]


DAR command feature sectorCount lba
DAR command feature sectorCount lbalo
DAR command feature sectorCount cyl head sect

[AUTO] [DIO] [REP]

Execute an ATA DMA In command in CHS or LBA mode.

Note: See the documentation file DMA.HTM.

Data compare is limited when a DAR command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the COMPx and TAG commands.

Also see:  CHSIncr DAW DR DW LBAIncr REPeat

(Go To TOC)

[ DAW ]


DAW command feature sectorCount lba
DAW command feature sectorCount lbalo
DAW command feature sectorCount cyl head sect

[AUTO] [DIO] [FULL] [REP]

Execute an ATA DMA Out command in CHS or LBA mode.

Note: See the documentation file DMA.HTM.

Data generation is limited when a DAW command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the FILLx and TAG commands.

Also see:  CHSIncr DAR DR DW LBAIncr REPeat

(Go To TOC)

[ DECR ]


DECR varName

[FULL]

Equvalent to the command


   SET varName = ( varName - 1 )

Also see:  LOCAL SET

(Go To TOC)

[ DELAY ]


DELAY

Display the last delay times used.


DELAY n

Set the big delay time to n seconds and perform that delay. n is in seconds and may be a value from 0 to 600 (10 minutes).

Note: Use 'DELAY *' to use the previously set big delay time.

Warning: See "Variables that look like keywords" above.


DELAY MS n

Set the small delay time to n milliseconds and perform that delay. n is in milliseconds and may be a value from 0 to 10000 (10 seconds).

Note: Use 'DELAY MS *' to use the previously set small delay time.

Warning: See "Variables that look like keywords" above.


DELAY US n

Set the tiny delay time to n microseconds and perform that delay. n is in microseconds and may be a value from 0 to 10000 (10 milliseconds).

Note: Use 'DELAY US *' to use the previously set small delay time.

Warning: See "Variables that look like keywords" above.

Also see:  CMDTime

(Go To TOC)

[ DEVice ]


DEVice

Reselect and display the currently selected device.


DEVice ATA
DEVice ATAPI

Change the type of the currently selected device to either ATA or ATAPI. This changes ATADRVR's reg_config[] data. The following changes are allowed:

Use this command when ATADRVR and ATADEMO have been able to find a device but were not able to determine the device type or incorrectly determined the device type. This command should be followed by an ID or RCAp command.

Warning: See "Variables that look like keywords" above.


DEVice DEFault

Select the device that was originally selected when ATADEMO started. See the command line options P0, P1, S0 and S1.

Warning: See "Variables that look like keywords" above.


DEVice n

Select device 0 (master) or device 1 (slave).

Warning: See "Variables that look like keywords" above.

(Go To TOC)

[ DEVRESet ]


DEVRESet

[AUTO] [DIO] [REP]

Execute a Device Reset command (command code 08H). This is an ATA Non-Data command. It is normally only supported by ATAPI devices.

This command is equivalent to the command


   ND 08H 0 0 0      ; lba
   ND 08H 0 0 0 0 0  ; chs

(Go To TOC)

[ DMA ]


DMA
DMA OFf
DMA ON
DMA (n)

This command changes the way the R, RCD, R10, R12, W, W10 and W12 commands operate.

If DMA is ON, the R and W commands execute an ATA Read DMA or ATA Write DMA command and the RCD, R10, R12, W10 and W12 commands execute an ATAPI read/write data transfer in DMA mode.

If DMA is OFf, the R and W commands execute an ATA Read Sectors, Read Multiple, Write Sectors or Write Multiple command and the RCD, R10, R12, W10 and W12 commands execute an ATAPI read/write data transfer in PIO mode.

For DMA (n), a zero value is the same as OFf and a non zero value is the same as ON.

Warning: See "Variables that look like keywords" above.

The DMA command without a parameter displays the current DMA setting.

DMA can not be turned ON unless interrupt mode was enabled at startup and interrupt mode is currently active.

Also see:  DMA INTerrupt NODMA POLL R RCD R10 R12 W W10 W12

(Go To TOC)

[ DPR ]


DPR dmabc cdb0 cdb1 ... cdbn [etl]

[AUTO] [DIO] [REP]

Execute an ATAPI Packet command that reads data from the device. The data transfer will be done in DMA mode (the Features register is set to 01H before the Packet command is started).

dmabc is the amount of data that the device should transfer up to 33Mbytes (65536*512 bytes). The DMA channel is programmed to transfer this amount of data. Data compare is bypassed when dmabc is larger than the ATADEMO I/O buffer - see the COMPx commands.

etl is the expect data transfer length. If etl is omitted there is no check of the data transfer length.

cdb0, cdb1, ... cdbn is the command packet.

This command forces LBA32 sector/block addressing mode.

If this command is repeated and cdb0 is 28H (Read 10), A8H (Read 12) or BEH (Read CD) the LBA will be updated by the LBAIncr command. The LBA is also updated for a 08H (Read) command (but the LBA does not appear in the CDB for this command). See the 'LBA SET n' command for more information.

Note: See the documentation file DMA.HTM.

Also see:  ATAPIRegs LBA LBAIncr REPeat

(Go To TOC)

[ DPW ]


DPW dmabc cdb0 cdb1 ... cdbn [etl]

[AUTO] [DIO] [FULL] [REP]

Execute an ATAPI Packet command that writes data to the device. The data transfer will be done in DMA mode (the Features register is set to 01H before the Packet command is started).

dmabc is the amount of data that the device should transfer up to 33Mbytes (65536*512 bytes). The DMA channel is programmed to transfer this amount of data. Data generation is limited when dmabc is larger than the ATADEMO I/O buffer - see the FILLx commands.

etl is the expect data transfer length. If etl is omitted there is no check of the data transfer length.

cdb0, cdb1, ... cdbn is the command packet.

This command forces LBA32 sector/block addressing mode.

If this command is repeated and cdb0 is 2AH (Write 10) or AAH (Write 12) the LBA will be updated by the LBAIncr command. The LBA is also updated for a 0AH (Write) command (but the LBA does not appear in the CDB for this command). See the 'LBA SET n' command for more information.

Note: See the documentation file DMA.HTM.

Also see:  ATAPIRegs LBA LBAIncr REPeat

(Go To TOC)

[ DR ]


DR feature sectorCount lba
DR feature sectorCount lbalo
DR feature sectorCount cyl head sect

[AUTO] [DIO] [REP]

Execute an ATA Read DMA command (command code C8H) in CHS or LBA mode.

Note: See the documentation file DMA.HTM.

Data compare is limited when a DR command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the COMPx and TAG commands.

DR is equivalnt to one of these commands:


      DAR C8H x x x       // lba28
      DAR 25H x x x       // lba48
      DAR C8H x x x x x   // chs

Also see:  CHSIncr DAR DAW DW LBAIncr REPeat

(Go To TOC)

[ DRQIN ]


DRQIN sectorOffset byteOffset numBytes

Read a PIO DRQ data block. The data read is placed into the I/O buffer starting at the specified sectorOffset and byteOffset. numBytes are read using the current PIO transfer size - see the PIO command.

Do not use this command unless the device has status of BSY=0 and DRQ=1.

Also see:  DRQOUT PIO

(Go To TOC)

[ DRQOUT ]


DRQOUT sectorOffset byteOffset numBytes

Write a PIO DRQ data block. The data is written from the I/O buffer starting at the specified sectorOffset and byteOffset. numBytes are read using the current PIO transfer size - see the PIO command.

Do not use this command unless the device has status of BSY=0 and DRQ=1.

Also see:  DRQIN PIO

(Go To TOC)

[ DTO ]


DTO

Display the current low level driver timeout.


DTO n

Set the low level driver timeout. The timeout can be set to 2 to 60000 seconds. The default is 20 seconds.

(Go To TOC)

[ DUMPx ]

See Dump, DUMPCt, DUMPId, DUMPSub and DUMPTag below.

(Go To TOC)

[ Dump ]


Dump DEC
Dump HEX
Dump sectorOffset [ byteOffset [ numBytes ] ]
Dump

Dump data from the I/O buffer.

DEC and HEX select the format of the sector and byte offsets in the Dump output, either decimal or hexadecimal. The default is HEX.

sectorOffset is 0 to one less than the maximum number of sectors/blocks that fit into the I/O buffer. The default is 0, or following a data compare error the default is the first incorrect sector/block.

byteOffset is 0 to one less than the size of a sector/blocks. The default is 0.

numBytes is the number of bytes to dump. The default is the currect block size for the selected device, or following some I/O commands (such as RCAP, RS, RTOC, etc) it is the number of bytes transferred by the I/O command.

The dump command increments the byteOffset and the sectorOffset as needed. A Dump (or Next) command with no parameters will continue to dump the next data in the I/O buffer.

Also see:  BLOCKSIZE ID Next RCAp

(Go To TOC)

[ DUMPCt ]


DUMPCt

Dump the ATACT/ATAMDT sector tag data for sectors in the buffer. The ATACT/ATAMDT LBA and last write command tag information is dumped. See the ATACT and/or ATAMDT User Guide.

Note: ATACT, ATADEMO and ATAMDT place the LBA part of the sector tag data at the same offset in a sector. This command (used with AFTERNOerror) can be used with read data commands to scan a disk that was written by ATADEMO, ATACT or ATAMDT to look for sectors with incorrect tag data.

Also see:  DUMPTag, TAG.

(Go To TOC)

[ DUMPId ]


DUMPId

Dumps the first 512 bytes of the buffer as 256 words. Each word is display as a 16-bit value (bits 15-0). Words that contain 32-bit values are also displayed together as 32-bit values (bits 31-0).

This command does not check that the buffer contains data read by an Identify command so it may be useful to display other data that is organized as words.

Also see:  DUMPx ID SHOWx

(Go To TOC)

[ DUMPSub ]


DUMPSub

[FULL]

Displays the currently defined subroutine names and the type of each.

Also see:  BEGINSub ENDSub CAll

(Go To TOC)

[ DUMPTag ]


DUMPTag

Dumps only the tag data for each sector/block in the buffer.

Note: ATACT, ATADEMO and ATAMDT place the LBA part of the sector tag data at the same offset in a sector. This command (used with AFTERNOerror) can be used with read data commands to scan a disk that was written by ATADEMO, ATACT or ATAMDT to look for sectors with incorrect tag data.

Also see:  DUMPCt, TAG

(Go To TOC)

[ DUMPVar ]


DUMPVar [varName ...]

[FULL]

Display builtin and user defined variable names and the current values.

If varName is the single character * all user defined global variables are displayed, including any that may be currently hidden by a local variable with the same name, and the currently active user defined local variables are displayed.

Examples:


   dumpv             ; display all built-in and all user
   dumpv pci_bus *   ; display one built-in and all user
   dumpv *           ; display all user

Also see:  SET SAYx

(Go To TOC)

[ DW ]


DW feature sectorCount lba
DW feature sectorCount lbalo
DW feature sectorCount cyl head sect

[AUTO] [DIO] [FULL] [REP]

Execute an ATA Write DMA command (command code CAH) in CHS or LBA mode.

Note: See the documentation file DMA.HTM.

Data generation is limited when a DW command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the FILLx and TAG commands.

DW is equivalnt to one of these commands:


      DAW CAH x x x       // lba28
      DAW 35H x x x       // lba48
      DAW CAH x x x x x   // chs

Also see:  CHSIncr DAR DAW DR LBAIncr REPeat

(Go To TOC)

[ DWFUA ]


DWFUA feature sectorCount lbalo

[AUTO] [DIO] [FULL] [REP]

Execute an ATA WRITE DMA FUA EXT command (command code 3DH).

Note: See the documentation file DMA.HTM.

Data generation is limited when a DW command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the FILLx and TAG commands.

Also see:  LBAIncr REPeat

(Go To TOC)

[ ECHO ]


ECHO
ECHO OFf
ECHO ON
ECHO (n)

Turn logging of the prompt messages and command lines on and off. These messages begin with a '?' or '#' character.

For ECHO (n), a zero value is the same as OFf and a non zero value is the same as ON.

ECHO ON is equivalent to using these two commands:


   LOG KML K *
   LOG SML K *

ECHO OFF is equivalent to using these two commands:


   LOG KML -K *
   LOG SML -K *

Warning: See "Variables that look like keywords" above.

Also see:  LOG

(Go To TOC)

[ EDITx ]

These commands invode the ATADEMO editor. See the EDIT, EDITCH, EDITKB, EDITLL and EDITSF commands below.

The ATADEMO editor is also available as a stand alone program named AEDIT. See the AEDIT User Guide (AEDIT.HTM).

Also see:  Editor EDIT EDITCH EDITKB EDITLL EDITSF

(Go To TOC)

[ EDIT ]


EDIT
EDIT [fileName]

Same as the EDITSF command below.

Also see:  Editor EDITSF

(Go To TOC)

[ EDITCH ]


EDITCH
EDITCH [fileName]

Start the editor and read the Command History Trace data into the editor's buffer. If fileName is not specified the filename defaults to 'CHtrace.TXT'.

Also see:  Editor SHOWCH

(Go To TOC)

[ EDITKB ]


EDITKB
EDITKB [fileName]

Start the editor and read the Keyboard Buffer data into the editor's buffer. If fileName is not specified the filename defaults to 'KBbuffer.DSF'.

Also see:  Editor

(Go To TOC)

[ EDITLL ]


EDITLL
EDITLL [fileName]

Start the editor and read the Low Level Trace data into the editor's buffer. If fileName is not specified the filename defaults to 'LLtrace.TXT'.

Also see:  Editor SHOWLL

(Go To TOC)

[ EDITSF ]


EDITSF
EDITSF [fileName]

Start the editor to edit a file. If fileName is not specified the filename defaults to 'default.DSF'. The file is read into the editor's buffer.

Also see:  Editor EDIT

(Go To TOC)

[ EE ]


EE n

Evaluate expression n and display the result in decimal and hex. This command is an easy way to display the value of a variable or expression.


   x = 31
   ee x     // displays '31 (1FH)'
   ee (x+1) // displays '32 (20H)'

(Go To TOC)

[ ELSE ]


ELSE

[FULL] [SCRIPT]

Defines the beginning of the else part of an IF/ELSE/ENDIF command sequence. The ELSE part of this command sequence is optional.

(Go To TOC)

[ ENDIF ]


ENDIF

[FULL] [SCRIPT]

Defines the end of a IF/ELSE/ENDIF command sequence. The ELSE part of this command sequence is optional.

Also see:  IF ELSE

Also see:  IF ENDIF

(Go To TOC)

[ ENDSub ]


ENDSub [subName]

[FULL] [SCRIPT]

Defines the end of a script file subroutine. If the execution of a script reaches an ENDSUB command the ENDSUB command is equivalent to a "RETURN 0" command.

Also see:  RETurn

(Go To TOC)

[ ENDWHile ]


ENDWHile

[FULL] [SCRIPT]

Defines the end of a WHILE loop.

(Go To TOC)

[ EXit ]


EXit [n]

When used in a script file this command terminates execution of the script file and terminates ATADEMO. When used in keyboard mode this command terminates ATADEMO.

The optional parameter n sets the DOS ERRORLEVEL when ATADEMO exits. The allowed values are 0 to 199 (200 to 255 are reserved for use by ATADEMO). The default for n is zero.

(Go To TOC)

[ EXPEcterror ]


EXPEcterror

The next ATA or ATAPI command is expected to end with an error. EXPEcterror is reset at the end a single command or at the end of the repeat loop for repeated commands.

Also see:  AFTERx ONERRor REPeat

(Go To TOC)

[ FETCHx ]

See FETCHBUF and FETCHCDB below.

(Go To TOC)

[ FETCHBUF ]


FETCHBUF varName sectorOffset byteOffset size

[FULL]

See the description of "user defined variables" above.

The value is fetched from the buffer. The value may be 1, 2, 3 or 4 bytes in size. The first byte is fetched from the sector and byte offset defined by the sectorOffset and byteOffset parameters. The value is assigned to the user define variable varName.

Also see:  ALTER BLOCKSIZE ID RCAp SET STORE STOREBUF

(Go To TOC)

[ FETCHCDB ]


FETCHCDB varName offset size

[FULL]

See the description of "user defined variables" above.

The value is fetched from the ATAPI CDB buffer. The value may be 1, 2, 3 or 4 bytes in size. The first byte is fetched from the CDB buffer at 'offset'. The value is assigned to the user defined variable varName.

Also see:  SET STORECDB

(Go To TOC)

[ FILLx ]

General information for the FILLx commands.

The FILLx commands fill the I/O buffer with data. All data generated is based on the current BLOCKSIZE for the device.

When TAG is OFF the entire sector is filled with the specified data pattern. When TAG is ON the entire sector is filled with the specified data pattern and the sector tag data is placed into the middle of each sector's data.

The command FILLTag updates only the sector tag data leaving all other bytes of the sector's data unchanged.

Normally these commands are used with the BEFORE command and only the sectors that are about to be written are filled with data.

When the FILLx commands are not used with the BEFORE command, use the FILLNUM command to limit the number of sectors in the buffer that are filled with data.

When the FILLX commands are used with write commands that transfer more data than the size of the ATADEMO I/O buffer the following rules apply:

Example 1: On an ATA device the following command sequence will generate a data compare error because the data pattern (3 bytes) does not fit a whole number of times into a 512 byte sector:


   int
   dma on
   lba48
   tag off
   fillpat 11h 22h 33h
   before fillpat
   afternoerror comppat
   w 5000 0       // large DMA xfer
   r 5000 0       // read w/o data compare
   lbai tl
   rep 500 r 10 0 // read with data compare

Example 2: On an ATA device the following command sequence will generate a data compare error because TAG is ON for some write commands and TAG is OFf for other write commands:


   int
   dma on
   lba48
   tag on
   before fillzero
   afternoerror compzero
   w 10 0      // small DMA xfer - full data generation
   w 5000 10   // large DMA xfer - sectors not tagged
   r 10 0      // full data compare (no error)
   r 5000 10   // no compare is done
   r 10 10     // data compare error (no tag data)

Example 3: An example of how data written by a large DMA transfer command on an ATA device can be checked by read commands with data compare (but not including any sector tag data):


   before fillrand
   afternoerror comprand
   int
   dma on
   lba48
   w 10000 0         // write the sectors
   r 10000 0         // read w/o data compare
   lbaincr 10
   rep 1000 r 10 0   // read with data compare

Also see:  FILLIncr FILLOne FILLPat FILLRand FILLStart FILLTag FILLWord FILLZero

(Go To TOC)

[ FILLIncr ]


FILLIncr [sbv]

Fill each sector/block of the buffer with the incrementing byte data pattern.

If sbv is specified (0 to 255) the first byte of each sector will have this value. If sbv is not specified the first byte of each sector will have a random value.

The most recent sbv value will be used by BEFORE FILLIncr.

If TAG is ON the sector tag data will also be added.

Also see:  BEFORE BLOCKSIZE COMPx FILLx READ TAG

(Go To TOC)

[ FILLNUM ]


FILLNUM n

Specify the number of sectors to fill when a FILLx command is not used with the BEFORE command.

The default is to fill all the sectors in the buffer even if a following write command will not write those sectors.

For example:


   // no FILLNUM command has been previous used...
   FILLR    // fills all sectors in the buffer
   W 1 0    // but this command writes only the first sector
   // to fill and write only the one sector...
   FILLNUM 1
   FILLR
   W 1 0

Also see:  AFTERx BEFORE BLOCKSIZE COMPx FILLx TAG

(Go To TOC)

[ FILLOne ]


FILLOne

Fill each sector/block of the buffer with FFH bytes.

If TAG is ON the sector tag data will also be added.

Also see:  BEFORE BLOCKSIZE COMPx FILLx READ TAG

(Go To TOC)

[ FILLPat ]


FILLPat

Fill each sector/block of the buffer with the current data pattern.

If TAG is ON the sector tag data will also be added.

Also see:  BEFORE BLOCKSIZE COMPx FILLx READ TAG


FILLPat n ...
FILLPat + n ...

Fill each sector/block of the buffer with a data pattern.

Specify each byte of the data pattern byte (in decimal or hex) separated by one or more spaces. If the first two characters are the plus sign followed by a space, the pattern is appended to the current pattern. By using the plus sign a pattern of up to current sector/block size of the device may be created.

If TAG is ON the sector tag data will also be added.

Also see:  BEFORE BLOCKSIZE COMPx FILLx READ TAG

(Go To TOC)

[ FILLStart ]


FILLStart

Fill each sector/block of the buffer with the program Run ID (a 4 byte data pattern).

If TAG is ON the sector tag data will also be added.

Also see:  AFTERx BEFORE BLOCKSIZE COMPx FILLx TAG

(Go To TOC)

[ FILLRand ]


FILLRand

Fill each sector/block of the buffer with a randomly generated 4 byte data pattern. The 4 byte pattern looks like this:


   1st byte = random data
   2nd byte = random data
   3rd byte = 1's complement of the 1st byte
   4th byte = 1's complement of the 2nd byte

If TAG is ON the sector tag data will also be added.

Also see:  BEFORE BLOCKSIZE COMPx FILLx READ TAG

(Go To TOC)

[ FILLTag ]


FILLTag

Fill each sector/block of the buffer with the sector tag data. Only the sector tag data is updated.

Example:


   lbaincr tl
   tag on            // use tags
   fillzero          // fill all with 00h plus tags
   w 1 0             // write lba 0
   before filltag    // fill (update) only tags
   repeat 9 w 1 0    // write lba 1 to 9
   afternoerror comptag
   repeat 10 r 1 0   // read lba 0-9 checking only the tags

Also see:  BEFORE BLOCKSIZE COMPx FILLx READ TAG

(Go To TOC)

[ FILLWord ]


FILLWord [swv]

Fill each sector/block of the buffer with the incrementing word data pattern.

If sbw is specified (0 to 65535) the first word of each sector will have this value. If sbv is not specified the first word of each sector will have a random value.

The most recent sbw value will be used by BEFORE FILLWord.

If TAG is ON the sector tag data will also be added.

Also see:  BEFORE BLOCKSIZE COMPx FILLx READ TAG

(Go To TOC)

[ FILLZero ]


FILLZero

Fill each sector/block of the buffer with 00H data.

If TAG is ON the sector tag data will also be added.

Also see:  BEFORE BLOCKSIZE COMPx FILLx READ TAG

(Go To TOC)

[ Help ]


Help [x]

Display ATADEMO help summary.

The first character of 'x' is used to limit the help output to the commands that start with that character. Both the command summary and the command syntax are shown.

Also see:  (QuestionMark)

 


HELPC [x]

Displays ATA command code help.

The first character of 'x' is used to limit the help output to the commands that start with that character. Both the command summary and the command syntax are shown.

 


HELPP [x]

Displays ATAPI CD-ROM packet command code help.

The first character of 'x' is used to limit the help output to the commands that start with that character. Both the command summary and the command syntax are shown.

(Go To TOC)

[ ID ]


ID [NOSHOW] [NOCHECK] [NOSET]

[AUTO] [DIO] [REP]

Execute an ATA or ATAPI Identify Device command and 1) display (show) the data 2) check the data against ATA/ATAPI-7 requirements, and 3) update the built-in variables.

The NOSHOW parameter can be used to bypass the data display. The NOCHECK parameter can be used to bypass the requirements check. The NOSET parameter can be used to bypass the built-in variable update.

NOSHOW, NOCHECK and NOSET can appear in any order.

For ATA devices the ID command will set: 1) the maximum cylinder, head and sector values used by the CHSIncr command, 2) the maximum LBA value used by the LBAIncr command and 3) set the sector/block size to 512 or to the sector size found in IDENTIFY data words 106 and 117-118.

For ATAPI devices the ID command will set the ATAPI command packet size to 12 or 16. Note: Use the RCAp command to set the sector/block size.

The data check, data display and setting of the built-in variables is performed only during the first execution of a repeated ID command.

The ID command executes one of the following commands:


   pdi ech 0 0 0        ; ata in lba
   pdi ech 0 0 0 0 0    ; ata in chs
   pdi a1h 0 0 0        ; atapi in lba
   pdi a1h 0 0 0 0 0    ; atapi in chs

Also see:  BLOCKSIZE DUMPId PS RCAp REPeat SHOWx SHOWID

(Go To TOC)

[ IF ]


IF n

[FULL] [SCRIPT]

Defines the beginning of an IF/ELSE/ENDIF command sequence. The ELSE part of this command sequence is optional.

If n is not zero then the IF part of the command is executed. If n is zero then the IF part of the command sequence is no executed and the optional ELSE part is executed.

Example without ELSE part:


   if lba & 1
      set nsect = 4
   endif

Example with ELSE part:


   if ( lba > 10000 )
      set nsect = ( lba & 0xf )
   else
      if ( lba > 100000 )
         set nsect = 32
      else
         set nsect = 4
      endif
   endif

Also see:  ELSE ENDIF

(Go To TOC)

[ INCCR ]


INCCR offset [varName]

[FULL]

See the description of "user defined variables" above.

Read an 8-bit value from a PCMCIA Card Configuration register.

offset is the address of the register to be read. This must be an even number between 0 and 14. The offset of a word value must be an even number. This command sets varName to -1 if the offset is a invalid value.

If varName is not specified the value read is displayed. If varName is specified the value is assigned to the user defined variable varName.

Also see:  OUTCCR SHOWx

(Go To TOC)

[ INCR ]


INCR varName

[FULL]

Equvalent to the command


   SET varName = ( varName + 1 )

Also see:  LOCAL SET

(Go To TOC)

[ INPCIx ]    


INPCIByte
INPCIWord
INPCIByte offset varName [pciBus pciDev pciFun]
INPCIWord offset
INPCIWord offset varName [pciBus pciDev pciFun]

[FULL]

See the description of "user defined variables" above.

Read an 8-bit value or a 16-bit value from the PCI configuration space of the PCI Bus Mastering ATA host adapter that is currently being used by ATADEMO. When no such adapter is in use the built-in variables pci_bus, pci_dev and pci_fun will have the value -1 and this command sets varName to -1.

offset is the address of the byte or word to be read (0 to 127). The offset of a word value must be an even number. This command sets varName to -1 if the offset of a word value is an odd number.

If varName is not specified or if specified as '*' the value read is displayed. If varName is specified the value is assigned to the user defined variable varName.

pciBus, pciDev and pciFun are the PCI device to be read. The default to the values of the built-in varables pci_bus, pci_dev and pci_fun.

Examples:


   The following are equivalent.

   inpcibyte 7
   inpcibyte 7 * pci_bus pci_dev pci_fun

   The following are equivalent.

   inpcibyte 7 myvar
   inpcibyte 7 myvar pci_bus pci_dev pci_fun

Also see:  OUTPCIx

(Go To TOC)

[ INPORTx ]    


INPORTByte
INPORTWord
INPORTByte ioAddr [varName]
INPORTWord ioAddr [varName]

[FULL]

See the description of "user defined variables" above.

Read an 8-bit value or a 16-bit value from a x86 I/O port. ioAddr is the I/O port address (0000H to FFFFH). The value read is placed into the user defined variable varName.

If varName is not specified the value read is displayed. If varName is specified the value is assigned to the user defined variable varName.

Hints: Use the addr_* built-in variables to access the I/O ports for the ATA host adapter (these accesses will not appear in the ATADRVR low level trace). Use the bmcr_addr/bmide_addr built-in variables to access the Bus Master IDE registers (BMIDE).

Note: In PC Card ATA Memory mode, the addr_* built-in variables are set to memory offset values (not I/O addresses). The OUTPORTx commands can not be used to access the ATA/ATAPI registers in PCMCIA Memory mode. See the intf_mode built-in variable.

Warning: Be careful when using these commands. Reading some I/O ports incorrectly can cause system failures.

Also see:  OUTPORTx

(Go To TOC)

[ INQ ]


INQ

[AUTO] [DIO] [REP]

Execute an ATAPI Inquiry command and display the Inquiry data received. Inquiry (ATAPI packet command code 12H) is a "packet read" (PR) command.

The data display is performed only during the first execution of a repeated INQ command.

This command forces LBA32 sector/block addressing mode.

Also see:  LBA SHOWx

(Go To TOC)

[ INTerrupt ]


INTerrupt

Switch to interrupt mode. Not allowed in PCCMODE=MEMORY mode and not allowed if the POLL command line option was used.

Also see:  DMA INTerrupt POLL

(Go To TOC)

[ LBA ]


LBA

Switch to LBA sector addressing. When switching from CHS to LBA mode this command will restore the previously active LBA mode.

Also see:  CHS LBA28 LBA32 LBA48


LBA (n)

Set the LBA mode to LBA28 or LBA48. The expression n must have the value 28 or 48.


LBA SET n

Switch to LBA sector addressing and set the LBA for the next command. When switching from CHS to LBA mode this command will restore the previously active LBA mode. This command is normally not needed except before an ATAPI Packet command that does not have the LBA in the CDB, for example, the Read (08H) and Write (0AH) commands used by ATAPI tape drives. This command provides the LBA so that commands like COMPx, FILLx, LBAIncr, TAG, etc, work correctly.

Example:


   BLOCKSIZE 128   ; set block size
   TAG ON          ; tagging on
   BEFORE FILLRAND ; data pattern
   LBA SET 1000    ; set starting LBA = 1000
   LBAINCR 1 2000  ; incr LBA by 1, go to LBA 2000
   REP 100 PW 512 0AH 0 0 0 1 0   ; TL=1, LBA=1000,1001, ...

Also see:  CHS

     


LBA28
LBA32
LBA48

Switch to LBA sector addressing using 28, 32 or 48 bit LBA.

Also see:  CHS


LBA28 SET n
LBA32 SET n
LBA48 SET n n

Switch to LBA sector addressing and set the LBA for the next command. This command is normally not needed except before an ATAPI Packet command that does not have the LBA in the CDB, for example, the Read (08H) and Write (0AH) commands used by ATAPI tape drives. This command provides the LBA so that commands like COMPx, FILLx, LBAIncr, TAG, etc, work correctly.

Example:


   BLOCKSIZE 128   ; set block size
   TAG ON          ; tagging on
   BEFORE FILLRAND ; data pattern
   LBA32 SET 1000  ; set starting LBA = 1000
   LBAINCR 1 2000  ; incr LBA by 1, go to LBA 2000
   REP 100 PW 512 0AH 0 0 0 1 0   ; TL=1, LBA=1000,1001, ...

Also see:  CHS

(Go To TOC)

[ LBAIncr ]


LBAIncr

[FULL]

Display the current LBAIncr settings.

The LBAIncr command uses the following terms. Some of these values can be read using built-in variables.

curLBA is the LBA used in the current command, see the io_lbalo and io_lbahi built-in variables.

baseLBA is the LBA specified by the ATADEMO command being repeated.

numLBA is the number of sectors in the current LBA geometry, see the max_lba built-in variable.

incrLBA is the LBA increment.

numSect is the number of sectors that the current command will attempt to transfer.

The ID command will set numLBA to the contents of ATA Identify data words 60-61. The RCAp command will set numLBA to the capacity of an ATAPI device. LBAIncr can be used to override the value set by ID or RCAp.

In LBA addressing mode the LBAIncr command and the REPeat command use the following rules:

- When REPeat is used with LBAIncr Random, curLBA will be in the range baseLBA to (numLBA - numSect).

- When REPeat is used with LBAIncr incrLBA, and n is positive, curLBA will start at baseLBA and be incremented by incrLBA until numLBA is reached. If needed, the curLBA of the last command repeated will be adjusted to (numLBA - incrLBA).

- When REPeat is used with LBAIncr incrLBA, and n is negative, curLBA will start at baseLBA and be decremented by incrLBA until LBA 0 is reached. If needed, the curLBA of the last command repeated will be adjusted to LBA 0.

Also see:  CHSIncr ID RCAp REPeat

Examples: See "Using CHSIncr, LBAIncr and REPeat Commands" below.


LBAIncr lbaIncr [numLba]

[FULL]

See the terms and rules defined in the LBAIncr command above.

incrLBA may be a value from -65536 to 65536.

When an ATA command in LBA sector addressing is repeated, or when an ATAPI Read, Read CD, Read 10, Read 12, Seek 10, Write, Write 10 or Write 12 command is repeated, curLBA of the first command is baseLBA. Starting with the second command, curLBA is incremented by incrLBA before each command. A REPeat loop in LBA mode will terminate when (curLBA + incrLBA) reaches numLBA or less than LBA 0. When incrLBA is greater than 0, the curLBA of the last command repeated may be adjusted to (numLBA - numSect). When incrLBA is less than 0, the curLBA of the last command repeated may be adjusted to LBA 0.

The default is


   LBAIncr 0 1032192

so that LBA addresses are not incremented by the REPeat command until either an ID, LBAIncr or RCAp command is executed.

Warning: See "Variables that look like keywords" above.

Also see:  CHSIncr ID RCAp REPeat


LBAIncr Random [numLba]

[FULL]

See the terms and rules defined in the LBAIncr command above.

When an ATA command in LBA sector addressing is repeated, or when an ATAPI Read, Read 10, Read 12, Seek 10, Write, Write 10 or Write 12 command is repeated, curLBA of the first command is baseLBA. Starting with the second command, curLBA is randomly generated within the range baseLBA to (numLBA + 1 - numSect).

The default is


   LBAIncr 0 1032192

so that LBA addresses are not incremented by the REPeat command until either an ID, LBAIncr or RCAp command is executed.

Warning: See "Variables that look like keywords" above.

Also see:  CHSIncr ID RCAp REPeat


LBAIncr TL [numLba]

[FULL]

See the terms and rules defined in the LBAIncr command above.

When an ATA command in LBA sector addressing is repeated, or when an ATAPI Read, Read 10, Read 12, Seek 10, Write, Write 10 or Write 12 command is repeated, curLBA of the first command is baseLBA. Starting with the second command, curLBA is incremented by the numSect value of the previous command. A REPeat loop in LBA mode will terminate when (curLBA + numSect) is greater than numLBA. The curLBA of the last command repeated may be adjusted to (numLBA - numSect).

The default is


   LBAIncr 0 1032192

so that LBA addresses are not incremented by the REPeat command until either an ID, LBAIncr or RCAp command is executed.

Warning: See "Variables that look like keywords" above.

Also see:  CHSIncr ID RCAp REPeat

(Go To TOC)

[ LOCAL ]


LOCAL varName [=] n

[FULL] [SCRIPT]

See the description of "user defined variables" above.

Creates a user defined variable local to the current subroutine and assigns the value n to it. LOCAL commands in the main part of a script are converted to SET commands.

Variable names must begin with an alphabetic character and must contain only alphabetic and numeric characters.

The equal sign is optional.

Examples:


   set a 1
   set b = 4
   LOCAL x ( a + 3 * b - 2 )
   Say X is now {x}

      Will display "X is now 11".

   set x = 3
   say X is now {x}
   local x = 4
   say X is now {x}

      Will display "X is now 3" followed by "X is now 4".

Also see:  ASK ASKYN FETCHx SET

(Go To TOC)

[ LOG ]


LOG

Display the current state of the log file (open or closed) and the current setting of logging message levels.


LOG DELETE

Delete the current log file. If the file is currently closed, it will remain closed. If the file is open, it will be closed, deleted and re-opend.


LOG KML normal repeat
LOG SML normal repeat

Set the logging message levels for keyboard (KML) and script file (SML) operations. See "Message Logging" above.

The normal and repeat parameters are a string of characters that control the message level(s) to be turned on or off. The characters in the string are processed one at a time from left to right. The valid characters are:


   * - do not change the setting. If * is used it must be the
       only character in the string.
   + - Turn on the message level indicated by the next
       character.
   - - Turn off the message level indicated by the next
       character.
   A - All messages. Note that '-A' is equivalent to 'N'.
   C - Data compare command messages.
   D - Dump command messages.
   E - I/O and data compare error messages.
   I - I/O start/done messages.
   K - Command prompt messages.
   M - Command informational messages.
   N - No messages. Note that '-N' is equivalent to 'A'.
   S - Show command messages.
   T - Command timing messages.

Note: Some ATADEMO error and some status messages can not be turned off.

Examples:


   LOG KML * N

   Do not change the current keyboard normal level but turn
   off all keyboard repeat message levels.

   LOG SML -I-KT -I-KT

   For scipt file operations, Turn off I/O start/done and command
   echo messages and turn on command timing messages.

   LOG KML NCDEIST NCDES

   is equivalent to LOG MINimun for keyboard operations.

   LOG SML A A

   is equivalent to LOG MAXimun for script file operations.

   LOG SML -K *

   is equivalent to ECHO OFF for script file operations.

Also see:  ECHO LOG LOG


LOG MAXimum
LOG MINimum

Turn on full (MAXimum) message logging or turn on reduced (MINimum) message logging.

LOG MAXimum is equivalent to using these two commands:


   LOG KML A A
   LOG SML A A

LOG MINimum is equivalent to using these two commands:


   LOG KML NCDEIST NCDES
   LOG SML NCDEIST NCDES

Also see:  ECHO


LOG NEW fileName

Close the current log file, if one is open, and open a new log file with the name fileName.

See the section FILE NAMES above for the description of how file names can be specified.

LOG NEW also forces LOG MAXimum.

Examples:


   LOG NEW NEWLOG.TXT   ; file name is 'NEWLOG.TXT'

   SET X = 583
   LOG NEW (x+3)  ; file name is '586.LOG'

   SET Y = 8943
   SET Z = 26
   LOG NEW D{Y}.{*Z}H ; file name is 'D8943.1AH


LOG OFf
LOG ON
LOG (n)

Turn message logging to the current log file on and off.

LOG ON also forces LOG MAXimum.

For LOG (n), a zero value is the same as OFf and a non zero value is the same as ON.

Warning: See "Variables that look like keywords" above.

Also see:  WL

(Go To TOC)

[ ND ]


ND command feature sectorCount lba
ND command feature sectorCount lbalo
ND command feature sectorCount cyl head sect

[AUTO] [DIO] [REP]

Execute an ATA Non-Data command in CHS or LBA mode.

Also see:  DR DW CHSIncr LBAIncr PDI PDO REPeat SF SM

(Go To TOC)

[ NDX ]


NDX fr sc sn cl ch dh cmd

[AUTO] [DIO] [FULL]

Execute an ATA Non-data command using specified values for each ATA Command Block register. This command can not be used with the REPeat command. This command operates in CHS or LBA28 mode. It will change LBA32 or LBA48 mode to LBA28.

fr is the Features Register value (0-255).

sc is the Sector Count value (0-255).

sn is the Sector Number value (0-255).

cl is the Cylinder Low value (0-255).

ch is the Cylinder High value (0-255).

dh is the Drive/Head value (0-15).

cmd is the Command register value (0-255).

The dh value is the value for bits 3-0 of the register. Bits 7-4 of the register are set as follows:

Also see:  PDI PDIX PDO PDOX

(Go To TOC)

[ Next ]


Next

This command is equivalent to the following command:


   Dump

Also see:  Dump

(Go To TOC)

[ ONERRor ]


ONERRor

Display the current setting of ONERRor.


ONERRor CAll subName [n1]

[FULL] [SCRIPT]

In script files, ONERRor CAll is similar to placing IF, CAll and ENDIF commands after each device I/O or data compare command that calls the subroutine subName if there is an error. The optional value n1 is evaluted and saved at the time the ONERRor CAll command is executed. The value is then passed to the subroutine in the sub_param1 variable. The sub_param2, ..., sub_parm9 variables are set to 0 when the subroutine is called. If n1 is omitted, n1 is assumed to be 0. In keyboard mode ONERRor CAll is converted to ONERRor QUit.

Also see the other ONERRor options.


ONERRor COntinue

COntinue causes the an error to be ignored.

Also see the other ONERRor options.


ONERRor NExt

ONERRor NExt is equivalent to ONERRor QUIT except when there is an error on a REPeat command in a script file. ONERRor NExt causes the script to continue at the next command in the script file.

Also see the other ONERRor options.


ONERRor EXit
ONERRor QUit

In script files, EXit will cause ATADEMO to terminate and QUit will cause ATADEMO to return to keyboard mode.

In keyboard mode EXit and QUit terminate a REPeat command and ATADEMO will remain in keyboard mode.

The ONERRor default is QUit. ONERRor remains in effect until the next ONERRor command.

The following tables show all the ONERRor actions. Note that in keyboard mode CAll is the same as QUit and NExt is the same as QUit.

Table 1.

ATA/ATAPI command EXPEcterror active Action
ends with no error no No ONERRor action is taken, execution continues.
ends with no error yes This is an 'error', see Table 2.
ends with an error no This is an 'error', see Table 2.
ends with an error yes No ONERRor action is taken, execution continues.

Table 2.

ONERRor setting Action
CAll Keyboard: Same as QUit.
CAll Script: The subroutine is called. If thesubroutine ends with a RETurn, execution of the script file continues with the next command in the script file.
CONTinue Keyboard: Execution of the current REPeat comand continues.
CONTinue Script: Execution of the current REPeat comandand/or script file continues.
EXit Keyboard: Same as QUit.
EXit Script: ATADEMO terminates.
NExt Keyboard: Same as Quit.
NExt Script: A REPeat command is stoppedand execution continues with the next command in the script file. For all other commands executions continues with the next command in the script file.
QUit Keyboard: REPeat stops, otherwise no action is taken.
QUit Script: Script stops and keyboard mode is entered.

Also see:  AFTERx BEFORE BEGINSub CAll ENDSub EXPEcterror ONESCkey REPeat

(Go To TOC)

[ ONESCkey ]


ONESCkey

[FULL] [SCRIPT]

Display the current setting of ONESCkey.


ONESCkey CAll subName [n1]

[FULL] [SCRIPT]

In script files, ONESCkey CAll is similar to placing IF, CAll and ENDIF commands before each device I/O command that calls the subroutine subName if the ESC key has been pressed. The optional value n1 is evaluted and saved at the time the ONESCkey CAll command is executed. The value is then passed to the subroutine in the sub_param1 variable. The sub_param2, through sub_parm9 variables are set to 0 when the subroutine is called. If n1 is omitted, n1 is assumed to be 0.

If subName returns, script execution continues. The best use of ONESCkey CALL is to perform some cleanup or reporting function for the script and then end the script with an EXit or QUit command. For example:


      ONESCkey CALL escsub 1
      // ...
      WHILE 1
         // ... Some I/O testing you would
         // ... like to stop using the ESC key.
      ENDWHILE
      // ...
      BEGINSUB escsub
         SAY ! ESC KEY DETECTED, sub_param1={sub_param1} !
         QUit
      ENDSUB

Also see the other ONESCkey options.


ONESCkey COntinue
ONESCkey NExt

[FULL] [SCRIPT]

ONESCkey NExt and ONESCkey COntinue cause the ESC key press to be ignored. Use these options with caution since ignoring the ESC key may prevent the user from stopping a script file.

Also see the other ONESCkey options.


ONESCkey EXit
ONESCkey QUit

[FULL] [SCRIPT]

In script files, EXit will cause ATADEMO to terminate and QUit will cause ATADEMO to return to keyboard mode.

In keyboard mode EXit and QUit terminate a REPeat command and ATADEMO will remain in keyboard mode.

The ONESCkey default is QUit. ONESCkey remains in effect until the next ONESCkey command.

Also see:  BEGINSub CAll ENDSub ONERRor REPeat

(Go To TOC)

[ OUTCCR ]


OUTCCR offset n

[FULL]

Write an 8-bit value to a PCMCIA Card Configuration Register.

offset is the address of the register to be written. This must be an even value between 0 and 14. The least significant 8-bits of n are written to the register.

Also see:  INCCR SHOWx

(Go To TOC)

[ OUTPCIx ]    


OUTPCIByte
OUTPCIWord
OUTPCIByte offset n [pciBus pciDev pciFun]
OUTPCIWord offset n [pciBus pciDev pciFun]

[FULL]


   ----- WARNING ----- WARNING ---- WARNING----- WARNING --------
                   DO NOT IGNORE THIS WARNING!
   DO NOT ALTER PCI CONFIGURATION DATA UNLESS YOU KNOW WHAT YOU
   ARE DOING.  INCORRECT ALTERATIONS OF THIS DATA MAY CAUSE
   PHYSICAL DAMAGE TO YOUR SYSTEM (SMOKE!)  AND/OR OTHER SYSTEM
   FAILURES.  If you are trying to alter the configuration of the
   PCI Bus Mastering ATA host adapter being used by ATADEMO you
   MUST have the correct documentation from the vendor of that
   host adapter chip.  DO NOT USE out-of-date documentation or
   documentation for a different chip.
                   DO NOT IGNORE THIS WARNING!
   --------------------------------------------------------------

Write an 8-bit or a 16-bit value to the PCI configuration space of the PCI Bus Mastering ATA host adapter that is currently being used by ATADEMO. When no such adapter is in use the built in variables pci_bus, pci_dev and pci_fun will have the value -1 and this command performs no operation.

offset is the address of the byte or word to be read (0 to 127). least significant 8 bits or 16 bits of the value n are written to the PCI configuration space offset. The offset of a word value must be an even number. This command performs no operation if the offset of a word value is an odd number.

n is the 8-bit or 16-bit value to be written.

pciBus, pciDev and pciFun are the PCI device to be changed. The default to the values of the built-in varables pci_bus, pci_dev and pci_fun.

Examples:


   The following are equivalent.

   outpcibyte 7 0
   outpcibyte 7 0 pci_bus pci_dev pci_fun

Also see:  INPCIx

(Go To TOC)

[ OUTPORTx ]    


OUTPORTByte
OUTPORTWord
OUTPORTByte ioAddr n
OUTPORTWord ioAddr n

[FULL]

Write an 8-bit value or a 16-bit value to a x86 I/O port. ioAddr is the I/O port address (0000H to FFFFH). The least significant 8 bits or 16 bits of the value n are written to the I/O port.

Hints: Use the addr_* built-in variables to access the I/O ports for the ATA host adapter (these accesses will not appear in the ATADRVR low level trace). Use the bmcr_addr/bmide_addr built-in variables to access the Bus Master IDE registers (BMIDE).

Note: In PC Card ATA Memory mode, the addr_* built-in variables are set to memory offset values (not I/O addresses). The OUTPORTx commands can not be used to access the ATA/ATAPI registers in PCMCIA Memory mode. See the intf_mode built-in variable.

Warning: Be careful when using these commands. Writing I/O ports incorrectly can cause system failures.

Also see:  INPORTx

(Go To TOC)

[ PCCMODE ]


PCCMODE OFf [DEBUG]
PCCMODE ON [DEBUG]
PCCMODE (n) [DEBUG]

This command does nothing if ATADEMO is not currently using a PCMCIA interface mode.

PCCMODE OFf turns off the PCMCIA socket power.

PCCMODE ON reinitializes the PCMCIA PCIC and device inteface mode. It performs the same functions as were performed during ATADEMO startup using the PCCMODE command line option.

For PCCMODE (n), a zero value is the same as OFf and a non zero value is the same as ON.

DEBUG displays the PCMCIA PCIC initialization messages.

Warning: See "Variables that look like keywords" above.

Also see:  PCCMODE=x INCCR OUTCCR SHOWx

(Go To TOC)

[ PDI ]


PDI command feature sectorCount lba [multiCount]
PDI command feature sectorCount lbalo [multiCount]
PDI command feature sectorCount cyl head sect [multiCount]

[AUTO] [DIO] [REP]

Execute an ATA PIO Data In command in CHS or LBA mode.

multiCount is required for Read/Write Multiple commands (command codes C4H and C5H).

Data compare is limited when a PDI command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the COMPx and TAG commands.

Also see:  CHSIncr DR DW LBAIncr PN PDO REPeat

(Go To TOC)

[ PDIX ]


PDIX fr sc sn cl ch dh cmd numSect [multiCnt]

[AUTO] [DIO] [FULL]

Execute an ATA PIO Data In command using specified values for each ATA Command Block register. This command can not be used with the REPeat command. This command operates in CHS or LBA28 mode. It will change LBA32 or LBA48 mode to LBA28.

fr is the Features Register value (0-255).

sc is the Sector Count value (0-255).

sn is the Sector Number value (0-255).

cl is the Cylinder Low value (0-255).

ch is the Cylinder High value (0-255).

dh is the Drive/Head value (0-15).

cmd is the Command register value (0-255).

numSect is the number of sector to transfer.

multiCnt is the current multiple value.

The dh value is the value for bits 3-0 of the register. Bits 7-4 of the register are set as follows:

Data compare is limited when a PDIX command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the COMPx and TAG commands.

Also see:  ND NDX PDO PDOX

(Go To TOC)

[ PDO ]


PDO command feature sectorCount lba [multiCount]
PDO command feature sectorCount lbalo [multiCount]
PDO command feature sectorCount cyl head sect [multiCount]

[AUTO] [DIO] [FULL] [REP]

Execute an ATA PIO Data Out command in CHS or LBA mode.

multiCount is required for Read/Write Multiple commands (command codes C4H and C5H).

Data generation is limited when a PDO command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the FILLx and TAG commands.

Also see:  CHSIncr DR DW LBAIncr PN PDI REPeat

(Go To TOC)

[ PDOX ]


PDOX fr sc sn cl ch dh cmd numSect [multiCnt]

[AUTO] [DIO] [FULL]

Execute an ATA PIO Data Out command using specified values for each ATA Command Block register. This command can not be used with the REPeat command. This command operates in CHS or LBA28 mode. It will change LBA32 or LBA48 mode to LBA28.

fr is the Features Register value (0-255).

sc is the Sector Count value (0-255).

sn is the Sector Number value (0-255).

cl is the Cylinder Low value (0-255).

ch is the Cylinder High value (0-255).

dh is the Drive/Head value (0-15).

cmd is the Command register value (0-255).

numSect is the number of sector to transfer.

multiCnt is the current multiple value.

The dh value is the value for bits 3-0 of the register. Bits 7-4 of the register are set as follows:

Data generation is limited when a PDOX command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the FILLx and TAG commands.

Also see:  ND NDX PDO PDOX

(Go To TOC)

[ PIO ]


PIO
PIO BYTE
PIO DWORD
PIO WORD

Specify the width of PIO data transfers. This affects only the ATA Data register reads and writes.

BYTE specifies that 8-bit instructions are used to transfer data (REP INSB and REP OUTSB, or, 8-bit memory access instructions).

Note: 8-bit PIO data transfers should be used only with PCMCIA and CF devices and only after the appropriate SET FEATURES command has been issued to the device to turn on 8-bit mode.

WORD specifies that 16-bit instructions are used to transfer data (REP INSW and REP OUTSW, or, 16-bit memory access instructions).

DWORD specifies that 32-bit instructions are used to transfer data in PIO mode (REP INSD and REP OUTSD).

Note: Many ATA host adapters do not implement 32-bit data transfers correctly and will corrupt data passing through the host adapter if DWORD is used.

The default is determined by the PIO option on the command line.

Read the documentation file PIO.HTM before using this command!

The current PIO setting is displayed if no parameter is specified.

Also see:  PIO


PIO ODR0
PIO ODR8
PIO ODR400
PIO ODRRAND

These commands apply only when ATADEMO is running in PCMCIA PC Card ATA Memory mode. These commands are ignored at all other times.

In Memory mode the ATA Data register appears at several locations in the Common memory space. These are offsets 0H, 8H and 400H. These commands select the offset that will be used by ATADRVR when performing PIO data transfers.

The default is ODRRAND. ODRRAND causes ATADRVR to randonly select one of the three offsets at the start of each DRQ data block.

Also see:  PIO

(Go To TOC)

[ PN ]


PN bcl cdb0 cdb1 ... cdbn [etl]

[AUTO] [DIO] [REP]

Execute an ATAPI Packet command that does not transfer data.

bcl is the Byte Count Limit (maximum data packet size). This value is placed into the Byte Count registers before the Packet command is started.

cdb0, cdb1, ... cdbn is the command packet.

etl is the expect data transfer length. The PN command assumes that the only valid etl value is zero. If etl is omitted there is no check of the data transfer length.

This command forces LBA32 sector/block addressing mode.

If this command is repeated and cdb0 is 2BH (Seek 10) the LBA will be updated by the LBAIncr command.

Also see:  ATAPIRegs DPR DPW LBAIncr PR PS PW REPeat

(Go To TOC)

[ POLL ]


POLL

Switch to polling mode. The POLL command also forces the DMA OFF command.

Also see:  DMA INTerrupt POLL

(Go To TOC)

[ PR ]


PR bcl cdb0 cdb1 ... cdbn [etl]

[AUTO] [DIO] [REP]

Execute an ATAPI Packet command that reads data from the device in PIO mode (the Features register is set to 00H before the Packet command is started).

bcl is the Byte Count Limit (maximum data packet size). This value is placed into the Byte Count registers before the Packet command is started.

cdb0, cdb1, ... cdbn is the command packet.

etl is the expect data transfer length. If etl is omitted there is no check of the data transfer length.

This command forces LBA32 sector/block addressing mode.

If this command is repeated and cdb0 is 28H (Read 10), A8H (Read 12) or BEH (Read CD) the LBA will be updated by the LBAIncr command. The LBA is also updated for a 08H (Read) command (but the LBA does not appear in the CDB for this command). See the 'LBA SET n' command for more information.

For Read 10/12 commands the data transfer may be greater than the ATADEMO I/O buffer size. Data compare is bypassed for transfers that are greater than the ATADEMO I/O buffer size. See the COMPx and TAG commands.

Also see:  ATAPIRegs DPR DPW LBA LBAIncr PR PS PW REPeat

(Go To TOC)

[ PS ]


PS

Display the ATAPI command packet size for the currently selected device.


PS 12
PS 16
PS n

Set the ATAPI command packet size for the currently selected device to 12 or 16 bytes.

Also see:  ID

(Go To TOC)

[ PW ]


PW bcl cdb0 cdb1 ... cdbn [etl]

[AUTO] [DIO] [FULL] [REP]

Execute an ATAPI Packet command that writes data to the device in PIO mode (the Features register is set to 00H before the Packet command is started).

bcl is the Byte Count Limit (maximum data packet size). This value is placed into the Byte Count registers before the Packet command is started.

cdb0, cdb1, ... cdbn is the command packet.

etl is the expect data transfer length. If etl is omitted there is no check of the data transfer length.

This command forces LBA32 sector/block addressing mode.

If this command is repeated and cdb0 is 2AH (Write 10) or AAH (Write 12) the LBA will be updated by the LBAIncr command. The LBA is also updated for a 0AH (Write) command (but the LBA does not appear in the CDB for this command). See the 'LBA SET n' command for more information.

For Write 10 and Write 12 commands the data transfer may be greater than the ATADEMO I/O buffer size. Data generation is limited for transfers that are greater than the ATADEMO I/O buffer size. See the FILLx and TAG commands.

Also see:  ATAPIRegs DPR DPW LBA LBAIncr PR PS PW REPeat

(Go To TOC)

[ QUit ]


QUit

When used in a script file this command terminates execution of the script file and ATADEMO returns to keyboard mode. When used in keyboard mode this command terminates ATADEMO (it is equivalent to the command "EXit 0").

(Go To TOC)

[ R ]


R sectorCount lba [multiCount]
R sectorCount lbalo [multiCount]
R sectorCount cyl head sect [multiCount]

[AUTO] [DIO] [REP]

Execute an ATA Read Sectors, Read Multiple or Read DMA command.

If DMA is OFf and multiCount is not specified the R command is equivalent to


   PDI 20h 0 sectorCount lba
   PDI 20h 0 sectorCount cyl head sect
   PDI 24h 0 sectorCount lbalo

If DMA is OFf and multiCount is specified the R command is equivalent to


   PDI C4h 0 sectorCount lba multiCount
   PDI C4h 0 sectorCount cyl head sect multiCount
   PDI 29h 0 sectorCount lbalo

If DMA is ON, multiCount is ignored and the R command is equivalent to


   DR 0 sectorCount lba
   DR 0 sectorCount cyl head sect

Note that sector tagging is done only in LBA mode.

Data compare is limited when a R command uses DMA and the sectorCount greater that the size of the ATADEMO I/O buffer - see the COMPx and TAG commands.

Also see:  CHSIncr DMA DR DW LBAIncr PDI PDO REPeat W

(Go To TOC)

[ R10 ]

(Go To TOC)

[ R12 ]


R10 tl lba [etl]
R12 tl lba [etl]

[AUTO] [DIO] [REP]

Execute an ATAPI Read 10 or Read 12 command. Read 10 (ATAPI packet command code 28H) and Read 12 (ATAPI packet command code 2AH) are "packet read" (PR) commands. If DMA is ON, the data transfer will be done in DMA mode. If DMA is OFf, the data transfer will be done in PIO mode.

tl is the transfer length (number of blocks to read).

The data transfer of a R10 or R12 command may be up to 33Mbytes (65536*512 bytes). Data compare is bypassed for a data transfer that is larger than the ATADEMO I/O buffer size - see the COMPx and TAG commands.

lba is the starting block address.

etl is the expected transfer length. If not specified, etl will be set to (tl * dev_bs). If DMA is ON, etl is ignored.

This command forces LBA32 sector/block addressing mode.

Also see:  BLOCKSIZE DMA LBAIncr RCAp RCD REPeat W10 W12

(Go To TOC)

[ RANDSEED ]


RANDSEED n

Seed the random number generator. n is 0 to 32767.

Set n to 1 to reinitialize (this is the default when ATADEMO starts).

Use RANDSEED at the beginning of a script file so that the script generates the same sequence of events and/or data.

Also see:  rand_num

(Go To TOC)

[ RCAp ]


RCAp

[AUTO] [DIO] [REP]

Execute an ATAPI Read Capacity command and display the capacity data received. Inquiry (ATAPI packet command code 25H) is a "packet read" (PR) command.

The RCAp command sets the LBA increment and the total number of sectors/blocks used by the REPeat command.

The RCAp command sets the sector/block size for the selected ATAPI device.

The data display and setting of the sector/block size is performed only during the first execution of a repeated RCAp command.

This command forces LBA32 sector/block addressing mode.

Also see:  BLOCKSIZE LBAIncr REPeat

(Go To TOC)

[ RCD ]


RCD tl lba [etl]

[AUTO] [DIO] [REP]

Execute an ATAPI Read CD command. Read CD (ATAPI packet command code BEH) is a "packet read" (PR) command. If DMA is ON, the data transfer will be done in DMA mode. If DMA is OFf, the data transfer will be done in PIO mode.

The current BLOCKSIZE (dev_bs) should be set to 2048 (CD-ROM data) or to 2352 (CD-DA data) before using this command.

tl is the transfer length (number of blocks to read).

This command is equivalent to these PR and DPR commands:


     PR dev_bs beH 00h lba3 lba2 lba1 lba0 0 tl1 tl0 10H 0 0
   or
     SET dmabc = ( dev_bs * tl )
     DPR dmabc beH 00h lba3 lba2 lba1 lba0 0 tl1 tl0 10H 0 0

The data transfer of a RCD command may be up to 33Mbytes (65536*512 bytes). Data compare is bypassed for a data transfer that is larger than the ATADEMO I/O buffer size - see the COMPx and TAG commands.

lba is the starting block address.

etl is the expected transfer length. If not specified, etl will be set to (tl * dev_bs). If DMA is ON, etl is ignored.

This command forces LBA32 sector/block addressing mode.

Also see:  BLOCKSIZE DMA LBAIncr R10 R12 RCAp REPeat W10 W12

(Go To TOC)

[ READ ]


READ numBytes fileName [offset]

Read data from file fileName into the buffer. No more than numBytes are read from the file. If offset is specified, reading begins at that byte offset in the file.

The READ command sets the built-in variable num_bytes to the actual number of bytes read from the file.

See the section FILE NAMES above for the description of how file names can be specified.

Also see:  WRITE

Examples:


   READ 10 NEWLOG.TXT

      Read 10 bytes into the buffer from file NEWLOG.TXT.

   SET X = 583
   READ (x) (x+3)

      Read 583 bytes into the buffer from file 586.BIN.

   SET Y = 8943
   SET Z = 26
   READ 24 D{Y}.{*Z}H

      Read 24 bytes into the buffer from file D8943.1AH.

(Go To TOC)

[ READOnly ]


READOnly
READOnly OFf
READOnly ON
READOnly (n)

Display the current setting of readonly mode or turn readonly mode on or off.

READONLY ON places ATADEMO into read only mode. In this mode the DPW, DW, PDO, PW, W, W10 and W12 commands are not allowed.

For READOnly (n), a zero value is the same as OFf and a non zero value is the same as ON.

Note: The READOnly command does not effect the READOnly option (the READOnly ON command as no effect if the READOnly option was used on the ATADEMO command line).

Warning: While the READOnly option and command can be used to disable write commands, be careful, some Non-Data (ND) commands do write to the device media!

Warning: See "Variables that look like keywords" above.

Also see:  READOnly

(Go To TOC)

[ REPeat ]


REPeat count command

[FULL]

Repeat a device I/O command 'count' times. The commands marked with the symbol [DIO] may be used with the REPeat command.

The command will be repeated count times unless the CHSIncr or LBAIncr commands stop the repeating.

Also see:  CHS CHSIncr EXPEcterror ID LBA LBAIncr ONERRor RCAp

(Go To TOC)

[ RESet ]


RESet [SATA]

[AUTO] [DIO] [REP]

Execute an ATA Soft Reset (SRST in the Device Control register).

If the host controller is a supported SATA host controller then SATA forces a SATA port reset for the currently selected device. SATA is forced if the previous command ended with a timeout error and the device is a SATA device. The SATA port is reset before the ATA Soft Reset is executed.

(Go To TOC)

[ RETurn ]


RETurn [n]

[FULL] [SCRIPT]

Return from a subroutine.

The built-in variable sub_return is set to either 0 or to the value n.

Note: The command "return sub_return" is equivalent to the command "return 0".

Also see:  ENDSub

(Go To TOC)

[ RS ]


RS

[AUTO] [DIO] [REP]

Execute an ATAPI Request Sense command and display the request sense data received. Request Sense (ATAPI packet command code 03H) is a "packet read" (PR) command.

The data display is performed only during the first execution of a repeated RS command.

This command forces LBA32 sector/block addressing mode.

Also see:  SHOWx

(Go To TOC)

[ RSVW ]


RSVW sequence lba minSC maxSC [multiCount]

[AUTO] [DIO] [FULL] [REP]

This command allows a sequence of write, read, seek and/or verify commands to be executed on an ATA device. The sequence of commands is specified using W, R, S and V characters in any order.

This command is valid only in LBA28 and LBA48 mode.

RSVW selects a sector count and then performs read, write or seek commands in the order specified. Each command will start at the same LBA and use the same sector count.

lba is the starting sector/block address.

minSC and maxSC are the minimum sector counts to use. In LBA28 these are values between 1 and 256. In LBA48 these are values between 1 and 65536. Data generation and data compare is limited when a R or W command uses a sectorCount greater that the size of the ATADEMO I/O buffer - see the COMPx, FILLx and TAG commands.

If DMA is OFf and multiCount is not specified a W or R command uses Read or Write Sectors commands. In LBA48 mode the Read or Write Sectors Extended commands are used.

If DMA is OFf and multiCount is specified a W or R command use Read or Write Multiple commands. In LBA48 mode the Read or Write Multiple Extended commands are used.

If DMA is ON, multiCount is ignored and a W or R command uses Read or Write DMA commands. In LBA48 mode the Read or Write DMA Extended commands are used.

Note: If LBA48 and DMA ON is enabled and the data transfer is larger than the size of the ATADEMO I/O buffer, TAG OFF is assumed when data is generated for the write command - see the COMPx, FILLx and TAG commands.

Also see:  CHSIncr DMA DR DW LBAIncr ND PDI PDO R REPeat W

Examples:


   RSVW SWRSR 90 4 4

      Execute a sequence of seek write read seek read commands,
      each command starting at LBA 90 with a sector count of 4.

   tag on
   before fillzero
   afternoerror compzero
   onerror continue
   lbai 10 7999
   rep 9999 rsvw wrr 5000 10 10 4

      Execute a sequence of write read read commands using binary
      zero data with sector tags.  Read/Write Multiple will be used
      with 4 sectors per block.  Each set of commands will use a
      sector count of 10.  The read commands will include
      data compare.  The first set of write, read, read commands
      will be done at LBA 5000, the second set at LBA 5010, the
      third set at LBA 5020, ... up to LBA 7990.

   tag on
   before fillone
   afternoerror compone
   onerror continue
   lbai random
   dma on
   rep 1000 rsvw wrr 0 1 20

      Execute a sequence of write read read commands using binary
      one data with sector tags.  Read/Write DMA commands will be
      used.  Each set of commands will use a random sector count
      between 1 and 20.  The read commands will include data
      compare.  The first set of write, read, read commands will be
      done at LBA 0, the second set and remaining sets will be at
      randomly selected LBA locations.

(Go To TOC)

[ RTOc ]


RTOc
RTOc format

[AUTO] [DIO] [REP]

Execute an ATAPI Read TOC command and display the TOC data received. Read TOC (ATAPI packet command code 43H) is a "packet read" (PR) command.

format specifies the format of the TOC returned by the device. format is 0, 1 or 2. The default is 2. This value is placed into bits 7 and 6 of CDB byte 9.

The data display is performed only during the first execution of a repeated RTOc command.

This command forces LBA32 sector/block addressing mode.

Also see:  SHOWx

(Go To TOC)

[ S10 ]


S10 lba

[AUTO] [DIO] [REP]

Execute an ATAPI Seek 10 command.

This command is equivalent to the following command


   pn 4096 2bh 0 lba3 lba2 lba1 lba0 0 0 0 0 0 0

If this command is repeated the LBA will be updated by the LBAIncr command.

This command forces LBA32 sector/block addressing mode.

Also see:  CHSIncr LBAIncr PN REPeat Seek

(Go To TOC)

[ SAYx ]

See SAY, SAYFail and SAYPass below.

(Go To TOC)

[ SAY ]


SAY text

[FULL]

See the section TEXT STRING FORMATING for the rules on how 'text' strings are used with this command.

SAY messages will display even if all message levels are turned off.

Note: The first character of the message text can be used to control the message color. The following characters will change the message color: '*', '>', '?', '#' and '!'.

Also see:  SAYFail SAYPass WL WRITEText

Examples:


   SAY ! Display this message now !

      Will display "! Display this message now !"
      in the error message color.

   SAY max_lba is {max_lba} 0x{*max_lba} {*max_lba}H

      Will display "max_lba is 4098 0x1002 1002H"
      (assuming max_lba is 4098).

   


SAYFail
SAYPass

[FULL]

Displays a large block message with the word FAIL or PASS. These messages will display even if all message levels are turned off.

(Go To TOC)

[ SCRipt ]


SCRipt fileName

[FULL]

Load and execute a script file.

The script file is read, compiled and executed. The new script replaces the current script.

See the section FILE NAMES above for the description of how file names can be specified.

Execution of the script begins with the first command of the script, also known as the first line in the main part of the script file.

A script file contains a main part followed by zero, one or more subroutine definitions. The main part can have zero, one or more commands. The main part ends at the first BEGINSub command or at the end of the script file.

After the script file is loaded execution begins with the first line of the main part. If the main part exection ends with a BEGINSub or QUit command ATADEMO returns to keyboard mode and the PUBlic subroutines defined by the script file can be executed by using the CAll command from the keyboard.

Warning: A script file can define PUBlic subroutines that have the same name as any ATADEMO command. For commands enter at the keyboard this has the effect of replacing the ATADEMO command.

Loading a new script does not alter any of the command settings, such as the current CHS, ECHO, LBA or TAG, etc, setting. Loading a script does not alter any built-in or user defined variables, except the script_flag built-in variable.

The built-in variable script_flag counts the number of times any part of the script is executed using the SCRipt or CAll commands. The SCRipt command sets script_flag so that script_flag is zero only when the main part of a script is executing.

Also see:  BEGINSub CAll ENDSub

Examples:


   SCRIPT NEWLOG.TXT   ; script file name is 'NEWLOG.TXT'

   SET X = 583
   SCRIPT (x+3)  ; script file name is '586.DSF'

   SET Y = 8943
   SET Z = 26
   SCRIPT D{Y}.{*Z}H ; script name is 'D8943.1AH

(Go To TOC)

[ Seek ]


Seek lba
Seek cyl head sect

[AUTO] [DIO] [REP]

Execute an ATA Seek command.

Note: The ATA Seek command is obsolete. There is no LBA48 Seek command (no SEEK EXT command).

This command is equivalent to one of the following commands


   nd 70h 0 1 lba
   nd 70h 0 1 cyl head sect

Also see:  CHSIncr LBAIncr ND PN REPeat S10

(Go To TOC)

[ SET ]


SET varName [=] n
varName = n

[FULL]

See the description of "user defined variables" above.

Creates a global variable and assigns the value n to it. In a subroutine if varName is a local user defined variable the SET command is converted to a LOCAL command.

Variable names must begin with an alphabetic character and must contain only alphabetic and numeric characters.

In the first format (using SET) the equal sign is optional.

In the second format varName must not be the name of an ATADEMO command and the equal sign (=) is required.

Example:


   set a 1
   set b = 4
   SET x ( a + 3 * b - 2 )
   Say X is now {x}

      Will display "X is now 11"

This example is equivalent to the example above:


   a = 1
   b = 4
   x = ( a + 3 * b - 2 )
   Say X is now {x}

      Will display "X is now 11"

Also see:  ASK ASKYN FETCHx LOCAL

(Go To TOC)

[ SF ]


SF PIo n
SF SW n
SF MW n
SF ULtra n
SF DRC
SF ERC
SF DWC
SF EWC

[AUTO] [DIO] [REP]

Execute an ATA Set Features command to set the PIO, Single Word DMA, MultiWord DMA, UltraDMA mode, or, to disable read cache (DRC), enable read cache (ERC), disable write cache (DWC) or enable write cache (EWC).

This command is equivalent to one of the following commands


   nd efh 03h x lba           ; set pio, sw, mw, u-dma
   nd efh 03h x cyl head sect ; set pio, sw, mw, u-dma
   nd efh y 0 0               ; read/write cache on/off
   nd efh y 0 0 0 0           ; read/write cache on/off

Where x is the value for the PIO, SW, MW or U-DMA setting and y is the value to turn read or write cache on/off.

Also see:  ND REPeat

(Go To TOC)

[ SHOWx ]

See SHOWBM, SHOWCB, SHOWCCr, SHOWCH, SHOWCIs, SHOWCS, SHOWID, SHOWINq, SHOWLL, SHOWPC, SHOWRS and SHOWTOc below.

(Go To TOC)

[ SHOWBM ]


SHOWBM

Display the Bus Master IDE registers (BMIDE) for the PCI bus ATA controller being used by ATADEMO.

(Go To TOC)

[ SHOWCB ]


SHOWCB

Read and display the ATA Command Block.

(Go To TOC)

[ SHOWCCr ]


SHOWCCr

Display the PCMCIA PC Card ATA Card Configuration Registers.

(Go To TOC)

[ SHOWCH ]


SHOWCH

Display the command history buffer.

Also see:  Clear SHOWx

(Go To TOC)

[ SHOWCIs ]


SHOWCIs

Display the PCMCIA PC Card ATA Card Information Structure data.

Also see:  COPYCIs

(Go To TOC)

[ SHOWCS ]


SHOWCS

Display the PCI Configuration Space data for the PCI bus ATA controller being used by ATADEMO.

(Go To TOC)

[ SHOWID ]


SHOWID

Assume the sector buffer contains ATA or ATAPI Identify data and display the data.

Also see:  DUMPId ID

(Go To TOC)

[ SHOWINq ]


SHOWINq

Assume the sector buffer contains ATAPI Inquiry data and display the data.

Also see:  INQ

(Go To TOC)

[ SHOWLL ]


SHOWLL

Display the low level trace buffer.

Also see:  Clear SHOWx

(Go To TOC)

[ SHOWPC ]


SHOWPC

Show results of last ATA or ATAPI command.

(Go To TOC)

[ SHOWRS ]


SHOWRS

Assume the sector buffer contains ATAPI Request Sense data and display the data.

Also see:  RS

(Go To TOC)

[ SHOWTOc ]


SHOWTOc

Assume the sector buffer contains ATAPI CD-ROM TOC data and display the dat.

Also see:  RTOc

(Go To TOC)

[ SM ]


SM multiCount

[AUTO] [DIO] [REP]

Execute an ATA Set Multiple command.

This command is equivalent to one of the following commands


   nd c6h 0 multiCount lba
   nd efh 0 multiCount cyl head sect

Where multiCount is the Set Multiple block count value.

Also see:  ND REPeat

(Go To TOC)

[ SMART ]


SMART DIsable
SMART ENable
SMART STatus

[AUTO] [DIO] [REP]

Execute an ATA SMART command.

This command is equivalent to one of the following commands


   nd b0h d9h 0 c24f00h   ; disable (lba)
   nd b0h d9h 0 c24fh 0 0 ; disable (chs)
   nd b0h d8h 0 c24f00h   ; enable  (lba)
   nd b0h d8h 0 c24fh 0 0 ; enable  (chs)
   nd b0h dah 0 c24f00h   ; return status (lba)
   nd b0h dah 0 c24fh 0 0 ; return status (chs)

SMART STatus displays the status returned by the device (OK or threshold exceeded).

Also see:  ND REPeat

(Go To TOC)

[ SSS ]


SSS option

[FULL]

This command controls the single step script function. Use this command to debug script files. When this command is active and ATADEMO is executing a script file, ATADEMO will pause before executing the selected script command.

SSS with no parameter displays the current setting.

option is any combination of the following characters:


   A - pause before all commands.
   B - pause before IF commands.
   C - pause before CAll commands.
   I - pause before I/O commands.
   N - turn off SSS pause.
   R - pause before REPeat commands.
   W - pause before WHILE commands.

When ATADEMO pauses before a command:

Examples:


   SSS NA      // equivalent to SSS A
   SSS BCIRW   // equivalent to SSS A
   SSS AIWNB   // equivalent to SSS B
   SSS IN      // equivalent to SSS N

(Go To TOC)

[ SSU ]


SSU [option]

[AUTO] [DIO] [REP]

Execute an ATAPI Start/Stop Unit command. Start/Stop Unit (ATAPI packet command code 1BH) is a "packet no data" (PN) command.

option specifies the value of the Load Eject and Start bits. option is 0, 1, 2 or 3. The default is 0. This value is placed into bits 1 and 0 of CDB byte 4.

This command forces LBA32 sector/block addressing mode.

(Go To TOC)

[ STOREx ]

See STORE, STOREBUF and STORECDB below.

(Go To TOC)

[ STORE ]


STORE sectorOffset byteOffset n ...

Store bytes of data into the buffer.

sectorOffset is 0 to one less than the maximum number of sectors that fit into the buffer.

byteOffset is 0 to one less than the size of a sector.

n is the value of each byte to be stored into the buffer.

Also see:  ALTER BLOCKSIZE FETCHBUF FILLx ID RCAp STOREBUF

(Go To TOC)

[ STOREBUF ]


STOREBUF sectorOffset byteOffset size value

[FULL]

Store a value into the buffer.

sectorOffset is 0 to one less than the maximum number of sectors that fit into the buffer.

byteOffset is 0 to one less than the size of a sector.

size is the number of bytes to place into the buffer. size is 1, 2, 4 or 4.

value is the value to store. value is a 32-bit signed value.

Also see:  ALTER BLOCKSIZE FETCHBUF FILLx ID RCAp STORE

(Go To TOC)

[ STORECDB ]


STORECDB offset size value

[FULL]

Store data into the CDB buffer used to issue Packet commands.

offset is the offset into the CDB buffer. size is either 0 to 11 or 0 to 15.

size is the number of bytes to place into the CDB buffer. size is 1, 2, 3 or 4.

value is the value to store. value is a 32-bit signed value.

The rightmost 'size' bytes of value are stored into the CDB buffer starting at 'offset'.

For example, execute a Read 10 command:


   SET CMDCODE 28H            ; command code to use
   SET SLBA 1036              ; starting lba
   STORECDB 0 1 CMDCODE       ; store the command code
   STORECDB 2 4 SLBA          ; store the lba
   STORECDB 7 2 4             ; store the transfer length of 4
   ; now zero the other bytes of the CDB when
   ; the command is issued...
   PR * 0 * * * * 0 * * 0 0 0 ; execute the command !

Also see:  FETCHCDB

(Go To TOC)

[ STRx ]

See the STRCMP, STRCOMV, STRFBUF, STRFIND, STRLEN, STRLWR, STRPARSE, STRSBUF, STRSET, STRSUB and STRUPR commands below.

These commands perform variable operations on the built-in str_s* string variables.

The STRx comands set the built-in variable str_result with the result of the command execution.

(Go To TOC)

[ STRCMP ]


STRCMP strVar1 strVar2

Compare two strings.

str_result is set to -1, 0 or 1.

Also see:  str_result

Examples:


   strset str_s5 model123
   strset str_s7 m123
   strcmp str_s5 str_s7
      // sets str_result=1
   strcmp str_s7 str_s5
      // sets str_result=-1
   strcmp str_s7 str_s7
      // sets str_result=0

(Go To TOC)

[ STRCONV ]


STRCONV varName strVar

See the description of "user defined variables" above.

The numeric character string is converted to a binary value and stored in the user defined variable. The numeric string follows the same rules as numeric parameters to ATADEMO commands.

varName will be defined if it does not exists.

str_result is set to 0 if the conversion was sucessful. str_resultis set to 1 if the conversion failed. varName is not defined or changed if the conversion fails.

Also see:  str_result

Examples:


   strset str_s6 123
   strset str_s7 -456
   strset str_s8 0x23
   strset str_s9 1M2N
   strconv x str_s6
      // sets str_result=0, sets x=123
   strconv x str_s7
      // sets str_result=0, sets x=-456
   strconv x str_s8
      // sets str_result=0, sets x=35
   strconv x str_s9
      // sets str_result=1, x is not changed

(Go To TOC)

[ STRFBUF ]


STRFBUF strVar sectorOffset byteOffset

Fetch a string from the buffer. Bytes are fetched from the buffer until a NULL character (0x00) is fetched or 96 characters have been fetched.

Also see:  str_result STRSBUF

(Go To TOC)

[ STRFIND ]


STRFIND strVar1 strVar2

str_result is set to the offset of string2 within string1. If string2 is not found str_result is set to -1.

Also see:  str_result

Examples:


   strset str_s3 this is a string
   strset str_s5 this
   strfind str_s3 str_s5
      // set str_result=0
   strset str_s5 a
   strfind str_s3 str_s5
      // set str_result=8
   strset str_s5 xyz
   strfind str_s3 str_s5
      // set str_result=-1

(Go To TOC)

[ STRLEN ]


STRLEN strVar

str_result is set to the length of the string.

Also see:  str_result

Examples:


   strset str_s3 this is a string
   strlen str_s3
      // sets str_result=16

(Go To TOC)

[ STRLWR ]


STRLWR strVar

Converts the string to lower case.

Examples:


   strset str_s3 AaBc12Xx
   strupr str_s3
      // sets str_result=8,
      // str_s3 is now "aabc12xx"

Also see:  str_result STRUPR

(Go To TOC)

[ STRPARSE ]


STRPARSE strVar1 strVar2 strVar3

Using the first character in string3 as a delimiter, copy characters from string2 to string1 up to but not including the delimiter character.

str_result is set to the length of string1.

Also see:  str_result

Examples:


   strset str_s4 1.02/A7-Q1
   strset str_s5 .
   strset str_s6 -
   strfind str_0 str_s5 str_s5
      // sets str_s0 to "1", str_result=1
   strfind str_0 str_s5 str_s6
      // sets str_s0 to "1.02/A7", str_result=7

Also see:  str_result STRSUB

(Go To TOC)

[ STRSBUF ]


STRSBUF sectorOffset byteOffset strVar

Store a string into the buffer.

Also see:  str_result STRFBUF

(Go To TOC)

[ STRSET ]


STRSET strVar [text]

Set the string to a new value.

See the section TEXT STRING FORMATING for the rules on how 'text' strings are used with this command.

str_result is set to the length of the string.

Also see:  str_result ASKSTR Sn=string

Examples:


   set count = 3
   strset str_s5 too low
   strset str_s0 value{count1} is {str_s5}.
      // str_s0 is set to "value3 is too low.",
      // str_result=18
   strset str_s0 str_s5
      // str_s0 is set to "str_s5",
      // str_result=6
   strset str_s0 {str_s5}
      // str_s0 is set to "too low",
      // str_result=7

(Go To TOC)

[ STRSUB ]


STRSUB strVar1 strVar2 offset length

Sets string1 to the substring from string2.

offset is the starting offset of the substring (0 to 96), length is the length of the substring (0 to 96).

str_result is set to the length of string1 (may be less than length).

Also see:  str_result STRPARSE

Examples:


   strset str_s0 1234567890abcdefgh
   strsub str_s1 str_s0 0 3
      // sets str_s1 to "123", sets str_result=3
   strsub str_s1 str_s0 3 5
      // sets str_s1 to "45678", sets str_result=5
   strsub str_s1 str_s0 9 15
      // sets str_s1 to "0abcdefgh", sets str_result=9
   strsub str_s1 str_s0 9 0
      // sets str_s1 to "", sets str_result=0

(Go To TOC)

[ STRUPR ]


STRUPR strVar

Converts the string to upper case.

Also see:  str_result STRLWR

Examples:


   strset str_s3 AaBc12Xx
   strupr str_s3
      // sets str_result=8,
      // str_s3 is now "AABC12XX"

(Go To TOC)

[ TAG ]


TAG

Display the current setting of sector tagging or turn sector tagging on and off for the currently selected device.


TAG OFf
TAG ON
TAG (n)

The sector tag is the LBA of the sector and is located in the middle of the sector's data.

Sector tagging is allowed only if the BLOCKSIZE value for the device is greater than 64 bytes.

When sector tagging is off the FILLx commands do not insert the LBA of the sector into the buffer. When sector tagging is on the FILLx commands will insert the LBA of the sector into the buffer.

When using ATA DMA or ATAPI PIO/DMA commands that transfer more data than the size of the ATADEMO I/O buffer: 1) the FILLx commands do not insert sector tag data into the buffer - see the FILLx commands, and 2) data compare is bypassed - see the COMPx commands.

When sector tagging is off the COMPx commands do not expect a sector tag in a sector's data. When sector tagging is on the COMPx commands will verify that the sector's tag data is correct.

For TAG (n), a zero value is the same as OFf and a non zero value is the same as ON.

Warning: See "Variables that look like keywords" above.

Also see:  AFTERx BEFORE BLOCKSIZE COMPx DUMPCt DUMPTag FILLx LBA LBAIncr

(Go To TOC)

[ TUR ]


TUR

[AUTO] [DIO] [REP]

Execute an ATAPI Test Unit Ready command. Test Unit Ready (ATAPI packet command code 00H) is a "packet non-data" (PN) command.

This command forces LBA32 sector/block addressing mode.

Also see:  LBA

(Go To TOC)

[ V ]


V sectorCount lba
V sectorCount cyl head sect

[AUTO] [DIO] [REP]

Execute an ATA Read Verify command.

This command is equivalent to one of the following commands


   ND 40h 0 sectorCount lba
   ND 40h 0 sectorCount cyl head sect
   ND 42h 0 sectorCount lbalo

Also see:  CHSIncr LBAIncr REPeat

(Go To TOC)

[ W ]


W sectorCount lba [multiCount]
W sectorCount lbalo [multiCount]
W sectorCount cyl head sect [multiCount]

[AUTO] [DIO] [FULL] [REP]

Execute an ATA Write Sectors, Write Multiple or Write DMA command.

If DMA is OFf and multiCount is not specified the W command is equivalent to


   PDO 30h 0 sectorCount lba
   PDO 30h 0 sectorCount cyl head sect
   PDO 34H 0 sectorCount lbalo

If DMA is OFf and multiCount is specified the W command is equivalent to


   PDO C5h 0 sectorCount lba multiCount
   PDO C5h 0 sectorCount cyl head sect multiCount
   PDO 39h 0 sectorCount lbalo

If DMA is ON, multiCount is ignored and the W command is equivalent to


   DW 0 sectorCount lba
   DW 0 sectorCount cyl head sect

Note that sector tagging is done only in LBA mode.

Data generation is limited when a W command uses DMA and the sectorCount greater that the size of the ATADEMO I/O buffer - see the FILLx and TAG commands.

Also see:  CHSIncr DMA DR DW LBAIncr PDI PDO R REPeat

(Go To TOC)

[ W10 ]

(Go To TOC)

[ W12 ]


W10 tl lba [etl]
W12 tl lba [etl]

[AUTO] [DIO] [FULL] [REP]

Execute an ATAPI Write 10 or Write 12 command. Write 10 (ATAPI packet command code 2AH) and Write 12 (ATAPI packet command code AAH) are "packet write" (PW) commands. If DMA is ON, the data transfer will be done in DMA mode. If DMA is OFf, the data transfer will be done in PIO mode.

tl is the transfer length (number of blocks to write).

The data transfer of a W10 or W12 command may be up to 33Mbytes (65536*512 bytes). Data generation is limited for a data transfer that is larger than the ATADEMO I/O buffer size - see the FILLx and TAG commands.

lba is the starting block address.

etl is the expected transfer length. If not specified, etl will be set to (tl * dev_bs). If DMA is ON, etl is ignored.

This command forces LBA32 sector/block addressing mode.

Also see:  BLOCKSIZE DMA LBA LBAIncr RCAp RCD REPeat R10 R12

(Go To TOC)

[ WHILE ]


WHILE n

[FULL] [SCRIPT]

Define the beginning of a WHILE loop. Commands within the WHILE loop are executed while the value of n is not zero.

Example:


   set x = 0
   while ( x < 100 )
      if ( x % 4 == 0 )
         say x is a multiple of 4
      endif
      if ( x == y )
         break;
      endif
      if ( x == z )
         continue
      endif
      say x is {x}
      set x = x + 1
   endwhile

Also see:  BReak COntinue ENDWHile

(Go To TOC)

[ WINdow ]


WINdow ASK varName

[FULL] [SCRIPT]

See the description of "user defined variables" above.

Asks the user to select a item (row) in the window area.

varName is the name of a user defined variable that will be set to a value between 0 and 9 indicating the item (row) that was selected by the user.

The user is allowed to highlight rows on the screen that have a '[' character as the left most character. To make the selection the enter key must be pressed. The value assigned to varName is base on the single character to the right of the '[' character:


   [n or [N sets varName to 0.
   [y or [Y sets varName to 1.
   [0       sets varName to 0.
   [1       sets varName to 1.
   [2 to [9 sets varName to 2 to 9.

Also see:  ASK ASKYN ASKSTR SAYx SET WINdow


WINdow CLEAR

[FULL] [SCRIPT]

Clears the window area of the screen and sets the row number to 1. The next SAY command will place data at this window location.

Also see:  SAY SAYFail SAYx WINdow


WINdow CLOSE

[FULL] [SCRIPT]

This command closes window mode. The normal output screen is restored when closed.

Also see:  SAY SAYFail SAYx WINdow


WINdow COLOR fb

[FULL] [SCRIPT]

Set the foreground and background colors for the window area of the screen. These colors are used until the next COLOR command.

fb is two characters. The first character sets the foreground color. The second character sets the background color. These characters are:


   k or K - black
   b or B - blue
   g or G - green
   c or C - cyan
   r or R - red
   m or M - magenta
   y or Y - yellow
   w or W - white

The lower case character results in a low intensity color and a upper case character results in a high intensity color.

The next SAY, SAYFail or SAYPass command will use these colors.

Also see:  SAY SAYFail SAYx WINdow


WINdow GOTO n

[FULL] [SCRIPT]

Sets the row number to row n of the window. The next SAY, SAYFail or SAYPass command will place data at this window location.

Also see:  SAY SAYFail SAYx WINdow


WINdow OPEN

[FULL] [SCRIPT]

This command opens the window area of the screen. The window area is all the lines on the screen except the bottom two lines (the status and input lines). The window area will remain open until the end of the current script file execution or until a WINdow CLOSE command.

While in window mode only the ASK, ASKYN, SAY, SAYFail and SAYPass commands send messages to the window area of the screen. The ASK and ASKYN commands use the bottom two lines of of the screen.

The windows area is cleared when opened and the row number is set to 1.

The normal output screen is restored when closed.

Also see:  SAY SAYFail SAYx WINdow

(Go To TOC)

[ WL ]


WL text

[FULL]

This command writes a message into the log file.

See the section TEXT STRING FORMATING for the rules on how 'text' strings are used with this command.

Also see:  SAYx WRITEText

Examples:


   WL Display this message now!

      Will log the message "Display this message now!".

   WL max_lba is {max_lba} 0x{*max_lba} {*max_lba}H

      Will log the message "max_lba is 4098 0x1002 1002H"
      (assuming max_lba is 4098).

(Go To TOC)

[ WRITE ]


WRITE numBytes fileName [Append]

The first numBytes of the buffer are written or appended to the file fileName.

The WRITE command sets the built-in variable num_bytes to the actual number of bytes written to the file.

See the section FILE NAMES above for the description of how file names can be specified.

Also see:  READ

Examples:


   WRITE 10 NEWLOG.TXT

      Write 10 bytes from the buffer into file NEWLOG.TXT.

   SET X = 583
   WRITE (x) (x+3)

      Write 583 bytes from the buffer into file 586.BIN.

   SET Y = 8943
   SET Z = 26
   WRITE 24 D{Y}.{*Z}H

      Write 24 bytes from the buffer into file D8943.1AH.

(Go To TOC)

[ WRITEText ]


WRITEText fileName text

[FULL]

The text is written to specified file.

See the section FILE NAMES above for the description of how file names can be specified.

See the section TEXT STRING FORMATING for the rules on how 'text' strings are used with this command.

Also see:  SAYx WL

Examples:


   WRITEText NEWLOG.TXT Display this message now!

      Will write the message "Display this message now!"
      to the file NEWLOG.TXT.

   SET X = 583
   WRITEText (x+3) max_lba is {max_lba} 0x{*max_lba} {*max_lba}H

      Will write the message
      "max_lba is 4098 0x1002 1002H"
      (assuming max_lba is 4098) to file 586.TXT.

   SET Y = 8943
   SET Z = 26
   WRITEText D{Y}.{*Z}H We have an error here.

      Will write the message "We have an error here."
      to file D8943.1AH.

(Go To TOC)

[ (EqSign) ]


(EqSign)

This command is a single equal sign character (=) entered at the keyboard.

Repeat the last ATADEMO command. This command is not allowed in a script file.

Also see:  (EqSignEqSign)

(Go To TOC)

[ (EqSignEqSign) ]


(EqSignEqSign)

This command is two equal sign characters (==) entered at the keyboard.

Clear the trace buffers and repeat the last ATADEMO command. This command is not allowed in a script file.

(Go To TOC)

[ (Slash) ]


(Slash)

This command is a single slash character (/) entered at the keyboard.

Repeat the last device I/O command. See the commands marked with the symbol [DIO]. This command is not allowed in a script file.

Also see:  (SlashSlash)

(Go To TOC)

[ (SlashSlash) ]


(SlashSlash)

This command is two slash characters (==) entered at the keyboard.

Clear trace buffers and repea the last device I/O command. See the commands marked with the symbol [DIO]. This command is not allowed in a script file.

(Go To TOC)

USING CHSIncr, LBAIncr and REPeat COMMANDS

The CHSIncr, LBAIncr and REPeat commands are the most powerful commands in ATADEMO. These commands can be used to execute commands over the entire media or on only part of the media. Below are some examples of using the LBAIncr command. These examples would operate the same in CHS mode and with commands other than a "read" command. Assume that an ID or RCAp command was successful before any of these examples are executed.

1) Read every sector reading 10 sectors at a time.


   lbaincr 10
   repeat 999999999 r 10 0

2) Read 10 sectors at random locations. Execute 15000 reads.


   lbaincr random
   repeat 15000 r 10 0

3) Read every sector from LBA 11000 to 19999 8 sectors at a time.


   lbaincr 8 20000
   repeat 99000 r 8 11000

4) Read 8 sectors at random locations within LBA 11000 to 19999. Execute 15000 reads.


   lbaincr random 20000
   repeat 15000 r 8 11000

5) Read 100 sectors, skip the next 50 sectors and repeat.


   lbaincr 150
   repeat 999999 r 100 0

6) Read all the sectors in decending LBA order.


   lbaincr -1
   repeat 99999999 r 1 max_lba

7) Do overlapping reads in decending LBA order.


   lbaincr -10
   repeat 99999999 r 20 max_lba

8) Using TL can make a script file smaller.


   lbaincr tl
   repeat 5000 r 1 0
   repeat 5000 r 2 0
   repeat 5000 r 3 0

   is equivalent to

   lbaincr 1
   repeat 5000 r 1 0
   lbaincr 2
   repeat 5000 r 2 0
   lbaincr 3
   repeat 5000 r 3 0

9) Execute an ATA Identify command with random data in the SN, CL, CH and DH (bits 3-0) registers.


   lbaincr random
   repeat 100 pdi ech 0 0 0

10) Also see the examples in the RSVW command description.

(Go To TOC)

Editor

The ATADEMO editor may be used to edit text files.

Also see:  EDITx EDIT EDITCH EDITKB EDITLL EDITSF

The ATADEMO editor is also available as a stand alone program named AEDIT. See the AEDIT User Guide (AEDIT.HTM).

The editor inforces the basic file formatting rules required in ATADEMO script files. Those rules are:

Editor Screen Format

The top line of the screen shows the following information:

The bottom line of the screen shows the following information and/or error messages:

Editor Keys and Functions

AEDIT is a full screen editor. Characters typed are normally placed into the current line at the current cursor position. Only the keys 20H (space) to 7EH (~) are allowed.

The following keys invoke editor functions:

ALT-A

A a line following the current cursor position.

ALT-C

Copy the marked lines after the current cursor position. Use ALT-L to mark lines.

ALT-D

Delete the line at the current cursor position.

ALT-E

Move the cursor to the end of the file.

ALT-F

Enter a search string and find the next occurance of the string.

ALT-G

Find the next occurance of the search string.

ALT-K

Delete the marked block of lines. Use ALT-L to mark lines.

ALT-L

Mark lines. Move the cursor to the first line to be marked and press ALT-L. If marking more than one line, move the cursor up or down to the last line to be marked and press ALT-L again. Then use the ALT-C, ALT-K or ALT=M keys to copy, delete or move the marked block of line(s). Also see ALT-U.

ALT-M

Move the marked block of lines after the current cursor position.

ALT-T

Move the cursor to the top of the file.

ALT-U

Unmark any marked lines.

ALT-X

Exit/quit the editor. Causes the ALT-X menu to be displayed.

BS

Move the cursor left and delete a character.

CTRL-END

Delete all characters to the right of the cursor position.

DEL

Delete the character at the cursor position.

DOWN

Move the cursor down one line.

END

Move the cursor to the end of the current line.

ENTER

Move the cursor to the left side of the next line.

ESC

Undo any changes to the current line since the cursor arrived on the line.

HOME

Move the cursor to the left side of the current line.

INS

Toggle replace/inser mode.

LEFT

Move the cursor left.

PGDN

Move the cursor down 1/2 of the screen size.

PGUP

Move the cursor up 1/2 of the screen size.

RIGHT

Move the cursor right.

UP

Move the cursor up one line.

Editor ALT-X Menu

The ALT-X key (or running out of free memory) will cause the ALT-X menu to be displayed. Use this menu to:

(Go To TOC)

HOW MUCH DATA WILL A DEVICE TRANSFER?

Some ATA/ATAPI commands transfer a fixed number of bytes. Generally these are commands that do not access the device media, such as IDENTIFY or RCAp.

On an ATA device for commands that access data on the media the amount of data transferred depends upon the type of command: non-data (ND), PIO Data In (PDI), PIO Data Out (PDO) or DMA In/Out. Non-data commands transfer no data. PIO Data In/Out and DMA In/Out commands transfer (N * sector_size) bytes where N is 0 to 256 (LBA28) or 0 to 65536 (LBA48). Note that N is 0 only when there is an error and the device rejects the command immediately.

For ATAPI devices, the answer is much more complex. First there is really only one ATAPI command protocol and the device can choose to make the command a command that transfers no data or a command that sends data to the host or a command that receives data from the host.

When the ATADEMO PN command is used, ATADEMO will signal an error if the device attempts to transfer data. No data will actually be transferred. When the PR or PW commands are used, ATADEMO will transfer data up to 33Mbytes (65536*512 bytes).

The problem with ATAPI devices is that there are a wide range of implementations, may of which are not compliant with the ATA/ATAPI-x specification. An ATAPI device should obey the maximum data packet size that the host specifies when the A0H command is written into the ATA Command register. Many devices ignore this value. Many devices use this value incorrectly when commands like Request Sense are executed. This is the reason the PR and PW commands have an optional expected data transfer length parameter (etl). Use this command parameter to confirm that an ATAPI device is transfering the proper amount of data.

(Go To TOC)

ATAPI CD-ROM DRIVES

While ATAPI CD-ROM drives are really ATA devices and should execute ATA commands properly, many do not. One example (and this is just one of many examples) of incorrect ATAPI device design is not maintaining the proper ATA status during the execution of an ATAPI Identify command (command code A1H) and during the execution of the ATAPI Packet command (command code A0H).

Many of these ATAPI devices can operate with ATADEMO but only if a special delay of approximately 110ms is used prior to checking the device status at critical times during command execution. This delay can be enabled and disabled using the ATAPIDelay ON and ATAPIDelay OFf commands. The ATAPIDELAY ON command may be required before any commands can be issued to an ATAPI device.

You will need a copy of the SCSI MMC-x document if you want to try any of the ATAPI CD-ROM packet commands. Packet commands are SCSI like commands that are sent to an ATAPI device using the ATA command code A0H. This command is known as the ATAPI Packet command. In ATADEMO the PN, PR, PS and PW commands are used to setup and execute the ATAPI Packet command.

(Go To TOC)

HINTS

a) Whenever ATADEMO asks you for an ATA command code, you may enter a ? character to see a list of ATA hard disk commands. (just as if you had used the HELPC command). Whenever ATADEMO asks you for the command byte (byte 0) of an ATAPI Packet CDB you may enter a ? character to see a list of the ATAPI CD-ROM packet commands (just as if you had used the HELPP command).

b) Don't switch to LBA sector addressing usless your hard disk supports LBA addressing.

(Go To TOC)

THINGS TO TRY

Here are some things to try the first time you use ATADEMO...

(Go To TOC)

HISTORY

Versions not shown were test or skipped versions.

Version 12A2

(Go To TOC)

QUESTIONS OR PROBLEMS?

Technical support can be found at:


   http://www.ata-atapi.com/techsupp.html

-end-