completely redesign how user mode memory is allocated, fix a few smp and scheduler bugs, terminating a process now terminates the process, telemetry, optimize text editor, new font, new color scheme
This commit is contained in:
1 parent
27b31f62b6
commit
325149006c
45 files changed
+2091
-760
No files matched your search
@@ -13,6 +13,8 @@
|
||||
#define SYS_STATUS_TIMEOUT 3u
|
||||
#define SYS_STATUS_PENDING 4u
|
||||
#define SYS_STATUS_ALERTED 5u
|
||||
#define SYS_STATUS_INVALID_PARAMETER 0x10u
|
||||
#define SYS_STATUS_NO_MEMORY 0x20u
|
||||
#define SYS_STATUS_KERNEL_APC 6u
|
||||
#define SYS_STATUS_USER_APC 7u
|
||||
#define SYS_STATUS_CANCELLED 0x33u
|
||||
@@ -205,11 +207,33 @@ uint32_t SysSetUserApcDispatcher(void* dispatcher);
|
||||
uint32_t SysApcReturn(const SYS_USER_APC_FRAME* frame);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Memory and handles
|
||||
// Virtual memory and handles
|
||||
// ---------------------------------------------------------------------------
|
||||
void* SysAlloc(size_t size);
|
||||
uint32_t SysFree(void* ptr);
|
||||
void* SysRealloc(void* ptr, size_t newSize);
|
||||
typedef enum SYS_VM_PROTECTION {
|
||||
SYS_VM_NOACCESS = 0,
|
||||
SYS_VM_READ = 1,
|
||||
SYS_VM_READWRITE = 2,
|
||||
SYS_VM_EXECUTE = 3,
|
||||
SYS_VM_EXECUTE_READ = 4,
|
||||
SYS_VM_EXECUTE_READWRITE = 5,
|
||||
} SYS_VM_PROTECTION;
|
||||
|
||||
#define SYS_VM_FLAG_NONE 0u
|
||||
#define SYS_VM_FLAG_FIXED 1u
|
||||
|
||||
typedef struct SYS_VM_REGION_INFO {
|
||||
void* Base;
|
||||
size_t PageCount;
|
||||
uint32_t Protect;
|
||||
uint32_t Flags;
|
||||
uint32_t Type;
|
||||
uint32_t OwnerPid;
|
||||
} SYS_VM_REGION_INFO;
|
||||
|
||||
uint32_t SysVmAlloc(void* preferredBase, size_t pageCount, uint32_t protect, uint32_t flags, void** baseOut);
|
||||
uint32_t SysVmFree(void* base);
|
||||
uint32_t SysVmProtect(void* base, size_t pageCount, uint32_t protect, uint32_t* oldProtectOut);
|
||||
uint32_t SysVmQuery(void* address, SYS_VM_REGION_INFO* out);
|
||||
uint32_t SysCloseHandle(uint32_t handle);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -382,6 +406,58 @@ typedef struct SYS_MEMORY_STATUS {
|
||||
uint64_t UserHeapBytes;
|
||||
} SYS_MEMORY_STATUS;
|
||||
|
||||
#define SYS_KERNEL_STATS_SCHEDULER 1u
|
||||
#define SYS_KERNEL_STATS_PMM 2u
|
||||
#define SYS_KERNEL_STATS_CPU 3u
|
||||
|
||||
#define SYS_KERNEL_STATS_MAX_CPUS 32u
|
||||
|
||||
typedef struct SYS_SCHEDULER_STATS {
|
||||
uint64_t Ticks;
|
||||
uint64_t ContextSwitches;
|
||||
uint64_t KeepCurrentDecisions;
|
||||
uint64_t IdleSelections;
|
||||
uint64_t Demotions;
|
||||
uint64_t AgingPromotions;
|
||||
uint64_t QuantumExpirations;
|
||||
uint64_t PriorityPreemptions;
|
||||
uint64_t VoluntaryBlocks;
|
||||
uint64_t CpuBurstDemotions;
|
||||
uint64_t SmtSiblingDeferrals;
|
||||
uint64_t SmtPrimaryPokes;
|
||||
} SYS_SCHEDULER_STATS;
|
||||
|
||||
typedef struct SYS_PMM_STATS {
|
||||
uint64_t TotalFrames;
|
||||
uint64_t FreeFrames;
|
||||
uint64_t UsedFrames;
|
||||
uint64_t LargestFreeRun;
|
||||
uint64_t FreeRunCount;
|
||||
uint64_t FreeRunHistogram[8];
|
||||
} SYS_PMM_STATS;
|
||||
|
||||
typedef struct SYS_CPU_STAT {
|
||||
uint32_t CpuIndex;
|
||||
uint32_t LapicId;
|
||||
uint32_t Flags;
|
||||
uint32_t CurrentTid;
|
||||
uint64_t SchedulerTicks;
|
||||
uint64_t ContextSwitches;
|
||||
} SYS_CPU_STAT;
|
||||
|
||||
typedef struct SYS_CPU_STATS {
|
||||
uint32_t CpuCount;
|
||||
uint32_t Reserved;
|
||||
SYS_CPU_STAT Cpu[SYS_KERNEL_STATS_MAX_CPUS];
|
||||
} SYS_CPU_STATS;
|
||||
|
||||
#define SYS_CPU_FLAG_PRESENT 0x00000001u
|
||||
#define SYS_CPU_FLAG_STARTED 0x00000002u
|
||||
#define SYS_CPU_FLAG_PARKED 0x00000004u
|
||||
#define SYS_CPU_FLAG_ONLINE 0x00000008u
|
||||
#define SYS_CPU_FLAG_BSP 0x00000010u
|
||||
#define SYS_CPU_FLAG_PRIMARY 0x00000020u
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Time and diagnostics
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -390,3 +466,4 @@ uint32_t SysDebugPrint(const SYS_DEBUG_PRINT_REQUEST* request);
|
||||
uint32_t SysQueryTrapFrame(SYS_TRAP_FRAME_INFO* info);
|
||||
|
||||
uint32_t SysGetMemoryStatus(SYS_MEMORY_STATUS* statusOut);
|
||||
uint32_t SysQueryKernelStats(uint32_t classId, void* buffer, size_t bufferSize, size_t* requiredSizeOut);
|
||||
Reference in new issue
Block a user