summaryrefslogtreecommitdiff
path: root/src/kernel/task.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-03-03 23:47:26 -0500
committerBenji Dial <benji6283@gmail.com>2021-03-03 23:47:26 -0500
commit2fc768319887945c5c6beafcd21d29d9884cd48a (patch)
tree9dadaf32069588c23e755228099669557449304f /src/kernel/task.c
parent81df4702c424f91cca5570ab2554d1d4cbae534d (diff)
downloadportland-os-2fc768319887945c5c6beafcd21d29d9884cd48a.tar.gz
moving windows with mouse, changing some old panics into syslogs, small bugfix in knob files, "send to back" wm keybinding
Diffstat (limited to 'src/kernel/task.c')
-rw-r--r--src/kernel/task.c9
1 files changed, 4 insertions, 5 deletions
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() {