Skip to content

Commit 3eecc42

Browse files
HBeluscabinarymaster
authored andcommitted
[FREELDR] Improvements for the RamDisk support.
- Implement support for the "RDIMAGELENGTH" and "RDIMAGEOFFSET" boot options. Fixes CORE-15432. - Separate the initialization of the global gInitRamDiskBase / gInitRamDiskSize variables from the FreeLdr command-line, and the actual initialization of the internal variables of the RamDisk. The latter are initialized via calls to RamDiskInitialize(). - Implement 'SeekRelative' mode in RamDiskSeek(). - Make RamDiskLoadVirtualFile() internal function that gets called by RamDiskInitialize(), and we use the latter in the NT loader instead.
1 parent b3f45a2 commit 3eecc42

File tree

6 files changed

+182
-120
lines changed

6 files changed

+182
-120
lines changed

boot/freeldr/freeldr/arch/arm/macharm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ ArmHwDetect(VOID)
120120
SecondLevelIcacheSize =
121121
SecondLevelIcacheFillSize = 0;
122122

123-
/* Register RAMDISK Device */
124-
RamDiskInitialize();
123+
/* Initialize the RAMDISK Device */
124+
RamDiskInitialize(TRUE, NULL, NULL);
125125

126126
/* Fill out the ARC disk block */
127127
AddReactOSArcDiskInfo("ramdisk(0)", 0xBADAB00F, 0xDEADBABE, TRUE);

boot/freeldr/freeldr/cmdline.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ CmdLineParse(IN PCSTR CmdLine)
9191
Setting = strstr(CmdLine, "rdbase=");
9292
if (Setting)
9393
{
94-
gRamDiskBase =
94+
gInitRamDiskBase =
9595
(PVOID)(ULONG_PTR)strtoull(Setting +
9696
sizeof("rdbase=") - sizeof(ANSI_NULL),
9797
NULL, 0);
@@ -101,9 +101,9 @@ CmdLineParse(IN PCSTR CmdLine)
101101
Setting = strstr(CmdLine, "rdsize=");
102102
if (Setting)
103103
{
104-
gRamDiskSize = strtoul(Setting +
105-
sizeof("rdsize=") - sizeof(ANSI_NULL),
106-
NULL, 0);
104+
gInitRamDiskSize = strtoul(Setting +
105+
sizeof("rdsize=") - sizeof(ANSI_NULL),
106+
NULL, 0);
107107
}
108108

109109
/* Get ramdisk offset */
@@ -116,7 +116,7 @@ CmdLineParse(IN PCSTR CmdLine)
116116
}
117117

118118
/* Fix it up */
119-
gRamDiskBase = (PVOID)((ULONG_PTR)gRamDiskBase + Offset);
119+
gInitRamDiskBase = (PVOID)((ULONG_PTR)gInitRamDiskBase + Offset);
120120
}
121121

122122
PCSTR

0 commit comments

Comments
 (0)