diff --git a/Build/Cosmos/ISO/BuildM.ps1 b/Build/Cosmos/ISO/BuildM.ps1 index c10299d02..4f3d81043 100644 --- a/Build/Cosmos/ISO/BuildM.ps1 +++ b/Build/Cosmos/ISO/BuildM.ps1 @@ -31,8 +31,33 @@ cd ..\..\..\tools\qemu\ $qemu = resolve-path qemu.exe $qemuparms = '-L . -cdrom ..\..\build\Cosmos\ISO\Cosmos.iso -boot d -hda ..\..\build\Cosmos\ISO\C-drive.img -serial "file:..\..\build\Cosmos\ISO\serial-debug.txt" -S -s' # Still failing - because its a command line exe? run under cmd.exe? -[System.Diagnostics.Process]::Start($qemu, $qemuparms) +$processInfo = new-object System.Diagnostics.ProcessStartInfo +$processInfo.FileName = $qemu +$processInfo.WorkingDirectory = [System.IO.Path]::GetDirectoryName($qemu); +$processInfo.Arguments = $qemuparms; +$processInfo.UseShellExecute = $False +$processInfo.RedirectStandardOutput = $False +$processInfo.RedirectStandardError = $False +$process = [System.Diagnostics.Process]::Start($processInfo) +#if(!($process.WaitForExit(60*1000) -and ($process.ExitCode -eq 0))) +#{ +# Write-Host $process.StandardOutput.ReadToEnd() +# Write-Host $process.StandardError.ReadToEnd() +#} +[System.Threading.Thread]::Sleep(1000) +cd ..\gdb\bin\ +$gdb = resolve-path gdb.exe +$gdbparms = '..\..\..\Build\Cosmos\ISO\output.obj --eval-command="target remote:1234"' +$process2 = [System.Diagnostics.Process]::Start($gdb, $gdbparms); +$process2.WaitForExit() +pause #http://www.vistax64.com/powershell/114718-how-can-i-execute-wmi-method-asynchronously.html #http://blogs.technet.com/industry_insiders/pages/executing-a-command-line-utility-from-powershell-and-waiting-for-it-to-finish.aspx -#invoke-item \ No newline at end of file +#invoke-item +if(!$process2.HasExited) { + $process2.Kill() +} +if(!$process.HasExited) { + $process.Kill() +}