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

AmigaOS 4.0 - About OS4 - Commands

IDETOOL Utility
Purpose: To temporarily configure your ide devices.
Format: IDETOOL
Template: (none)
Path: C:IDETOOL
IDETOOL is a program provided with AmigaOS 4.0 to manage the PCI buses, and is normally run from a Shell. Please note though, that any changes you make using IDETOOL will be lost at the next re-boot. If you want to make permanent changes you must set the appropriate U-Boot environment variables, as detailed in UBoot environment variables.

Instructions for using IDETOOL vary slightly depending on the IDE controller being referenced. This documentation applies to the built-in VIA686B controller on the AmigaOne. For other add-on controller cards, see the corresponding pages:

Understanding Transfer Modes
While the "a1ide_xfer" U-Boot environment variable uses letters (shown in the left-most column), idetool reports/uses the numeric "modeid" (shown in the right-most column) as per the following table :

0 = Automatic
a = PIO 0
b = PIO 1
c = PIO 2
d = PIO 3
e = PIO 4
A = UDMA 0
B = UDMA 1
C = UDMA 2
D = UDMA 3
E = UDMA 4
F = UDMA 5
G = UDMA 6
(let a1ide.device choose best mode)
(3 MB/s, modeid 8)
(5 MB/s, modeid 9)
(8 MB/s, modeid 10)
(11 MB/s, modeid 11)
(16 MB/s, modeid 12)
(16 MB/s, modeid 64)
(25 MB/s, modeid 65)
(33 MB/s, modeid 66)
(44 MB/s, modeid 67)
(66 MB/s, modeid 68)
(100 MB/s, modeid 69)
(133 MB/s, modeid 70)

For example, if you specified "C" for UDMA 2 at 33MB/s in the U-Boot a1ide_xfer environment variable, that would be equivalent to using "modeid 66" in idetools. Similarly if you specified "c" for PIO 2 at 8MB/s in the U-Boot a1ide_xfer environment variable, that would be equivalent to using "modeid 10" in idetools.

Getting Help
If you simply enter the program name "idetool", the following help information is displayed:

3.OS4:> idetool
idetool - usage :

   idetool -<cmd1> [cmd arg1] ... [cmd arg n] -<cmd2> [cmd arg1] ... [cmd arg n] ...
Where <cmd> is a command, and [cmd arg1] ... [cmd arg n] are the command args

General commands :
  -v (no args) : tell idetool version
  -c (no args) : tell CPU configuration

OS4 device unit commands :
  -l devname : tell unit info for all device units
  -u devname unit : tell unit info for unit 'unit'
  -d devname unit : tell drive info for unit 'unit'
  -r devname unit : tell raw drive info for unit 'unit'
  -x devname unit mode : put drive 'unit' into transfer mode 'mode'
  -p devname unit mode : put drive 'unit' into power mode 'mode' (2: spin up, 3: spin down, 5: sleep forever)
  -i devname unit mode : put drive 'unit' into interrupt mode 'mode' (0: don't use IRQ's, 1: use IRQ's)
  -y devname unit : query geometry for devname/unit
  -o devname unit : just open & close devname/unit

CD/DVD-specific device unit commands :
  -j devname unit 'e'/'l' : eject/load disk in drive 'unit'
  -m devname unit read_speed write_speed : set 'unit' medium read / write speed (1 .. n for x1 ... xn, or 0xFFFF for max.)

PCI chip config dump commands :
  -w (no args) : tell VIA686b PCI IDE configuration
  -s (no argside) : tell SiI0680 PCI IDE configuration
  -a (no args) : tell SiI3112 PCI IDE configuration
  -b (no args) : tell SiI3114 PCI IDE configuration
  -e (no args) : tell SiI3512 PCI IDE configuration
  -f (no args) : tell LSI53cxxx PCI SCSI configuration
  -t vendor device : tell PCI IDE device 'vendor/device' configuration

PCI chip config patch commands :
  -0 reg val : patch VIA function 0 (ISA) configspace byte 'reg' with value 'val'
  -1 reg val : patch VIA function 0 (IDE) configspace byte 'reg' with value 'val'
  -2 reg val : patch SiI0680 configspace byte 'reg' with value 'val'
  -3 reg val : patch SiI3112 configspace byte 'reg' with value 'val'
  -4 reg val : patch SiI3114 configspace byte 'reg' with value 'val'
  -5 reg val : patch SiI3512 configspace byte 'reg' with value 'val'
  -g reg val : patch LSI53cxxx configspace byte 'reg' with value 'val'
  -8 vendor device reg : tell PCI device 'vendor/device' configspace byte 'reg' value
  -9 vendor device reg val : patch PCI device 'vendor/device' configspace byte 'reg' with value 'val'

PCI chip I/O patch commands :
  -6 vendor device reg : tell PCI device 'vendor/device' I/O byte 'reg' value
  -7 vendor device reg val : patch PCI device 'vendor/device' I/O byte 'reg' with value 'val'

Beware : do not use this tool except if you really know what you are doing.
Note on inputting numeric values : if the first character is 0 and the second character is not 'x' or 'X', the string is interpreted as an octal integer; otherwise, it is interpreted as a decimal number. If the first character is '0' and the second character is 'x' or 'X'', the string is interpreted as a hexadecimal integer.

Examples of using idetool

  • to display the idetool version information, with the '-v' option:

        idetool -v

    3.OS4:> idetool -v
     IDETool 52.1 (09.12.2006)
    (made to work only with same version device drivers)
    3.OS4:>

  • to display the idetool CPU configuration information, with the '-c' option:

        idetool -c

    3.OS4:> idetool -c
    -----------------AmigaOne CPU Configuration-----------------
    CPU Type IBM PowerPC 750 FX
            Version 2.2
            Extensions performancemonitor
            Freq 800 MHz
            FSB 133 MHz
            L1 Cache 32768 bytes
            L2 Cache 524288 bytes
            L3 Cache 0 bytes
    3.OS4:>

  • to see what modes devices connected to the on-board IDE ports support and currently use, with the '-l' (that's 'ell') option:

        idetool -l a1ide.device

    3.OS4:> idetool -l a1ide.device
    -------------------Unit 0 information------------------------
           Flags : $00000185 - present, supports DMA, ATA, supports cache flush, interrupts used,
           Xfer mode : best pio 12 (PIO 4, 16MB/s) / best dma 69 (UDMA 5, 100MB/s) / current 12 (PIO 4, 16MB/s)
           Total blocks : 156301488
           Blocksize : 512
           Power mode : 2 / idle (ready for operation)
           IO1 / IO2 / BMCR @ : $802400 / $80240A / $802420
    *** Error opening device a1ide.device / unit 1
    -------------------Unit 2 information------------------------
           Flags : $0000011D - present, supports DMA, removable media, ATAPI, interrupts used,
           Xfer mode : best pio 12 (PIO 4, 16MB/s) / best dma 66 (UDMA 2, 33MB/s) / current 12 (PIO 4, 16MB/s)
           Total blocks : 310872
           Blocksize : 2048
           Packet spec : 5
           Packet size : 12
           Current medium read speed : x 65535 ('65535' stands for max.)
           Current medium write speed : x 65535 (idem)
           Power mode : 2 / idle (ready for operation)
           IO1 / IO2 / BMCR @ : $802410 / $80241A / $802428
    *** Error opening device a1ide.device / unit 3
    *** Error opening device a1ide.device / unit 4
    *** Error opening device a1ide.device / unit 5
    *** Error opening device a1ide.device / unit 6
    *** Error opening device a1ide.device / unit 7
    *** Error opening device a1ide.device / unit 8
    *** Error opening device a1ide.device / unit 9
    *** Error opening device a1ide.device / unit 10
    *** Error opening device a1ide.device / unit 11
    *** Error opening device a1ide.device / unit 12
    *** Error opening device a1ide.device / unit 13
    *** Error opening device a1ide.device / unit 14
    *** Error opening device a1ide.device / unit 15

    3.OS4:>

    The lines shown in red above display the best PIO mode that the devices can use, then the best DMA mode the devices can use, and the current mode specified for the devices, separated by /'s. Both devices are running the best PIO mode the on-board IDE bus can deliver.

    The lines shown in green above display the block size used for each device. For FFS devices the blocksize needs to be >= 2048 to get decent performance, while for SFS devices you get best performance with 512.

  • to switch primary master harddisk to UDMA100 (alias mode 69 or 'F'), with the '-x' option:

        idetool -x a1ide.device 0 69

    3.OS4:> idetool -x a1ide.device 0 69
    Unit 0 : transfer mode 69 returned 0
    3.OS4:>

    IMPORTANT: Please note that switching drives connected to the VIA686B controller to UDMA mode may cause data and file corruption, especially when moving large files, so is not generally recommended.

  • You can try some of the other commands, like putting your harddrive to sleep with

        idetool -p a1ide.device 0 2

    (don't worry it wakes up automatically at next access)

  • As long as you don't mess with -0, -1, -2 and -9 commands you can't do much harm
Idetool can do many other things (including examining any PCI device, and patching its configuration in real time) but don't try that unless you fully understand what you are doing, and can deal with the consequences.


Return to Commands Selection

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


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: December 24, 2006.