From a9bb8d1be024730fc4687aab78a8e5cb54b4f05e Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Fri, 4 May 2012 20:47:46 +0200 Subject: More OOP; --- src/kernel/core/loader_.asm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/kernel/core') diff --git a/src/kernel/core/loader_.asm b/src/kernel/core/loader_.asm index 07de52c..28d1d2f 100644 --- a/src/kernel/core/loader_.asm +++ b/src/kernel/core/loader_.asm @@ -2,6 +2,7 @@ [GLOBAL loader] ; making entry point visible to linker [EXTERN kmain] ; kmain is defined in kmain.c [EXTERN tasking_tmpStack] ; a temporary 4k stack used by tasking, and used when setting up kernel stuff +EXTERN start_ctors, end_ctors, start_dtors, end_dtors ; setting up the Multiboot header - see GRUB docs for details MODULEALIGN equ 1<<0 ; align loaded modules on page boundaries @@ -36,9 +37,30 @@ higherhalf: ; now we're running in higher half add ebx, k_highhalf_addr ; update the MB info structure so that it is in the new seg push ebx ; pass Multiboot info structure +static_ctors_loop: + mov ebx, start_ctors + jmp .test +.body: + call [ebx] + add ebx,4 +.test: + cmp ebx, end_ctors + jb .body + call kmain ; call kernel proper cli ; disable interupts + +static_dtors_loop: + mov ebx, start_dtors + jmp .test +.body: + call [ebx] + add ebx,4 +.test: + cmp ebx, end_dtors + jb .body + hang: hlt ; halt machine should kernel return jmp hang -- cgit v1.2.3