forked from xt-sys/exectos
Compare commits
1 Commits
powershell
...
356c221e23
| Author | SHA1 | Date | |
|---|---|---|---|
| 356c221e23 |
@@ -151,7 +151,7 @@ ReadSectors:
|
|||||||
|
|
||||||
ReadCHS:
|
ReadCHS:
|
||||||
/* Read sectors using CHS */
|
/* Read sectors using CHS */
|
||||||
pushw %cx
|
popal
|
||||||
pushal
|
pushal
|
||||||
xorl %edx, %edx
|
xorl %edx, %edx
|
||||||
movzwl SectorsPerTrack - Start(%bp), %ecx
|
movzwl SectorsPerTrack - Start(%bp), %ecx
|
||||||
@@ -169,9 +169,8 @@ ReadCHS:
|
|||||||
orb %ah, %cl
|
orb %ah, %cl
|
||||||
movw $0x0201, %ax
|
movw $0x0201, %ax
|
||||||
int $0x13
|
int $0x13
|
||||||
popal
|
|
||||||
popw %cx
|
|
||||||
jc DiskError
|
jc DiskError
|
||||||
|
popal
|
||||||
incl %eax
|
incl %eax
|
||||||
movw %es, %dx
|
movw %es, %dx
|
||||||
addw $0x20, %dx
|
addw $0x20, %dx
|
||||||
|
|||||||
@@ -4,41 +4,48 @@
|
|||||||
# DESCRIPTION: Project configuration script for preparing the build environment
|
# DESCRIPTION: Project configuration script for preparing the build environment
|
||||||
# DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
# DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||||
|
|
||||||
|
|
||||||
# Check XTchain
|
# Check XTchain
|
||||||
if (-not $env:XTCVER) {
|
if (-not $env:XTCVER) {
|
||||||
Write-Error "XTChain not detected or corrupted!"
|
Write-Host "XTChain not detected or corrupted!"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set target architecture defaulting to amd64
|
# Set target architecture
|
||||||
$ARCH = if ($env:TARGET) { $env:TARGET } else { "amd64" }
|
if ($env:TARGET) {
|
||||||
|
$ARCH = $env:TARGET
|
||||||
# Set target build type defaulting to Debug
|
} else {
|
||||||
$env:BUILD_TYPE = if ($env:BUILD_TYPE -in @("Debug", "Release")) { $env:BUILD_TYPE } else { "Debug" }
|
$ARCH = "amd64"
|
||||||
|
|
||||||
# Set variables
|
|
||||||
$EXECTOS_SOURCE_DIR = $PSScriptRoot
|
|
||||||
$EXECTOS_BINARY_DIR = Join-Path $EXECTOS_SOURCE_DIR "build-$ARCH-$($env:BUILD_TYPE.ToLower())"
|
|
||||||
|
|
||||||
# Create build directory
|
|
||||||
if (-not (Test-Path $EXECTOS_BINARY_DIR)) {
|
|
||||||
Write-Host "Creating build directory: $EXECTOS_BINARY_DIR"
|
|
||||||
New-Item -ItemType Directory -Path $EXECTOS_BINARY_DIR -Force | Out-Null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Set-Location $EXECTOS_BINARY_DIR
|
# Set target build type
|
||||||
|
if (-not $env:BUILD_TYPE) {
|
||||||
|
$env:BUILD_TYPE = "DEBUG"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set variables
|
||||||
|
$EXECTOS_SOURCE_DIR = (Get-Location).Path
|
||||||
|
$EXECTOS_BINARY_DIR = "build-$($ARCH)-$($env:BUILD_TYPE.ToLower())"
|
||||||
|
|
||||||
|
# Create directories if needed
|
||||||
|
if ($EXECTOS_SOURCE_DIR -eq (Get-Location).Path) {
|
||||||
|
Write-Host "Creating directories in $EXECTOS_BINARY_DIR"
|
||||||
|
New-Item -ItemType Directory -Path $EXECTOS_BINARY_DIR -Force | Out-Null
|
||||||
|
Set-Location -Path $EXECTOS_BINARY_DIR
|
||||||
|
}
|
||||||
|
|
||||||
# Delete old cache
|
# Delete old cache
|
||||||
Remove-Item "CMakeCache.txt", "host-tools/CMakeCache.txt" -ErrorAction SilentlyContinue
|
Remove-Item -Path "CMakeCache.txt" -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "host-tools/CMakeCache.txt" -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
# Configure project using CMake
|
# Configure project using CMake
|
||||||
& cmake -G Ninja "-DARCH:STRING=$ARCH" "-DBUILD_TYPE:STRING=$($env:BUILD_TYPE)" $EXECTOS_SOURCE_DIR
|
& cmake -G Ninja -DARCH:STRING=$($ARCH) -DBUILD_TYPE:STRING=$($env:BUILD_TYPE) $EXECTOS_SOURCE_DIR
|
||||||
|
|
||||||
# Check if configuration succeeded
|
# Check if configuration succeeded
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
Write-Error "Configure script failed."
|
Write-Host "Configure script failed."
|
||||||
exit 1
|
exit 1
|
||||||
|
} else {
|
||||||
|
"$($ARCH)" | Out-File -Encoding ASCII -NoNewline build.arch
|
||||||
|
Write-Host "Configure script completed. Enter '$EXECTOS_BINARY_DIR' directory and execute 'xbuild' to build ExectOS."
|
||||||
}
|
}
|
||||||
|
|
||||||
$ARCH | Out-File -Encoding ASCII -NoNewline "build.arch"
|
|
||||||
Write-Host "Configure completed. Run 'xbuild' to build ExectOS."
|
|
||||||
@@ -23,57 +23,49 @@ endif()
|
|||||||
|
|
||||||
find_program(QEMU_EMULATOR ${QEMU_COMMAND})
|
find_program(QEMU_EMULATOR ${QEMU_COMMAND})
|
||||||
if(QEMU_EMULATOR)
|
if(QEMU_EMULATOR)
|
||||||
if(CMAKE_HOST_LINUX)
|
# This target starts up a QEMU+OVMF virtual machine using KVM accelerator
|
||||||
# This target starts up a QEMU+OVMF virtual machine using KVM accelerator
|
add_custom_target(testefikvm
|
||||||
add_custom_target(testefikvm
|
DEPENDS install
|
||||||
DEPENDS install
|
COMMAND ${QEMU_COMMAND} -name "ExectOS-${ARCH}-EFI-KVM" -machine type=q35,kernel_irqchip=on,accel="kvm:whpx",mem-merge=off,vmport=off -enable-kvm -cpu host,-hypervisor,+topoext
|
||||||
COMMAND ${QEMU_COMMAND} -name "ExectOS-${ARCH}-EFI-KVM" -machine type=q35,kernel_irqchip=on,accel=kvm,mem-merge=off,vmport=off -enable-kvm -cpu host,-hypervisor,+topoext
|
-smp 2,sockets=1,cores=1,threads=2 -m 4G -overcommit mem-lock=off -rtc clock=host,base=localtime,driftfix=none
|
||||||
-smp 2,sockets=1,cores=1,threads=2 -m 4G -overcommit mem-lock=off -rtc clock=host,base=localtime,driftfix=none
|
-drive file=${EXECTOS_SOURCE_DIR}/sdk/firmware/ovmf_code_${ARCH}.fd,if=pflash,format=raw,unit=0,readonly=on
|
||||||
-bios ${EXECTOS_SOURCE_DIR}/sdk/firmware/ovmf_${ARCH}.fd
|
-drive file=${EXECTOS_SOURCE_DIR}/sdk/firmware/ovmf_vars_${ARCH}.fd,if=pflash,format=raw,unit=1
|
||||||
-hda fat:rw:${EXECTOS_BINARY_DIR}/output/binaries
|
-hda fat:rw:${EXECTOS_BINARY_DIR}/output/binaries
|
||||||
-boot menu=on -d int -M smm=off -no-reboot -no-shutdown -serial stdio
|
-boot menu=on -d int -M smm=off -no-reboot -no-shutdown -serial stdio
|
||||||
VERBATIM USES_TERMINAL)
|
VERBATIM USES_TERMINAL)
|
||||||
elseif(CMAKE_HOST_WIN32)
|
|
||||||
# This target starts up a QEMU+OVMF virtual machine using WHPX accelerator
|
|
||||||
add_custom_target(testefiwhpx
|
|
||||||
DEPENDS install
|
|
||||||
COMMAND ${QEMU_COMMAND} -name "ExectOS-${ARCH}-EFI-WHPX" -machine type=q35,kernel_irqchip=off,accel=whpx,mem-merge=off,vmport=off
|
|
||||||
-m 4G -overcommit mem-lock=off -rtc clock=host,base=localtime,driftfix=none
|
|
||||||
-bios ${EXECTOS_SOURCE_DIR}/sdk/firmware/ovmf_${ARCH}.fd
|
|
||||||
-hda fat:rw:${EXECTOS_BINARY_DIR}/output/binaries
|
|
||||||
-boot menu=on -d int -M smm=off -no-reboot -no-shutdown -serial stdio
|
|
||||||
VERBATIM USES_TERMINAL)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# This target starts up a QEMU+OVMF virtual machine using TCG accelerator
|
# This target starts up a QEMU+OVMF virtual machine using TCG accelerator
|
||||||
add_custom_target(testefitcg
|
add_custom_target(testefitcg
|
||||||
DEPENDS install
|
DEPENDS install
|
||||||
COMMAND ${QEMU_COMMAND} -name "ExectOS-${ARCH}-EFI-TCG" -machine type=q35,accel=tcg -cpu max,-hypervisor
|
COMMAND ${QEMU_COMMAND} -name "ExectOS-${ARCH}-EFI-TCG" -machine type=q35,accel=tcg -cpu max,-hypervisor
|
||||||
-smp 2,sockets=1,cores=1,threads=2 -m 4G -overcommit mem-lock=off -rtc clock=host,base=localtime,driftfix=none
|
-smp 2,sockets=1,cores=1,threads=2 -m 4G -overcommit mem-lock=off -rtc clock=host,base=localtime,driftfix=none
|
||||||
-bios ${EXECTOS_SOURCE_DIR}/sdk/firmware/ovmf_${ARCH}.fd
|
-drive file=${EXECTOS_SOURCE_DIR}/sdk/firmware/ovmf_code_${ARCH}.fd,if=pflash,format=raw,unit=0,readonly=on
|
||||||
|
-drive file=${EXECTOS_SOURCE_DIR}/sdk/firmware/ovmf_vars_${ARCH}.fd,if=pflash,format=raw,unit=1
|
||||||
-hda fat:rw:${EXECTOS_BINARY_DIR}/output/binaries
|
-hda fat:rw:${EXECTOS_BINARY_DIR}/output/binaries
|
||||||
-boot menu=on -d int -no-reboot -no-shutdown -serial stdio
|
-boot menu=on -d int -no-reboot -no-shutdown -serial stdio
|
||||||
VERBATIM USES_TERMINAL)
|
VERBATIM USES_TERMINAL)
|
||||||
|
|
||||||
if(CMAKE_HOST_LINUX)
|
if(WIN32)
|
||||||
|
# This target starts up a QEMU+OVMF virtual machine using WHPX accelerator on Windows
|
||||||
|
add_custom_target(testkvm
|
||||||
|
DEPENDS install
|
||||||
|
COMMAND ${QEMU_COMMAND} -name "ExectOS-${ARCH}-WHPX" -machine accel=whpx,kernel-irqchip=off
|
||||||
|
-bios ${EXECTOS_SOURCE_DIR}/sdk/firmware/OVMF-pure-efi.fd
|
||||||
|
-hda fat:rw:${EXECTOS_BINARY_DIR}/output/binaries
|
||||||
|
-no-reboot -no-shutdown -serial stdio
|
||||||
|
COMMENT "Using WHPX acceleration on Windows"
|
||||||
|
VERBATIM USES_TERMINAL)
|
||||||
|
|
||||||
|
else()
|
||||||
# This target starts up a QEMU+SEABIOS virtual machine using KVM accelerator
|
# This target starts up a QEMU+SEABIOS virtual machine using KVM accelerator
|
||||||
add_custom_target(testkvm
|
add_custom_target(testkvm
|
||||||
DEPENDS diskimg
|
DEPENDS diskimg
|
||||||
COMMAND ${QEMU_COMMAND} -name "ExectOS-${ARCH}-BIOS-KVM" -machine type=q35,kernel_irqchip=on,accel=kvm,mem-merge=off,vmport=off -enable-kvm -cpu host,-hypervisor,+topoext
|
COMMAND ${QEMU_COMMAND} -name "ExectOS-${ARCH}-BIOS-KVM" -machine type=q35,kernel_irqchip=on,accel="kvm:whpx",mem-merge=off,vmport=off -enable-kvm -cpu host,-hypervisor,+topoext
|
||||||
-smp 2,sockets=1,cores=1,threads=2 -m 4G -overcommit mem-lock=off -rtc clock=host,base=localtime,driftfix=none
|
-smp 2,sockets=1,cores=1,threads=2 -m 4G -overcommit mem-lock=off -rtc clock=host,base=localtime,driftfix=none
|
||||||
-hda ${EXECTOS_BINARY_DIR}/output/disk.img
|
-hda ${EXECTOS_BINARY_DIR}/output/disk.img
|
||||||
-boot menu=on -d int -no-reboot -no-shutdown -serial stdio
|
-boot menu=on -d int -no-reboot -no-shutdown -serial stdio
|
||||||
VERBATIM USES_TERMINAL)
|
VERBATIM USES_TERMINAL)
|
||||||
elseif(CMAKE_HOST_WIN32)
|
endif()
|
||||||
# This target starts up a QEMU+SEABIOS virtual machine using WHPX accelerator
|
|
||||||
add_custom_target(testwhpx
|
|
||||||
DEPENDS diskimg
|
|
||||||
COMMAND ${QEMU_COMMAND} -name "ExectOS-${ARCH}-BIOS-WHPX" -machine type=q35,kernel_irqchip=off,accel=whpx,mem-merge=off,vmport=off
|
|
||||||
-m 4G -overcommit mem-lock=off -rtc clock=host,base=localtime,driftfix=none
|
|
||||||
-hda ${EXECTOS_BINARY_DIR}/output/disk.img
|
|
||||||
-boot menu=on -d int -no-reboot -no-shutdown -serial stdio
|
|
||||||
VERBATIM USES_TERMINAL)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# This target starts up a QEMU+SEABIOS virtual machine using TCG accelerator
|
# This target starts up a QEMU+SEABIOS virtual machine using TCG accelerator
|
||||||
add_custom_target(testtcg
|
add_custom_target(testtcg
|
||||||
|
|||||||
BIN
sdk/firmware/OVMF-pure-efi.fd
Normal file
BIN
sdk/firmware/OVMF-pure-efi.fd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
sdk/firmware/ovmf_vars_amd64.fd
Normal file
BIN
sdk/firmware/ovmf_vars_amd64.fd
Normal file
Binary file not shown.
BIN
sdk/firmware/ovmf_vars_i686.fd
Normal file
BIN
sdk/firmware/ovmf_vars_i686.fd
Normal file
Binary file not shown.
Reference in New Issue
Block a user