diff --git a/boot/loader/cpu/cpu.inc b/boot/loader/cpu/cpu.inc
index 25a3b08..4700598 100644
--- a/boot/loader/cpu/cpu.inc
+++ b/boot/loader/cpu/cpu.inc
@@ -23,11 +23,12 @@
; along with OS/K. If not, see . ;
;=----------------------------------------------------------------------------=;
-[global temporize]
-[global bitemporize]
-[global tritemporize]
+global temporize
+global bitemporize
+global tritemporize
[BITS 64]
+[section .text]
temporize:
push rcx
diff --git a/boot/loader/cpu/cpu32.inc b/boot/loader/cpu/cpu32.inc
index c67fb08..9eaa036 100644
--- a/boot/loader/cpu/cpu32.inc
+++ b/boot/loader/cpu/cpu32.inc
@@ -24,6 +24,7 @@
;=----------------------------------------------------------------------------=;
[BITS 32]
+[section .text]
; ---------------------------------------------------------------------------- ;
; Checks if the CPU is compatible with 64-bits operating systems ;
diff --git a/boot/loader/io/terminal.inc b/boot/loader/io/terminal.inc
index c2bce9a..50b4175 100644
--- a/boot/loader/io/terminal.inc
+++ b/boot/loader/io/terminal.inc
@@ -22,7 +22,9 @@
; You should have received a copy of the GNU General Public License ;
; along with OS/K. If not, see . ;
;=----------------------------------------------------------------------------=;
-[global testf]
+
+[BITS 64]
+[section .text]
;;VIDEO
%define TRAM 0xB8000 ; [T]ext[RAM]
@@ -30,16 +32,12 @@
%define VGA_HEIGHT 80
;; GLOBAL DATA
-
NextTRAM dq 0xB8000 ; Last position of cursor
NextTRAM32 dq 0xB8000 ; Last position of cursor
VGA_X32 dq 0
VGA_HEIGHT64 dq VGA_HEIGHT
VGA_X dq 0
-;; TEXT
-
-[BITS 64]
testf:
push rsi
diff --git a/boot/loader/loader.asm b/boot/loader/loader.asm
index 1a12b81..785e4c2 100644
--- a/boot/loader/loader.asm
+++ b/boot/loader/loader.asm
@@ -31,9 +31,10 @@
%include "boot/loader/cpu/cpu.inc"
%include "boot/loader/mem/structures.inc"
-[BITS 32]
-[global MB_start]
+global MB_start
+extern StartKern
+[BITS 32]
[section .multiboot]
;; MAGNIFICENT MULTIBOOT HEADER FOR GRUB ------------------------------------ ;;
@@ -50,8 +51,8 @@ MB_start:
mov esp, KERNEL_STACK ; Setup the stack
push 0 ; Reset EFLAGS
popf
- push eax ; 2nd argument is magic number
- push ebx ; 1st argument multiboot info pointer
+ mov [mbInfo], ebx
+ mov [mbMagic], eax
mov ecx, eax ; For debug
call _loader
add esp, 8 ; Cleanup arguments "A la MIPS"
@@ -100,12 +101,6 @@ mbInfo dq 0
mbMagic dq 0
lbegin:
-
- pop ebx ; 1st argument multiboot info pointer
- mov [mbInfo], ebx
- pop eax ; 2nd argument is magic number
- mov [mbMagic], eax
-
call clear ; Clear the screen
;; BEGIN OF CHECKLIST
@@ -160,10 +155,8 @@ _loader64:
;; Launch the kernel !
call tritemporize ; Let time to see
- extern StartKern
-
- mov rsi, [mbInfo]
- mov rdi, [mbMagic]
+ mov rdi, [mbInfo]
+ mov rsi, [mbMagic]
call StartKern
;; We must never reach this point ------------------------------------------- ;;
diff --git a/boot/loader/mem/management.inc b/boot/loader/mem/management.inc
index 876d2fe..b44bf4f 100644
--- a/boot/loader/mem/management.inc
+++ b/boot/loader/mem/management.inc
@@ -24,7 +24,7 @@
;=----------------------------------------------------------------------------=;
[BITS 32]
-
+[section .text]
; ---------------------------------------------------------------------------- ;
; Constructor for the page tables in protected mode ;
; ---------------------------------------------------------------------------- ;
diff --git a/boot/loader/mem/structures.inc b/boot/loader/mem/structures.inc
index 4b92e56..0c7bd8b 100644
--- a/boot/loader/mem/structures.inc
+++ b/boot/loader/mem/structures.inc
@@ -24,7 +24,7 @@
;=----------------------------------------------------------------------------=;
[BITS 32]
-section .rodata
+[section .rodata]
;; GDT WITH DOC
ALIGN 4096
GDT64:
@@ -44,7 +44,7 @@ GDT64:
dq GDT64
;; EMPTY PAGE TABLES (identity of the first 1GiB)
-section .bss
+[section .bss]
ALIGN 4096
PML4_table:
resb 4096
diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c
index 39ad1ed..6430af3 100644
--- a/kaleid/kernel/init/init.c
+++ b/kaleid/kernel/init/init.c
@@ -40,6 +40,6 @@ noreturn void StartKern(void *mbInfo, int mbMagic)
InitTerms();
// We're out
- StartPanic("We had\n *mbInfo : %p\n mbMagic : %x\n\nGoodbye World :(", mbInfo, mbMagic);
+ StartPanic("We had\n *mbInfo : %p\n mbMagic : %p\n\nGoodbye World :(", mbInfo, mbMagic);
}