]> Zhao Yanbai Git Server - kernel.git/commitdiff
authorzhaoyanbai <zhaoyanbai@126.com>
Thu, 4 Nov 2021 02:40:31 +0000 (10:40 +0800)
committerzhaoyanbai <zhaoyanbai@126.com>
Thu, 4 Nov 2021 02:40:31 +0000 (10:40 +0800)
Makefile
boot/boot.c
boot/boot.h [moved from include/boot/boot.h with 100% similarity]
boot/multiboot.S
boot/multiboot.h [moved from include/boot/multiboot.h with 100% similarity]
include/stdio.h
kernel/setup.c
mm/bootmem.c
mm/buddy.c
mm/mm.c
mm/slub.c

index 7648af5..428b585 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ KERNELBIN     = KERNEL.BIN
 LINKSCRIPT     = scripts/link.ld
 
 SRC_DIRS = boot mm lib fs kernel drivers
-INC_DIRS = include drivers
+INC_DIRS = include drivers boot
 
 CFLAGS += ${INC_DIRS:%=-I%}
 
index c3e3ee7..35b9fc4 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <assert.h>
 #include <bits.h>
-#include <boot/boot.h>
+#include <boot.h>
 #include <page.h>
 #include <system.h>
 
similarity index 100%
rename from include/boot/boot.h
rename to boot/boot.h
index 372e07a..2209b1e 100644 (file)
@@ -14,7 +14,7 @@
  *--------------------------------------------------------------------------
  */
 #define ASM
-#include "boot/boot.h"
+#include "boot.h"
 #include "system.h"
 #include "task.h"
 .global kernel_entry
@@ -148,4 +148,4 @@ GDTR:
     # Flags
     .long MULTIBOOT_HEADER_FLAGS
     # Checksum
-    .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
\ No newline at end of file
+    .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
similarity index 100%
rename from include/boot/multiboot.h
rename to boot/multiboot.h
index 1b36e1d..b6ba90d 100644 (file)
@@ -19,6 +19,7 @@
 #include <string.h>
 #include <syscall.h>
 extern int write(int fd, const char *buf, unsigned long size);
+extern int vsprintf(char *buf, const char *fmt, char *args);
 static inline int printf(const char *fmt, ...) {
     char ptfbuf[512];
     char *args = (char *)(((char *)&fmt) + 4);
index e6a0c43..fcddc9d 100644 (file)
@@ -18,6 +18,8 @@
 #include <printk.h>
 #include <system.h>
 
+extern void vga_init();
+extern void init_mm();
 extern void setup_gdt();
 extern void setup_idt();
 extern void setup_gate();
@@ -26,6 +28,7 @@ extern void setup_sysc();
 extern void setup_pci();
 extern void set_tss();
 extern void setup_tasks();
+extern void setup_irqs();
 extern void ide_init();
 extern void setup_fs();
 extern void setup_ext2();
index c6eaa08..418f313 100644 (file)
@@ -6,7 +6,7 @@
  * Description: none
  * ------------------------------------------------------------------------
  */
-#include <boot/boot.h>
+#include <boot.h>
 #include <mm.h>
 #include <printk.h>
 #include <system.h>
@@ -209,4 +209,4 @@ find_next_block:
     printk("%s alloc bootmem size: %x pfn cnt: %d [%d, %d)\n", title, size, pfn_cnt, bgn_pfn, end_pfn);
 
     return region;
-}
\ No newline at end of file
+}
index d2ceed7..e7f58cf 100644 (file)
@@ -8,6 +8,7 @@
  */
 #include <irq.h>
 #include <mm.h>
+#include <string.h>
 #include <sysctl.h>
 
 struct buddy_system {
diff --git a/mm/mm.c b/mm/mm.c
index cd4509e..323306e 100644 (file)
--- a/mm/mm.c
+++ b/mm/mm.c
@@ -14,7 +14,7 @@
  *--------------------------------------------------------------------------
  */
 #include <bits.h>
-#include <boot/boot.h>
+#include <boot.h>
 #include <linkage.h>
 #include <mm.h>
 #include <page.h>
index d182f2c..92547e9 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -310,5 +310,5 @@ void init_slub_system() {
         printk("kmalloc addr %08x\n", (unsigned long) addr);
         addrs[i] = addr;
     }
-#endifq
+#endif
 }