aboutsummaryrefslogtreecommitdiff
path: root/src/boot.s
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2024-05-01 23:12:21 +0300
committerMarin Ivanov <[email protected]>2024-05-01 23:12:21 +0300
commitbf67bb3b39cf8acad442bc4731c6f300697ad992 (patch)
treeeff5c6a5f13cc82ea1a587f4999784d81b03bf33 /src/boot.s
parent8a0560edda7ba516625d310cc1b6b995fd5ad672 (diff)
add 32-bit assembly
Diffstat (limited to 'src/boot.s')
-rw-r--r--src/boot.s17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/boot.s b/src/boot.s
new file mode 100644
index 0000000..2530d18
--- /dev/null
+++ b/src/boot.s
@@ -0,0 +1,17 @@
+.global _start
+.type _start, @function
+
+.code32
+// Entry point. It puts the machine into a consistent state,
+// starts the kernel and then waits forever.
+_start:
+ mov _sstack, %esp // Setup the stack.
+
+ push %ebx // Pass multiboot info structure.
+ push %eax // Pass multiboot magic code.
+ call kmain // Call the kernel.
+
+ // Halt the CPU.
+ cli
+ hlt
+