[TEST_KERNEL][BOOT] make a test kernel for the sake of doing paging

right
This commit is contained in:
Justin Miller 2023-10-09 14:55:32 -07:00
parent f002961da0
commit 84ce7ff4fa
7 changed files with 81 additions and 47 deletions

View file

@ -367,6 +367,7 @@ Enable this if the module uses typeid or dynamic_cast. You will probably need to
add_subdirectory(media)
add_subdirectory(modules)
add_subdirectory(ntoskrnl)
add_subdirectory(test_kernel)
add_subdirectory(subsystems)
add_subdirectory(sdk/tools/wpp)
add_subdirectory(win32ss)

View file

@ -1,45 +0,0 @@
[FREELOADER]
DefaultOS=LiveCD_Debug
TimeOut=5
[Display]
TitleText=ReactOS LiveCD
MinimalUI=Yes
[Operating Systems]
LiveCD="LiveCD"
LiveCD_Debug="LiveCD (Debug)"
LiveCD_Aacpi="LiveCD ACPI APIC (Debug)"
LiveCD_VBoxDebug="LiveCD (VBox Debug)"
LiveCD_Screen="LiveCD (Screen)"
LiveCD_LogFile="LiveCD (Log file)"
[LiveCD]
BootType=Windows2003
SystemPath=\reactos
Options=/MININT
[LiveCD_Debug]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT
[LiveCD_Aacpi]
BootType=Windows2003
SystemPath=\reactos
Options=/HAL=halaacpi.dll /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT
[LiveCD_VBoxDebug]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=VBOX /SOS /MININT
[LiveCD_Screen]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT
[LiveCD_LogFile]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=FILE:\Device\HarddiskX\PartitionY\debug.log /SOS /MININT

View file

@ -654,9 +654,9 @@ function(set_module_type MODULE TYPE)
if (ARCH STREQUAL "arm64")
# special case for kernel
if (TYPE STREQUAL kernel)
set_image_base(${MODULE} 0x80000000)
set_image_base(${MODULE} 0x400000000)
else()
set_image_base(${MODULE} 0x40000000)
set_image_base(${MODULE} 0x400000000)
endif()
else()
# special case for kernel

View file

@ -0,0 +1,32 @@
PROJECT(NTOS)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
# Enable this again. CORE-17637
add_compile_options(-Wunused-result)
endif()
spec2def(testkernel.exe testkernel.spec ADD_IMPORTLIB)
# Embed RTC libs
if (STACK_PROTECTOR)
target_sources(testkernel PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
# Clang optimises strcmp calls to memcmp.
target_sources(testkernel PRIVATE $<TARGET_OBJECTS:memcmp>)
endif()
list(APPEND PCH_SKIP_SOURCE
guid.c)
add_executable(testkernel
main.c
testkernel.rc
${CMAKE_CURRENT_BINARY_DIR}/testkernel.def)
set_module_type(testkernel kernel)
target_link_libraries(testkernel cportlib csq cmlib ntlsalib ${ROSSYM_LIB} libcntpr wdmguid ioevent)
add_dependencies(testkernel psdk asm)

41
test_kernel/main.c Normal file
View file

@ -0,0 +1,41 @@
/* INCLUDES ******************************************************************/
/* C Headers */
#include <stdio.h>
/* WDK HAL Compilation hack */
#include <excpt.h>
#include <ntdef.h>
#ifndef _MINIHAL_
#undef NTSYSAPI
#define NTSYSAPI __declspec(dllimport)
#else
#undef NTSYSAPI
#define NTSYSAPI
#endif
/* IFS/DDK/NDK Headers */
#include <ntifs.h>
#include <arc/arc.h>
#include <ndk/asm.h>
#include <ndk/halfuncs.h>
#include <ndk/inbvfuncs.h>
#include <ndk/iofuncs.h>
#include <ndk/kefuncs.h>
#include <ndk/rtlfuncs.h>
CODE_SEG("INIT")
DECLSPEC_NORETURN
VOID
NTAPI
KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
for(;;)
{
}
}

View file

@ -0,0 +1,5 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Kernel tetL"
#define REACTOS_STR_INTERNAL_NAME "testkernel"
#define REACTOS_STR_ORIGINAL_FILENAME "testkernel.exe"
#include <reactos/version.rc>

View file