<commit_before>function Pause ($Message="Press any key to continue...") {
	Write-Host -NoNewLine $Message
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	Write-Host ""
}


"You must first run Set-ExecutionPolicy remotesigned"
"You may also have to unblock this file using file, properties in explorer"

# call msbuild3_5 d:\dotnet\il2asm\repos\source\IL2CPU.sln

# ----------- Compile with IL2CPU
remove-item output.asm -ea SilentlyContinue
..\..\..\source\il2cpu\bin\Debug\il2cpu "-in:..\..\..\source\Cosmos\Cosmos.Shell.Console\bin\Debug\Cosmos.Shell.Console.exe" "-plug:..\..\..\source\Cosmos\Cosmos.Kernel.Plugs\bin\Debug\Cosmos.Kernel.Plugs.dll" "-out:output.obj" "-platform:nativex86" "-asm:output.asm"
remove-item files\output.obj -ea SilentlyContinue
copy-item output.obj files\output.obj
pause

# ----------- Build ISO
remove-item cosmos.iso -ea SilentlyContinue
attrib files\boot\grub\stage2_eltorito -r
..\..\..\Tools\mkisofs\mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o Cosmos.iso files
pause

# ----------- Start QEMU
remove-item serial-debug.txt -ea SilentlyContinue
cd ..\..\..\tools\qemu\
#.\qemu -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
#pause
$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" -kernel-kqemu -S -s'
# Still failing - because its a command line exe? run under cmd.exe?
$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\<commit_msg>when debuging with qemu, you cant use kqemu accelerator (is this a vista only issue??), so disabled that in the debug script<commit_after>function Pause ($Message="Press any key to continue...") {
	Write-Host -NoNewLine $Message
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	Write-Host ""
}


"You must first run Set-ExecutionPolicy remotesigned"
"You may also have to unblock this file using file, properties in explorer"

# call msbuild3_5 d:\dotnet\il2asm\repos\source\IL2CPU.sln

# ----------- Compile with IL2CPU
remove-item output.asm -ea SilentlyContinue
..\..\..\source\il2cpu\bin\Debug\il2cpu "-in:..\..\..\source\Cosmos\Cosmos.Shell.Console\bin\Debug\Cosmos.Shell.Console.exe" "-plug:..\..\..\source\Cosmos\Cosmos.Kernel.Plugs\bin\Debug\Cosmos.Kernel.Plugs.dll" "-out:output.obj" "-platform:nativex86" "-asm:output.asm"
remove-item files\output.obj -ea SilentlyContinue
copy-item output.obj files\output.obj
pause

# ----------- Build ISO
remove-item cosmos.iso -ea SilentlyContinue
attrib files\boot\grub\stage2_eltorito -r
..\..\..\Tools\mkisofs\mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o Cosmos.iso files
pause

# ----------- Start QEMU
remove-item serial-debug.txt -ea SilentlyContinue
cd ..\..\..\tools\qemu\
#.\qemu -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
#pause
$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" -no-kqemu -S -s'
# Still failing - because its a command line exe? run under cmd.exe?
$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\
{'fraction_non_alphanumeric': 0.18229279965194692, 'fraction_numerical': 0.01000652599521427, 'mean_word_length': 3.7207392197125255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6857570', 'n_tokens_mistral': 1721, 'n_tokens_neox': 1592, 'n_words': 328}