Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

50 строки
2.1KB

  1. # E06-S06: run the interface lifetime fixture in x128 and check its mailbox.
  2. [CmdletBinding()]
  3. param([int]$Port = 6561, [int]$TimeoutSeconds = 180)
  4. $ErrorActionPreference = "Stop"
  5. $project = Split-Path $PSScriptRoot -Parent
  6. Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force
  7. & (Join-Path $PSScriptRoot "build-lifetime-test.ps1")
  8. $out = Join-Path $project "build\lifetime-test"
  9. $disk = Join-Path $out "lifetime-test.d81"
  10. $failures = @()
  11. $session = Start-Nova128X128 -Autostart $disk -Drive8Image $disk -Port $Port `
  12. -Screenshot (Join-Path $out "lifetime-test-vicii.png")
  13. try {
  14. $mb = Wait-Nova128Mailbox $session -TimeoutSeconds $TimeoutSeconds
  15. Start-Sleep -Milliseconds 500
  16. $screenRam = Read-Nova128Memory $session 0x0400 1000
  17. } finally {
  18. Stop-Nova128X128 $session -SettleSeconds 0
  19. }
  20. if ($mb[2] -ne 0x03) { $failures += "producer $($mb[2]) expected 3" }
  21. if ($mb[3] -ne 0xA5) { $failures += ("status {0:X2} expected A5" -f $mb[3]) }
  22. if ($mb[4] -ne 0 -or $mb[5] -ne 0) { $failures += "code $($mb[4] + 256 * $mb[5]) expected 0" }
  23. for ($i = 0; $i -lt 5; $i++) {
  24. if ($mb[8 + $i] -ne 1) { $failures += "phase $i flag is $($mb[8 + $i]), expected 1" }
  25. }
  26. $rows = for ($r = 0; $r -lt 25; $r++) {
  27. $chars = for ($c = 0; $c -lt 40; $c++) {
  28. $code = $screenRam[$r * 40 + $c]
  29. if ($code -le 0x1F) { [char]($code + 0x40) } elseif ($code -le 0x3F) { [char]$code } else { '?' }
  30. }
  31. (-join $chars).TrimEnd()
  32. }
  33. if (-not ($rows -contains "LIFETIME OK")) {
  34. $failures += "screen does not contain 'LIFETIME OK'"
  35. }
  36. if ($failures) {
  37. throw ("interface lifetime verification failed (code {0}, addr {1:X4}):`n " -f ($mb[4] + 256 * $mb[5]), ($mb[6] + 256 * $mb[7]) +
  38. ($failures -join "`n ") + "`n mailbox: " + ($mb -join ' ') + "`n screen:`n " + (($rows | Where-Object { $_ }) -join "`n "))
  39. }
  40. Write-Host "screen:"
  41. $rows | Where-Object { $_ } | ForEach-Object { Write-Host " |$_" }
  42. Write-Host "mailbox: producer 3, PASS, code 0, all 5 lifetime flags set"
  43. Write-Host "verified delete through one and two interface values, null delete, alias detection, and the null call fault"

Powered by TurnKey Linux.