Index: boot/bootdata/packages/reactos.dff.in =================================================================== --- boot/bootdata/packages/reactos.dff.in (revision 72609) +++ boot/bootdata/packages/reactos.dff.in (working copy) @@ -70,6 +70,8 @@ 51 = system32\CatRoot 52 = system32\CatRoot2 53 = AppPatch +54 = system32\Boot +55 = Boot\EFI .InfEnd Index: boot/environ/app/rosload_exe/rosload.c =================================================================== --- boot/environ/app/rosload_exe/rosload.c (nonexistent) +++ boot/environ/app/rosload_exe/rosload.c (working copy) @@ -0,0 +1,25 @@ +/* + * COPYRIGHT: See COPYING.ARM in the top level directory + * PROJECT: ReactOS UEFI OS Loader + * FILE: boot/environ/app/rosload_exe/rosload.c + * PURPOSE: OS Loader Entrypoint - Executable + * PROGRAMMER: Lee Schroeder (spaceseel at gmail dot com) + */ + +#define WIN32_NO_STATUS +#define NTOS_MODE_USER +#include +#include + +#define NDEBUG +#include + +int +_cdecl +_main(int argc, + char *argv[], + char *envp[], + int DebugFlag) +{ + return 0; +} Index: boot/environ/app/rosload_exe/rosload.rc =================================================================== --- boot/environ/app/rosload_exe/rosload.rc (nonexistent) +++ boot/environ/app/rosload_exe/rosload.rc (working copy) @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "OS Loader" +#define REACTOS_STR_INTERNAL_NAME "rosload" +#define REACTOS_STR_ORIGINAL_FILENAME "rosload.exe" +#include Index: boot/environ/app/rosload_exe/rosload.c =================================================================== --- boot/environ/app/rosload_exe/rosload.c (nonexistent) +++ boot/environ/app/rosload_exe/rosload.c (working copy) @@ -0,0 +1,25 @@ +/* + * COPYRIGHT: See COPYING.ARM in the top level directory + * PROJECT: ReactOS UEFI OS Loader + * FILE: boot/environ/app/rosload_exe/rosload.c + * PURPOSE: OS Loader Entrypoint - Executable + * PROGRAMMER: Lee Schroeder (spaceseel at gmail dot com) + */ + +#define WIN32_NO_STATUS +#define NTOS_MODE_USER +#include +#include + +#define NDEBUG +#include + +int +_cdecl +_main(int argc, + char *argv[], + char *envp[], + int DebugFlag) +{ + return 0; +} Index: boot/environ/app/rosload_exe/rosload.rc =================================================================== --- boot/environ/app/rosload_exe/rosload.rc (nonexistent) +++ boot/environ/app/rosload_exe/rosload.rc (working copy) @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "OS Loader" +#define REACTOS_STR_INTERNAL_NAME "rosload" +#define REACTOS_STR_ORIGINAL_FILENAME "rosload.exe" +#include Index: boot/environ/app/rosresume/rosresume.c =================================================================== --- boot/environ/app/rosresume/rosresume.c (nonexistent) +++ boot/environ/app/rosresume/rosresume.c (working copy) @@ -0,0 +1,39 @@ +/* + * COPYRIGHT: See COPYING.ARM in the top level directory + * PROJECT: ReactOS UEFI OS Loader + * FILE: boot/environ/app/rosresume/rosresume.c + * PURPOSE: OS Loader Entrypoint + * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include "rosresume.h" + +/* DATA VARIABLES ************************************************************/ + +/* FUNCTIONS *****************************************************************/ + +/*++ + * @name OslMain + * + * The OslMain function implements the Windows Boot Application entrypoint for + * the OS Hibernation resume feature. + * + * @param BootParameters + * Pointer to the Boot Application Parameter Block. + * + * @return NT_SUCCESS if the image was loaded correctly, relevant error code + * otherwise. + * + *--*/ +NTSTATUS +NTAPI +OslMain ( + _In_ PBOOT_APPLICATION_PARAMETER_BLOCK BootParameters + ) +{ + EfiPrintf(L"ReactOS UEFI OS Resume Initializing...\r\n"); + return STATUS_NOT_IMPLEMENTED; +} + Index: boot/environ/app/rosresume/rosresume.h =================================================================== --- boot/environ/app/rosresume/rosresume.h (nonexistent) +++ boot/environ/app/rosresume/rosresume.h (working copy) @@ -0,0 +1,36 @@ +/* + * COPYRIGHT: See COPYING.ARM in the top level directory + * PROJECT: ReactOS UEFI OS Loader + * FILE: boot/environ/app/rosload/rosload.h + * PURPOSE: Main OS Loader Header + * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org) +*/ + +#ifndef _ROSLOAD_H +#define _ROSLOAD_H + +/* INCLUDES ******************************************************************/ + +/* C Headers */ +#include +#include +#include + +/* NT Base Headers */ +#include +#include + +/* UEFI Headers */ +#include + +/* Boot Library Headers */ +#include + +/* BCD Headers */ +#include + +/* STRUCTURES ****************************************************************/ + +/* FUNCTIONS *****************************************************************/ + +#endif Index: boot/environ/app/rosresume/rosresume.c =================================================================== --- boot/environ/app/rosresume/rosresume.c (nonexistent) +++ boot/environ/app/rosresume/rosresume.c (working copy) @@ -0,0 +1,39 @@ +/* + * COPYRIGHT: See COPYING.ARM in the top level directory + * PROJECT: ReactOS UEFI OS Loader + * FILE: boot/environ/app/rosresume/rosresume.c + * PURPOSE: OS Loader Entrypoint + * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include "rosresume.h" + +/* DATA VARIABLES ************************************************************/ + +/* FUNCTIONS *****************************************************************/ + +/*++ + * @name OslMain + * + * The OslMain function implements the Windows Boot Application entrypoint for + * the OS Hibernation resume feature. + * + * @param BootParameters + * Pointer to the Boot Application Parameter Block. + * + * @return NT_SUCCESS if the image was loaded correctly, relevant error code + * otherwise. + * + *--*/ +NTSTATUS +NTAPI +OslMain ( + _In_ PBOOT_APPLICATION_PARAMETER_BLOCK BootParameters + ) +{ + EfiPrintf(L"ReactOS UEFI OS Resume Initializing...\r\n"); + return STATUS_NOT_IMPLEMENTED; +} + Index: boot/environ/app/rosresume/rosresume.h =================================================================== --- boot/environ/app/rosresume/rosresume.h (nonexistent) +++ boot/environ/app/rosresume/rosresume.h (working copy) @@ -0,0 +1,36 @@ +/* + * COPYRIGHT: See COPYING.ARM in the top level directory + * PROJECT: ReactOS UEFI OS Loader + * FILE: boot/environ/app/rosload/rosload.h + * PURPOSE: Main OS Loader Header + * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org) +*/ + +#ifndef _ROSLOAD_H +#define _ROSLOAD_H + +/* INCLUDES ******************************************************************/ + +/* C Headers */ +#include +#include +#include + +/* NT Base Headers */ +#include +#include + +/* UEFI Headers */ +#include + +/* Boot Library Headers */ +#include + +/* BCD Headers */ +#include + +/* STRUCTURES ****************************************************************/ + +/* FUNCTIONS *****************************************************************/ + +#endif Index: boot/environ/app/rosresume_exe/rosresume.c =================================================================== --- boot/environ/app/rosresume_exe/rosresume.c (nonexistent) +++ boot/environ/app/rosresume_exe/rosresume.c (working copy) @@ -0,0 +1,25 @@ +/* + * COPYRIGHT: See COPYING.ARM in the top level directory + * PROJECT: ReactOS UEFI OS Hibernation Resume + * FILE: boot/environ/app/rosload_exe/rosload.c + * PURPOSE: OS Hibernation Resume Entrypoint - Executable + * PROGRAMMER: Lee Schroeder (spaceseel at gmail dot com) + */ + +#define WIN32_NO_STATUS +#define NTOS_MODE_USER +#include +#include + +#define NDEBUG +#include + +int +_cdecl +_main(int argc, + char *argv[], + char *envp[], + int DebugFlag) +{ + return 0; +} Index: boot/environ/app/rosresume_exe/rosresume.rc =================================================================== --- boot/environ/app/rosresume_exe/rosresume.rc (nonexistent) +++ boot/environ/app/rosresume_exe/rosresume.rc (working copy) @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "Resume from Hibernation" +#define REACTOS_STR_INTERNAL_NAME "rosresume" +#define REACTOS_STR_ORIGINAL_FILENAME "rosresume.exe" +#include Index: boot/environ/app/rosresume_exe/rosresume.c =================================================================== --- boot/environ/app/rosresume_exe/rosresume.c (nonexistent) +++ boot/environ/app/rosresume_exe/rosresume.c (working copy) @@ -0,0 +1,25 @@ +/* + * COPYRIGHT: See COPYING.ARM in the top level directory + * PROJECT: ReactOS UEFI OS Hibernation Resume + * FILE: boot/environ/app/rosload_exe/rosload.c + * PURPOSE: OS Hibernation Resume Entrypoint - Executable + * PROGRAMMER: Lee Schroeder (spaceseel at gmail dot com) + */ + +#define WIN32_NO_STATUS +#define NTOS_MODE_USER +#include +#include + +#define NDEBUG +#include + +int +_cdecl +_main(int argc, + char *argv[], + char *envp[], + int DebugFlag) +{ + return 0; +} Index: boot/environ/app/rosresume_exe/rosresume.rc =================================================================== --- boot/environ/app/rosresume_exe/rosresume.rc (nonexistent) +++ boot/environ/app/rosresume_exe/rosresume.rc (working copy) @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "Resume from Hibernation" +#define REACTOS_STR_INTERNAL_NAME "rosresume" +#define REACTOS_STR_ORIGINAL_FILENAME "rosresume.exe" +#include Index: boot/environ/CMakeLists.txt =================================================================== --- boot/environ/CMakeLists.txt (revision 72609) +++ boot/environ/CMakeLists.txt (working copy) @@ -110,37 +110,85 @@ app/rosload/rosload.c ) +list(APPEND ROSRESUME_BASE_SOURCE + app/rosresume/rosresume.c + ) + +list(APPEND ROSLOAD_EXE_BASE_SOURCE + app/rosload_exe/rosload.c + app/rosload_exe/rosload.rc + ) + +list(APPEND ROSRESUME_EXE_BASE_SOURCE + app/rosresume_exe/rosresume.c + app/rosresume_exe/rosresume.rc + ) + add_executable(rosload ${ROSLOAD_BASE_SOURCE}) set_target_properties(rosload PROPERTIES SUFFIX ".efi") +add_executable(rosresume ${ROSLOAD_BASE_SOURCE}) +set_target_properties(rosresume PROPERTIES SUFFIX ".efi") + +add_executable(rosload_exe WIN32 ${ROSLOAD_EXE_BASE_SOURCE}) +set_target_properties(rosload_exe PROPERTIES OUTPUT_NAME "rosload") +set_module_type(rosload_exe nativecui) + +add_executable(rosresume_exe WIN32 ${ROSLOAD_EXE_BASE_SOURCE}) +set_target_properties(rosresume_exe PROPERTIES OUTPUT_NAME "rosresume") +set_module_type(rosresume_exe nativecui) + + if(MSVC) add_target_link_flags(rosload "/ignore:4078 /ignore:4254 /DRIVER") + add_target_link_flags(rosresume "/ignore:4078 /ignore:4254 /DRIVER") else() add_target_link_flags(rosload "-Wl,--strip-all,--exclude-all-symbols,--dynamicbase,--pic-executable") + add_target_link_flags(rosresume "-Wl,--strip-all,--exclude-all-symbols,--dynamicbase,--pic-executable") endif() set_image_base(rosload 0x10000) +set_image_base(rosresume 0x10000) if(MSVC) set_subsystem(rosload BOOT_APPLICATION) + set_subsystem(rosresume BOOT_APPLICATION) else() set_subsystem(rosload 16) + set_subsystem(rosresume 16) endif() if(ARCH STREQUAL "i386") set_entrypoint(rosload OslMain 4) + set_entrypoint(rosresume OslMain 4) else() set_entrypoint(rosload OslMain) + set_entrypoint(rosresume OslMain) endif() target_link_libraries(rosload bootlib cportlib cmlib rtl libcntpr) +target_link_libraries(rosresume bootlib cportlib cmlib rtl libcntpr) +target_link_libraries(rosload_exe nt) +add_importlibs(rosload_exe ntdll) +target_link_libraries(rosresume_exe nt) +add_importlibs(rosresume_exe ntdll) if(STACK_PROTECTOR) target_link_libraries(rosload gcc_ssp) + target_link_libraries(rosresume gcc_ssp) elseif(RUNTIME_CHECKS) target_link_libraries(rosload runtmchk) + target_link_libraries(rosresume runtmchk) endif() add_dependencies(rosload asm bugcodes) -add_cd_file(TARGET rosload DESTINATION reactos/system32/boot NO_CAB FOR all) +add_cd_file(TARGET rosload DESTINATION reactos/system32/Boot NO_CAB FOR all) +add_cd_file(TARGET rosload DESTINATION reactos/system32/Boot FOR all) +add_cd_file(TARGET rosresume DESTINATION reactos/system32/Boot NO_CAB FOR all) +add_cd_file(TARGET rosresume DESTINATION reactos/system32/Boot FOR all) +add_cd_file(TARGET rosload_exe DESTINATION reactos/system32/Boot NO_CAB FOR all) +add_cd_file(TARGET rosload_exe DESTINATION reactos/system32/Boot FOR all) +add_cd_file(TARGET rosresume_exe DESTINATION reactos/system32/Boot NO_CAB FOR all) +add_cd_file(TARGET rosresume_exe DESTINATION reactos/system32/Boot FOR all) +add_cd_file(TARGET bootmgfw DESTINATION reactos/Boot/EFI FOR all) Index: sdk/cmake/CMakeMacros.cmake =================================================================== --- sdk/cmake/CMakeMacros.cmake (revision 72609) +++ sdk/cmake/CMakeMacros.cmake (working copy) @@ -269,6 +269,10 @@ set(${var} 52) elseif(${dir} STREQUAL reactos/AppPatch) set(${var} 53) + elseif(${dir} STREQUAL reactos/system32/Boot) + set(${var} 54) + elseif(${dir} STREQUAL reactos/Boot/EFI) + set(${var} 55) else() message(FATAL_ERROR "Wrong destination: ${dir}") endif()