]> git.corax.cc Git - corax/commitdiff
Remove task-related code from main.c
authorMatthias Kruk <m@m10k.eu>
Tue, 3 Sep 2019 16:42:44 +0000 (01:42 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 3 Sep 2019 16:42:44 +0000 (01:42 +0900)
kernel/core/main.c

index 1667edad57c78e31bb2a13961bf962551c1a1182..6288152e41a51dfa905c8d26fa32ea007b4f85be 100644 (file)
  * along with Corax.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <corax/types.h>
 #include <debug.h>
 #include <arch.h>
-#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");
     }