This file defines constants, structures, and macros for memory management functions of PwnOS.
| Memory.inc | This file defines constants, structures, and macros for memory management functions of PwnOS. |
| PHYSPAGEINFO | This structure is an entry in the Physical To Virtual Table. |
| Constants | |
| Memory Map Constants | These define the sizes and addresses of fixed-location data and data blocks. |
This structure is an entry in the Physical To Virtual Table.
256 of these entries make up each of the 256 sections of the table. A physical page can’t have more than one virtual address so if needed, make a copy of the page. This was decided for simplicity and since the OS is focused toward having only a few processes running at once anyway.
GetVirtAddr and RegisterNewPhysPg rely heavily on this structure.
| pVirtual | virtual address of this physical page in the memory space of process(es) determined by hProcess; PHYSPAGEINFO_FREE if this page isn’t used; PHYSPAGEINFO_UNUSABLE if this page is never allowed to be used (e.g. video memory bank at 0A0000h) |
| hProcess | handle of the process owning this; can also be a handle to a handle list (though not implemented yet) |
| Age | age of the page in a format indicating how long ago the past 4 accesses were (1 byte each); 00 = accessed in current round; 01-FE = accessed 01-FE cycles before current round or more recent access; FF = accessed an indeterminably long time before current round or more recent access. |
| Reserved | reserved for future use, and padding to 16 bytes |
| Constants | |
| Memory Map Constants | These define the sizes and addresses of fixed-location data and data blocks. |
INITIAL GLOBAL DESCRIPTOR TABLE
GDT dq 0 ;NULL descriptor