Skip to content

Instantly share code, notes, and snippets.

View mvankuipers's full-sized avatar

Michael VanKuipers mvankuipers

View GitHub Profile
@mvankuipers
mvankuipers / pte.c
Created July 7, 2017 23:42
Structure defining a page table (PT) entry in IA-32e paging.
typedef struct _PTE
{
union
{
struct
{
ULONG64 Present : 1; // Must be 1, region invalid if 0.
ULONG64 ReadWrite : 1; // If 0, writes not allowed.
ULONG64 UserSupervisor : 1; // If 0, user-mode accesses not allowed.
ULONG64 PageWriteThrough : 1; // Determines the memory type used to access the memory.
@mvankuipers
mvankuipers / pde.c
Created July 7, 2017 23:34
Structure defining a page directory (PD) entry in IA-32e paging.
typedef struct _PDE
{
union
{
struct
{
ULONG64 Present : 1; // Must be 1, region invalid if 0.
ULONG64 ReadWrite : 1; // If 0, writes not allowed.
ULONG64 UserSupervisor : 1; // If 0, user-mode accesses not allowed.
ULONG64 PageWriteThrough : 1; // Determines the memory type used to access PT.
@mvankuipers
mvankuipers / pdpte.c
Last active January 11, 2024 10:03
Structure defining a page directory pointer table (PDPT) entry in IA-32e paging.
typedef struct _PDPTE
{
union
{
struct
{
ULONG64 Present : 1; // Must be 1, region invalid if 0.
ULONG64 ReadWrite : 1; // If 0, writes not allowed.
ULONG64 UserSupervisor : 1; // If 0, user-mode accesses not allowed.
ULONG64 PageWriteThrough : 1; // Determines the memory type used to access PD.
@mvankuipers
mvankuipers / pml4e.c
Last active March 28, 2023 13:08
Structure defining a PML4 entry in IA-32e paging.
typedef struct _PML4E
{
union
{
struct
{
ULONG64 Present : 1; // Must be 1, region invalid if 0.
ULONG64 ReadWrite : 1; // If 0, writes not allowed.
ULONG64 UserSupervisor : 1; // If 0, user-mode accesses not allowed.
ULONG64 PageWriteThrough : 1; // Determines the memory type used to access PDPT.