forked from xt-sys/exectos
Implement HlHalt() intrinsic routine and add basic definitions for kernel services
This commit is contained in:
@@ -91,7 +91,7 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings,
|
||||
|
||||
/* Map the stack */
|
||||
BlGetStackPointer(&Stack);
|
||||
Status = BlAddVirtualMemoryMapping(MemoryMappings, Stack, Stack, XTOS_KERNEL_STACK_SIZE,
|
||||
Status = BlAddVirtualMemoryMapping(MemoryMappings, Stack, Stack, KERNEL_STACK_SIZE,
|
||||
LoaderOsloaderStack);
|
||||
if(Status != STATUS_EFI_SUCCESS)
|
||||
{
|
||||
|
@@ -101,7 +101,7 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings,
|
||||
BlDbgPrint(L"Physical Address Extension (PAE) available\n");
|
||||
|
||||
/* Calculate physical address based on KSEG0 base */
|
||||
PhysicalAddress = (UINT_PTR)VirtualAddress - XTOS_VIRTUAL_MEMORY_AREA;
|
||||
PhysicalAddress = (UINT_PTR)VirtualAddress - KSEG0_BASE;
|
||||
|
||||
/* Iterate over all descriptors from memory map to find satisfying address for PDPT */
|
||||
for(Index = 0; Index < DescriptorCount; Index++)
|
||||
@@ -142,7 +142,7 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings,
|
||||
}
|
||||
|
||||
/* Set virtual address based on new PDPT address mapped to KSEG0 base */
|
||||
VirtualAddress = (void*)(UINT_PTR)(PDPTAddress + EFI_PAGE_SIZE + XTOS_VIRTUAL_MEMORY_AREA);
|
||||
VirtualAddress = (void*)(UINT_PTR)(PDPTAddress + EFI_PAGE_SIZE + KSEG0_BASE);
|
||||
|
||||
/* Set base page frame number */
|
||||
Address = 0x100000; // MEM_TOP_DOWN ?
|
||||
@@ -191,7 +191,7 @@ BlEnablePaging(IN PLIST_ENTRY MemoryMappings,
|
||||
|
||||
/* Map the stack */
|
||||
BlGetStackPointer(&Stack);
|
||||
Status = BlAddVirtualMemoryMapping(MemoryMappings, Stack, Stack, XTOS_KERNEL_STACK_SIZE,
|
||||
Status = BlAddVirtualMemoryMapping(MemoryMappings, Stack, Stack, KERNEL_STACK_SIZE,
|
||||
LoaderOsloaderStack);
|
||||
if(Status != STATUS_EFI_SUCCESS)
|
||||
{
|
||||
|
@@ -361,7 +361,7 @@ BlStartNewStack()
|
||||
|
||||
/* Infinite bootloader loop */
|
||||
BlEfiPrint(L"System halted!");
|
||||
for(;;);
|
||||
HlHalt();
|
||||
|
||||
/* Return success */
|
||||
return STATUS_EFI_SUCCESS;
|
||||
@@ -437,12 +437,12 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle,
|
||||
BlEnumerateEfiBlockDevices();
|
||||
|
||||
/* Create new bootloader stack */
|
||||
BlCreateStack(&EfiLoaderStack, XTOS_KERNEL_STACK_SIZE, &BlStartNewStack);
|
||||
BlCreateStack(&EfiLoaderStack, KERNEL_STACK_SIZE, &BlStartNewStack);
|
||||
|
||||
/* Infinite bootloader loop */
|
||||
BlDbgPrint(L"ERROR: Unexpected exception occurred, probably did not create a new stack\n");
|
||||
BlEfiPrint(L"System halted!");
|
||||
for(;;);
|
||||
HlHalt();
|
||||
|
||||
/* Return success */
|
||||
return STATUS_EFI_SUCCESS;
|
||||
|
Reference in New Issue
Block a user