course 1 and project setup
authorMinep <zelong56@gmail.com>
Sat, 5 Feb 2022 23:19:35 +0000 (23:19 +0000)
committerMinep <zelong56@gmail.com>
Sat, 5 Feb 2022 23:19:35 +0000 (23:19 +0000)
.gitignore
lunaix-os/arch/x86/boot.S [new file with mode: 0644]
lunaix-os/arch/x86/multiboot.h [new file with mode: 0644]
practice-c0/slides.odp [moved from practice-c0/slide.odp with 97% similarity]
practice-c1/slides.odp [new file with mode: 0644]

index a8b2e7a0b3ac3eaad635f119fb3beaaded625b04..6f9db1df1c03e3178d120022e9bd1ca39c8eab27 100644 (file)
@@ -1,2 +1,3 @@
-os-dev
 slide-resources
+
+workspace
diff --git a/lunaix-os/arch/x86/boot.S b/lunaix-os/arch/x86/boot.S
new file mode 100644 (file)
index 0000000..8e019a5
--- /dev/null
@@ -0,0 +1,32 @@
+#include "multiboot.h"
+
+.section .multiboot
+    .long MB_MAGIC
+    .long MB_ALIGNED_4K_MEM_MAP
+    .long CHECKSUM(MB_ALIGNED_4K_MEM_MAP)
+
+.section .bss
+    /* According to System V ABI, the stack must be aligned at 16 bytes boundary */
+    .align 16
+    stack_bottom:
+        .skip 16318, 0
+    stack_top:
+
+.section .text
+    start_:
+        movl $stack_top, %esp
+        /* 
+            TODO: kernel init
+                1. Load GDT
+                2. Load IDT
+                3. Enable paging
+        */
+        call _kernel_init
+
+        pushl %ebx
+        call _kernel_main
+
+        cli
+    j_:
+        hlt
+        jmp j_
\ No newline at end of file
diff --git a/lunaix-os/arch/x86/multiboot.h b/lunaix-os/arch/x86/multiboot.h
new file mode 100644 (file)
index 0000000..60f5943
--- /dev/null
@@ -0,0 +1,3 @@
+#define MB_MAGIC 0x1BADB002
+#define MB_ALIGNED_4K_MEM_MAP 0x03
+#define CHECKSUM(flags)     -(MB_MAGIC+flags)
\ No newline at end of file
similarity index 97%
rename from practice-c0/slide.odp
rename to practice-c0/slides.odp
index 25a0c815dd084fd74e902f62788d52805542a092..b23ac3442e207fbbdd21435ea4ea60582b55959f 100644 (file)
Binary files a/practice-c0/slide.odp and b/practice-c0/slides.odp differ
diff --git a/practice-c1/slides.odp b/practice-c1/slides.odp
new file mode 100644 (file)
index 0000000..0298ab3
Binary files /dev/null and b/practice-c1/slides.odp differ