Skip to content

Conversation

@jarz
Copy link
Contributor

@jarz jarz commented Feb 10, 2026

  • Add shared scsiparseutils module to parse SCSI-2 MODE SELECT(6) parameter lists (headers, block descriptors, and variable-length mode pages).
  • Integrate parser into ScsiHardDisk and ScsiCdrom to replace TODO stubs. Incoming MODE SELECT commands are now validated and detailed structure is logged for debugging.
  • Add test_modeselect.cpp test suite with 44 unit tests covering parsing edge cases (truncation, overflow, multi-page).
  • Add DPPC_BUILD_SCSI_TESTS CMake option (default OFF) and testscsi target.
  • Add documentation in ScsiCdrom regarding the BlockStorageDevice refactoring needed to support 512 <-> 2048 byte block size switching.

- Add shared `scsiparseutils` module to parse SCSI-2 MODE SELECT(6) parameter lists (headers, block descriptors, and variable-length mode pages).
- Integrate parser into `ScsiHardDisk` and `ScsiCdrom` to replace TODO stubs. Incoming MODE SELECT commands are now validated and detailed structure is logged for debugging.
- Add `test_modeselect.cpp` test suite with 44 unit tests covering parsing edge cases (truncation, overflow, multi-page).
- Add `DPPC_BUILD_SCSI_TESTS` CMake option (default OFF) and `testscsi` target.
- Add documentation in `ScsiCdrom` regarding the `BlockStorageDevice` refactoring needed to support 512 <-> 2048 byte block size switching.
@maximumspatium
Copy link
Collaborator

First of all, thank you very much for your contribution!

I'd like to let you know that I'm currently refactoring SCSI emulation in DingusPPC. That implies that the whole architecture is about to be changed because the current one suffers from code duplication.
ScsiHardDisk and ScsiCdrom will become sub-classes of ScsiBlockCmds that shall implement all commands for block devices in one place.
MODE SENSE/MODE SELECT and their ten-byte counterparts need generic implementations that belong to ScsiCommonCmds that gathers commands for all device types.
The idea is to implement all SCSI commands independent of the physical layer to avoid copy-paste coding and additional maintainancy burden. The required physical layer - be it SCSI or ATAPI - can be just "plugged in".
Would you mind holding until the above described changes will be pushed?
Your code can be adapted to the new achitecture with minimal effort...

One of the follow-up questions is what to do with parsed mode data. For the moment being, our SCSI emulation just discards mode select data. No guest software package has seriously "complained" so far.
Maybe we should log attempts to change some defaults.
Anyway, I would appreciate any suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants