58 Commits

Author SHA1 Message Date
wash 1db6de6bc2 meta: rename kernel to Magenta 2026-04-30 20:30:36 +01:00
wash 4a6809e2df sched: task: fix leftover invalid pmap pointer 2026-04-30 19:10:51 +01:00
wash 607efa961f sched: task: implement task_config_get and task_config_set 2026-04-30 19:08:02 +01:00
wash 02a44f67b9 sched: task: implement task creation flags 2026-04-30 19:06:46 +01:00
wash 982e518cf7 kernel: formatting tweaks 2026-04-19 20:17:31 +01:00
wash 9a9b0f63ba sched: task: optional handle_table pointer can now be passed to task_create 2026-04-19 20:04:18 +01:00
wash 6c5bf2344f sched: thread: implement cloning of userspace thread contexts 2026-04-01 18:29:54 +01:00
wash 512356ac2d sched: enforce ref-counting on current task/thread pointers 2026-04-01 18:17:05 +01:00
wash 537242e606 kernel: handle: add support for allocating a specific handle value 2026-03-29 11:47:22 +01:00
wash 7dc0c742fa kernel: rebuild object ref-counting using atomic types 2026-03-24 19:10:36 +00:00
wash a2c89df195 kernel: convert some verbose log messages to trace messages 2026-03-21 10:27:23 +00:00
wash 4551e7b2e6 sched: implement various ways to end tasks and threads 2026-03-18 21:07:43 +00:00
wash 24f9ef85bf sched: implement user-configurable fs and gs segment base addresses 2026-03-18 21:07:05 +00:00
wash 63703a3d34 sched: don't reschedule a thread if its status is THREAD_STOPPED 2026-03-18 21:02:40 +00:00
wash b774415f64 sched: wait: implement wakeup_n, waitqueue_empty 2026-03-18 20:56:15 +00:00
wash e73a5c41ce sched: fix thread_awaken manipulating a runqueue without locking it 2026-03-14 22:23:07 +00:00
wash 89dac0c951 sched: add a thread flag to indicate when a thread is scheduled on a runqueue
this prevents runqueue corruption that can occur if rq_enqueue is called on
a thread that's already on a runqueue.
2026-03-14 22:22:05 +00:00
wash 7c630ece54 sched: add wait begin/end functions that don't change thread state
these functions can be used when waiting on multiple queues at once, to prevent
the thread state from being changed unexpectedly while initialising a set of wait items.
2026-03-14 22:20:10 +00:00
wash c628390f4a vm: replace vm-region with address-space
address-space is a non-recursive data structure, which contains a flat list of vm_areas representing
mapped vm-objects.

userspace programs can no longer create sub-address-spaces. instead, they can reserve portions of
the address space, and use that reserved space to create mappings.
2026-03-13 19:44:50 +00:00
wash 6ba236b2fe kernel: resolving a handle now increments the refcount of the corresponding object 2026-03-12 20:42:05 +00:00
wash 7d4cede788 misc: adjust formatting 2026-03-12 20:34:31 +00:00
wash 3f21e888d6 sched: split sched.h into separate header files 2026-03-12 20:30:36 +00:00
wash 6e39dd45a4 sched: only disable/enable interrupts if schedule() is called from non-IRQ context 2026-02-21 11:23:43 +00:00
wash b2dbb88778 thread: move thread awaken functionality to a dedicated function 2026-02-19 19:17:38 +00:00
wash 9424e7bcd6 thread: fix thread object data corruption 2026-02-19 19:17:18 +00:00
wash 4c35723959 sched: add helper functions for opening and resolving handles for a task 2026-02-19 19:16:59 +00:00
wash 2f413c603d kernel: all string parameters now take a corresponding length parameter 2026-02-19 19:08:17 +00:00
wash 291a5f677e sched: implement passing arguments to user-mode threads 2026-02-19 19:05:53 +00:00
wash 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
wash ee82097017 sched: implement user-mode task and thread creation 2026-02-08 13:11:17 +00:00
wash d2f303680d sched: add root vm-region and handle table to struct task 2026-02-08 13:10:54 +00:00
wash 27bed1a3d3 sched: all kernel-mode tasks now have negative task ids 2026-02-08 13:09:29 +00:00
wash bcda479879 sched: implement task id allocation; remove thread id bitmap 2026-02-08 12:54:43 +00:00
wash 0490541dc9 kernel: adjust formatting 2026-02-08 12:32:48 +00:00
wash 62ec4c93ab meta: rename 2024-11-02 11:31:51 +00:00
wash ef05233dcf sched: allocate and assign ids to each thread 2024-09-17 17:49:05 +01:00
wash 4a1c6cae69 sched: add support for scheduling functions to be executed later 2023-06-14 17:36:45 +01:00
wash 63f27adb1b sched: implement waitqueues 2023-05-10 20:29:57 +01:00
wash d8326cfec5 sched: remove unused code 2023-05-07 21:42:38 +01:00
wash a79d109fcc obj: add header-offset field to object_type
this allows the object header to be placed anywhere within the larger
object structure.

the object system now also ensures that the object is zero-initialised
during allocation.
2023-05-06 22:22:05 +01:00
wash f52ca2f1e2 obj: object header is no longer allocated automatically 2023-05-06 19:48:14 +01:00
wash 7d321fb7f0 sched: add kernel thread creation and SMP-aware thread scheduling 2023-05-04 21:43:18 +01:00
wash bb524c1576 kernel: add support for getting percpu variables that belong to other CPUs 2023-05-04 21:42:51 +01:00
wash 3a315901ba sched: fix create_idle_thread() not initialising tr_parent 2023-05-03 20:19:11 +01:00
wash c64577e24e sched: add function to create per-cpu idle threads 2023-05-03 19:27:18 +01:00
wash fbbe339f72 sched: schedule() no longer switches threads when preempt_count > 0 2023-05-01 08:27:18 +01:00
wash 194efd4b6b sched: fix timeout_expiry() not releasing its reference to this_cpu 2023-05-01 08:26:13 +01:00
wash 8a0291c9b3 sched: add timer tasks and schedule_timeout() 2023-04-30 21:09:36 +01:00
wash 085c3d2a89 sched: add kernel-mode context switching 2023-04-30 14:27:57 +01:00
wash e2131b08ac sched: track CPU clock cycles used by threads 2023-04-28 21:05:48 +01:00