aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/boot
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/src/boot')
-rw-r--r--arch/x86_64/src/boot/boot32.S (renamed from arch/x86_64/src/boot/boot.S)23
-rw-r--r--arch/x86_64/src/boot/entry64.s21
2 files changed, 25 insertions, 19 deletions
diff --git a/arch/x86_64/src/boot/boot.S b/arch/x86_64/src/boot/boot32.S
index d65c865..7e6c2ae 100644
--- a/arch/x86_64/src/boot/boot.S
+++ b/arch/x86_64/src/boot/boot32.S
@@ -31,6 +31,8 @@ stack_top:
*/
.section .boot_rodata, "a", @progbits
+.global global_descriptor_table_data
+
/**
* @brief A basic GDT for long mode.
*/
@@ -106,6 +108,7 @@ vga_buffer_pointer: .quad 0xb8000
* @param %ebx The Multiboot 2 information pointer.
* @return void This function does not return.
*/
+.global _start
_start:
call 0f
0:
@@ -127,7 +130,7 @@ _start:
call _enable_sse
call _reload_gdt
- lea (_transition_to_long_mode - 0b)(%esi), %eax
+ lea (_entry64 - 0b)(%esi), %eax
pushl $global_descriptor_table_code
pushl %eax
lret
@@ -413,21 +416,3 @@ _reload_gdt:
add $10, %esp
pie_function_end
-
-.section .boot_text, "ax", @progbits
-.code64
-
-_transition_to_long_mode:
- mov $global_descriptor_table_data, %rax
- mov %rax, %ss
- mov %rax, %ds
- mov %rax, %es
- mov %rax, %fs
- mov %rax, %gs
-
- xor %rax, %rax
-
- call _init
-
- call main
- call _halt
diff --git a/arch/x86_64/src/boot/entry64.s b/arch/x86_64/src/boot/entry64.s
new file mode 100644
index 0000000..f575c50
--- /dev/null
+++ b/arch/x86_64/src/boot/entry64.s
@@ -0,0 +1,21 @@
+.section .boot_text, "ax", @progbits
+.code64
+
+.global _entry64
+_entry64:
+ mov $global_descriptor_table_data, %rax
+ mov %rax, %ss
+ mov %rax, %ds
+ mov %rax, %es
+ mov %rax, %fs
+ mov %rax, %gs
+
+ xor %rax, %rax
+
+ call _init
+
+ call main
+
+1:
+ hlt
+ jmp 1b