diff options
author | Marvin Borner | 2021-04-05 00:22:15 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-05 00:22:15 +0200 |
commit | b476dc856431436ac0f3e0179f8a25302421a0cc (patch) | |
tree | ac89ab7533db5ebae796ec0f732271afff10c891 /kernel/main.c | |
parent | 248c0d2fd007eeeb108ff1a88924e3ef8ff84ba4 (diff) |
Added new randomization features
Diffstat (limited to 'kernel/main.c')
-rw-r--r-- | kernel/main.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/main.c b/kernel/main.c index 6752fcf..faac719 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -14,12 +14,16 @@ #include <net.h> #include <pci.h> #include <random.h> +#include <rtc.h> #include <serial.h> #include <syscall.h> #include <timer.h> -void kernel_main(struct mem_info *mem_info, struct vid_info *vid_info); // Decl -void kernel_main(struct mem_info *mem_info, struct vid_info *vid_info) +extern u32 __stack_chk_guard; +u32 __stack_chk_guard; + +int kernel_main(struct mem_info *mem_info, struct vid_info *vid_info); // Decl +int kernel_main(struct mem_info *mem_info, struct vid_info *vid_info) { // Serial connection serial_install(); @@ -31,7 +35,9 @@ void kernel_main(struct mem_info *mem_info, struct vid_info *vid_info) cpu_enable_features(); cpu_print(); - srand(rand()); + + srand(rtc_stamp()); + __stack_chk_guard = rand(); // Install drivers vfs_install(); @@ -40,6 +46,7 @@ void kernel_main(struct mem_info *mem_info, struct vid_info *vid_info) pci_install(); interrupts_install(); timer_install(); + rtc_install(); keyboard_install(); mouse_install(); fb_install(vid_info); @@ -52,4 +59,6 @@ void kernel_main(struct mem_info *mem_info, struct vid_info *vid_info) syscall_init(); proc_init(); + + return 1; } |