AS 400 (iSeries) Support


BlueSCSI can emulate SCSI hard disks for IBM AS/400 (iSeries) systems. AS/400 systems use non-standard block sizes and vendor-specific SCSI commands, so dedicated configuration is required.

This work is based on yyzkevin’s work to BlueSCSI v2 in mid-2025 here https://github.com/yyzkevin/BlueSCSI-v2/commits/as400/

Requirements

  • BlueSCSI Ultra or BlueSCSI Ultra Wide hardware (RP2350-based)
  • Currently use a build based of the as400 tag.

Quick Start

  1. Create a disk image at the correct block size (520 or 522 bytes per sector)
  2. Name it following the standard pattern: HD0_520.img (SCSI ID 0, 520-byte blocks)
  3. Add System = AS400 to your bluescsi.ini
  4. Insert the SD card and power on

Minimal bluescsi.ini

[SCSI]
System = AS400

That’s it. The System = AS400 preset automatically configures:

  • IBM drive identity (INQUIRY response matching a real IBMAS400 DGVS09U drive)
  • All 8 IBM Vital Product Data (VPD) pages with unique serial numbers
  • Unit Attention on power-on (required for AS/400 IPL)
  • SCSI-2 mode

Block Size

AS/400 systems use non-standard sector sizes. Set the block size either in the image filename or in the INI file:

Via Filename (Preferred)

Include the block size in the image filename:

HD0_520.img     # SCSI ID 0, 520-byte sectors
HD1_522.img     # SCSI ID 1, 522-byte sectors

Or via bluescsi.ini file:

[SCSI0]
BlockSize = 520

Configuration Reference

System Preset

[SCSI]
System = AS400

The AS/400 system preset enables all the quirks and defaults needed for AS/400 operation. It is strongly recommended over manual configuration.

Per-Device Settings

These are set under [SCSI0] through [SCSI7] and override preset defaults when specified:

Key Default Description
BlockSize From filename Sector size in bytes (520 or 522)
Vendor IBMAS400 SCSI INQUIRY vendor string
Product DGVS09U SCSI INQUIRY product string

Custom Inquiry Data (Advanced)

For users who need to emulate a specific IBM drive model, inquiry and VPD data can be overridden with raw hex in the INI file. When System = AS400 is set, these override the built-in defaults:

[SCSI0]
; Override standard INQUIRY response (hex bytes, space-separated)
spd = 00 00 03 02 9f 00 01 3A 49 42 4D ...

; Override individual VPD pages (hex bytes)
vpd00 = 00 00 00 08 00 01 03 80 82 83 D1 D2
vpd80 = 00 80 00 10 20 20 20 20 20 20 ...
vpd83 = 00 83 00 32 02 01 00 22 ...

VPD page keys use the format vpd followed by the two-digit hex page code: vpd00, vpd01, vpd03, vpd80, vpd82, vpd83, vpdD1, vpdD2.

Most users do not need custom inquiry data. The built-in defaults work for typical AS/400 configurations.

Supported SCSI Commands

In addition to the standard SCSI-2 command set, the following vendor-specific and extended commands are supported for AS/400:

Command CDB Opcode Description
WRITE SAME(10) 0x41 Write a single block pattern across a range of LBAs
Skip Read(10) 0xE8 Read selected sectors using a bitmask
Skip Write(10) 0xEA Write selected sectors using a bitmask
LOG SENSE 0x4D Device diagnostics (pages 0x00, 0x30, 0x31)
RESERVE / RELEASE 0x16 / 0x17 Extent reservations accepted silently
START STOP UNIT 0x1B 13-second spin-up delay on start (matches real drive timing)

Skip Read / Skip Write

These are IBM vendor-specific commands used by AS/400 for sparse I/O. A bitmask in the command specifies which sectors within a range to actually transfer (1 = transfer, 0 = skip). This allows the AS/400 to efficiently read or write non-contiguous sectors in a single operation.

Linked command chaining (multiple skip operations in sequence) is supported.

LOG SENSE

Three log pages are implemented:

  • Page 0x00: Supported log pages list
  • Page 0x30: Device I/O statistics (read/write operation counters)
  • Page 0x31: Device information (includes device serial number)

MODE SENSE

When AS/400 quirks are active, MODE SENSE(6) for all pages (page code 0x3F) returns a complete response captured from a real IBM drive. This includes geometry, caching, and vendor-specific mode pages that the AS/400 expects during device initialization.

Serial Numbers

A unique 8-character serial number is generated per SCSI ID, derived from the microcontroller’s hardware unique ID. The serial is automatically injected into the standard INQUIRY response and VPD pages 0x80, 0x82, 0x83, and 0xD1.

Different SCSI IDs on the same BlueSCSI will have different serial numbers. If you move an SD card to a different BlueSCSI board, the serials will change (since they are derived from the MCU, not the SD card).

Creating Disk Images

AS/400 disk images must use the correct block size. The image file size should be a multiple of the block size.

Example: a 9.1 GB drive with 520-byte sectors:

# Total size = sector_count * 520
# 17,783,240 sectors * 520 bytes = 9,247,284,800 bytes
dd if=/dev/zero of=HD0_520.img bs=520 count=17783240

You can also create images from real SCSI drives using dd with the appropriate block size, or use AS/400 save/restore operations to populate the image.

Drive shows errors or timeout during IPL

  • The 13-second spin-up delay is normal on first START STOP UNIT command
  • Check log.txt on the SD card for SCSI command traces
  • Verify the image file size is a multiple of the block size

Custom inquiry data not loading

  • VPD page keys use the format vpd + hex page code (e.g., vpd80, vpdD1)
  • Ensure the hex string is space-separated with no 0x prefixes
  • Check log.txt for “Custom VPD page” messages confirming the data was loaded
This wiki has been updated 959 times by 98 people like you!
Click here to edit this page.
Generated 2026-04-26