diff --git a/README.md b/README.md index 95daf63..ea183fb 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,12 @@ ninja run - [x] Create (register) - [ ] Delete (unregister) - [x] List +- PROCFS + - [x] Read + - [x] Write + - [x] Create (register) + - [ ] Delete (unregister) + - [x] List - ISO9660 (RO) - [x] Read - [x] List @@ -138,7 +144,8 @@ ninja run - [x] EXT2 - [x] FAT1x - [x] VFRFS - - [ ] DEVFS + - [x] DEVFS + - [x] PROCFS - [ ] ISO9660 ### Drivers - Network diff --git a/cmake/source.cmake b/cmake/source.cmake index d1408a3..a431884 100644 --- a/cmake/source.cmake +++ b/cmake/source.cmake @@ -71,6 +71,7 @@ set(FS_SOURCES fs/FAT/FAT1x.c fs/EXT/Ext2.c fs/NTFS/NTFS.c + fs/procfs/ProcFS.c fs/Iso9660.c fs/VFS.c fs/BlockDevice.c @@ -87,6 +88,7 @@ set(DRIVER_SOURCES drivers/TSC.c drivers/ACPI.c drivers/Serial.c + drivers/Random.c drivers/PS2.c drivers/storage/Ide.c drivers/Vesa.c diff --git a/drivers/Random.c b/drivers/Random.c new file mode 100644 index 0000000..d912c84 --- /dev/null +++ b/drivers/Random.c @@ -0,0 +1,41 @@ +#include "Random.h" +#include "../crypto/RNG.h" +#include "../fs/CharDevice.h" + +static int RandomDevRead(struct CharDevice* dev, void* buffer, uint32_t size) { + uint8_t* buf = (uint8_t*)buffer; + if (rdrand_supported()) { + for (uint32_t i = 0; i < size; i += 2) { + uint16_t rand = rdrand16(); + buf[i] = rand & 0xFF; + if (i + 1 < size) { + buf[i + 1] = (rand >> 8) & 0xFF; + } + } + } else { + for (uint32_t i = 0; i < size; i += 8) { + uint64_t rand = xoroshiro128plus(); + for (int j = 0; j < 8 && (i + j) < size; ++j) { + buf[i + j] = (rand >> (j * 8)) & 0xFF; + } + } + } + return size; +} + +static CharDevice_t g_random_device = { + .name = "Random", + .Read = RandomDevRead, + .Write = NULL, // Not supported +}; + +void RandomInit(void) { + if (!rdrand_supported()) { + uint32_t lo, hi; + __asm__ volatile("rdtsc" : "=a"(lo), "=d"(hi)); + uint64_t tsc = ((uint64_t)hi << 32) | lo; + uint64_t entropy = tsc ^ (uint64_t)(uintptr_t)&g_random_device; + rng_seed(tsc, entropy); + } + CharDeviceRegister(&g_random_device); +} diff --git a/drivers/Random.h b/drivers/Random.h new file mode 100644 index 0000000..48684e2 --- /dev/null +++ b/drivers/Random.h @@ -0,0 +1,8 @@ +#ifndef VOIDFRAME_RANDOM_H +#define VOIDFRAME_RANDOM_H + +#include "stdint.h" + +void RandomInit(void); + +#endif //VOIDFRAME_RANDOM_H diff --git a/fs/CharDevice.c b/fs/CharDevice.c index 42b97fe..36a74f1 100644 --- a/fs/CharDevice.c +++ b/fs/CharDevice.c @@ -1,6 +1,5 @@ #include "CharDevice.h" #include "../kernel/etc/StringOps.h" -#include "../../kernel/etc/Console.h" static CharDevice_t* g_char_devices[MAX_CHAR_DEVICES]; static int g_num_char_devices = 0; diff --git a/fs/VFS.c b/fs/VFS.c index aa7f51d..3e76381 100644 --- a/fs/VFS.c +++ b/fs/VFS.c @@ -4,6 +4,7 @@ #include "CharDevice.h" #include "Console.h" #include "devfs/DevFS.h" +#include "procfs/ProcFS.h" #include "EXT/Ext2.h" #include "FAT/FAT1x.h" #include "FileSystem.h" @@ -92,6 +93,7 @@ int VfsInit(void) { mounts[i].active = 0; } PrintKernel( "VFS: Mount table cleared\n"); + ProcFSInit(); // Register filesystems static FileSystemDriver ntfs_driver = {"NTFS", NtfsDetect, NtfsMount, NtfsUnmount}; @@ -106,6 +108,9 @@ int VfsInit(void) { static FileSystemDriver devfs_driver = {"DevFS", NULL, DevfsMount, NULL}; FileSystemRegister(&devfs_driver); PrintKernel("VFS: DevFS driver registered\n"); + static FileSystemDriver procfs_driver = {"ProcFS", NULL, ProcfsMount, NULL}; + FileSystemRegister(&procfs_driver); + PrintKernel("VFS: ProcFS driver registered\n"); int result = VfsMount("/", NULL, NULL); // RamFS doesn't need a device or driver if (result != 0) { @@ -117,6 +122,11 @@ int VfsInit(void) { SerialWrite("VFS: Failed to mount /Devices\n"); } + result = VfsMount(RuntimeProcesses, NULL, &procfs_driver); + if (result != 0) { + SerialWrite("VFS: Failed to mount /Runtime/Processes\n"); + } + PrintKernelSuccess("VFS: Virtual File System initialized\n"); return 0; } @@ -193,6 +203,8 @@ int VfsReadFile(const char* path, void* buffer, uint32_t max_size) { return NtfsReadFile(local_path, buffer, max_size); } else if (FastStrCmp(mount->fs_driver->name, "DevFS") == 0) { return DevfsReadFile(local_path, buffer, max_size); + } else if (FastStrCmp(mount->fs_driver->name, "ProcFS") == 0) { + return ProcfsReadFile(local_path, buffer, max_size); } } else { FsNode* node = FsFind(local_path); @@ -226,6 +238,8 @@ int VfsWriteFile(const char* path, const void* buffer, uint32_t size) { return NtfsWriteFile(local_path, buffer, size); } else if (FastStrCmp(mount->fs_driver->name, "DevFS") == 0) { return DevfsWriteFile(local_path, buffer, size); + } else if (FastStrCmp(mount->fs_driver->name, "ProcFS") == 0) { + return ProcfsWriteFile(local_path, buffer, size); } } else { int fd = FsOpen(local_path, FS_WRITE); @@ -257,6 +271,8 @@ int VfsListDir(const char* path) { return NtfsListDir(local_path); } else if (FastStrCmp(mount->fs_driver->name, "DevFS") == 0) { return DevfsListDir(local_path); + } else if (FastStrCmp(mount->fs_driver->name, "ProcFS") == 0) { + return ProcfsListDir(local_path); } } else { return FsListDir(local_path); @@ -364,6 +380,8 @@ int VfsIsDir(const char* path) { return NtfsIsDir(local_path); } else if (FastStrCmp(mount->fs_driver->name, "DevFS") == 0) { return DevfsIsDir(local_path); + } else if (FastStrCmp(mount->fs_driver->name, "ProcFS") == 0) { + return ProcfsIsDir(local_path); } } else { FsNode* node = FsFind(local_path); diff --git a/fs/procfs/ProcFS.c b/fs/procfs/ProcFS.c new file mode 100644 index 0000000..46046b2 --- /dev/null +++ b/fs/procfs/ProcFS.c @@ -0,0 +1,174 @@ +#include "ProcFS.h" +#include "VFS.h" +#include "KernelHeap.h" +#include "StringOps.h" +#include "Console.h" +#include "Format.h" +#include "stdlib.h" +#include "MemOps.h" +#include "Scheduler.h" + +static ProcFSEntry* proc_list_head = NULL; + +void ProcFSInit() { + proc_list_head = NULL; + PrintKernelF("VFS: Initialized ProcFS\n"); +} + +void ProcFSRegisterProcess(uint32_t pid, void* data) { + ProcFSEntry* new_entry = (ProcFSEntry*)KernelMemoryAlloc(sizeof(ProcFSEntry)); + if (!new_entry) { + PrintKernelError("VFS: Failed to allocate memory for new process entry\n"); + return; + } + new_entry->pid = pid; + new_entry->next = proc_list_head; + proc_list_head = new_entry; +} + +void ProcFSUnregisterProcess(uint32_t pid) { + ProcFSEntry* current = proc_list_head; + ProcFSEntry* prev = NULL; + + while (current) { + if (current->pid == pid) { + if (prev) { + prev->next = current->next; + } else { + proc_list_head = current->next; + } + KernelFree(current); + return; + } + prev = current; + current = current->next; + } +} + +int ProcfsMount(struct BlockDevice* device, const char* mount_point) { + (void)device; + (void)mount_point; + return 0; +} + +int ProcfsReadFile(const char* path, void* buffer, uint32_t max_size) { + if (path[0] != '/') return -1; + + char pid_str[16]; + int i = 1; + int j = 0; + while (path[i] != '/' && path[i] != '\0' && j < 15) { + pid_str[j++] = path[i++]; + } + pid_str[j] = '\0'; + + if (path[i] == '\0') return -1; + + uint32_t pid = atoi(pid_str); + CurrentProcessControlBlock* pcb = GetCurrentProcessByPID(pid); + + if (!pcb) { + return -1; + } + + const char* filename = &path[i + 1]; + char local_buffer[1024]; + + if (FastStrCmp(filename, "info") == 0) { + int len = FormatA(local_buffer, sizeof(local_buffer), + "Name: %s\n" + "PID: %u\n" + "State: %d\n" + "PPID: %u\n" + "Priority: %d\n" + "Privilege: %d\n" + "CPU Time: %llu ticks\n" + "Creation Time: %llu\n", + pcb->name, + pcb->pid, + pcb->state, + pcb->parent_pid, +#if defined(VF_CONFIG_SCHED_MLFQ) + pcb->priority, +#else + pcb->nice, +#endif + pcb->privilege_level, + pcb->cpu_time_accumulated, + pcb->creation_time); + + if (len > max_size) len = max_size; + FastMemcpy(buffer, local_buffer, len); + return len; + } + return -1; +} + +int ProcfsWriteFile(const char* path, const void* buffer, uint32_t size) { + (void)path; + (void)buffer; + (void)size; + return -1; +} + +int ProcfsListDir(const char* path) { + if (FastStrCmp(path, "/") == 0) { + ProcFSEntry* current = proc_list_head; + while (current) { + PrintKernelF(" %d/\n", current->pid); + current = current->next; + } + return 0; + } + + if (path[0] == '/' && path[1] != '\0') { + char pid_str[16]; + int i = 1; + int j = 0; + while (path[i] != '/' && path[i] != '\0' && j < 15) { + pid_str[j++] = path[i++]; + } + pid_str[j] = '\0'; + + uint32_t pid = atoi(pid_str); + ProcFSEntry* current = proc_list_head; + while (current) { + if (current->pid == pid) { + if (path[i] == '\0' || (path[i] == '/' && path[i+1] == '\0')) { + PrintKernelF(" info\n"); + return 0; + } + } + current = current->next; + } + } + return -1; +} + +int ProcfsIsDir(const char* path) { + if (FastStrCmp(path, "/") == 0) { + return 1; + } + + if (path[0] == '/' && path[1] != '\0') { + char pid_str[16]; + int i = 1; + int j = 0; + while (path[i] != '/' && path[i] != '\0' && j < 15) { + pid_str[j++] = path[i++]; + } + pid_str[j] = '\0'; + + uint32_t pid = atoi(pid_str); + ProcFSEntry* current = proc_list_head; + while (current) { + if (current->pid == pid) { + if (path[i] == '\0' || (path[i] == '/' && path[i+1] == '\0')) { + return 1; + } + } + current = current->next; + } + } + return 0; +} \ No newline at end of file diff --git a/fs/procfs/ProcFS.h b/fs/procfs/ProcFS.h new file mode 100644 index 0000000..6063518 --- /dev/null +++ b/fs/procfs/ProcFS.h @@ -0,0 +1,39 @@ +#ifndef VOIDFRAME_PROCFS_H +#define VOIDFRAME_PROCFS_H + +#include "../BlockDevice.h" +#include +#include + +// Represents an entry in the procfs, typically a process. +// The data pointer is generic and can be used to store scheduler-specific info. +typedef struct ProcFSEntry { + uint32_t pid; // Process ID + struct ProcFSEntry* next; // Pointer to the next process entry +} ProcFSEntry; + +// Initializes the procfs filesystem. +void ProcFSInit(); + +// Registers a new process with the given PID and associated data. +void ProcFSRegisterProcess(uint32_t pid, void* data); + +// Unregisters a process from procfs using its PID. +void ProcFSUnregisterProcess(uint32_t pid); + +// Mounts the procfs. This is a dummy function as procfs is a virtual filesystem. +int ProcfsMount(struct BlockDevice* device, const char* mount_point); + +// Reads the content of a file within the procfs. +int ProcfsReadFile(const char* path, void* buffer, uint32_t max_size); + +// Writes content to a file in procfs. Currently not supported. +int ProcfsWriteFile(const char* path, const void* buffer, uint32_t size); + +// Lists the directory contents in procfs. +int ProcfsListDir(const char* path); + +// Checks if a given path in procfs is a directory. +int ProcfsIsDir(const char* path); + +#endif //VOIDFRAME_PROCFS_H \ No newline at end of file diff --git a/kernel/core/Kernel.c b/kernel/core/Kernel.c index 571a33b..56ddb81 100644 --- a/kernel/core/Kernel.c +++ b/kernel/core/Kernel.c @@ -22,6 +22,7 @@ #include "PCI/PCI.h" #include "PMem.h" #include "PS2.h" +#include "Random.h" #include "Panic.h" #include "SVGAII.h" #include "Scheduler.h" @@ -607,6 +608,11 @@ static InitResultT PXS2(void) { TSCInit(); PrintKernelSuccess("System: TSC initialized\n"); + // Initialize Random Device + PrintKernel("Info: Initializing Random Device...\n"); + RandomInit(); + PrintKernelSuccess("System: Random Device initialized\n"); + // Initialize ACPI for power management if (ACPIInit()) PrintKernelSuccess("System: ACPI initialized\n"); else PrintKernelWarning("System: ACPI initialization failed\n"); @@ -765,13 +771,6 @@ static InitResultT PXS2(void) { return INIT_SUCCESS; } -void StackUsage(void) { - uintptr_t current_sp; - __asm__ __volatile__("mov %%rsp, %0" : "=r"(current_sp)); - size_t used = (uintptr_t)kernel_stack + KERNEL_STACK_SIZE - current_sp; - PrintKernelF("Stack used: %llu/%d bytes\n", used, KERNEL_STACK_SIZE); -} - asmlinkage void KernelMain(const uint32_t magic, const uint32_t info) { if (magic != MULTIBOOT2_BOOTLOADER_MAGIC) { ClearScreen(); @@ -797,7 +796,6 @@ void KernelMainHigherHalf(void) { // Initialize core systems PXS2(); - StackUsage(); #ifdef VF_CONFIG_SNOOZE_ON_BOOT Unsnooze(); diff --git a/kernel/etc/Shell.c b/kernel/etc/Shell.c index b113f1e..61f8657 100644 --- a/kernel/etc/Shell.c +++ b/kernel/etc/Shell.c @@ -187,7 +187,6 @@ static const HelpEntry system_cmds[] = { {"perf", "Show performance stats"}, {"kill ", "Terminate process"}, {"memstat", "Show memory statistics"}, - {"stacksize", "Show stack usage"}, {"lscpu", "List CPU features"}, {"vfc NULL/fork", "Start VFCompositor as another process or on the currently session"}, {"snoozer ", "Snooze messages from PrintKernel"}, @@ -1011,12 +1010,6 @@ void LsCPUHandler(const char* args) { PrintFeatures(); } -void StackSizeHandler(const char* args) { - (void)args; - extern void StackUsage(void); - StackUsage(); -} - static void IsoCpHandler(const char* args) { char* src = GetArg(args, 1); char* dest = GetArg(args, 2); @@ -1295,7 +1288,6 @@ static const ShellCommand commands[] = {\ {"size", SizeHandler}, {"heapvallvl", KHeapValidationHandler}, {"lscpu", LsCPUHandler}, - {"stacksize", StackSizeHandler}, {"vfc", VFCompositorRequestInit}, // internal uses {"cp", CpHandler}, {"mv", MvHandler}, diff --git a/kernel/sched/EEVDF.c b/kernel/sched/EEVDF.c index 8ca201d..80bf677 100644 --- a/kernel/sched/EEVDF.c +++ b/kernel/sched/EEVDF.c @@ -3,7 +3,6 @@ #ifdef VF_CONFIG_USE_CERBERUS #include "Cerberus.h" #endif -#include "Compositor.h" #include "Console.h" #include "Format.h" #include "Gdt.h" @@ -15,6 +14,7 @@ #include "VFS.h" #include "VMem.h" #include "x64.h" +#include "procfs/ProcFS.h" #define offsetof(type, member) ((uint64_t)&(((type*)0)->member)) @@ -878,7 +878,9 @@ int EEVDFSchedInit(void) { token->pcb_hash = EEVDFCalculatePCBHash(idle_proc); FormatA(idle_proc->ProcessRuntimePath, sizeof(idle_proc->ProcessRuntimePath), "%s/%d", RuntimeServices, idle_proc->pid); - + + ProcFSRegisterProcess(0, 0); + process_count = 1; active_process_bitmap |= 1ULL; @@ -1004,7 +1006,9 @@ uint32_t EEVDFCreateSecureProcess(const char* name, void (*entry_point)(void), u #ifdef VF_CONFIG_USE_CERBERUS CerberusRegisterProcess(new_pid, (uint64_t)stack, EEVDF_STACK_SIZE); #endif - + + ProcFSRegisterProcess(new_pid, stack); + // Update counters __sync_fetch_and_add(&process_count, 1); ready_process_bitmap |= (1ULL << slot); @@ -1217,30 +1221,13 @@ static void EEVDFTerminateProcess(uint32_t pid, TerminationReason reason, uint32 eevdf_scheduler.total_processes--; } + ProcFSUnregisterProcess(pid); + rust_spinlock_unlock_irqrestore(eevdf_lock, flags); #ifdef VF_CONFIG_USE_CERBERUS CerberusUnregisterProcess(proc->pid); #endif - -#ifdef VF_CONFIG_PROCINFO_AUTO_CLEANUP - char cleanup_path[256]; - FormatA(cleanup_path, sizeof(cleanup_path), "%s/%d", RuntimeProcesses, proc->pid); - - PrintKernel("EEVDF: Attempting cleanup of "); - PrintKernel(cleanup_path); - PrintKernel(" for PID "); - PrintKernelInt(proc->pid); - PrintKernel("\n"); - int cleanup_result = VfsDelete(cleanup_path, true); - if (cleanup_result != 0) { - PrintKernelError("EEVDF: Cleanup failed with code "); - PrintKernelInt(cleanup_result); - PrintKernel("\n"); - } else { - PrintKernel("EEVDF: Cleanup successful\n"); - } -#endif } // EEVDF's deadly termination function - bypasses all protections @@ -1274,28 +1261,12 @@ static void EEVDFASTerminate(uint32_t pid, const char* reason) { eevdf_scheduler.total_processes--; } + ProcFSUnregisterProcess(pid); + rust_spinlock_unlock_irqrestore(eevdf_lock, flags); -#ifdef VF_CONFIG_PROCINFO_AUTO_CLEANUP - char cleanup_path[256]; - FormatA(cleanup_path, sizeof(cleanup_path), "%s/%d", RuntimeProcesses, proc->pid); - - PrintKernel("EEVDF-AS: Attempting forced cleanup of "); - PrintKernel(cleanup_path); - PrintKernel(" for PID "); - PrintKernelInt(proc->pid); - PrintKernel(" (Reason: "); - PrintKernel(reason); - PrintKernel(")\n"); - - int cleanup_result = VfsDelete(cleanup_path, true); - if (cleanup_result != 0) { - PrintKernelError("EEVDF-AS: Forced cleanup failed with code "); - PrintKernelInt(cleanup_result); - PrintKernel("\n"); - } else { - PrintKernel("EEVDF-AS: Forced cleanup successful\n"); - } +#ifdef VF_CONFIG_USE_CERBERUS + CerberusUnregisterProcess(proc->pid); #endif } diff --git a/kernel/sched/MLFQ.c b/kernel/sched/MLFQ.c index 86cc66b..193064d 100644 --- a/kernel/sched/MLFQ.c +++ b/kernel/sched/MLFQ.c @@ -24,6 +24,7 @@ #include "math.h" #include "stdbool.h" #include "x64.h" +#include "procfs/ProcFS.h" #define offsetof(type, member) ((uint64_t)&(((type*)0)->member)) @@ -359,25 +360,7 @@ static void __attribute__((visibility("hidden"))) TerminateProcess(uint32_t pid, CerberusUnregisterProcess(proc->pid); #endif -#ifdef VF_CONFIG_PROCINFO_AUTO_CLEANUP - char cleanup_path[256]; - FormatA(cleanup_path, sizeof(cleanup_path), "%s/%d", RuntimeProcesses, proc->pid); - - // Add debug output - PrintKernel("System: Attempting cleanup of "); - PrintKernel(cleanup_path); - PrintKernel(" for PID "); - PrintKernelInt(proc->pid); - PrintKernel("\n"); - int cleanup_result = VfsDelete(cleanup_path, true); - if (cleanup_result != 0) { - PrintKernelError("System: Cleanup failed with code "); - PrintKernelInt(cleanup_result); - PrintKernel("\n"); - } else { - PrintKernel("System: Cleanup successful\n"); - } -#endif + ProcFSUnregisterProcess(proc->pid); } @@ -414,25 +397,13 @@ static void __attribute__((visibility("hidden"))) ASTerminate(uint32_t pid, cons } rust_spinlock_unlock_irqrestore(scheduler_lock, flags); -#ifdef VF_CONFIG_PROCINFO_AUTO_CLEANUP - char cleanup_path[256]; - FormatA(cleanup_path, sizeof(cleanup_path), "%s/%d", RuntimeProcesses, proc->pid); - - // Add debug output - PrintKernel("System: Attempting cleanup of "); - PrintKernel(cleanup_path); - PrintKernel(" for PID "); - PrintKernelInt(proc->pid); - - int cleanup_result = VfsDelete(cleanup_path, true); - if (cleanup_result != 0) { - PrintKernelError("System: Cleanup failed with code "); - PrintKernelInt(cleanup_result); - PrintKernel("\n"); - } else { - PrintKernel("System: Cleanup successful\n"); - } + +#ifdef VF_CONFIG_USE_CERBERUS + CerberusUnregisterProcess(proc->pid); #endif + + ProcFSUnregisterProcess(proc->pid); + PrintKernelSuccessF("Astra: Terminated PID %d with reason %s\n", pid, reason); } @@ -1110,17 +1081,8 @@ uint32_t MLFQCreateSecureProcess(const char * name, void (*entry_point)(void), u CerberusRegisterProcess(new_pid, (uint64_t)stack, STACK_SIZE); #endif -#ifdef VF_CONFIG_PROCINFO_CREATE_DEFAULT - if (!VfsIsDir(processes[slot].ProcessRuntimePath)) { - int rc = VfsCreateDir(processes[slot].ProcessRuntimePath); - if (rc != 0 && !VfsIsDir(processes[slot].ProcessRuntimePath)) { - PrintKernelError("ProcINFO: failed to create dir for PID "); - PrintKernelInt(processes[slot].pid); - PrintKernel("\n"); - /* Non-fatal: ProcINFO features degrade for this process */ - } - } -#endif + ProcFSRegisterProcess(new_pid, stack); + // Initialize CPU burst history with reasonable defaults for (int i = 0; i < CPU_BURST_HISTORY; i++) { processes[slot].cpu_burst_history[i] = QUANTUM_BASE / 2; @@ -1206,20 +1168,12 @@ void MLFQCleanupTerminatedProcess(void) { proc->ipc_queue.count = 0; // Clear process structure - this will set state to PROC_TERMINATED (0) - uint32_t pid_backup = proc->pid; // Keep for logging FastMemset(proc, 0, sizeof(MLFQProcessControlBlock)); // Free the slot FreeSlotFast(slot); process_count--; cleanup_count++; - - PrintKernel("System: Process PID "); - PrintKernelInt(pid_backup); - PrintKernel(" cleaned up successfully (state now PROC_TERMINATED=0)\n"); - char cleanup_path[256]; - FormatA(cleanup_path, sizeof(cleanup_path), "%s/%d", RuntimeProcesses, pid_backup); - VfsDelete(cleanup_path, true); } rust_spinlock_unlock_irqrestore(scheduler_lock, flags); } @@ -1730,9 +1684,7 @@ int MLFQSchedInit(void) { idle_proc->scheduler_node = NULL; idle_proc->creation_time = MLFQGetSystemTicks(); FormatA(idle_proc->ProcessRuntimePath, sizeof(idle_proc->ProcessRuntimePath), "%s/%d", RuntimeServices, idle_proc->pid); -#ifdef VF_CONFIG_PROCINFO_CREATE_DEFAULT - if (VfsCreateDir(idle_proc->ProcessRuntimePath) != 0) PANIC("Failed to create ProcINFO directory"); -#endif + ProcFSRegisterProcess(0, 0); // Securely initialize the token for the Idle Process MLFQSecurityToken* token = &idle_proc->token; token->magic = SECURITY_MAGIC;