Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0454127)
raw | patch | inline | side by side (parent: 0454127)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Thu, 4 Nov 2021 02:40:31 +0000 (10:40 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Thu, 4 Nov 2021 02:40:31 +0000 (10:40 +0800) |
| Makefile | patch | blob | history | |
| boot/boot.c | patch | blob | history | |
| boot/boot.h | [moved from include/boot/boot.h with 100% similarity] | patch | blob | history |
| boot/multiboot.S | patch | blob | history | |
| boot/multiboot.h | [moved from include/boot/multiboot.h with 100% similarity] | patch | blob | history |
| include/stdio.h | patch | blob | history | |
| kernel/setup.c | patch | blob | history | |
| mm/bootmem.c | patch | blob | history | |
| mm/buddy.c | patch | blob | history | |
| mm/mm.c | patch | blob | history | |
| mm/slub.c | patch | blob | history |
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
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%}
diff --git a/boot/boot.c b/boot/boot.c
--- a/boot/boot.c
+++ b/boot/boot.c
#include <assert.h>
#include <bits.h>
-#include <boot/boot.h>
+#include <boot.h>
#include <page.h>
#include <system.h>
diff --git a/include/boot/boot.h b/boot/boot.h
diff --git a/boot/multiboot.S b/boot/multiboot.S
--- a/boot/multiboot.S
+++ b/boot/multiboot.S
*--------------------------------------------------------------------------
*/
#define ASM
-#include "boot/boot.h"
+#include "boot.h"
#include "system.h"
#include "task.h"
.global kernel_entry
# 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)
diff --git a/include/boot/multiboot.h b/boot/multiboot.h
diff --git a/include/stdio.h b/include/stdio.h
--- a/include/stdio.h
+++ b/include/stdio.h
#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);
diff --git a/kernel/setup.c b/kernel/setup.c
--- a/kernel/setup.c
+++ b/kernel/setup.c
#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();
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();
diff --git a/mm/bootmem.c b/mm/bootmem.c
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
* Description: none
* ------------------------------------------------------------------------
*/
-#include <boot/boot.h>
+#include <boot.h>
#include <mm.h>
#include <printk.h>
#include <system.h>
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
+}
diff --git a/mm/buddy.c b/mm/buddy.c
--- a/mm/buddy.c
+++ b/mm/buddy.c
*/
#include <irq.h>
#include <mm.h>
+#include <string.h>
#include <sysctl.h>
struct buddy_system {
--- a/mm/mm.c
+++ b/mm/mm.c
*--------------------------------------------------------------------------
*/
#include <bits.h>
-#include <boot/boot.h>
+#include <boot.h>
#include <linkage.h>
#include <mm.h>
#include <page.h>
diff --git a/mm/slub.c b/mm/slub.c
--- a/mm/slub.c
+++ b/mm/slub.c
printk("kmalloc addr %08x\n", (unsigned long) addr);
addrs[i] = addr;
}
-#endifq
+#endif
}