Commit Graph

216 Commits

Author SHA1 Message Date
Drew Galbraith 30b6511467 [Zion] Add a AddressSpaceUnmap syscall to free memory. 2023-11-19 18:55:44 -08:00
Drew Galbraith e668428d9d [Zion] Move Memory Mappings to a dedicated tree impl. 2023-11-19 18:45:13 -08:00
Drew Galbraith 7d48dd2b8b [Zion] Add the ability to delete a capability. 2023-11-19 17:53:56 -08:00
Drew Galbraith 2e08eb76ff [zion] Move process.CheckState() to prevent infinite loop on thread exit. 2023-11-19 17:31:01 -08:00
Drew Galbraith 70bdb822a7 [Zion] Add implementation of KernelVmm::FreeKernelStack. 2023-11-19 17:29:09 -08:00
Drew Galbraith 308dd6a203 [Zion] Add a framework for better process exit. 2023-11-16 23:03:27 -08:00
Drew Galbraith aa2d80b557 [Zion] Move ProcessManager to map as well. 2023-11-16 22:17:11 -08:00
Drew Galbraith 6e227e1cf6 [Zion/Glacier] Add a HashMap to store process capabilities. 2023-11-16 22:12:00 -08:00
Drew Galbraith e1dc790155 [Zion] Clear interrupts on panic to actually hault the machine. 2023-11-16 22:10:54 -08:00
Drew Galbraith e4deca716c [Zion] Use range based for loop on LinkedList as POC. 2023-11-15 18:50:58 -08:00
Drew Galbraith 46d02e5eae [Zion] Remove sleeping messages. 2023-11-15 16:27:09 -08:00
Drew Galbraith c080c61398 [Denali] Reduce noise on AHCI interrupt. 2023-11-15 16:21:19 -08:00
Drew Galbraith e642f3900f [Zion] Print less about acpi on boot. 2023-11-15 16:09:36 -08:00
Drew Galbraith 9e76c81e97 [Zion] Move Kernel Stack Memory constants to separate file. 2023-11-15 15:55:24 -08:00
Drew Galbraith 07e6e3028d [Zion] Access the KernelStackManager through the VMM. 2023-11-15 15:38:25 -08:00
Drew Galbraith c5b9d20c7e [Zion] Remove early_dbgln since dbgln no longer allocs. 2023-11-15 15:19:02 -08:00
Drew Galbraith 20d6d2aaaf [Zion] Introduce the Kernel VMM to centralize allocs. 2023-11-15 15:15:31 -08:00
Drew Galbraith 0b47e3b7fc [Zion] Track used vs free physical memory. 2023-11-15 14:53:05 -08:00
Drew Galbraith 8e95a11907 [Zion] Move the physical memory manager to the LinkedList class. 2023-11-15 14:44:16 -08:00
Drew Galbraith 92d8a02291 [Zion] Cleanup memory debug statistics slightly. 2023-11-15 13:10:53 -08:00
Drew Galbraith 10d16e129f [Zion] Use a slab allocator for 64 byte and 128 byte allocs.
This has no effect on page usage for now (each uses a small amount of
pages so has some overhead.

However it does reduce the active allocations from
234 -> 146 (64B)
61 -> 51 (128B)
2023-11-15 13:06:14 -08:00
Drew Galbraith cc16210e90 [Zion] Use slab allocators immediately during heap init. 2023-11-15 13:02:34 -08:00
Drew Galbraith 659f122c9e [Zion] Free memory that was allocated with the slab allocator.
This reduces the number of active allocs by ~ 200.
Size 8: 142 -> 2
Size 16: 319 > 313
Size 32: 364-> 312
2023-11-15 12:53:14 -08:00
Drew Galbraith 6d27ee5dc5 [Zion] Add more debug information about kernel heap usage.
This will be helpful as we work to improve it.

Without deallocations, we currently stand at the following alloc numbers
8 - 142
16 - 319
32 - 364

unsized - 305

total page usage including slabs is 12.
2023-11-15 12:36:18 -08:00
Drew Galbraith 4657c46f73 [Zion] Fix kernel heap distribution calculation. 2023-11-15 12:14:58 -08:00
Drew Galbraith d71d543b2a [Zion] Move to a kernel slab allocator that will allow easier dealloc. 2023-11-15 12:04:35 -08:00
Drew Galbraith e5568450c2 [Zion] Make kernel slab allocation failures less chatty.
We started to hit this constraint but the allocators are due for
a redesign that actually does deallocation soon.
2023-11-15 09:45:37 -08:00
Drew Galbraith 52142afeb8 [Zion] Add proc prefix without allocation 2023-11-14 21:41:35 -08:00
Drew Galbraith fa6a5949b2 [Zion] Pass the framebuffer info to yellowstone init process. 2023-11-09 11:20:41 -08:00
Drew Galbraith 8d10f19312 [Glacier][Zion] Add a fix sized string builder to allow non-alloc debug. 2023-11-09 09:07:32 -08:00
Drew Galbraith 601f29c324 [Glacier] Add a specific VariableStringBuilder for StrFormat. 2023-11-09 08:52:30 -08:00
Drew Galbraith a745f45b5d [Zion] Add a method to dump the bootloader memory regions. 2023-11-08 08:07:57 -08:00
Drew Galbraith 69aced2220 [Zion] Move to StrFormat for debug line. 2023-11-05 09:24:09 -08:00
Drew Galbraith 4af19d010f [Zion] Add an early debug method without allocations. 2023-11-05 08:48:41 -08:00
Drew Galbraith 85564b018d [Zion] Add todo comment for storing memory mappings in the address space. 2023-11-05 05:59:45 -08:00
Drew Galbraith a16dcc2aa9 [Zion] Use a binary tree to store address space mappings. 2023-11-03 19:47:39 -07:00
Drew Galbraith d9df1212b7 [Zion] Pass data to message queue as IpcMessage obj. 2023-11-03 00:37:53 -07:00
Drew Galbraith d7af2e3f4f [Zion] Return the IpcMessage up to the syscall level. 2023-11-03 00:12:28 -07:00
Drew Galbraith d2c77e1d18 [Zion] Move away from storing pointers to IpcMessages. 2023-11-02 23:51:52 -07:00
Drew Galbraith 59f147193a [Zion] Store IPC capabilities in a vector rather than list. 2023-11-02 23:44:15 -07:00
Drew Galbraith 4c09a9d019 [Zion] Move to a general IpcMessage object for Ipc. 2023-11-02 23:40:23 -07:00
Drew Galbraith 277b0d3ccc [Zion] Use the glacier ArrayView class for sending IPC msgs. 2023-11-02 23:31:08 -07:00
Drew Galbraith 1643f7b4cc [Zion] Update FIXME in threading. 2023-11-02 22:36:48 -07:00
Drew Galbraith 78624d5291 [Zion] Immediately schedule enqueued threads if we are sleeping. 2023-11-02 22:28:08 -07:00
Drew Galbraith c63a54d6b1 [Zion] Validate that started threads are in user space. 2023-11-02 22:23:32 -07:00
Drew Galbraith f31652b981 Add a way to restrict permissions on cap duplication. 2023-11-02 22:12:55 -07:00
Drew Galbraith 7dd10a3e53 [Zion] Remove dead ZMessage struct. 2023-11-02 21:57:29 -07:00
Drew Galbraith e66706d381 [Glacier] Convert ErrorCode into an Enum. 2023-11-02 21:55:12 -07:00
Drew Galbraith 4c04f9d561 [Zion] Add a mutex object with appropriate syscalls. 2023-10-25 14:47:45 -07:00
Drew Galbraith 05e12aaa7d [Yellowstone] Move registration service to the main yellowstone service 2023-10-24 23:42:49 -07:00