Skip to content

Commit

Permalink
Add ModeSense page 0x25 (DEC unique page)
Browse files Browse the repository at this point in the history
VAXServer 3100 (CPU KA41-E) console firmware issues ModeSense(6)
page 0x25 when probing for disks. A disk won't be recognized if
this returns an error.

The DEC SCSI specification[1], section 8.5 documents this page.

[1] https://manx-docs.org/collections/antonio/dec/dec-scsi.pdf

Fixes PiSCSI#1410

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
  • Loading branch information
kkaempf committed Jan 14, 2024
1 parent ad5eae9 commit 222261c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cpp/devices/scsihd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,32 @@ void SCSIHD::AddFormatPage(map<int, vector<byte>>& pages, bool changeable) const
EnrichFormatPage(pages, changeable, 1 << GetSectorSizeShiftCount());
}

// Page code 37 (25h) - DEC Unique Page

void SCSIHD::AddDECUniquePage(map<int, vector<byte>>& pages, bool changeable) const
{
vector<byte> buf(25);

// No changeable area
if (changeable) {
pages[0x25] = buf;

return;
}

buf[0] = static_cast<byte> (0x25 | 0x80); // page code, high bit set
buf[1] = static_cast<byte> (sizeof(buf) - 1);
buf[2] = static_cast<byte> (0x01); // drive does not auto-start

pages[0x25] = buf;
}

void SCSIHD::AddVendorPage(map<int, vector<byte>>& pages, int page, bool changeable) const
{
// Page code 0x25: DEC unique
if (page == 0x25 || page == 0x3f) {
AddDECUniquePage(pages, changeable);
}
// Page code 48
if (page == 0x30 || page == 0x3f) {
AddAppleVendorModePage(pages, changeable);
Expand Down
1 change: 1 addition & 0 deletions cpp/devices/scsihd.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class SCSIHD : public Disk
void ModeSelect(scsi_defs::scsi_command, cdb_t, span<const uint8_t>, int) const override;

void AddFormatPage(map<int, vector<byte>>&, bool) const override;
void AddDECUniquePage(map<int, vector<byte>>&, bool) const;
void AddVendorPage(map<int, vector<byte>>&, int, bool) const override;

private:
Expand Down

0 comments on commit 222261c

Please sign in to comment.