diff options
Diffstat (limited to 'src/kernel/core')
-rw-r--r-- | src/kernel/core/kmain.c | 12 | ||||
-rw-r--r-- | src/kernel/core/thread.c | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.c index 219bab1..fa5d69c 100644 --- a/src/kernel/core/kmain.c +++ b/src/kernel/core/kmain.c @@ -124,14 +124,6 @@ void kernel_init_stage2(void* data) { // Launch some worker threads start_workers(2); - // test sleep() - dbg_printf("Testing sleep() : "); - for (int i = 0; i < 20; i++) { - usleep(50000); - dbg_printf("."); - } - dbg_printf("\n"); - TEST_PLACEHOLDER_AFTER_TASKING; // Create devfs @@ -167,13 +159,13 @@ void kernel_init_stage2(void* data) { ASSERT(nullfs_add_ram_file(devfs, name, (char*)mods[i].mod_start, - len, false, FM_READ | FM_MMAP)); + len, false, FM_READ)); } TEST_PLACEHOLDER_AFTER_DEVFS; // Launch INIT - fs_handle_t *init_bin = fs_open(devfs, "/mod/init.bin", FM_READ | FM_MMAP); + fs_handle_t *init_bin = fs_open(devfs, "/mod/init.bin", FM_READ); if (init_bin == 0) PANIC("No init.bin module provided!"); if (!is_elf(init_bin)) PANIC("init.bin is not valid ELF32 binary"); diff --git a/src/kernel/core/thread.c b/src/kernel/core/thread.c index 7f9f25e..60dccde 100644 --- a/src/kernel/core/thread.c +++ b/src/kernel/core/thread.c @@ -7,6 +7,7 @@ #include <frame.h> #include <paging.h> #include <worker.h> +#include <process.h> void save_context_and_enter_scheduler(saved_context_t *ctx); void resume_context(saved_context_t *ctx); @@ -84,6 +85,8 @@ void run_scheduler() { // This function is expected NEVER TO RETURN if (current_thread != 0 && current_thread->state == T_STATE_RUNNING) { + current_thread->last_ran = worker_get_time(); + if (current_thread->proc) current_thread->proc->last_ran = current_thread->last_ran; enqueue_thread(current_thread, true); } @@ -141,6 +144,7 @@ thread_t *new_thread(entry_t entry, void* data) { t->ctx.eip = (void(*)())run_thread; t->state = T_STATE_PAUSED; + t->last_ran = 0; t->current_pd_d = get_kernel_pagedir(); |