Commit Graph

435 Commits

Author SHA1 Message Date
Matthew Leach
172ac28126 Merge pull request #244 from arihant2math/fix-arch-ls
Distinguish between file permissions and file mode
2026-03-03 07:33:21 +00:00
Matthew Leach
7c007b7c9f Merge pull request #243 from arihant2math/fix-justfile
Fix justfile
2026-03-03 07:31:24 +00:00
Ashwin Naren
edca499714 distinguish between file permissions and file mode 2026-03-02 11:53:06 -08:00
Ashwin Naren
28c1ca3fa3 fix justfile 2026-03-02 09:48:28 -08:00
Matthew Leach
d164e06558 Merge pull request #241 from TroyNeubauer/handle-sigsev 2026-03-02 06:17:23 +00:00
Troy Neubauer
15605b11ef no pub on location 2026-03-01 04:26:49 -08:00
Troy Neubauer
5cdeb82dfa clippy 2026-03-01 04:23:47 -08:00
Troy Neubauer
c180f1ca24 stack overflow test 2026-03-01 03:59:38 -08:00
Troy Neubauer
1bcd8b90ae Merge remote-tracking branch 'upstream/master' into handle-sigsev 2026-03-01 03:32:47 -08:00
Matthew Leach
912dc0f713 Merge pull request #239 from arihant2math/get-process-api 2026-03-01 05:55:17 +00:00
Matthew Leach
0105caf8dc Merge pull request #238 from TroyNeubauer/add-nix-shell 2026-03-01 05:53:27 +00:00
Ashwin Naren
ce27c4bc36 add find_process_by_tgid 2026-02-28 17:09:07 -08:00
Troy Neubauer
fc3e39fb54 Merge branch 'add-nix-shell' of github.com:TroyNeubauer/moss-kernel into add-nix-shell 2026-02-28 16:34:15 -08:00
Troy Neubauer
d28959937f update to 2-24 toolchain to avoid rust-analyzer #21715 2026-02-28 16:32:10 -08:00
Troy Neubauer
17769108dd Update flake.nix
Co-authored-by: Ashwin Naren <arihant2math@gmail.com>
2026-02-28 13:16:41 -08:00
Troy Neubauer
6a0fb71cb6 Update flake.nix
Co-authored-by: Ashwin Naren <arihant2math@gmail.com>
2026-02-28 13:16:25 -08:00
Troy Neubauer
07044d1c4c add nix shell 2026-02-28 12:11:59 -08:00
Troy Neubauer
6a7c40c545 un-register rust's SIGSEV handler in test 2026-02-28 11:53:08 -08:00
Matthew Leach
e114a64a82 Merge pull request #237 from arihant2math/sigsev
Handle SIGSEVs correctly
2026-02-28 19:19:46 +00:00
Troy Neubauer
704f4e05f0 segfault properly 2026-02-28 10:32:05 -08:00
Ashwin Naren
c35982c9ea deliver signal to process on sig sev instead of panicking 2026-02-27 17:24:24 -08:00
Matthew Leach
7ab93dc0c1 Merge pull request #232 from arihant2math/dep-bump
Bump dependencies + more ext4 writing
2026-02-27 21:35:22 +00:00
Matthew Leach
5dda21c14a Merge pull request #235 from arihant2math/python-qemu-runner
Replace `qemu-runner.sh` with python script
2026-02-27 21:33:10 +00:00
Ashwin Naren
bd5235fc71 fix rename semantics 2026-02-26 23:14:31 -08:00
Ashwin Naren
2ecfda3cb9 fix unneeded inode cloning 2026-02-26 23:14:31 -08:00
Ashwin Naren
93e540bc5c support symlink creation 2026-02-26 23:14:31 -08:00
Ashwin Naren
f354fa7eaf implement rename_from 2026-02-26 23:14:31 -08:00
Ashwin Naren
1d5fb030b4 support directory creation 2026-02-26 23:14:31 -08:00
Ashwin Naren
357707fdb9 flock noop 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
2667a47aac fix CI 2026-02-26 22:01:39 -08:00
Ashwin Naren
162c0d9335 use python script to run qemu instead of shell script 2026-02-26 22:01:39 -08:00
Matthew Leach
6b8469b02f Merge pull request #236 from arihant2math/fix-clippy 2026-02-27 05:55:04 +00:00
Ashwin Naren
de358db4c4 fix clippy 2026-02-26 17:11:10 -08:00
Matthew Leach
95dbf4f4f2 drviers: chrdev: random: new
Add a new chardev which implements /dev/random.
2026-02-25 15:23:18 -08:00
Matthew Leach
d85293f5a7 Merge pull request #231 from hexagonal-sun/fix-miri-smalloc-errors 2026-02-23 06:05:46 +00:00
Matthew Leach
91cde85422 libkernel: smalloc: fix Miri errors
Miri is failing the smalloc tests due to poorly written tests, mainly
due to the fact that raw pointers were derived from mutable refs.  Fixup
the tests to use the global allocator funcitons directly.
2026-02-23 05:34:03 +00:00
Matthew Leach
39a5ef331d libkernel/slab: fix UB and accounting bugs identified by Miri
Fix several issues in the slab allocator identified by the heap stress
tests (intermittent) and running the tests under Miri.

1. Fix Undefined Behavior. Previously, the allocator created temporary
   `&mut Frame` references while raw pointers to that frame existed in the
   intrusive `partial` or `free` lists. Under Miri's strict aliasing rules,
   creating a unique reference to the whole struct invalidated the list
   pointers.

   The fix implements "split borrowing": we now maintain raw pointers to
   the frame and only create mutable references to the `.state` field
   when needed, ensuring the `.link` field remains valid for the
   intrusive list.

2. Fix `free_list_sz` accounting. In `try_alloc`, the `free_list_sz`
   counter was not being decremented when a slab was successfully popped
   from the free list. This caused the allocator to believe it had free
   slabs when the list was actually empty, leading to panics during
   batch-free operations.

3. Increase heap stress tests. The test suite now runs the stress test
   in a loop to catch state persistence bugs and ensures the allocator is
   fully torn down and reset between iterations.

Fixes: #220
2026-02-21 14:38:18 -08:00
Matthew Leach
e60cede2ba Merge pull request #228 from arihant2math/proc-macros
Make `ktest` a proc macro and remove docker from CI
2026-02-21 21:55:07 +00:00
Ashwin Naren
1974b04c1c fix some ump warnings and disable -Dwarnings in testing CI 2026-02-20 14:33:58 -08:00
Ashwin Naren
9f5311e788 post-rebase fixes 2026-02-20 14:31:19 -08:00
Ashwin Naren
076c17edaa remove docker from gh actions 2026-02-20 14:27:40 -08:00
Ashwin Naren
d188bff87e add to justfile 2026-02-20 14:27:40 -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
94018295da use sh instead of bash to fix CI 2026-02-19 22:42:40 -08:00
Matthew Leach
ad83ece9da Merge pull request #225 from arihant2math/new-image-scripts 2026-02-20 04:53:06 +00:00