diff options
| author | Jake Mannens <jake72360@gmail.com> | 2018-06-20 04:39:25 +1000 |
|---|---|---|
| committer | Jake Mannens <jake72360@gmail.com> | 2018-06-20 04:39:25 +1000 |
| commit | a4ea0b14840ef5946408a3893f3f1c92ed57ae80 (patch) | |
| tree | 0290ff480f8d9156b6bfcd35d009028e08cb5041 /kernel/kmain.c | |
| parent | f6858b7333139441215e83e070e098bf09056762 (diff) | |
Added a very basic types.h header file that defines NULL, size_t and
time_t.
Moved the kernel's loading point down to address 0 in
conventional memory and updated linker scripts accordingly.
Began to experiment with loading a binary blob into extended memory
(0x100000), switching to userspace mode, and executing it.
Diffstat (limited to 'kernel/kmain.c')
| -rw-r--r-- | kernel/kmain.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/kernel/kmain.c b/kernel/kmain.c index 5b10ee1..81fe741 100644 --- a/kernel/kmain.c +++ b/kernel/kmain.c @@ -1,27 +1,17 @@ -#include <asm/io.h> #include <kernel/con.h> #include <stdint.h> +#include <sys/types.h> -uint32_t ticks = 0; -#define millis() \ - (ticks * 10) +uint32_t ticks = 0; -void sleep(int ms) { - uint64_t t = millis() + ms; - while(millis() < t); -} +extern void userspace_init(void); void kmain(void) { con_init(); - printf("Kernel booting...\n"); - printf("Kernel booted!\n"); - - printf("PIC1 Mask: 0x%02x\n", inb(0x21)); + printf("Kernel booting...\n\n"); + printf("\nKernel booted!\n"); - while(1) { - sleep(500); - printf("Reliable 500ms tick!\n"); - } + userspace_init(); } |
