Commit Graph

250 Commits

Author SHA1 Message Date
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
Drew Galbraith b516087922 [Zion] Add the ability to pass capabilities via endpoint call. 2023-10-24 23:32:05 -07:00
Drew Galbraith 5b781bb394 Update READMEs and TODOs 2023-10-24 22:56:45 -07:00
Drew Galbraith 2b27af5814 [Yellowstone] Move to yunq definition for yellowstone server. 2023-10-24 18:24:26 -07:00
Drew Galbraith ee603b7478 [zion] Add a basic slab allocator to the kernel.
Don't free from the slab allocator yet but allocations appear to work.
2023-08-02 00:54:39 -07:00
Drew Galbraith e3a425e274 [zion] Use a separate stack for PF and GP faults in the kernel. 2023-08-01 23:11:12 -07:00
Drew Galbraith 259c64ef2a [zion] Check if scheduler exists in PF handler before trying to resolve 2023-08-01 23:10:20 -07:00
Drew Galbraith 35b1844862 [zion] Move all APIC functions into a global class. 2023-08-01 22:38:40 -07:00
Drew Galbraith f8de60e2dd [zion] Move more initialization into the ApicTimer class. 2023-08-01 21:48:20 -07:00
Drew Galbraith d99624daf6 [zion] Move to using the LAPIC timer over the PIT. 2023-08-01 20:18:47 -07:00
Drew Galbraith f0add6e0c3 [zion] Enforce cap transmit permissions in more places. 2023-08-01 18:43:48 -07:00
Drew Galbraith 4e9ad6a516 [zion] Begin requiring capability transmit permission.
As a first pass require the permission when passing a capability to a
new process.
2023-08-01 18:37:20 -07:00
Drew Galbraith f0a27d30be [zion] Enfore Duplication permissions on capabilities. 2023-08-01 18:30:24 -07:00
Drew Galbraith 1364fbed9f [zion] Move to default permissions being supplied by KernelObjects 2023-08-01 18:22:41 -07:00
Drew Galbraith 48c6e5b3a4 [zion] Add a method for duplicating and scoping down VMMOs.
Use the AHCI section of the PCI config as an example POC of this.

We can now pass a memory capability instead of just the physical
address.
2023-08-01 17:46:26 -07:00
Drew Galbraith 8f84f8c3ca [zion] Remove temp PCI Memory Object create function.
Pass the PCI memory space to the yellowstone init process instead.
2023-08-01 17:13:19 -07:00
Drew Galbraith 847d37addc [zion] Add info about APIC mapping 2023-08-01 11:19:48 -07:00
Drew Galbraith 3110087498 [zion] Don't dump process states on sleep 2023-08-01 10:42:53 -07:00
Drew Galbraith 02e6b49d90 [glacier] Add a vector class 2023-06-26 15:46:03 -07:00
Drew Galbraith 64d355b20d [glacier] Move LinkedList to glacier. 2023-06-26 15:01:55 -07:00
Drew Galbraith 7f2530bc15 [zion] Rename cmake zion_lib to zion_stub. 2023-06-26 11:57:19 -07:00
Drew Galbraith 36d82370c1 [zion] Add a thread wait syscall 2023-06-22 02:17:50 -07:00
Drew Galbraith f0e8ce14a4 [victoria] Create and start VictoriaFalls process 2023-06-22 00:22:59 -07:00
Drew Galbraith dc63084d61 [zion] Move synchronization to the message queue 2023-06-21 23:57:23 -07:00
Drew Galbraith 9dd457391c [zion] Move IPC objects to share code 2023-06-21 23:47:45 -07:00
Drew Galbraith 58df2c0ed2 [zion] Move ipc syscalls to one file to prep refactor 2023-06-21 23:20:56 -07:00
Drew Galbraith c064af5fa7 Endpoint syscalls implemented 2023-06-21 23:14:42 -07:00
Drew Galbraith 69501bfe01 [all] Add stub for new Endpoint kernel object 2023-06-21 21:43:27 -07:00
Drew Galbraith 0ec2fa3e76 [glacier] Move Pair to glacier. 2023-06-21 20:47:40 -07:00
Drew Galbraith c2dfe17363 [zion] Use ErrorOr in PciConfiguration 2023-06-21 18:46:06 -07:00
Drew Galbraith 0b86a94f14 Migrate to error constants in glacier 2023-06-21 18:28:54 -07:00
Drew Galbraith 3ab9b4d818 [zion] Move Channel and Port blocked threads to IntrusiveList. 2023-06-21 16:34:30 -07:00
Drew Galbraith a99096b0ff [zion] Move the scheduler to the IntrusiveList for runnable threads 2023-06-21 16:28:42 -07:00
Drew Galbraith e1af79b975 [zion/glacier] Move RefPtr to glacier. 2023-06-21 15:07:40 -07:00
Drew Galbraith 8bcb574677 [zion/glacier] Move RefCounted to glacier. 2023-06-21 14:52:40 -07:00
Drew Galbraith 56eae3d4e5 [zion/glacier] Move SharedPtr to glacier 2023-06-21 14:48:29 -07:00
Drew Galbraith f3443cf4de [zion] Link against glacier as a POC 2023-06-21 14:42:37 -07:00
Drew Galbraith 172bf51db7 [zion] Move capability validation to capability.h 2023-06-20 15:50:49 -07:00
Drew Galbraith 93cf8f2740 [zion] Cleanup syscall entrance. 2023-06-20 15:40:21 -07:00
Drew Galbraith d60b2bdc61 [zion] Move channel to use the message queue. 2023-06-20 15:36:17 -07:00
Drew Galbraith fe1641ac38 [zion] Create a message queue to be shared between the port and channel 2023-06-20 15:29:32 -07:00
Drew Galbraith 1edd5023ce [zion] Move the final syscalls to the new format. 2023-06-20 15:03:33 -07:00
Drew Galbraith bd431b94ce [zion] Move port calls to new syscall process. 2023-06-20 14:55:54 -07:00
Drew Galbraith 77bb3acfb4 [zion] Move channel syscalls to new format. 2023-06-20 14:41:44 -07:00
Drew Galbraith 1a70ce4855 [zion] Move memory syscalls to the new format 2023-06-20 14:26:06 -07:00
Drew Galbraith f755cd38fe [zion] Move thread syscalls to the new format. 2023-06-20 14:10:28 -07:00
Drew Galbraith c6dd0bbb0f [zion] Migrate process syscalls to new format. 2023-06-20 14:01:43 -07:00
Drew Galbraith 76107b7db7 [zion] Handle syscall cases by macro as well. 2023-06-20 13:50:18 -07:00
Drew Galbraith 5fc7296b20 [zion] POC for defining syscalls using macros 2023-06-20 13:43:12 -07:00
Drew Galbraith 4fef54084f [zion] Remove legacy capability method. 2023-06-19 23:48:06 -07:00
Drew Galbraith 164309eada [zion] Add utility to zero out a page when allocating one. 2023-06-19 23:44:33 -07:00
Drew Galbraith 0b9e0adfbb [zion] Remove legacy capability table method. 2023-06-19 23:32:49 -07:00
Drew Galbraith 1cebe547c0 [zion] Allow the sleep thread to be preempted.
We can't yield it when the next thread is unblocked for now because it
may still be holding a lock that the prempted thread is waiting on.
2023-06-19 21:47:37 -07:00
Drew Galbraith 27f540e9ae Move ipc calls to take a void* 2023-06-19 18:39:46 -07:00
Drew Galbraith 685070d65e Get rid of the type field on zmessage 2023-06-17 02:01:21 -07:00
Drew Galbraith 7bd6aa42b0 [zion] Declare z_cap_t and start replacing existing types 2023-06-17 01:53:19 -07:00
Drew Galbraith 5e99dbf7d1 Refactor all Zion decls into one header 2023-06-17 01:45:53 -07:00
Drew Galbraith 7dcbbd671e [denali] Get all caps from the init port.
This allows us to remove the bootstrap capabilities for good woo hoo!
2023-06-17 01:30:47 -07:00
Drew Galbraith 6e86ce67f0 [zion] Fix capability permission issues 2023-06-17 01:24:07 -07:00
Drew Galbraith 424b032146 [zion] Remove old debug messages 2023-06-17 01:09:48 -07:00
Drew Galbraith bbc31a0d2b [zion] Return proper code from PortCreate 2023-06-17 01:05:51 -07:00
Drew Galbraith 857b7fae03 [zion] Add a port send syscall 2023-06-17 01:05:10 -07:00
Drew Galbraith cc191cd6bb [zion] Add a syscall to duplicate capabilities 2023-06-17 00:59:44 -07:00
Drew Galbraith 378ced6b6c [zion] Add a port create syscall 2023-06-17 00:31:02 -07:00
Drew Galbraith 09ac87e6f5 [yellowstone] Recieve all caps via init port. 2023-06-17 00:17:43 -07:00
Drew Galbraith 2ea1f90690 [zion] Add a direct port write for the kernel 2023-06-17 00:07:58 -07:00
Drew Galbraith 0a909eae0e Print exit codes in hex 2023-06-17 00:03:09 -07:00