fix the return value of LdrLoadImage, make use of __declspec(dllexport), speed up blitting, add dummy TEB, redesign the syscall interface, fix stack alignent so movaps doesn't crash, implement a shitload of win32, implement a simple shell, add bink as video.exe 😎, minor kmain.c cleanup, HAL now supports power-off events, implemented \b in hal_screen.c, fix many deadlocks, add wait for exit event for processes, completely new error codes, small readme changes.
This commit is contained in:
1 parent
c13dd99150
commit
7f4052f41c
33 files changed
+6396
-735
No files matched your search
@@ -14,7 +14,8 @@ mkdir "obj\hal" 2>nul
|
||||
mkdir "obj\syscall" 2>nul
|
||||
mkdir "obj\win32" 2>nul
|
||||
mkdir "obj\drivers" 2>nul
|
||||
mkdir "obj\shell" 2>nul
|
||||
mkdir "obj\shell" 2>nul
|
||||
mkdir "obj\video" 2>nul
|
||||
mkdir "bin" 2>nul
|
||||
|
||||
set CFLAGS=/nologo /W4 /WX /Od /GS- /Gs999999 /Gz /Gy /EHsc- /GR- /Oi /Zi /std:c17 /D_CRT_SECURE_NO_WARNINGS /I"%SRC%\kernel" /I"%SRC%\hal"
|
||||
@@ -77,16 +78,7 @@ link %LFLAGS% /SUBSYSTEM:NATIVE /ENTRY:KernelMain /OUT:"bin\kernel.exe" ^
|
||||
:: ---- Compile syscall.dll ----
|
||||
echo Compiling syscall.dll...
|
||||
link /nologo /SUBSYSTEM:NATIVE /NODEFAULTLIB /DLL ^
|
||||
/OUT:"bin\syscall.dll" ^
|
||||
/EXPORT:SysYield /EXPORT:SysAlloc /EXPORT:SysFree ^
|
||||
/EXPORT:SysCreateThread /EXPORT:SysCloseHandle ^
|
||||
/EXPORT:SysMutexCreate /EXPORT:SysMutexAcquire /EXPORT:SysMutexRelease ^
|
||||
/EXPORT:SysSemCreate /EXPORT:SysSemWait /EXPORT:SysSemSignal ^
|
||||
/EXPORT:SysEventCreate /EXPORT:SysEventSet /EXPORT:SysEventWait ^
|
||||
/EXPORT:SysQueueCreate /EXPORT:SysQueueSend /EXPORT:SysQueueRecv ^
|
||||
/EXPORT:SysScreenBlit /EXPORT:SysGetTick /EXPORT:SysSleep ^
|
||||
/EXPORT:SysExitThread /EXPORT:SysExitProcess /EXPORT:SysDbgPrint ^
|
||||
obj\syscall\stubs.obj || exit /b 1
|
||||
/OUT:"bin\syscall.dll" obj\syscall\stubs.obj || exit /b 1
|
||||
|
||||
:: ---- Compile win32.dll ----
|
||||
echo Compiling win32.dll...
|
||||
@@ -94,15 +86,7 @@ for %%f in (%SRC%\win32\*.c) do (
|
||||
cl %CFLAGS% /c /Fo"obj\win32\%%~nf.obj" "%%f" || exit /b 1
|
||||
)
|
||||
link /nologo /SUBSYSTEM:NATIVE /NODEFAULTLIB /DLL ^
|
||||
/OUT:"bin\win32.dll" ^
|
||||
/EXPORT:HeapAlloc /EXPORT:HeapFree /EXPORT:HeapReAlloc ^
|
||||
/EXPORT:CreateThread /EXPORT:ExitProcess /EXPORT:ExitThread ^
|
||||
/EXPORT:Sleep /EXPORT:SwitchToThread ^
|
||||
/EXPORT:CreateMutex /EXPORT:ReleaseMutex /EXPORT:WaitForSingleObject ^
|
||||
/EXPORT:CreateEvent /EXPORT:SetEvent /EXPORT:CloseHandle ^
|
||||
/EXPORT:GetTickCount /EXPORT:GetTickCount64 ^
|
||||
/EXPORT:BitBlt /EXPORT:GetMessage /EXPORT:DispatchMessage /EXPORT:OutputDebugStringA ^
|
||||
bin\syscall.lib obj\win32\*.obj || exit /b 1
|
||||
/OUT:"bin\win32.dll" bin\syscall.lib obj\libc.obj obj\win32\*.obj || exit /b 1
|
||||
|
||||
:: ---- Compile drivers ----
|
||||
echo Compiling drivers...
|
||||
@@ -137,6 +121,17 @@ echo Linking shell.exe...
|
||||
link %LFLAGS% /SUBSYSTEM:NATIVE /ENTRY:main ^
|
||||
/OUT:"bin\shell.exe" /PDB:"bin\shell.pdb" bin\win32.lib obj\libc.obj obj\shell\*.obj || exit /b 1
|
||||
|
||||
:: ---- Compile video player ----
|
||||
echo Compiling video...
|
||||
for %%f in (%SRC%\video\*.c) do (
|
||||
cl %CFLAGS% /c /Fo"obj\video\%%~nf.obj" "%%f" || exit /b 1
|
||||
)
|
||||
|
||||
:: ---- Link video.exe ----
|
||||
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
|
||||
|
||||
:: ---- Copy to ESP layout ----
|
||||
echo Assembling ESP...
|
||||
mkdir "%DEST%\drivers" 2>nul
|
||||
@@ -150,7 +145,8 @@ copy /y "bin\ide.sys" "%DEST%\drivers\"
|
||||
copy /y "bin\ahci.sys" "%DEST%\drivers\"
|
||||
copy /y "bin\fat32.sys" "%DEST%\drivers\"
|
||||
copy /y "bin\usb.sys" "%DEST%\drivers\"
|
||||
copy /y "bin\shell.exe" "%DEST%\"
|
||||
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\"
|
||||
|
||||
|
||||
Reference in new issue
Block a user