fix writing by using a virtual image instead of a physical thumbdrive, better document the hack in KeIrqDispatch

This commit is contained in:
maksw committed 2026-05-05 19:33:04 +02:00
1 parent 68b3fdbc63
commit 320a24e1a5
11 files changed
+88 -10

No files matched your search

+38 -1
View File
@@ -3,7 +3,12 @@ setlocal enabledelayedexpansion
set ROOT=%~dp0.
set SRC=%ROOT%\code
set DEST=%NTLITE_DRIVE%
set VHD=%~dp0disk.vhd
if not exist "%VHD%" (
echo ERROR: disk.vhd not found. Run mkimage.bat first.
exit /b 1
)
if exist "obj" rd /s /q "obj"
if exist "bin" rd /s /q "bin"
@@ -129,6 +134,26 @@ echo Linking video.exe...
link %LFLAGS% /SUBSYSTEM:NATIVE /ENTRY:main ^
/OUT:"bin\video.exe" /PDB:"bin\video.pdb" bin\win32.lib obj\libc.obj %SRC%\video\bink2w64.lib obj\video\*.obj || exit /b 1
:: ---- Mount disk image ----
echo Mounting disk.vhd as Z: ...
set DPS=%TEMP%\ntlite_mnt_%RANDOM%.txt
(
echo select vdisk file="%VHD%"
echo attach vdisk
echo select partition 1
echo assign letter=Z
echo exit
) > "%DPS%"
diskpart /s "%DPS%"
del "%DPS%"
if not exist "Z:\" (
echo ERROR: Could not mount disk.vhd as Z:
echo If Z: is already in use, change the letter in build.bat and mkimage.bat.
exit /b 1
)
set DEST=Z:
:: ---- Copy to ESP layout ----
echo Assembling ESP...
mkdir "%DEST%\drivers" 2>nul
@@ -147,6 +172,18 @@ copy /y "bin\shell.exe" "%DEST%\"
copy /y "bin\video.exe" "%DEST%\"
copy /y "%SRC%\boot.ini" "%DEST%\"
copy /y "%SRC%\drivers\drivers.ini" "%DEST%\drivers\"
if exist "%SRC%\video\bink2w64.dll" copy /y "%SRC%\video\bink2w64.dll" "%DEST%\"
:: ---- Unmount disk image ----
echo Unmounting disk.vhd...
set DPS=%TEMP%\ntlite_umnt_%RANDOM%.txt
(
echo select vdisk file="%VHD%"
echo detach vdisk
echo exit
) > "%DPS%"
diskpart /s "%DPS%"
del "%DPS%"
echo.
echo Build complete.