Skip to content

Commit 48564e4

Browse files
committed
[FREELDR] Unsplit it
1 parent c91684d commit 48564e4

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

boot/freeldr/freeldr/CMakeLists.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ list(APPEND FREELDR_BOOTLIB_SOURCE
5858

5959
list(APPEND FREELDR_BOOTMGR_SOURCE
6060
include/freeldr.h
61+
custom.c
62+
# linuxboot.c
63+
miscboot.c
64+
options.c
65+
oslist.c
6166
settings.c
6267
ui/directui.c
6368
# ui/gui.c
@@ -83,7 +88,10 @@ if(ARCH STREQUAL "i386")
8388
# arch/i386/linux.S
8489

8590
list(APPEND FREELDR_ARC_SOURCE
86-
arch/i386/i386bug.c)
91+
arch/i386/i386bug.c
92+
arch/i386/halstub.c
93+
arch/i386/ntoskrnl.c
94+
disk/scsiport.c)
8795

8896
list(APPEND FREELDR_NTLDR_SOURCE
8997
ntldr/arch/i386/winldr.c
@@ -110,8 +118,14 @@ else()
110118
endif()
111119

112120
list(APPEND FREELDR_BASE_SOURCE
121+
bootmgr.c # This file is compiled with custom definitions
113122
freeldr.c
114-
ntldr/ntldropts.c # Should be in rosload, but is currently needed by machpc.c, etc.
123+
ntldr/setupldr.c ## Strangely enough this file is needed in GCC builds
124+
## even if ${FREELDR_NTLDR_SOURCE} is not added,
125+
## otherwise we get linking errors with Rtl**Bitmap** APIs.
126+
## Do not happen on MSVC builds however...
127+
ntldr/inffile.c
128+
ntldr/ntldropts.c
115129
lib/rtl/libsupp.c)
116130

117131
if(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
@@ -121,7 +135,6 @@ if(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
121135
endif()
122136

123137
include(pcat.cmake)
124-
include(rosload.cmake)
125138
if(NOT ARCH STREQUAL "i386" OR NOT (SARCH STREQUAL "pc98" OR SARCH STREQUAL "xbox"))
126139
include(uefi.cmake)
127140
endif()

boot/freeldr/freeldr/freeldr.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ CCHAR FrLdrBootPath[MAX_PATH] = "";
3030

3131
/* FUNCTIONS ******************************************************************/
3232

33+
VOID RunLoader(VOID);
34+
3335
static
3436
BOOLEAN
3537
LoadRosload(
@@ -68,6 +70,9 @@ static
6870
ULONG
6971
LaunchSecondStageLoader(VOID)
7072
{
73+
RunLoader();
74+
return ESUCCESS;
75+
7176
PLDR_DATA_TABLE_ENTRY RosloadDTE;
7277
PVOID ImageBase;
7378
LONG (*EntryPoint)(VOID);

boot/freeldr/freeldr/pcat.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ add_library(freeldr_common
155155
${PCATLDR_ARC_SOURCE}
156156
${FREELDR_BOOTLIB_SOURCE}
157157
${PCATLDR_BOOTMGR_SOURCE}
158+
${FREELDR_NTLDR_SOURCE}
158159
)
159160

160161
if(MSVC AND CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -170,6 +171,7 @@ set(PCH_SOURCE
170171
${PCATLDR_ARC_SOURCE}
171172
${FREELDR_BOOTLIB_SOURCE}
172173
${PCATLDR_BOOTMGR_SOURCE}
174+
${FREELDR_NTLDR_SOURCE}
173175
)
174176

175177
add_pch(freeldr_common include/freeldr.h PCH_SOURCE)
@@ -221,7 +223,7 @@ if(ARCH STREQUAL "i386")
221223
target_link_libraries(freeldr_pe mini_hal)
222224
endif()
223225

224-
target_link_libraries(freeldr_pe freeldr_common cportlib libcntpr blrtl)
226+
target_link_libraries(freeldr_pe freeldr_common cportlib blcmlib blrtl libcntpr)
225227

226228
# dynamic analysis switches
227229
if(STACK_PROTECTOR)

0 commit comments

Comments
 (0)