2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/ex/xipdisp.c
5 * PURPOSE: eXecute In Place (XIP) Support.
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
9 /* INCLUDES ******************************************************************/
14 /* GLOBALS *******************************************************************/
16 /* FUNCTIONS *****************************************************************/
20 XIPDispatch(IN ULONG DispatchCode
,
25 return STATUS_NOT_IMPLEMENTED
;
29 PMEMORY_ALLOCATION_DESCRIPTOR
31 XIPpFindMemoryDescriptor(IN PLOADER_PARAMETER_BLOCK LoaderBlock
)
33 PLIST_ENTRY NextEntry
;
34 PMEMORY_ALLOCATION_DESCRIPTOR Descriptor
= NULL
;
36 /* Loop the memory descriptors */
37 for (NextEntry
= LoaderBlock
->MemoryDescriptorListHead
.Flink
;
38 NextEntry
!= &LoaderBlock
->MemoryDescriptorListHead
;
39 NextEntry
= NextEntry
->Flink
)
41 /* Get the current descriptor and check if it's the XIP ROM */
42 Descriptor
= CONTAINING_RECORD(NextEntry
,
43 MEMORY_ALLOCATION_DESCRIPTOR
,
45 if (Descriptor
->MemoryType
== LoaderXIPRom
) return Descriptor
;
48 /* Nothing found if we got here */
55 XIPInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock
)
57 PCHAR CommandLine
, XipBoot
, XipRom
, XipMegs
, XipVerbose
, XipRam
;
58 PMEMORY_ALLOCATION_DESCRIPTOR XipDescriptor
;
60 /* Get the command line */
61 CommandLine
= LoaderBlock
->LoadOptions
;
62 if (!CommandLine
) return;
64 /* Get XIP settings */
65 XipBoot
= strstr(CommandLine
, "XIPBOOT");
66 XipRam
= strstr(CommandLine
, "XIPRAM=");
67 XipRom
= strstr(CommandLine
, "XIPROM=");
68 XipMegs
= strstr(CommandLine
, "XIPMEGS=");
69 XipVerbose
= strstr(CommandLine
, "XIPVERBOSE");
71 /* Check if this is a verbose boot */
74 /* Print out our header */
75 DbgPrint("\n\nXIP: debug timestamp at line %d in %s: <<<%s %s>>>\n\n",
82 /* Find the XIP memory descriptor */
83 XipDescriptor
= XIPpFindMemoryDescriptor(LoaderBlock
);
84 if (!XipDescriptor
) return;
87 // Make sure this is really XIP, and not RAM Disk -- also validate XIP
88 // Basically, either this is a ROM boot or a RAM boot, but not both nor none
90 if (!((ULONG_PTR
)XipRom
^ (ULONG_PTR
)XipRam
)) return;
93 DPRINT1("ReactOS does not yet support eXecute In Place boot technology\n");
94 DPRINT("%s MB requested (XIP = %s)\n", XipMegs
, XipBoot
);