[ROSLOAD]: Continue work on loader

[ROSLOAD]: Implement OslExecuteTransition, OslArchKernelSetup,
ArchRestoreProcessorFeatures, OslArchTransferToKernel.
[ROSLOAD]: Factor out the logo code. Clean ups.
This commit is contained in:
Alex Ionescu 2018-02-03 09:16:06 -08:00
parent ce044cf80e
commit b6f5520bee
7 changed files with 10108 additions and 9861 deletions

View file

@ -112,9 +112,17 @@ add_dependencies(bootmgfw asm bugcodes)
list(APPEND ROSLOAD_BASE_SOURCE
app/rosload/rosload.c
app/rosload/roslogo.c
)
add_executable(rosload ${ROSLOAD_BASE_SOURCE})
if(ARCH STREQUAL "i386")
list(APPEND ROSLOAD_ASM_SOURCE
app/rosload/i386/osxfera.s
)
endif()
add_asm_files(rosload_asm ${ROSLOAD_ASM_SOURCE})
add_executable(rosload ${ROSLOAD_BASE_SOURCE} ${rosload_asm})
set_target_properties(rosload PROPERTIES SUFFIX ".efi")
if(MSVC)

View file

@ -0,0 +1,55 @@
/*
* COPYRIGHT: See COPYING.ARM in the top level directory
* PROJECT: ReactOS UEFI OS Loader
* FILE: boot/environ/i386/osxfera.asm
* PURPOSE: OS Loader i386 Transfer Functions
* PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
*/
/* INCLUDES ******************************************************************/
#include <asm.inc>
#include <ks386.inc>
EXTERN _OslKernelGdt:FWORD
EXTERN _OslKernelIdt:FWORD
/* FUNCTIONS ****************************************************************/
.code
ASSUME nothing
PUBLIC _OslArchTransferToKernel
_OslArchTransferToKernel:
/* Load new GDT and IDT */
lgdt _OslKernelGdt+2
lidt _OslKernelIdt+2
/* Set the Ring 0 DS/ES/SS Segment */
mov ax, KGDT_R0_DATA
mov ds, ax
mov es, ax
mov ss, ax
mov gs, ax
/* Get the Ring 0 TSS */
mov ax, KGDT_TSS
ltr ax
/* Save loader block and entrypoint */
mov ecx, [esp+4]
mov eax, [esp+8]
/* Create initial interrupt frame */
xor edx, edx
push ecx
push edx
push KGDT_R0_CODE
push eax
/* Jump to KGDT_R0_CODE:[EAX] */
retf
/* We should never make it here */
ret 8
END

File diff suppressed because it is too large Load diff

View file

@ -29,8 +29,17 @@
/* BCD Headers */
#include <bcd.h>
/* ARC Headers */
#include <arc\arc.h>
/* STRUCTURES ****************************************************************/
/* FUNCTIONS *****************************************************************/
VOID
NTAPI
OslDrawLogo (
VOID
);
#endif

File diff suppressed because it is too large Load diff

View file

@ -675,6 +675,73 @@ NTSTATUS
VOID
);
typedef VOID
(*PBL_MM_FLUSH_TLB) (
VOID
);
typedef VOID
(*PBL_MM_RELOCATE_SELF_MAP) (
VOID
);
typedef NTSTATUS
(*PBL_MM_MOVE_VIRTUAL_ADDRESS_RANGE) (
_In_ PVOID DestinationAddress,
_In_ PVOID SourceAddress,
_In_ ULONGLONG Size
);
typedef NTSTATUS
(*PBL_MM_ZERO_VIRTUAL_ADDRESS_RANGE) (
_In_ PVOID DestinationAddress,
_In_ ULONGLONG Size
);
typedef VOID
(*PBL_MM_DESTROY_SELF_MAP) (
VOID
);
typedef VOID
(*PBL_MM_FLUSH_TLB_ENTRY) (
_In_ PVOID VirtualAddress
);
typedef VOID
(*PBL_MM_FLUSH_TLB) (
VOID
);
typedef NTSTATUS
(*PBL_MM_UNMAP_VIRTUAL_ADDRESS) (
_In_ PVOID VirtualAddress,
_In_ ULONG Size
);
typedef NTSTATUS
(*PBL_MM_REMAP_VIRTUAL_ADDRESS) (
_In_ PPHYSICAL_ADDRESS PhysicalAddress,
_Out_ PVOID VirtualAddress,
_In_ ULONG Size,
_In_ ULONG CacheAttributes
);
typedef NTSTATUS
(*PBL_MM_MAP_PHYSICAL_ADDRESS) (
_In_ PHYSICAL_ADDRESS PhysicalAddress,
_Out_ PVOID VirtualAddress,
_In_ ULONG Size,
_In_ ULONG CacheAttributes
);
typedef BOOLEAN
(*PBL_MM_TRANSLATE_VIRTUAL_ADDRESS) (
_In_ PVOID VirtualAddress,
_Out_ PPHYSICAL_ADDRESS PhysicalAddress,
_Out_opt_ PULONG CacheAttributes
);
/* DATA STRUCTURES ***********************************************************/
typedef struct _BL_LIBRARY_PARAMETERS
@ -1632,7 +1699,6 @@ EtfsMount (
/* DEBUG ROUTINES ************************************************************/
BOOLEAN
BlBdDebuggerEnabled (
VOID
@ -2179,6 +2245,7 @@ MmPaReserveSelfMapPages (
_In_ ULONG Alignment,
_In_ ULONG PageCount
);
NTSTATUS
BlMmFreePhysicalPages (
_In_ PHYSICAL_ADDRESS Address
@ -2760,5 +2827,9 @@ extern ULONGLONG BlpTimePerformanceFrequency;
extern LIST_ENTRY RegisteredFileSystems;
extern BL_ADDRESS_RANGE MmArchKsegAddressRange;
extern ULONG_PTR MmArchTopOfApplicationAddressSpace;
extern PBL_MM_RELOCATE_SELF_MAP BlMmRelocateSelfMap;
extern PBL_MM_FLUSH_TLB BlMmFlushTlb;
extern PBL_MM_MOVE_VIRTUAL_ADDRESS_RANGE BlMmMoveVirtualAddressRange;
extern PBL_MM_ZERO_VIRTUAL_ADDRESS_RANGE BlMmZeroVirtualAddressRange;
#endif

View file

@ -36,73 +36,6 @@ PVOID MmPteBase;
PVOID MmPdeBase;
ULONG MmArchReferencePageSize;
typedef VOID
(*PBL_MM_FLUSH_TLB) (
VOID
);
typedef VOID
(*PBL_MM_RELOCATE_SELF_MAP) (
VOID
);
typedef NTSTATUS
(*PBL_MM_MOVE_VIRTUAL_ADDRESS_RANGE) (
_In_ PVOID DestinationAddress,
_In_ PVOID SourceAddress,
_In_ ULONGLONG Size
);
typedef NTSTATUS
(*PBL_MM_ZERO_VIRTUAL_ADDRESS_RANGE) (
_In_ PVOID DestinationAddress,
_In_ ULONGLONG Size
);
typedef VOID
(*PBL_MM_DESTROY_SELF_MAP) (
VOID
);
typedef VOID
(*PBL_MM_FLUSH_TLB_ENTRY) (
_In_ PVOID VirtualAddress
);
typedef VOID
(*PBL_MM_FLUSH_TLB) (
VOID
);
typedef NTSTATUS
(*PBL_MM_UNMAP_VIRTUAL_ADDRESS) (
_In_ PVOID VirtualAddress,
_In_ ULONG Size
);
typedef NTSTATUS
(*PBL_MM_REMAP_VIRTUAL_ADDRESS) (
_In_ PPHYSICAL_ADDRESS PhysicalAddress,
_Out_ PVOID VirtualAddress,
_In_ ULONG Size,
_In_ ULONG CacheAttributes
);
typedef NTSTATUS
(*PBL_MM_MAP_PHYSICAL_ADDRESS) (
_In_ PHYSICAL_ADDRESS PhysicalAddress,
_Out_ PVOID VirtualAddress,
_In_ ULONG Size,
_In_ ULONG CacheAttributes
);
typedef BOOLEAN
(*PBL_MM_TRANSLATE_VIRTUAL_ADDRESS) (
_In_ PVOID VirtualAddress,
_Out_ PPHYSICAL_ADDRESS PhysicalAddress,
_Out_opt_ PULONG CacheAttributes
);
PBL_MM_TRANSLATE_VIRTUAL_ADDRESS Mmx86TranslateVirtualAddress;
PBL_MM_MAP_PHYSICAL_ADDRESS Mmx86MapPhysicalAddress;
PBL_MM_REMAP_VIRTUAL_ADDRESS Mmx86RemapVirtualAddress;