diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme index 0cd11b1be..a52587e0e 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme +++ b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme @@ -72,7 +72,9 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + enableAddressSanitizer = "YES" enableASanStackUseAfterReturn = "YES" + enableUBSanitizer = "YES" disableMainThreadChecker = "YES" launchStyle = "0" useCustomWorkingDirectory = "NO" diff --git a/Storage/MassStorage/SCSI/TargetImplementation.hpp b/Storage/MassStorage/SCSI/TargetImplementation.hpp index d46a44e38..e61ce9b82 100644 --- a/Storage/MassStorage/SCSI/TargetImplementation.hpp +++ b/Storage/MassStorage/SCSI/TargetImplementation.hpp @@ -30,6 +30,11 @@ template void Target::scsi_bus_did_change(Bus *, B } switch(phase_) { + /* + While awaiting selection the SCSI target is passively watching the bus waiting for its ID + to be set during a target selection. It will segue automatically from there to the command + phase regardless of its executor. + */ case Phase::AwaitingSelection: if( (new_state & scsi_id_mask_) && @@ -43,6 +48,12 @@ template void Target::scsi_bus_did_change(Bus *, B } break; + /* + In the command phase, the target will stream an appropriate number of bytes for the command + it is being offered, before giving the executor a chance to handle the command. If the target + supports this command, it becomes responsible for the appropriate next phase transition. If it + reports that it doesn't support that command, a suitable response is automatically dispatched. + */ case Phase::Command: // Wait for select to be disabled before beginning the control phase proper. if((new_state & Line::SelectTarget)) return; @@ -62,7 +73,6 @@ template void Target::scsi_bus_did_change(Bus *, B command_[command_pointer_] = uint8_t(new_state); ++command_pointer_; if(command_pointer_ == command_.size()) { - printf("Dispatching command\n"); dispatch_command(); // TODO: if(!dispatch_command()) signal_error_somehow();