aboutsummaryrefslogtreecommitdiff
path: root/include/01.pocetak
diff options
context:
space:
mode:
authorAleksa Vučković <aleksav013@gmail.com>2022-01-02 22:56:02 +0100
committerAleksa Vučković <aleksav013@gmail.com>2022-01-02 22:56:02 +0100
commite2b78d20b80d89321d8d9df3ab8ade8407642dfc (patch)
tree148cb3bc894b974ae91290e493046120d04987b0 /include/01.pocetak
parentead31873b971044cd3ecb7e40ae03bdb2e6f7642 (diff)
Adding code
Diffstat (limited to 'include/01.pocetak')
-rw-r--r--include/01.pocetak/boot00.s5
-rw-r--r--include/01.pocetak/boot01.s5
-rw-r--r--include/01.pocetak/boot02.s5
-rw-r--r--include/01.pocetak/boot03.s11
4 files changed, 26 insertions, 0 deletions
diff --git a/include/01.pocetak/boot00.s b/include/01.pocetak/boot00.s
new file mode 100644
index 0000000..0e1bfbe
--- /dev/null
+++ b/include/01.pocetak/boot00.s
@@ -0,0 +1,5 @@
+.set ALIGN, 1<<0
+.set MEMINFO, 1<<1
+.set FLAGS, ALIGN | MEMINFO
+.set MAGIC, 0x1BADB002
+.set CHECKSUM, -(MAGIC + FLAGS)
diff --git a/include/01.pocetak/boot01.s b/include/01.pocetak/boot01.s
new file mode 100644
index 0000000..cd7b353
--- /dev/null
+++ b/include/01.pocetak/boot01.s
@@ -0,0 +1,5 @@
+.section .multiboot
+.align 4
+.long MAGIC
+.long FLAGS
+.long CHECKSUM
diff --git a/include/01.pocetak/boot02.s b/include/01.pocetak/boot02.s
new file mode 100644
index 0000000..a9280a6
--- /dev/null
+++ b/include/01.pocetak/boot02.s
@@ -0,0 +1,5 @@
+.section .bss
+.align 16
+stack_bottom:
+.skip 16384
+stack_top:
diff --git a/include/01.pocetak/boot03.s b/include/01.pocetak/boot03.s
new file mode 100644
index 0000000..46a4e7f
--- /dev/null
+++ b/include/01.pocetak/boot03.s
@@ -0,0 +1,11 @@
+.section .text
+.global _start
+.type _start, @function
+_start:
+ mov $stack_top, %esp
+ call kernel_main
+ cli
+1: hlt
+ jmp 1b
+
+.size _start, . - _start