qemu.bat 1.3 KB
Newer Older
D
David DAI 已提交
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
@echo off
set ROOT_DIR=%~dp0

set QEMU_TOOLS=qemu-system-arm.exe
set FILE=rtthread-imx6.elf
set RUN_TYPE=%1

rem parameter setting
set MACHINES=mcimx6ul-evk  -smp cpus=1
set NO_DISPLAY=-nographic
set DISPLAY=-display sdl -show-cursor
set SERIAL_PORT=mon:stdio
set NETWORK=-nic user

if exist %FILE% goto run
call scons -j4

:run

if "%RUN_TYPE%"=="" (
    goto _help
) else (
    goto _start
)

:_help
set var=""
echo "help(%0 [gui|nogui|debug]):"
echo "  1. gui"
echo "  2. nogui"
echo "  3. debug"
set /p var=Please input manually: 
if "%var%"=="1" (
    goto gui_start
) else if "%var%"=="2" (
    goto nogui_start
) else if "%var%"=="3" (
    goto debug_start
) else (
    echo "Input error!"
    goto _help
)

:_start
if "%RUN_TYPE%"=="gui" (
    goto gui_start
) else if "%RUN_TYPE%"=="nogui" (
    goto nogui_start
) else if "%RUN_TYPE%"=="debug" (
    goto debug_start
) else (
    goto _help
)

:gui_start
%QEMU_TOOLS% -M %MACHINES% -kernel %FILE% %DISPLAY% -serial %SERIAL_PORT% %NETWORK%
goto end

:nogui_start
%QEMU_TOOLS% -M %MACHINES% -kernel %FILE% %NO_DISPLAY% -serial %SERIAL_PORT% %NETWORK%
goto end

:debug_start
%QEMU_TOOLS% -M %MACHINES% -m 512M -kernel %FILE% %NO_DISPLAY% -serial %SERIAL_PORT% %NETWORK% -S -s
goto end

:end
pause