From e2b78d20b80d89321d8d9df3ab8ade8407642dfc Mon Sep 17 00:00:00 2001 From: Aleksa Vučković Date: Sun, 2 Jan 2022 22:56:02 +0100 Subject: Adding code --- include/01.pocetak/boot00.s | 5 +++++ include/01.pocetak/boot01.s | 5 +++++ include/01.pocetak/boot02.s | 5 +++++ include/01.pocetak/boot03.s | 11 +++++++++++ 4 files changed, 26 insertions(+) create mode 100644 include/01.pocetak/boot00.s create mode 100644 include/01.pocetak/boot01.s create mode 100644 include/01.pocetak/boot02.s create mode 100644 include/01.pocetak/boot03.s (limited to 'include/01.pocetak') 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 -- cgit v1.2.3