From: Matthias Kruk Date: Tue, 3 Sep 2019 16:42:44 +0000 (+0900) Subject: Remove task-related code from main.c X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=d394267cd72b032a1faffba47e04cf1b51f111a1;p=corax Remove task-related code from main.c --- diff --git a/kernel/core/main.c b/kernel/core/main.c index 1667eda..6288152 100644 --- a/kernel/core/main.c +++ b/kernel/core/main.c @@ -16,24 +16,13 @@ * along with Corax. If not, see . */ +#include #include #include #include -#include "../arch/task.h" void cpu_debug(void); -u8_t _stack[1024]; - -void _idle(void) -{ - while(1) { - asm volatile("hlt"); - } - - return; -} - void _print_mptbl(void *tbl) { u32_t *pmcp; @@ -111,20 +100,17 @@ int corax(void *mb_info, u32_t magic) { } } */ -/* void *ptr;*/ +#if 0 arch_init(mb_info); - dbg_panic("fooooo", "baaaaar", __LINE__, "foobar"); + { + u64_t capabilities = cpu_get_capabilities(); -/* - u64_t capabilities = cpu_get_capabilities(); - dbg_printf("CPUID.01h = 0x%016llx\n", capabilities); + dbg_printf("CPUID.01h = 0x%016llx\n", capabilities); + } +#endif - if(capabilities & 0x20000000000L) { - dbg_printf("This is cpu%u\n", cpu_get_id()); - } -*/ #if 0 { volatile register u64_t sysenter, sysexit; @@ -136,9 +122,7 @@ int corax(void *mb_info, u32_t magic) { dbg_printf("Syscall took %llu cycles\n", sysexit - sysenter); } #endif -/* - cpu_debug(); -*/ + /* for(ptr = (void*)0x9fc00; ptr < (void*)0x9fffc; ptr++) { if(*(u32_t*)ptr == 0x5f504d5f) { @@ -164,19 +148,10 @@ int corax(void *mb_info, u32_t magic) { */ dbg_printf("Switching pstate\n"); - asm volatile("int $0xcc"); - asm volatile("int $0xcc"); - /* p = cpu_set_pstate(1); dbg_printf("Entered P-state %u. (0x%x)\n", p & 0xffff, p); - dbg_printf("Initialisation complete. Nothing to do.\n"); */ -/* - struct task tsk; + dbg_printf("Initialisation complete. Nothing to do.\n"); - _task_prepare(&tsk, (u32_t)_idle, (u32_t)&_stack + sizeof(_stack)); - - _task_switch(&tsk); -*/ while(1) { asm volatile("hlt"); }