From: Minep Date: Sat, 5 Feb 2022 23:19:35 +0000 (+0000) Subject: course 1 and project setup X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/commitdiff_plain/ca038e65d1ccf0dae9e624baa4b4d173ea8ad175 course 1 and project setup --- diff --git a/.gitignore b/.gitignore index a8b2e7a..6f9db1d 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 0000000..8e019a5 --- /dev/null +++ b/lunaix-os/arch/x86/boot.S @@ -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 index 0000000..60f5943 --- /dev/null +++ b/lunaix-os/arch/x86/multiboot.h @@ -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 diff --git a/practice-c0/slide.odp b/practice-c0/slides.odp similarity index 97% rename from practice-c0/slide.odp rename to practice-c0/slides.odp index 25a0c81..b23ac34 100644 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 index 0000000..0298ab3 Binary files /dev/null and b/practice-c1/slides.odp differ