ref: initramfs -> StartupVolume; /bin -> /System/CoreServices;

ref(Kernel/VM/Heap): malloc -> VMHeapAllocate; free -> VMHeapFree; realloc -> VMHeapResize
This commit is contained in:
Karina
2026-01-31 16:11:45 +04:00
parent c30d57d06e
commit ee67cef4f8
12 changed files with 58 additions and 77 deletions
+3 -3
View File
@@ -29,7 +29,7 @@ void OSSchedulerInitialize() {
sOSSchedulerKernelProcess.physicalPML4 = gVMKernelPML4Physical;
strcpy(sOSSchedulerKernelProcess.name, "kernel");
OSTask* kernelTask = (OSTask*)malloc(sizeof(OSTask));
OSTask* kernelTask = (OSTask*)VMHeapAllocate(sizeof(OSTask));
memset(kernelTask, 0, sizeof(OSTask));
kernelTask->id = 0;
kernelTask->process = &sOSSchedulerKernelProcess;
@@ -43,12 +43,12 @@ void OSSchedulerInitialize() {
}
OSTask* OSSchedulerSpawn(void(*entry)(), OSProcess* owner, Boolean isUser, UInt64 fixedUserStackPointer) {
OSTask* task = (OSTask*)malloc(sizeof(OSTask));
OSTask* task = (OSTask*)VMHeapAllocate(sizeof(OSTask));
if (!task) return nullptr;
if (!owner) owner = &sOSSchedulerKernelProcess;
UInt64 stackSize = 16384;
UInt8* stackBaseAddress = (UInt8*)malloc(stackSize);
UInt8* stackBaseAddress = (UInt8*)VMHeapAllocate(stackSize);
if (!stackBaseAddress) OSPanic("OOM for task stack");
UInt64* rsp = (UInt64*)(stackBaseAddress + stackSize);