diff --git a/src/kernel.cpp b/src/kernel.cpp index ede7c06..340815b 100644 --- a/src/kernel.cpp +++ b/src/kernel.cpp @@ -36,7 +36,7 @@ void printf(char* str) * */ extern LANG_C void call_ctors() { - for(ctor* i = &start_ctors; i != end_ctors; i++) + for(ctor* i = &start_ctors; i != &end_ctors; i++) { (*i)(); } diff --git a/src/loader.s b/src/loader.s index a52f858..58a97f1 100644 --- a/src/loader.s +++ b/src/loader.s @@ -16,8 +16,7 @@ loader: mov $kernel_stack_ptr, %esp # set stack pointer, as kernel_main is a cpp program and it expects the stack pointer to be set. - # FIXME: When this is called, kernel doesn't run? - #call call_ctors # Call the compiler generated constructors. + call call_ctors # Call the compiler generated constructors. push %eax # The (GRUB2) bootloader stores the multiboot structure's RAM adress in the AX register during loading the kernel of choice, which contains valuable information, like the size of the RAM. We should push this to the stack in order to access it later. push %ebx # The (GRUB2) bootloader stores the MULTIBOOT_FLAG value in the BX register. diff --git a/src/types.h b/src/types.h new file mode 100644 index 0000000..969df98 --- /dev/null +++ b/src/types.h @@ -0,0 +1,11 @@ +#ifndef __TYPES_H__ +#define __TYPES_H__ + +typedef char int8_t; +typedef unsigned char uint8_t; + +typedef short int16_t; +typedef unsigned short uint16_t; + + +#endif