blob: eeccb325bfc8576afd8af17105e4598a92e0c88d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#include <stdint.h>
#include <stddef.h>
#include <toxic/vga.h>
#include <toxic/string.h>
#include <toxic/kernel.h>
#include <toxic/idt.h>
#include <toxic/io.h>
#include <mm/kernel_heap.h>
#include <mm/paging.h>
#include <block/block.h>
#include <fs/path.h>
static struct page_directory *kernel_directory;
void start_kernel()
{
char buf[512] = {0};
struct path_root *p;
init_display(2);
block_init();
vprintl("Hello World!!!\n");
vprintl("Testing it!!!\n");
kernel_heap_init();
interrupts_init();
kernel_directory = paging_new_directory(PAGING_IS_WRITABLE |
PAGING_IS_PRESENT |
PAGING_USER_ACCESS);
paging_switch(kernel_directory);
char *ptr = kzalloc(4096);
char *ptr2;
paging_map_vaddr(kernel_directory, (void *)0x1000,
ptr,
(PAGING_USER_ACCESS |
PAGING_IS_PRESENT | PAGING_IS_WRITABLE));
enable_paging();
enable_interrupts();
ptr2 = (char *) 0x1000;
ptr[0] = 'A';
vprintl(ptr);
vprintl(ptr2);
ptr2[1] = 'B';
vprintl("new ptr\n");
vprintl(ptr);
vprintl(ptr2);
kfree(ptr);
bread(bdev_get(0), 0, 1, buf);
p = parse_path("/home//foo/bar");
while(p);
}
|