{"id":46158325,"url":"https://github.com/cdhooper/amiga_devtest","last_synced_at":"2026-04-13T01:01:20.843Z","repository":{"id":56817185,"uuid":"483435115","full_name":"cdhooper/amiga_devtest","owner":"cdhooper","description":"AmigaOS block device test utility (trackdisk.device, scsi.device, etc) ","archived":false,"fork":false,"pushed_at":"2026-04-12T22:25:39.000Z","size":341,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-13T00:34:08.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdhooper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-19T23:01:17.000Z","updated_at":"2026-04-12T22:25:03.000Z","dependencies_parsed_at":"2023-12-18T18:54:49.562Z","dependency_job_id":"28b70764-85c9-4c8f-a6b4-353d5c713aea","html_url":"https://github.com/cdhooper/amiga_devtest","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cdhooper/amiga_devtest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdhooper%2Famiga_devtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdhooper%2Famiga_devtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdhooper%2Famiga_devtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdhooper%2Famiga_devtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdhooper","download_url":"https://codeload.github.com/cdhooper/amiga_devtest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdhooper%2Famiga_devtest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31735542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T22:19:12.206Z","status":"ssl_error","status_checked_at":"2026-04-12T22:18:33.088Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-02T10:31:37.886Z","updated_at":"2026-04-13T01:01:20.715Z","avatar_url":"https://github.com/cdhooper.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amiga block device test utility (devtest)\n\nThis utility interacts directly with an Amiga block device driver to test\nthe driver and physical device. There are several operation types that the\nutility can perform:\n   * Device probe\n   * Performance\n   * Packet support\n   * Device Geometry\n   * Data integrity\n\n## 1. Device probe\n\nIt can probe all targets and logical units of a device and report which\ntargets are responding. Example:\n```\n    9.OS322:\u003e devtest -p scsi.device\n      0 ZULUSCSI HARDDRIVE        1.1  Disk     512  2147 MB\n      5 ZULUSCSI CDROM            1.1  CDROM   2048    77 MB\n```\n\nYou can also probe a specific target id. If that target id is not present,\ndevtest will exit with a non-zero code. Example:\n```\n    9.OS322:\u003e devtest -p scsi.device 0\n      0 ZULUSCSI HARDDRIVE        1.1  Disk     512  2147 MB\n    9.OS322:\u003e echo $RC\n    0\n    9.OS322:\u003e devtest -p scsi.device 1\n    Open scsi.device Unit 1: Fail 32 TDERR_BadUnitNum\n    9.OS322:\u003e echo $RC\n    1\n```\n\n## 2. Performance\nYou can measure device read and write performance in the system, using\ndifferent Amiga memory types (default is fastmem).\n**WARNING: The -d option enables the write benchmark, which is destructive to any data on the drive!**\nExamples:\n```\n    9.OS322:\u003e devtest a4091.device 1 -bd\n    Test a4091.device 1 with Coprocessor RAM\n    read  512 KB xfers          5992 KB/sec\n    read  128 KB xfers          5783 KB/sec\n    read   32 KB xfers          4937 KB/sec\n    write 512 KB xfers          5821 KB/sec\n    write 128 KB xfers          4887 KB/sec\n    write  32 KB xfers          3913 KB/sec\n```\n\nTesting with Zorro memory\n```\n    9.OS322:\u003e devtest a4091.device 1 -bd -m zorro\n    Test a4091.device 1 with Zorro III RAM\n    read  512 KB xfers          7377 KB/sec\n    read  128 KB xfers          7063 KB/sec\n    read   32 KB xfers          5915 KB/sec\n    write 512 KB xfers          7350 KB/sec\n    write 128 KB xfers          5893 KB/sec\n    write  32 KB xfers          4031 KB/sec\n```\n\nNormally, the destructive test will still attempt to read the data\nbeforehand and write it back after completing the test. Adding a\nsecond `-d` option will skip the read and restore. This will speed\nup the test, but not affect the reported performance.\n\nSometimes there is a type of memory which is at a specific range\nof addresses, and you want to run the benchmark specifally against\nthat memoory. You should use an address in that range which is not\ncurrently allocated. With the -m option, you may both discover free\nmemory and specify the exact address to use. Use the `-m -` argument\nto show memory blocks in the free list.\n```\n    9.OS322:\u003e devtest -m -\n    Coprocessor RAM at 0x8000000 size=0x8000000\n      0x86b6220 0x400\n      0x86d1ef0 0x230\n      0x87892c0 0x7876d40\n    MB RAM at 0x7000000 size=0x1000000\n      0x7000020 0xffffe0\n    Zorro III RAM at 0x40000000 size=0x10000000\n      0x40000020 0xfffffe0\n    Zorro III RAM at 0x60000000 size=0x10000000\n      0x60000020 0xfffffe0\n    Zorro II RAM at 0x2000000 size=0x2000000\n      0x200020 0x1fffe0\n    Chip RAM at 0x004000 size=0x1fc000\n      0x0202d8 0x1dfd28\n```\n\nUse the ```-m \u003caddress\u003e``` option to specify a particular block or type\nof memory.\nExamples:\n```\n    9.OS322:\u003e devtest a4091.device 1 -bd -m 0x60000020\n```\n```\n    9.OS322:\u003e devtest a4091.device 1 -bd -m zorro2\n```\n\nAdding a second `-b` option will cause devtest to also measure\nlatency of a variety of packets. Example:\n```\n    9.OS322:\u003e devtest -bbd a4091.device 1\n    Test a4091.device 1 with Coprocessor RAM\n    read  512 KB xfers          5995 KB/sec\n    read  128 KB xfers          5768 KB/sec\n    read   32 KB xfers          4906 KB/sec\n    write 512 KB xfers          5800 KB/sec\n    write 128 KB xfers          5027 KB/sec\n    write  32 KB xfers          4020 KB/sec\n    OpenDevice / CloseDevice    2.090 ms\n    OpenDevice multiple         0.003 ms\n    CloseDevice multiple        0.001 ms\n    TD_GETGEOMETRY sequential   2.021 ms\n    TD_GETGEOMETRY parallel     1.100 ms\n    TD_CHANGENUM                0.006 ms\n    TD_CHANGENUM quick          0.006 ms\n    CMD_INVALID                 0.006 ms\n    CMD_START                   1.001 ms\n    CMD_READ butterfly average  1.063 ms\n    CMD_READ butterfly far      1.057 ms\n    CMD_READ butterfly constant 1.058 ms\n    CMD_READ sequential         2.077 ms\n    CMD_READ parallel           2.059 ms\n    HD_SCSICMD read sequential  2.072 ms\n    HD_SCSICMD read parallel    2.058 ms\n    CMD_WRITE sequential        3.052 ms\n    CMD_WRITE parallel          3.034 ms\n    HD_SCSICMD write sequential 3.054 ms\n    HD_SCSICMD write parallel   3.036 ms\n```\n\n## 3. Packet support\n    Trackdisk-compatible drivers often don't support all request\n    packet types that a filesystem may use. This is especially true\n    if it's an older driver that can't handle the packet standards\n    which support larger (4GB+) media. Devtest will test most known\n    trackdisk commands and report whether they are supported.\n**WARNING: The -d option enables the write benchmark, which is destructive to any data on the drive!**\n    Example:\n```\n    9.OS322:\u003e devtest -t a4091.device 1 -d\n    TD_GETGEOMETRY     Success  4194304 x 512  C=8192 H=32 S=16 Type=0\n    TD_CHANGENUM       Success  Count=1\n    TD_CHANGESTATE     Success  Disk present\n    TD_PROTSTATUS      Success  Unprotected\n    TD_GETDRIVETYPE    Fail -3 IOERR_NOCMD (unsupported)\n    TD_GETNUMTRACKS    Fail -3 IOERR_NOCMD (unsupported)\n    TD_RAWREAD         Fail -3 IOERR_NOCMD (unsupported)\n    SCSICMD Inquiry    Success  V='ZULUSCSI' P='HARDDRIVE' R='2.0' DT=0x0 Linked Sync\n    SCSICMD TUR        Success  Ready\n    NSCMD_DEVICEQUERY  Success\n    CMD_READ           Success\n    ETD_READ           Success\n    TD_READ64          Success\n    NSCMD_TD_READ64    Success\n    NSCMD_ETD_READ64   Success\n    TD_SEEK            Success\n    ETD_SEEK           Success\n    TD_SEEK64          Success\n    NSCMD_TD_SEEK64    Success\n    NSCMD_ETD_SEEK64   Success\n    CMD_WRITE          Success\n    ETD_WRITE          Success\n    TD_WRITE64         Success\n    NSCMD_TD_WRITE64   Success\n    NSCMD_ETD_WRITE64  Success\n    TD_FORMAT          Success\n    ETD_FORMAT         Success\n    TD_FORMAT64        Success\n    NSCMD_TD_FORMAT64  Success\n    NSCMD_ETD_FORMAT64 Success\n    TD_MOTOR ON        Success\n    TD_MOTOR OFF       Success\n```\n\nAdding a second `-t` option will cause devtest to test additional\npacket types. Some packets may cause your media to eject or trigger\nknown bugs in Amiga device drivers.\n\n\n## 4. Device Geometry\nOn the Amiga, there are multiple methods to acquire a drive's physical\ngeometry, including direct SCSI commands. These methods are reported\nby devtest.\n```\n    9.OS322:\u003e devtest -g a4091.device 1\n                     SSize TotalSectors    Cyl Head  Sect DType Removable\n    TD_GETGEOMETRY     512      4194304   8192   32    16  0x00 No\n    Inquiry                                                0x00 No\n    READ_CAPACITY_10   512      4194304\n    READ_CAPACITY_16     -            -                    Fail 52 ERROR_SENSE_CODE\n    Read-to capacity   512      4194304\n    Mode Page 0x03     512                             63\n    Mode Page 0x04                         261  255\n```\n\nTD_GETGEOMETRY is implemented by the Amiga device driver. It is the\nresponsibility of the driver to acquire details from the device to fill\nthe DriveGeometry structure. It is known that Commodore's scsi.device\nfor IDE is sometimes not able to acquire geometry information from CF\ndrives, and may fail this command.\n\nInquiry is a SCSI INQUIRY, sent to the drive using SCSI Direct. The only\ndetails reported by INQUIRY which are relevant here are the drive type\nand removable flag.\n\nREAD_CAPACITY_10 is the SCSI READ_CAPACITY_10 result. Some very old drives\n(SASI) do not support this command, but nearly all drives from the 90's\nand newer do.\n\nREAD_CAPACITY_16 is unnecessary and likely unimplemented for any drive\nsmaller than 2 TB. It first appeared in the SCSI specification in the early\n2000's, so older drives will definitely not support it. This command is\nsupported by PiSCSI regardless of the exported device size.\n\nRead-to capacity is implemented by devtest as a as-fast-as-possible means\nto determine the actual readable capacity of the drive. It uses a search\nbased on power-of-two sector addresses.\n\nMany SCSI drives support mode pages, and depending on the specific page,\nprovide details such as the number of cylinders, heads, and sectors that\nare present on the device.\n\nYou may specify a device or volume name instead of a driver and unit.\nAdditional details are provided when a device or volume name is specified.\n```\n    9.OS322:\u003e devtest -g Work:\n                     SSize TotalSectors    Cyl Head  Sect DType Removable\n    Partition          512     16738688   1042    1 16064  scsi.device 0\n    Partition-start    512      2104384    131\n    Partition-end      512     18843072   1173\n    TD_GETGEOMETRY     512     18874368   1174  255    63  0x00 No\n    Inquiry                                                0x00 No\n    READ_CAPACITY_10   512     18874368\n    READ_CAPACITY_16     -            -                    Fail 45 HFERR_BadStatus\n    Read-to capacity   512     16738687\n    Mode Page 0x03     512                             63\n    Mode Page 0x04                        1174  255\n```\n\n## 5. Data integrity\nThe benchmark test is a good tool for verifying the Amiga's bus interface\nand timing are being met, but it does no actual data verification. The\ndevtest utility can perform tests to verify that data can be reliably stored\nto and retrieved from the device media.\n\n\u003e CAUTION: This test is destructive when the -d flag is given. Do not\n           operate on a drive with data that you intend to keep.\n\nExample:\n```\n    9.OS322:\u003e devtest a4091.device 1 -i 1024 -d\n```\n\nThe above command performs a single 1024 byte write to the device, and then\nreads that data back. It will report any miscompares, and show the mismatching\ndata. The test always starts at the beginning of the device's storage. You can\nloop on this operation, in which case, all device data will be sequentially\nwritten and then read back.\nExample (test 64 MB of device storage in 64KB chunks):\n```\n    9.OS322:\u003e devtest a4091.device 1 -i 65536 -d -l 1024\n    Pass 1  2024-07-07 00:32:46\n    Pass 2  2024-07-07 00:32:46\n    Pass 3  2024-07-07 00:32:46\n    Pass 4  2024-07-07 00:32:46\n```\n...\n```\n    Pass 1023  2024-07-07 00:36:17\n    Pass 1024  2024-07-07 00:36:17\n    1024 passes completed successfully\n```\n\nAs can be calculated from the above (about 300 KB/sec), the data integrity\ntest is significantly slower than the performance test.\n\nWhen the data integrity test detects a failure, it automatically re-reads\nthe data. Example (512 byte transfers with 2-byte alignment):\n```\n    9.OS322:\u003e devtest scsi.device 1 -di 512,2\n    Miscompare at 0x0\n      0001fe: a5 != expected 29 [diff 8c]\n      0001ff: a5 != expected 86 [diff 23]\n    Re-read of data differs (floating data?)\n      0001fe: 5a != expected 29 [diff 73]\n      0001ff: 5a != expected 86 [diff dc]\n      0001fe: 5a != first read a5 [diff ff]\n      0001ff: 5a != first read a5 [diff ff]\n```\nThe above test suggests that the last two bytes of the transfer are\nconsistently not being written by the SCSI controller. This might happen\nin the case of the Amiga SDMAC-04 when paired with a Ramsey-04 (not confirmed).\n\nSome items to note:\n1) The pattern written to disk is pseudo-random.\n2) The read back buffer is filled with 0xa5 values by the CPU before the\n   transfer is initiated.\n3) If a miscompare is detected in the read back data, the same data will be\n   read again into a second read back buffer. That buffer is pre-filled with\n   0x5a values by the CPU before the transfer is initiated.\n4) Since we see that both the primary and secondary read-back buffers appear\n   to have original pattern contents, we can conclude that those values were\n   never updated by the SDMAC on the read back from disk.\n\nThe default mode of the integrity test is to generate a pseudo-random pattern\nfor the write data, alternating between the random values and inverted random\nvalues. There are two other generated data modes. If -ii is specified, the\nwritten data will be the byte offset of the data within the buffer.\n    0x00, 0x01, 0x02, ... 0xfe, 0xff, 0x00, 0x01 ...\nand alternate:\n    0xff, 0xfe, 0xfd, ... 0x01, 0x00, 0xff, 0xfe ...\n\nIf -iii is specified, the written data will be one of 7 specific values\nin a rotating cycle. The fact that there are 7 values (a prime number) in\nthe -iii mode is by design. This will cause different power-of-two\naddresses to experience different data patterns. Pattern values:\n    0xa5, 0x5a, 0xc3, 0x3c, 0x81, 0x00, 0xff\nand alternate:\n    0x5a, 0xa5, 0x3c, 0xc3, 0x7e, 0xff, 0x00\n\nThe simple integrity test, as shown above, performs a sequential check of\nall media on the device. At each pass in destructive mode, it writes a chunk,\nreads back that chunk, and compares. In non-destructive mode, it reads a\nchunk, reads the same chunk again, and compares.\n\nThe devtest utility offers another integrity test, butterfly. This test\nis specified with the -k option:\n```\n    -k butterfly\n```\nThe butterfly integrity test alternates between low and high offsets on\nthe device, each iteration the test moves the low and high closer to the\nmiddle of the device, until they cross over. At which point, the low and\nhigh swap places and then the test moves the low and high further from\nthe middle of the device. In destructive mode, the test writes data to\nthe low offset, and different data to the high offset. It then verifies\nthe low and high data match what was written. In non-destructive mode,\nthe test reads data at the low and high offset, then reads it a second\ntime from the low and high offset. It then verifies the low and high\ndata match what was previously read.\n```\n    8.SDH0:\u003e devtest scsi.device 1 -i 256k -k butterfly -ddyv -l 300\n    Pass 1  2020-03-30 15:04:43\n      Zone sector 0 (0.0% of media check #1) 0 KB\n    Pass 2  2020-03-30 15:05:00\n      Zone sector 512 (1.5% of media check #1) 16 MB\n    Pass 3  2020-03-30 15:05:15\n      Zone sector 1024 (3.1% of media check #1) 32 MB\n...\n    Pass 64  2020-03-30 15:20:44\n      Zone sector 32256 (98.4% of media check #1) 1023 MB\n    Pass 65  2020-03-30 15:20:59\n      Zone sector 0 (0.0% of media check #2) 1040 MB\n    Pass 66  2020-03-30 15:21:15\n...\n```\nThe above test ran at about 1 MB/sec.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdhooper%2Famiga_devtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdhooper%2Famiga_devtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdhooper%2Famiga_devtest/lists"}