Skip to content

Commit c979923

Browse files
[FREELDR:APPLETV] Change base address
This ensures that the Apple TV loader loads at 0x111000, the same address as Apple's kernel, which should prevent memory from being overwritten anywhere. Do note that this breaks Vista support (same issue with rosload).
1 parent f28a02e commit c979923

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

boot/freeldr/freeldr/appletv.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ else()
128128
COMMAND ${CMAKE_STRIP} --strip-all $<TARGET_FILE:freeldr_pe>)
129129
endif()
130130

131-
set_image_base(freeldr_pe 0x10000)
131+
set_image_base(freeldr_pe 0x112000)
132132
set_subsystem(freeldr_pe native)
133133
set_entrypoint(freeldr_pe AppleTVEntry)
134134

boot/freeldr/freeldr/include/arch/pc/x86common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@
1414
#define BSS_START HEX(6F00)
1515
#define STACKLOW HEX(7000)
1616
#define STACKADDR HEX(F000) /* The 32/64-bit stack top will be at 0000:F000, or 0xF000 */
17+
#ifdef SARCH_APPLETV
18+
#define FREELDR_BASE HEX(111000)
19+
#define FREELDR_PE_BASE HEX(112000)
20+
#else
1721
#define FREELDR_BASE HEX(F800)
1822
#define FREELDR_PE_BASE HEX(10000)
23+
#endif
1924
#define MEMORY_MARGIN HEX(88000) /* We need this much memory */
2025

2126
#define BIOSCALLBUFSEGMENT (BIOSCALLBUFFER/16) /* Buffer to store temporary data for any Int386() call */

0 commit comments

Comments
 (0)