wip
This commit is contained in:
parent
9e3d9b18ea
commit
1ce8a5727b
23
src/common/hos/page_table.d
Normal file
23
src/common/hos/page_table.d
Normal file
@ -0,0 +1,23 @@
|
||||
struct PageTableEntry
|
||||
{
|
||||
ulong entry;
|
||||
|
||||
this(ulong address, ulong no_execute, ulong global,
|
||||
ulong huge, ulong disable_cache, ulong write_through, ulong user,
|
||||
ulong writable, ulong present)
|
||||
{
|
||||
entry = (present |
|
||||
(writable << 1) |
|
||||
(user << 2) |
|
||||
(write_through << 3) |
|
||||
(disable_cache << 4) |
|
||||
(huge << 7) |
|
||||
(global << 8) |
|
||||
(no_execute << 63)) | address;
|
||||
}
|
||||
|
||||
bool present()
|
||||
{
|
||||
return (entry & 0x1u) != 0u;
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ import uefi;
|
||||
import output;
|
||||
import scratch;
|
||||
import hulk.bootinfo;
|
||||
import hos.page_table;
|
||||
|
||||
__gshared EFI_SYSTEM_TABLE * st;
|
||||
__gshared BootInfo bootinfo;
|
||||
@ -129,6 +130,9 @@ extern (C) EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE * st)
|
||||
writeln("HELLO, HOS EFI Lightweight LOader, v0.1.0");
|
||||
writeln("Firmware vendor: '%S', version: 0x%x", st.FirmwareVendor, st.FirmwareVendor);
|
||||
|
||||
PageTableEntry * pte = cast(PageTableEntry *)scratch_alloc(1u);
|
||||
wait_key();
|
||||
|
||||
if (!set_graphics_mode())
|
||||
{
|
||||
wait_key();
|
||||
|
Loading…
x
Reference in New Issue
Block a user