Commit Graph

25 Commits

Author SHA1 Message Date
Ashwin Naren
3fbb56098c futex impl
# Conflicts:
#	usertest/src/main.rs
2025-12-21 01:43:54 -08:00
Ashwin Naren
cd6d830ae9 Initial proc fs (#70) 2025-12-21 01:37:14 -08:00
Ashwin Naren
35a6caa541 Implement sys_sysinfo (#71) 2025-12-20 15:42:08 -08:00
Ashwin Naren
781b9b5c3f implement mkdir and unlink
rm, mkdir and rmdir now work in tmpfs
2025-12-18 15:35:09 +00:00
Matthew Leach
9db6162414 formatting 2025-12-17 20:04:31 -08:00
Matthew Leach
8bc271c266 fs: open: pass create mode parameter
Pass the `mode` parameter to the open VFS call, specifying the
permissions of the file when O_CREAT is specified.
2025-12-17 20:04:31 -08:00
Matthew Leach
bebee6d8f5 libkernel: address: ensure to_pfn can only be called on PA
calculating a PFN from a VA makes no sense since it could be mapped to
any address. Therefore, ensure that it can *only* be called on PAs.
2025-12-17 20:04:31 -08:00
Matthew Leach
a867493fa7 page_alloc: make test fixture public
Having the ability to use the `FrameAlloctor`, simulating via the heap
is a very useful pattern when testing libkernel code. Make the test
fixture public for other modules to use.
2025-12-17 20:04:31 -08:00
Matthew Leach
54f2d683b8 libkernel: move ClaimedPage into libkernel crate
By moving `ClaimedPage` into libkernel we can utilise it in
arch-agonstic ode.
2025-12-17 20:04:31 -08:00
Matthew Leach
c1bea5ecbb tmpfs: new
Add basic directory inode implementation and tmpfs filesystem
implementation.
2025-12-17 20:04:31 -08:00
Matthew Leach
ba7848fc8b libkernel: CpuOps: add 'static trait bound
The CpuOps trait should never hold a reference to any other object. In
fact, it should be a singleton object which is constructed at kernel
boot and live for the entire lifetime of the system. Therefore, it's
safe to add the `'static` trait bound.
2025-12-17 20:04:31 -08:00
Matthew Leach
b8edd4af68 fat32: downcase 8.3 filenames
Using mtools to prepare the initrd image results in an image that
exclusively uses 8.3 filenames; as per the spec, the 8.3 filenames are
stored uppercase. However, on most UNIX systems, people are used to
dealing with down-case names; therefore convert the strings to
lower-case before passing back to the user.
2025-12-14 06:38:42 +00:00
Matthew Leach
910203e0c2 syscalls: mprotect: implement
Implement the `mprotect` syscall. Including a bunch of tests for
ensuring proper VMA functionality regarding splitting and merging via
`mprotect`.
2025-11-30 20:13:36 +00:00
Matthew Leach
baf98c452f libkernel: vmarea: shrink_to: implement
Implement a `shrink_to` function for a VMA. This shrinks the VMA's
region to the specified region, while recalculating file offsets and
size if the VMA is file-backed.
2025-11-30 20:13:36 +00:00
Matthew Leach
3e3a9ad0c5 libkernel: region: add punch_hole
Add a function for calculating the set difference when punching one
region out of another.
2025-11-30 20:13:36 +00:00
Matthew Leach
1b95049159 libkernel: memory: VMArea: page align on from_pheader
Page align any non-aligned program headers, fixing up the file offset
and filesz accordingly.
2025-11-30 20:13:36 +00:00
Matthew Leach
fb405282cc syscalls: rseq: return ENOSYS
Return ENOSYS for sys_rseq
2025-11-28 20:09:05 +00:00
Matthew Leach
1ed714e47b libkernel: memory: region: remove breaking assert in expand
The `expand` function adds bytes size into the region; the check `size
>= self.size` isn't needed since this is an expanding function, not a
resizing one. To emphasise that, rename the function to `expand_by`.

Also include a bunch of unit tests to ensure that expansion by regions
with differing sizes works correctly.
2025-11-28 20:09:05 +00:00
Matthew Leach
6e988c3639 syscall: socket: return with error
Return with an error when calling socket()
2025-11-28 20:09:05 +00:00
Matthew Leach
825b3d7547 libkernel: mem: brk: return non-aligned break
Determine whether the program break needs extending with aligned logic,
but always return the requested, non-aligned, address.

Use `brk_addr` in unit tests instead.
2025-11-28 20:09:05 +00:00
Ashwin Naren
de76e243a2 properly shutdown system 2025-11-28 20:02:12 +00:00
Ashwin Naren
504f7f01dc fix failing tests 2025-11-28 12:08:06 +00:00
Ashwin Naren
0c749d7ce8 Parse fat dates 2025-11-28 12:08:06 +00:00
Matthew Leach
606500ba8b libkernel: fs: fat32: make lookups case-insensitive
Fat32 is a case-insensitive filesystem, therefore when looking up a path
in a directory entry, convert all strings to lowercase before
comparison.
2025-11-24 21:25:51 +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