Commit Graph

41 Commits

Author SHA1 Message Date
Ashwin Naren
1793e24cb8 bump ext4plus 2026-04-16 21:06:52 -07:00
Matthew Leach
3f87c1f3d9 libkernel: add feature gates
Add feature gates for different libkernel features. Specifically:

 - alloc: Memory allocation APIs.
 - paging: Paging related types & functions.
 - fs: Filesystem implementations.
 - proc_vm: Process VM management.
 - kbuf: Circular, page-backed, kernel buffer.

Also gate crate dependencies bsaed upon selected features.
2026-04-13 11:37:57 -07:00
Ashwin Naren
7edfe622f5 Use as_any to downcast inodes at will and bump ext4plus 2026-03-23 21:52:36 -07:00
Matthew Leach
5ebfc29cd2 sched: introduce Work as the unified scheduleable unit
Refactor the scheduler so all scheduleable work is wrapped in Arc<Work>,
replacing the previous per-CPU wait_q design where sleeping tasks were
bound to a specific CPU. Wakers now hold direct Arc<Work> references and
can re-enqueue tasks on any CPU upon wakeup.

Key changes:

- Add Work struct wrapping OwnedTask with an AtomicTaskState and
  scheduler metadata (SchedulerData), replacing the old SchedulableTask.
  Remove Task::state (Arc<SpinLock<TaskState>>). Work::state is now the
  single source of truth for task state.

- Rewrite the run queue using BinaryHeap-based eligible/ineligible split
  (EEVDF) with a dedicated VClock, replacing the BTreeMap linear scan.
  Extract vclock into its own module.

- Rewrite wakers to hold Arc<Work> directly instead of looking up tasks
  by TaskDescriptor from TASK_LIST.

- Replace lock-based sleep transitions in uspc_ret with atomic CAS
  (try_sleep_current) that correctly detects concurrent Woken state.

- Simplify least-tasked-CPU metric to use only run-queue weight, since
  sleeping tasks are no longer bound to any CPU.

- Add current_work() accessor.
2026-03-12 10:53:22 +00:00
Ashwin Naren
654b31efc6 bump to 0.1.0-alpha.5 2026-03-11 00:32:33 -07:00
Ashwin Naren
4212b85e6c update ext4plus to 0.1.0-alpha.4 2026-03-10 17:08:46 -07:00
Ashwin Naren
54265fdae0 support for ARM PL031 RTC 2026-03-06 23:51:04 -08:00
Ashwin Naren
9fea27a427 dependency updates (#248) 2026-03-06 23:47:10 -08:00
Matthew Leach
65517c6641 Add BLAKE2s entropy pool with per-CPU ChaCha20 CSPRNG
Replace the single `SmallRng` with a proper two-layer RNG architecture:

- Global BLAKE2s-256 entropy pool that accumulates entropy and gates
  seed extraction behind a 256-bit threshold.
- Per-CPU ChaCha20Rng instances that are lazily seeded from the pool on
  first use and periodically reseed every 1 MB by XOR-ing a fresh BLAKE2
  extract with 32 bytes of their own output.

The /dev/random chardev uses fill_random_bytes directly instead of
routing through the syscall layer.
2026-03-07 07:33:15 +00:00
Ashwin Naren
a3a324148e Socket implementation (#127) 2026-03-06 18:54:36 -08:00
Ashwin Naren
1523b9ccef switch to crates.io ext4plus 2026-03-04 15:48:18 -08:00
Ashwin Naren
4588e61aef GPU support with virtio driver 2026-03-04 12:13:01 -08:00
Ashwin Naren
bd5235fc71 fix rename semantics 2026-02-26 23:14:31 -08:00
Ashwin Naren
93e540bc5c support symlink creation 2026-02-26 23:14:31 -08:00
Ashwin Naren
1d5fb030b4 support directory creation 2026-02-26 23:14:31 -08:00
Ashwin Naren
c77ea09264 support file writing beyond block boundaries 2026-02-26 23:14:31 -08:00
Ashwin Naren
d21c449b5c support file creation 2026-02-26 23:14:31 -08:00
Ashwin Naren
28e3f4ab02 support linking and unlinking 2026-02-26 23:14:31 -08:00
Ashwin Naren
b28d2baa7f bump dependencies and use workspace dependencies when possible 2026-02-26 23:14:31 -08:00
Ashwin Naren
c6ba98decf initial macro system 2026-02-20 14:27:39 -08:00
Andrew Mackenzie
b142fb74ec Merge pull request #227 from andrewdavidmackenzie/master
Rework uname to avoid hardcoded datetime and add unit tests

Restructure `uname` so that:
- there is an internal function that does the main logic and can be tested by unit tests
- Generate an env var in build.rs that is the actual build datetime timestamp
- Avoid hardcoded date in the version string
- Use the timestamp in the building of `uname` response, so the data is the actual build time
- add a simple unit test for the sysname field
- add more complex test for the version field that checks the date formatting (not exhaustively)

NOTE: The build timestamp can be used by any other function, syscall or part of the code if required.
2026-02-20 14:23:59 -08:00
Ashwin Naren
901a2b3303 update ext4-view fork 2026-02-12 14:18:39 -08:00
Ashwin Naren
37c6217099 Merge pull request #192 from arihant2math/usertest-updates 2026-02-09 13:59:18 -08: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
4c69c969e2 report and edit nlinks 2026-02-07 16:37:41 -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
Ashwin Naren
01237ddf6f better error reporting 2026-01-30 15:34:56 -08:00
Ashwin Naren
2d34ebcef9 procfs refactor 2026-01-25 10:50:02 -08:00
Ashwin Naren
8df12a027c implement truncation 2026-01-18 01:17:19 -08:00
Ashwin Naren
8908b1e332 use macro for registration 2026-01-17 10:24:05 -08:00
Ashwin Naren
ff13b392f1 some support for ext4 writing 2026-01-13 16:47:51 -08:00
Ashwin Naren
15c70a1aea ext4 timestamps 2026-01-10 10:11:52 -08:00
Ashwin Naren
477215e641 optimize lookup 2026-01-02 17:01:02 -08:00
Ashwin Naren
9d8379c311 fix readdir 2026-01-02 17:01:02 -08:00
Ashwin Naren
b5138c30f9 working ext4 2026-01-02 17:01:02 -08:00
Ashwin Naren
74bc44a317 update dependencies 2025-12-29 12:03:32 -08:00
Ashwin Naren
c4f1d9acf5 support timeouts for futex 2025-12-23 13:08:37 -08:00
Ashwin Naren
78440f292b update dependencies 2025-12-23 00:01:45 -08:00
Ashwin Naren
b05c606a2a testing 2025-12-11 20:09:47 +00:00
Matthew Leach
8038a6c4e2 syscalls: sys_getrand: implement
Implement sys_getrand
2025-11-28 21:24:37 +00:00
Matthew Leach
ca6fdd0da5 Initial Commit
Initial commit of arm64 bring-up code, kernel core (libkernel) and build
infrastructure.
2025-11-16 20:15:01 +00:00