Commit Graph

478 Commits

Author SHA1 Message Date
aa0933be10 vm: region: implement reading from a user-space vm-region into a kernel buffer 2026-02-21 11:16:11 +00:00
8b188a0ac4 vm: region: fix iterator using wrong buffer offset when seek exceeds current buffer size 2026-02-21 11:07:53 +00:00
ed25ee6761 vm: object: fix iterator using wrong buffer offset when seek exceeds current buffer size 2026-02-21 11:07:12 +00:00
0bae39e550 vm: zone: ensure memblock region bounds are page-aligned while creating zone blocks 2026-02-21 11:01:58 +00:00
9a90662eaa libmango: add userspace syscall call-gates 2026-02-19 19:22:06 +00:00
1d4fd4f586 syscall: add lots of syscalls 2026-02-19 19:21:50 +00:00
dbc7b8fc59 kernel: libc: add headers 2026-02-19 19:21:15 +00:00
aa9439c392 kernel: add channel/port ipc mechanism 2026-02-19 19:21:04 +00:00
8e072945d8 kernel: add functions for moving sets of handles between tasks 2026-02-19 19:20:39 +00:00
821246bc16 kernel: add functions for iterating through an array of iovecs 2026-02-19 19:19:52 +00:00
fc8cdf62d3 bsp: adjust bsp executable mapping 2026-02-19 19:18:31 +00:00
b2dbb88778 thread: move thread awaken functionality to a dedicated function 2026-02-19 19:17:38 +00:00
9424e7bcd6 thread: fix thread object data corruption 2026-02-19 19:17:18 +00:00
4c35723959 sched: add helper functions for opening and resolving handles for a task 2026-02-19 19:16:59 +00:00
2b7e5368c9 vm: implement copying data between different vm-regions 2026-02-19 19:15:15 +00:00
85006411bd kernel: add header files 2026-02-19 19:13:44 +00:00
f2e128c57e handle: re-arrange handle space layout
the lowest 2 bits of handle values are no longer unused, and 0 is
now a valid handle value.

the first 64 handles are now reserved, and will not be automatically
allocated by the kernel. however, they are still valid handles, and
other handles can be moved to this area using an as-yet-unwritten
function. this is to allow support for standard POSIX file descriptors,
which require the values 0, 1, and 2.
2026-02-19 19:11:11 +00:00
c6e1ba21dd vm: implement direct read/write/copy access to vm-object memory 2026-02-19 19:09:38 +00:00
2f413c603d kernel: all string parameters now take a corresponding length parameter 2026-02-19 19:08:17 +00:00
291a5f677e sched: implement passing arguments to user-mode threads 2026-02-19 19:05:53 +00:00
b188573eea x86_64: pmap: change pmap_remove* pointer args to virt_addr_t 2026-02-19 19:02:28 +00:00
c69aed254f x86_64: enable interrupts during syscall execution 2026-02-19 19:00:04 +00:00
44c2904c11 x86_64: re-arrange user and kernel GDT entries for compatibility with syscall instruction 2026-02-19 18:59:37 +00:00
f89e3cb12c kernel: adjust formatting 2026-02-19 18:57:53 +00:00
6019c9307d kernel: separate headers into kernel and user headers
all kernel headers have been moved from include/mango to include/kernel
and include definitions that are only relevant to kernel-space.

any definitions that are relevant to both kernel- and user-space
(i.e. type definitions, syscall IDs) have been moved to
include/mango within libmango.
2026-02-19 18:54:48 +00:00
e3dd48a0fa build: remove per-subdirectory log message 2026-02-08 16:17:47 +00:00
9f7b7bdd2d kernel: refactor syscall dispatch system 2026-02-08 16:17:11 +00:00
c424e8127e kernel: bsp: update vm-region api usage 2026-02-08 15:52:04 +00:00
fb7d7635c2 vm: region: refactor to use offsets rather than absolute addresses 2026-02-08 15:51:51 +00:00
409725f9d4 kernel: implementing mapping and execution of bsp executable 2026-02-08 13:13:03 +00:00
1c74291b99 kernel: add a temporary syscall dispatch system 2026-02-08 13:12:24 +00:00
5d28955dc6 vm: update vm-page documentation 2026-02-08 13:11:41 +00:00
ee82097017 sched: implement user-mode task and thread creation 2026-02-08 13:11:17 +00:00
d2f303680d sched: add root vm-region and handle table to struct task 2026-02-08 13:10:54 +00:00
27bed1a3d3 sched: all kernel-mode tasks now have negative task ids 2026-02-08 13:09:29 +00:00
18a5325fa7 sched: add PID_MAX definition 2026-02-08 13:07:14 +00:00
7eaad64969 pmap: declare fault handler function and flags 2026-02-08 13:06:19 +00:00
343689764f x86_64: irq: route user-mode page faults to pmap_handle_fault 2026-02-08 13:05:29 +00:00
5f2ad06fb0 x86_64: all intermediate page table entries now have PTE_USR set
this allows user-accessible page mappings to be created. for kernel memory
mappings, PTE_USR will only be cleared on the lowest-level table entry.
2026-02-08 13:03:41 +00:00
67b3be9732 x86_64: add pmap_handle_fault to route user-mode page faults to vm-region to resolve 2026-02-08 13:03:28 +00:00
883b5ac9e2 vm: add vm-region to manage userspace virtual memory address spaces
vm-region supports creating nested regions of virtual memory, each with their
own memory protection restrictions.

vm-objects can be mapped into a vm-region, making the underlying memory
accessible. all mappings are lazy: page tables are not updated until the
mapped memory is accessed.
2026-02-08 12:59:08 +00:00
b8ccffd2d4 vm: add vm-object to represent non-contiguous physical memory allocations
vm-object can be used to demand-allocate non-contiguous physical memory, and
will provide an api for userspace programs to do the same. unless a vm-object
is created in-place (i.e. to represent a specific area of physical memory),
its memory pages are only allocated when the object is mapped AND someone
attempts to access the memory.
2026-02-08 12:58:31 +00:00
14ebcd4875 kernel: implement object handle tables 2026-02-08 12:55:47 +00:00
6950850f5b object: add a macro to define object lock/unlock functions 2026-02-08 12:55:13 +00:00
bcda479879 sched: implement task id allocation; remove thread id bitmap 2026-02-08 12:54:43 +00:00
7c4cff24f2 test: update object api usage 2026-02-08 12:52:14 +00:00
b31c3a40b4 vm: sparse: ensure that vm_pages for the reserved bsp region are created 2026-02-08 12:51:55 +00:00
2b1bed844a vm: change virt_to_phys param to const 2026-02-08 12:51:23 +00:00
26afc3c6c3 vm: sparse: fix region base/limit alignment calculation 2026-02-08 12:50:08 +00:00
d94a6ec7cb kernel: add generic FATAL_ERROR status code 2026-02-08 12:48:59 +00:00