aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMarvin Borner2020-09-14 18:38:44 +0200
committerMarvin Borner2020-09-14 18:38:44 +0200
commit096f9be4ac328ae39bd794c36a9a04ff68c2b844 (patch)
tree7228f9d1631fd126c1942bafb878cca381ff336b /kernel
parent18a0cc60d46d8ab22479e9683c27459703195480 (diff)
Some GUI fixes
Diffstat (limited to 'kernel')
-rw-r--r--kernel/drivers/timer.c6
-rw-r--r--kernel/features/proc.c3
-rw-r--r--kernel/inc/proc.h4
3 files changed, 7 insertions, 6 deletions
diff --git a/kernel/drivers/timer.c b/kernel/drivers/timer.c
index 8029a2a..812bde7 100644
--- a/kernel/drivers/timer.c
+++ b/kernel/drivers/timer.c
@@ -42,8 +42,8 @@ void timer_wait(u32 ticks)
// Install timer handler into IRQ0
void timer_install()
{
- hpet_install(10000); // TODO: Find optimal femtosecond period
- if (!hpet)
- timer_phase(1000);
+ /* hpet_install(10000); // TODO: Find optimal femtosecond period */
+ /* if (!hpet) */
+ timer_phase(1000);
irq_install_handler(0, timer_handler);
}
diff --git a/kernel/features/proc.c b/kernel/features/proc.c
index 09f1f4e..aab4fec 100644
--- a/kernel/features/proc.c
+++ b/kernel/features/proc.c
@@ -19,6 +19,7 @@ struct list *proc_list;
struct node *current;
// TODO: Use less memcpy and only copy relevant registers
+// TODO: 20 priority queues (https://www.kernel.org/doc/html/latest/scheduler/sched-nice-design.html)
void scheduler(struct regs *regs)
{
timer_handler();
@@ -151,7 +152,7 @@ struct proc *proc_make()
struct proc *proc = malloc(sizeof(*proc));
proc->pid = pid++;
proc->messages = list_new();
- proc->state = PROC_DEFAULT;
+ proc->state = PROC_RUNNING;
if (current)
list_add(proc_list, proc);
diff --git a/kernel/inc/proc.h b/kernel/inc/proc.h
index ea78885..7b47ed6 100644
--- a/kernel/inc/proc.h
+++ b/kernel/inc/proc.h
@@ -9,7 +9,7 @@
#include <list.h>
#include <sys.h>
-#define PROC_QUANTUM 420 // Nanoseconds or something // TODO
+#define PROC_QUANTUM 100 // Milliseconds or something // TODO
#define EFLAGS_ALWAYS 0x2 // Always one
#define EFLAGS_INTERRUPTS 0x200 // Enable interrupts
@@ -17,7 +17,7 @@
#define GDT_USER_CODE_OFFSET 0x1b // User code segment offset in GDT (with ring3 mask)
#define GDT_USER_DATA_OFFSET 0x23 // User data segment offset in GDT (with ring3 mask)
-enum proc_state { PROC_DEFAULT };
+enum proc_state { PROC_RUNNING };
struct proc {
u32 pid;