diff --git a/boot_hybrid.img b/boot_hybrid.img new file mode 100644 index 0000000..d3c6340 Binary files /dev/null and b/boot_hybrid.img differ diff --git a/buildImage.ps1 b/buildImage.ps1 new file mode 100644 index 0000000..78e8e2b --- /dev/null +++ b/buildImage.ps1 @@ -0,0 +1,64 @@ +#requires -RunAsAdministrator +param ([uint64]$diskSize=256MB, $driveLetter='Z') +# Thanks https://github.com/VoidNV/ZenithOS/blob/master/make.ps1! + +$vhdPath = ".\Chroma.vhd" + +if((Get-WindowsEdition -Online).Edition -eq "Home") { + Write-Host -ForegroundColor Red ` + "Windows 10 Home does not support Hyper-V. This install requires Professional or higher." + exit +} + + +if (-not (Get-Module -ListAvailable -Name "Hyper-V")) +{ + Write-Host -ForegroundColor Red "`nError: Hyper-V module not installed.`n" + Write-Host "The following Windows Features need to be enabled under " -NoNewLine + Write-Host -ForegroundColor Yellow "Hyper-V" -NoNewLine + Write-Host ":`n" + Write-Host -ForegroundColor Black -BackgroundColor Yellow "Hyper-V Module for Windows PowerShell" -NoNewLine + Write-Host " " -NoNewLine + Write-Host -ForegroundColor Black -BackgroundColor Yellow "Hyper-V Services" + + $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", "Launch the Windows Features dialog and exit." + $no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", "Exit. You can launch the Windows Features dialog yourself later." + $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no) + if ($Host.UI.PromptForChoice("", "`nLaunch the Windows Features dialog to enable them?", $options, 0) -eq 0) + { + Start-Process "OptionalFeatures" + } + exit +} + +function New-FAT32VHD { + $uuid = $null; + if(Test-Path $vhdPath) { + Remove-Item $vhdPath + } + + Hyper-V\New-VHD $vhdPath -SizeBytes $diskSize -Fixed | + Mount-VHD -Passthru -NoDriveLetter | + Initialize-Disk -PartitionStyle GPT -PassThru | + New-Partition -UseMaximumSize | + Format-Volume -FileSystem FAT32 -Force | + Get-Partition | + Set-Partition -NewDriveLetter $driveLetter + + Write-Host "Created disk of size" ($diskSize / 1MB) MiB. + + Copy-Item -Recurse -Force img\* ${driveLetter}:\ + + Dismount-VHD $vhdPath + +} + +function Update-VHD { + Mount-VHD $vhdPath -NoDriveLetter -PassThru | + Get-Partition | + Set-Partition -NewDriveLetter $driveLetter + + Copy-Item -Recurse -Force img\* ${driveLetter}:\ + + Dismount-VHD $vhdPath +} \ No newline at end of file diff --git a/chroma.img b/chroma.img new file mode 100644 index 0000000..ad4e06a Binary files /dev/null and b/chroma.img differ diff --git a/chroma.json b/chroma.json new file mode 100644 index 0000000..ff4af69 --- /dev/null +++ b/chroma.json @@ -0,0 +1,19 @@ +{ + "disksize": 80, + "config": "img/boot/config", + "initrd": { + "type": "tar", + "directory": "img/boot" + }, + "partitions": [ + { + "type": "boot", + "size": 4 + }, + { + "type": "Microsoft basic data", + "size": 76, + "name": "Chroma Data" + } + ] +} \ No newline at end of file diff --git a/img/boot/bootloader b/img/boot/bootloader new file mode 100644 index 0000000..a6e5838 Binary files /dev/null and b/img/boot/bootloader differ diff --git a/img/boot/config b/img/boot/config new file mode 100644 index 0000000..266813f --- /dev/null +++ b/img/boot/config @@ -0,0 +1 @@ +kernel=exe \ No newline at end of file diff --git a/img/boot/exe b/img/boot/exe new file mode 100644 index 0000000..95863b6 Binary files /dev/null and b/img/boot/exe differ diff --git a/mkbootimg b/mkbootimg new file mode 100644 index 0000000..379356f Binary files /dev/null and b/mkbootimg differ