-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQEMU_BOOT.BAT
More file actions
70 lines (58 loc) · 1.83 KB
/
QEMU_BOOT.BAT
File metadata and controls
70 lines (58 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@echo off
cd %~d0%~p0
call SET_ENV_VARS.BAT
set IMAGE_TYPE=
set DEBUG=0
set EFI=0
set SECONDARY_HD_IMAGE=
set QEMU_CMD=qemu-system-i386
set QEMU_ARGS=-audiodev dsound,id=stdsound -machine pcspk-audiodev=stdsound
:argLoop
setlocal ENABLEDELAYEDEXPANSION
if "%1" neq "" (
if "%1"=="floppy" (
set IMAGE_TYPE=Floppy
) else if "%1"=="hd" (
set IMAGE_TYPE=HD
) else if "%1"=="--debug" (
set DEBUG=1
) else if "%1"=="--efi" (
set EFI=1
) else if "%1"=="--x64" (
set QEMU_CMD=qemu-system-x86_64
) else if "%1"=="--secondary-hd-image" (
set SECONDARY_HD_IMAGE=%2
set SECONDARY_HD_IMAGE=!SECONDARY_HD_IMAGE:"=!
shift
) else (
goto USAGE
)
shift
goto argLoop
)
endlocal
if "%IMAGE_TYPE%"=="" goto USAGE
if "%EFI%"=="1" set QEMU_ARGS=%QEMU_ARGS% -bios tools/bios32.bin
if "%SECONDARY_HD_IMAGE%" NEQ "" set QEMU_ARGS=%QEMU_ARGS% -drive format=raw,file="%SECONDARY_HD_IMAGE%",index=1,if=ide
if "%IMAGE_TYPE%"=="HD" (
set QEMU_ARGS=%QEMU_ARGS% -drive format=raw,file=HDImage.bin,index=0,if=ide -boot c
) else if "%IMAGE_TYPE%"=="Floppy" (
set QEMU_ARGS=%QEMU_ARGS% -drive format=raw,file=FloppyImage.bin,index=0,if=floppy -boot a
)
if "%DEBUG%"=="1" (
if not exist kernel\CHAOSKRN.SYS_debug echo [91mWARNING^^! CHAOSKRN.SYS_debug does not exist[0m
start /b cmd /c %QEMU_CMD% %QEMU_ARGS% -S -s
gdb -x kernel_debug.gdb
) else (
%QEMU_CMD% %QEMU_ARGS%
)
goto eof
:USAGE
echo Usage: %0 ^<floppy^|hd^> [options]
echo Options:
echo --debug Run with debugger
echo --efi Enable EFI
echo --x64 Emulate 64-bit CPU
echo --secondary-hd-image ^<image^> Add a secondary hard drive image
EXIT /B 1
:eof