Mercurial > lcfOS
annotate cos/kernel/kernel.c @ 37:5c20bd53cccd
Cleanup
author | windel |
---|---|
date | Mon, 16 Jan 2012 21:38:55 +0100 |
parents | 91f91ff07ea8 |
children | 35cc54e078dd |
rev | line source |
---|---|
9 | 1 #include "kernel.h" |
2 | |
29 | 3 /* This routine initializes the kernel. |
4 * We are left here in 64-bit long mode with the first 6 MB identity mapped. | |
5 * */ | |
9 | 6 void kmain() |
7 { | |
34
8012221dd740
Fixes for uninitialized data. This causes problems on real machines
windel
parents:
33
diff
changeset
|
8 // No kmalloc required here yet: |
29 | 9 init_screen(); |
10 setupIDT(); | |
37 | 11 read_multiboot_info(); // Parse the GRUB multiboot header. |
12 init_memory(available_memory); // Setup a new paging scheme and memory manager | |
13 // From here kmalloc can be used. | |
36 | 14 keyboard_init(); |
15 timer_init(); | |
37 | 16 printf("Ramdisk location: %p\n", ramdisk_location); |
36 | 17 |
34
8012221dd740
Fixes for uninitialized data. This causes problems on real machines
windel
parents:
33
diff
changeset
|
18 /* |
32
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
19 fs_node_t *fs_root = 0; |
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
20 |
37 | 21 fs_root = initialize_initrd(ramdisk_location); |
22 | |
32
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
23 if (fs_root != 0) |
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
24 { |
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
25 fs_dirent_t *node = 0; |
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
26 int i = 0; |
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
27 while ( (node = readdir_fs(fs_root, i)) != 0) |
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
28 { |
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
29 |
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
30 } |
3a6a9b929db0
Added initial ramdisk and some virtual file system functions
windel
parents:
31
diff
changeset
|
31 } |
34
8012221dd740
Fixes for uninitialized data. This causes problems on real machines
windel
parents:
33
diff
changeset
|
32 */ |
29 | 33 |
37 | 34 // TODO: make shell a user space program! |
35 shell(); // Start user shell | |
9 | 36 } |
37 |