Commit Graph

359 Commits

Author SHA1 Message Date
Andrew Mackenzie
dbeb4eab96 Add an explicit quit command at the end of the symlink commands for debugfs 2026-02-15 15:54:30 +01:00
Andrew Mackenzie
6154709539 Add additional macos dependencies required, and details of how to configure them. 2026-02-15 15:54:05 +01:00
Matthew Leach
a55ecd1e33 Merge pull request #210 from hexagonal-sun/doc-fixes
Doc fixes
2026-02-13 12:19:38 +00:00
Matthew Leach
0b2391ffd5 doc: README: updates
Update readme and demo gif to show newer features.
2026-02-13 11:53:37 +00:00
Ashwin Naren
747da3324e Merge pull request #206 from arihant2math/settimeofdayfix
Fix `EFAULT` in settimeofday
2026-02-12 14:35:03 -08:00
Ashwin Naren
6d0a4370fb fix efault in settimeofday 2026-02-11 09:47:44 -08:00
Ashwin Naren
3d33578533 Merge pull request #187 from arihant2math/cap-raise
prctl: implement `AmbientCapOp::Raise`
2026-02-09 23:24:52 -08:00
Matthew Leach
141fbf8a1b Merge pull request #202 from hexagonal-sun/slab-alloc-stress-test 2026-02-10 07:21:18 +00:00
Ashwin Naren
2855ef7a51 Merge pull request #201 from arihant2math/hostname
Store hostname and allow for updates via `sys_sethostname`
2026-02-09 16:48:10 -08:00
Ashwin Naren
e65d51e48a address review 2026-02-09 16:40:53 -08:00
Ashwin Naren
eb84a1ec6d Merge pull request #198 from arihant2math/more-fnctl 2026-02-09 13:59:40 -08:00
Ashwin Naren
8281ea798f Merge pull request #197 from arihant2math/sysfs 2026-02-09 13:59:28 -08:00
Ashwin Naren
37c6217099 Merge pull request #192 from arihant2math/usertest-updates 2026-02-09 13:59:18 -08:00
Matthew Leach
9f21618058 libkernel: memory: slab: heap: new
Add a new module which implements the high-level heap logic (implements
`GlobalAlloc`) for the slab allocator.

Also implement a multi-threaded stress test of the heap ensuring
concurrent allocation is unique (doesn't corrupt other allocs) and all
memory is free'd back to the `FrameAllocator` when all caches are
purged.
2026-02-09 07:00:13 +00:00
Ashwin Naren
ef10631dc4 Merge pull request #195 from hexagonal-sun/slab-allocator
slab allocator
2026-02-08 16:51:29 -08:00
Ashwin Naren
c07dd2140c implement hostname properly 2026-02-08 00:39:55 -08:00
Ashwin Naren
75afc15bc7 fix typo 2026-02-07 18:26:28 -08:00
Ashwin Naren
479926f767 stub cgroup fs 2026-02-07 18:25:30 -08:00
Ashwin Naren
4c69c969e2 report and edit nlinks 2026-02-07 16:37:41 -08:00
Ashwin Naren
e9bcc1b10d implement fcntl F_SETFL 2026-02-07 13:53:34 -08:00
Ashwin Naren
157c29104f formatting 2026-02-07 00:31:23 -08:00
Ashwin Naren
ab93101a9f implement STATX_MNT_ID for sys_statx 2026-02-07 00:31:23 -08:00
Ashwin Naren
8046d746dd implement more of sys_power 2026-02-07 00:31:23 -08:00
Matthew Leach
1906f1be5e arch: arm64: memory: heap: new
Add a new heap module which integrates the per-cpu cache and
`SlabAllocator` into a usable `GlobalAlloc` for the kernel.
2026-02-07 08:26:35 +00:00
Matthew Leach
0f0febdad0 arch: arm64: exceptions: use SP_EL0 as scratch reg
When detecting stack overflow in the kernel exception handler, use
`SP_EL0`, rather than `TPIDR_EL1` as the scratch register.  This allows
us to use the `TPIDR_EL1` register as a CPU-banked register for other
purposes.

Use of `SP_EL0` is safe here since the stack overflow check occurs
during kernel exceptions and SP_EL0 will be restored by the user-space
context restore logic, overriding the clobber.
2026-02-07 08:26:35 +00:00
Matthew Leach
424d6b126e libkernel: memory: slab: cache: new
Add a new per-cpu slab cache for caching slab allocations on a given
CPU.
2026-02-07 08:26:35 +00:00
Matthew Leach
1bdaaef14a libkernel: memory: slab: allocator: new
Add a new slab allocator implementation. The `SlabAllocator` manages
lists of slabs for each size class.
2026-02-07 08:26:35 +00:00
Matthew Leach
a2f636cebb libkernel: memory: slab: slab: new
Add a new module for managing objects within a slab. The `Slab` struct
manages objects of a given set within a contiguous set of pages. It is
the handle to the underlying memory, allowing for objects to be
allocated, and free'd. It manages a free list of 'indexes' within the
object slots themselves.
2026-02-07 08:26:35 +00:00
Matthew Leach
c0ecac05f3 libkernel: memory: PageAllocGetter: return ref to allocator
Rather than returning a reference to the `OnceCell` wrapping the
allocator, return a static reference to the allocator itself. This
allows flexibility for how the allocator is wrapped.
2026-02-07 08:26:35 +00:00
Matthew Leach
1b8ef1bc88 libkernel: memory: allocs: move FrameList impl into frame
Move the FrameList logic out of the physical memory allocator into its
own module. This allows `FrameList` to be shared between the physical
memory allocator and the slab allocator.
2026-02-07 08:26:35 +00:00
Matthew Leach
972f023edc libkernel: memory: reorganise allocators
Create a new submodule within `memory`, `allocators` which contains all
memory allocators. Also split out the `Frame` struct from the `pg_alloc`
module, allowing it to be used by other modules.
2026-02-07 08:26:35 +00:00
Ashwin Naren
c394e18231 tmp 2026-02-07 00:20:37 -08:00
Ashwin Naren
ec0ffbfb25 formatting 2026-01-30 19:46:12 -08:00
Matthew Leach
fc873a9b67 arm64: mem: AddresSpace: impl Drop
Implement the Drop trait on `Arm64ProcessAddressSpace` freeing up all
pages which have been used by this address space.
2026-01-30 19:39:59 -08:00
Matthew Leach
8a84ba0fb9 libkernel: arm64: pg_tables; pg_tear_down: new
Add a new module which walks the page table hierarchy for a given
address space and applies a freeing closure to every allocated frame.
2026-01-30 19:39:59 -08:00
Matthew Leach
c49396ed35 libkernel: arm64: pg_tables: get_idx: new
Add a function which returns a descriptor from a page table by it's
numerical index.
2026-01-30 19:39:59 -08:00
Ashwin Naren
62709be4d6 cmdline inode 2026-01-30 19:36:42 -08:00
Ashwin Naren
4409aeddf5 fix failures leading to pass 2026-01-30 15:37:53 -08:00
Ashwin Naren
d042759126 more fs testing 2026-01-30 15:35:34 -08:00
Ashwin Naren
01237ddf6f better error reporting 2026-01-30 15:34:56 -08:00
Ashwin Naren
ac20045a08 use module path 2026-01-30 15:27:13 -08:00
Ashwin Naren
04ac1e8783 implement sys_waitid 2026-01-30 08:31:26 -08:00
Ashwin Naren
ba7c517685 prctl: implement AmbientCapOp::Raise 2026-01-29 14:30:24 -08:00
Matthew Leach
64469bb79c Merge pull request #185 from hexagonal-sun/hardware-smp-fixes 2026-01-28 09:14:25 +00:00
Matthew Leach
462de189b0 arm64: boot: secondaries: ensure WFI doesn't trap
The WFI insn is set not to trap on the primary core. Ensure it's also
set on the secondary cores too.
2026-01-28 08:00:01 +00:00
Matthew Leach
ba53418382 arm64: secondary: ensure boot_ctx is flushed to RAM
When the secondary boots and derefes the boot_ctx pointer passed in as a
parameter, it reads NULL, causing the secondary to end up stuck in an
exception loop. The data is sat in the primary core's cache and hasn't
been flushed to RAM. Since the secondary starts without the MMU (and
caches) enabled, the CCI doesn't kick in and we read stale data.

Manually flush the boot_ctx data to RAM before waking up the secondary.
2026-01-28 08:00:01 +00:00
Matthew Leach
d92945379a arm64: memory: flush_to_ram: new
Create a new function which takes a pointer to an object `T` and ensures
that the data is flushed from the caches to the point of
coherency (RAM).
2026-01-28 08:00:01 +00:00
Ashwin Naren
253a907c62 fix tests 2026-01-27 00:31:47 -08:00
Ashwin Naren
17b347cdc4 naming changes 2026-01-27 00:31:47 -08:00
Ashwin Naren
04f015848b percpu refactor 2026-01-27 00:31:47 -08:00