comparison cos/kernel/kernel.c @ 31:88590c42320f

Changed interrupt handler
author windel
date Tue, 10 Jan 2012 20:40:35 +0100
parents 7e3bdcb391dc
children 3a6a9b929db0
comparison
equal deleted inserted replaced
30:0148f55bfe24 31:88590c42320f
1
1 #include "kernel.h" 2 #include "kernel.h"
2 3
3 static void testMalloc() 4 static void testMalloc()
4 { 5 {
5 char *a, *b; 6 char *a, *b;
12 printf("Got b at %x\n", b); 13 printf("Got b at %x\n", b);
13 b[0] = 'B'; 14 b[0] = 'B';
14 kfree(a); 15 kfree(a);
15 } 16 }
16 17
17 // A test program that prints 'Hoi' to the screen:
18 unsigned char hello_program[] = {0x55, 0x48, 0x89, 0xe5, 0x48, 0x83, 0xec, 0x10, 0x48, 0xc7, 0x45, 0xf8, 0x0, 0x80, 0xb, 0x0, 0x48, 0x8b, 0x45, 0xf8, 0xc6, 0x0, 0x48, 0x48, 0x8b, 0x45, 0xf8, 0x48, 0x83, 0xc0, 0x2, 0xc6, 0x0, 0x6f, 0x48, 0x8b, 0x45, 0xf8, 0x48, 0x83, 0xc0, 0x4, 0xc6, 0x0, 0x69, 0xeb, 0xfe, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x7a, 0x52, 0x0, 0x1, 0x78, 0x10, 0x1, 0x1b, 0xc, 0x7, 0x8, 0x90, 0x1, 0x0, 0x0, 0x1c, 0x0, 0x0, 0x0, 0x1c, 0x0, 0x0, 0x0, 0xb0, 0xff, 0xff, 0xff, 0x2f, 0x0, 0x0, 0x0, 0x0, 0x41, 0xe, 0x10, 0x86, 0x2, 0x43, 0xd, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
19
20 /* This routine initializes the kernel. 18 /* This routine initializes the kernel.
21 * We are left here in 64-bit long mode with the first 6 MB identity mapped. 19 * We are left here in 64-bit long mode with the first 6 MB identity mapped.
22 * */ 20 * */
23 void kmain() 21 void kmain()
24 { 22 {
27 // init_heap(); 25 // init_heap();
28 26
29 // Assume first 16MB: 27 // Assume first 16MB:
30 // TODO: get size from grub 28 // TODO: get size from grub
31 init_memory(0x1000000); 29 init_memory(0x1000000);
32
33 //new_task(hello_program);
34 30
35 // TODO: make below a user space program! 31 // TODO: make below a user space program!
36 printf("Welcome!\n"); 32 printf("Welcome!\n");
37 33
38 while (1==1) 34 while (1==1)