summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/boot.s6
-rw-r--r--kernel/kernel.c22
-rw-r--r--kernel/linker.ld6
3 files changed, 27 insertions, 7 deletions
diff --git a/kernel/boot.s b/kernel/boot.s
index 2fd1c55..987cb48 100644
--- a/kernel/boot.s
+++ b/kernel/boot.s
@@ -1,6 +1,4 @@
-MBALIGN equ 1 << 0
-MEMINFO equ 1 << 1
-MBFLAGS equ MBALIGN | MEMINFO
+MBFLAGS equ 0
MAGIC equ 0x1BADB002
CHECKSUM equ -(MAGIC + MBFLAGS)
@@ -17,10 +15,10 @@ resb 16384
stack_top:
section .text
+extern main
global _start:function (_start.end - _start)
_start:
mov esp, stack_top
- extern main
call main
cli
.hang: hlt
diff --git a/kernel/kernel.c b/kernel/kernel.c
index 1d734c9..9a901b1 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -1,4 +1,22 @@
-int main()
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "../arch/x86/io/GlobalObj.h"
+#include "../arch/x86/inc/TypeConverter.h"
+
+void main()
{
- return 0;
+ VGADisplay d;
+ IntConverter conv;
+
+ unsigned int i = 124;
+
+ d << conv.intToChar(i);
+ d << "Hello, world!\tHello, world!";
+ for(int i = 0; i < 10; i++)d << "\tHello!";
};
+
+#ifdef __cplusplus
+};
+#endif
diff --git a/kernel/linker.ld b/kernel/linker.ld
index e490e6a..d5ee742 100644
--- a/kernel/linker.ld
+++ b/kernel/linker.ld
@@ -4,10 +4,14 @@ SECTIONS
{
. = 1M;
+ .multiboot :
+ {
+ *(.multiboot)
+ }
.text BLOCK(4K) : ALIGN(4K)
{
- *.(.multiboot)
*(.text)
+ *(.eh_frame)
}
.rodata BLOCK(4K) : ALIGN(4k)