From 2fc768319887945c5c6beafcd21d29d9884cd48a Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Wed, 3 Mar 2021 23:47:26 -0500 Subject: moving windows with mouse, changing some old panics into syslogs, small bugfix in knob files, "send to back" wm keybinding --- src/kernel/task.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/kernel/task.c') diff --git a/src/kernel/task.c b/src/kernel/task.c index 077eea6..b301217 100644 --- a/src/kernel/task.c +++ b/src/kernel/task.c @@ -46,18 +46,17 @@ struct tss { struct task_state tasks[MAX_TASKS]; struct task_state *active_task; -//puts the handle into ecx -uint32_t new_task(struct task_state state) { +struct task_state *new_task() { for (uint8_t n = 0; n < MAX_TASKS; ++n) if (!tasks[n].page_directory) { - tasks[n] = state; tasks[n].ecx = n + 1; tasks[n].waiting = false; for (uint8_t i = 0; i < MAX_WAITS; ++i) tasks[n].waits[i].mode = NONE; - return n + 1; + return tasks + n; } - PANIC("Maximum number of tasks reached."); + logf(LOG_ERROR, "Reached %d tasks, refusing to create any more.", MAX_TASKS); + return 0; } static void tmp_halt() { -- cgit v1.2.3