meta: rename
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include <socks/sched.h>
|
||||
#include <socks/compiler.h>
|
||||
#include <mango/sched.h>
|
||||
#include <mango/compiler.h>
|
||||
|
||||
//size_t THREAD_sp = offsetof(struct thread, tr_sp);
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
LD := $(SOCKS_ARCH)-elf-gcc
|
||||
CC := $(SOCKS_ARCH)-elf-gcc
|
||||
CXX := $(SOCKS_ARCH)-elf-g++
|
||||
ASM := $(SOCKS_ARCH)-elf-gcc
|
||||
OBJCOPY := $(SOCKS_ARCH)-elf-objcopy
|
||||
STRIP := $(SOCKS_ARCH)-elf-strip
|
||||
|
||||
CFLAGS := -ffreestanding -nostdlib
|
||||
CXXFLAGS := $(CFLAGS)
|
||||
ASMFLAGS := $(CFLAGS)
|
||||
LDFLAGS := -nostdlib
|
||||
|
||||
ARCH_CFLAGS := -z max-page-size=0x1000 -m64 -mcmodel=large -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -D_64BIT -DBYTE_ORDER=1234
|
||||
ARCH_LDFLAGS := -z max-page-size=0x1000 -T arch/x86_64/layout.ld
|
||||
|
||||
ARCH_DIR := arch/$(SOCKS_ARCH)
|
||||
|
||||
ARCH_C_FILES := $(wildcard $(ARCH_DIR)/*.c) $(wildcard $(ARCH_DIR)/acpi/*.c)
|
||||
ARCH_CXX_FILES := $(wildcard $(ARCH_DIR)/*.cpp) $(wildcard $(ARCH_DIR)/acpi/*.cpp)
|
||||
ARCH_ASM_FILES := $(wildcard $(ARCH_DIR)/*.S) $(wildcard $(ARCH_DIR)/acpi/*.S)
|
||||
ARCH_OBJ := $(addprefix $(BUILD_DIR)/,$(ARCH_C_FILES:.c=.o) $(ARCH_CXX_FILES:.cpp=.o) $(ARCH_ASM_FILES:.S=.o))
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <socks/machine/cpu.h>
|
||||
#include <mango/machine/cpu.h>
|
||||
#include <arch/msr.h>
|
||||
|
||||
int ml_cpu_block_init(ml_cpu_block *p)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "socks/types.h"
|
||||
#include <socks/memblock.h>
|
||||
#include <socks/printk.h>
|
||||
#include <socks/util.h>
|
||||
#include "mango/types.h"
|
||||
#include <mango/memblock.h>
|
||||
#include <mango/printk.h>
|
||||
#include <mango/util.h>
|
||||
#include <arch/e820.h>
|
||||
|
||||
void e820_scan(multiboot_memory_map_t *mmap, size_t len)
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
QEMU := qemu-system-x86_64
|
||||
#QEMU_MONITOR_FLAGS := -serial file:$(BUILD_DIR)socks.log -monitor stdio
|
||||
QEMU_MONITOR_FLAGS := -serial stdio
|
||||
QEMU_FLAGS := \
|
||||
-m 10M \
|
||||
-display sdl \
|
||||
-smp 4 -cpu qemu64,pdpe1gb
|
||||
|
||||
ARCH_TEMP_FILES := $(BUILD_DIR)/$(KERNEL_EXEC).elf32
|
||||
|
||||
# qemu refuses to boot ELF64 binaries. this creates a patched version of the kernel
|
||||
# binary to trick qemu into thinking its an ELF32.
|
||||
# this has no effect on the kernel itself; the x86_64 kernel's
|
||||
# entry point is 32-bit machine code.
|
||||
$(BUILD_DIR)/$(KERNEL_EXEC).elf32: $(BUILD_DIR)/$(KERNEL_EXEC)
|
||||
@cp $(BUILD_DIR)/$(KERNEL_EXEC) $(BUILD_DIR)/$(KERNEL_EXEC).elf32
|
||||
$(BUILD_DIR)/tools/e64patch/e64patch $(BUILD_DIR)/$(KERNEL_EXEC).elf32
|
||||
|
||||
$(BUILD_DIR)/socks-kernel.iso: $(BUILD_DIR)/$(KERNEL_EXEC)
|
||||
@$(BUILD_DIR)/../tools/socks.mkrescue
|
||||
|
||||
run: $(BUILD_DIR)/$(KERNEL_EXEC) $(BUILD_DIR)/$(KERNEL_EXEC).elf32
|
||||
@printf " \033[1;93mQEMU\033[0m $<\n"
|
||||
|
||||
@$(QEMU) -kernel $(BUILD_DIR)/$(KERNEL_EXEC).elf32 $(QEMU_FLAGS) $(QEMU_MONITOR_FLAGS)
|
||||
|
||||
run-curses: $(BUILD_DIR)/$(KERNEL_EXEC) $(BUILD_DIR)/$(KERNEL_EXEC).elf32
|
||||
@printf " \033[1;93mQEMU\033[0m $<\n"
|
||||
|
||||
@$(QEMU) -kernel $(BUILD_DIR)/$(KERNEL_EXEC).elf32 $(QEMU_FLAGS) $(QEMU_MONITOR_FLAGS)
|
||||
|
||||
run-cd-curses: $(BUILD_DIR)/socks-kernel.iso
|
||||
@printf " \033[1;93mQEMU\033[0m $<\n"
|
||||
|
||||
@$(QEMU) -cdrom $(BUILD_DIR)/socks-kernel.iso $(QEMU_FLAGS) -display curses -serial file:$(BUILD_DIR)/socks.log
|
||||
|
||||
debug: $(BUILD_DIR)/$(KERNEL_EXEC) $(BUILD_DIR)/$(KERNEL_EXEC).elf32
|
||||
@./tools/kernel-debug/debug_session.sh \
|
||||
tools/kernel-debug/gdb_session_init \
|
||||
tools/kernel-debug/lldb_session_init \
|
||||
$(QEMU) \
|
||||
-kernel $(BUILD_DIR)/$(KERNEL_EXEC).elf32 -S -s \
|
||||
-monitor stdio -serial file:$(BUILD_DIR)/socks.log $(QEMU_FLAGS)
|
||||
|
||||
|
||||
debug-curses: $(BUILD_DIR)/$(KERNEL_EXEC) $(BUILD_DIR)/$(KERNEL_EXEC).elf32
|
||||
@./tools/kernel-debug/debug_session.sh \
|
||||
tools/kernel-debug/gdb_session_init \
|
||||
tools/kernel-debug/lldb_session_init \
|
||||
$(QEMU) \
|
||||
-kernel $(BUILD_DIR)/$(KERNEL_EXEC).elf32 -S -s \
|
||||
-display curses -serial file:$(BUILD_DIR)/socks.log $(QEMU_FLAGS) > build/qemu.log
|
||||
|
||||
debug-cd-curses: $(BUILD_DIR)/socks-kernel.iso
|
||||
@./tools/kernel-debug/debug_session.sh \
|
||||
tools/kernel-debug/gdb_session_init \
|
||||
tools/kernel-debug/lldb_session_init \
|
||||
$(QEMU) \
|
||||
-cdrom $(BUILD_DIR)/socks-kernel.iso -S -s \
|
||||
-display curses -serial file:$(BUILD_DIR)/socks.log $(QEMU_FLAGS) > build/qemu.log
|
||||
|
||||
run-bochs: $(BUILD_DIR)/socks-kernel.iso
|
||||
@printf " \033[1;93mBOCHS\033[0m $<\n"
|
||||
@bochs -f $(BUILD_DIR)/../tools/bochsrc.bxrc
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <socks/libc/string.h>
|
||||
#include <mango/libc/string.h>
|
||||
#include <arch/gdt.h>
|
||||
|
||||
static void init_entry(struct gdt_entry *entry, int access, int flags)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef ARCH_GDT_H_
|
||||
#define ARCH_GDT_H_
|
||||
|
||||
#include <socks/compiler.h>
|
||||
#include <mango/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef ARCH_IRQ_H_
|
||||
#define ARCH_IRQ_H_
|
||||
|
||||
#include <socks/compiler.h>
|
||||
#include <socks/queue.h>
|
||||
#include <mango/compiler.h>
|
||||
#include <mango/queue.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef ARCH_PAGING_H_
|
||||
#define ARCH_PAGING_H_
|
||||
|
||||
#include <socks/types.h>
|
||||
#include <socks/compiler.h>
|
||||
#include <mango/types.h>
|
||||
#include <mango/compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef SOCKS_X86_64_CPU_H_
|
||||
#define SOCKS_X86_64_CPU_H_
|
||||
#ifndef MANGO_X86_64_CPU_H_
|
||||
#define MANGO_X86_64_CPU_H_
|
||||
|
||||
#include <arch/gdt.h>
|
||||
#include <arch/irq.h>
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef SOCKS_X86_64_HWLOCK_H_
|
||||
#define SOCKS_X86_64_HWLOCK_H_
|
||||
#ifndef MANGO_X86_64_HWLOCK_H_
|
||||
#define MANGO_X86_64_HWLOCK_H_
|
||||
|
||||
#define ML_HWLOCK_INIT (0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef SOCKS_X86_64_INIT_H_
|
||||
#define SOCKS_X86_64_INIT_H_
|
||||
#ifndef MANGO_X86_64_INIT_H_
|
||||
#define MANGO_X86_64_INIT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
5
arch/x86_64/include/mango/machine/irq.h
Normal file
5
arch/x86_64/include/mango/machine/irq.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#ifndef MANGO_X86_64_IRQ_H_
|
||||
#define MANGO_X86_64_IRQ_H_
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef SOCKS_X86_64_PANIC_H_
|
||||
#define SOCKS_X86_64_PANIC_H_
|
||||
#ifndef MANGO_X86_64_PANIC_H_
|
||||
#define MANGO_X86_64_PANIC_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef SOCKS_X86_64_PMAP_H_
|
||||
#define SOCKS_X86_64_PMAP_H_
|
||||
#ifndef MANGO_X86_64_PMAP_H_
|
||||
#define MANGO_X86_64_PMAP_H_
|
||||
|
||||
#include <arch/paging.h>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef SOCKS_X86_64_THREAD_H_
|
||||
#define SOCKS_X86_64_THREAD_H_
|
||||
#ifndef MANGO_X86_64_THREAD_H_
|
||||
#define MANGO_X86_64_THREAD_H_
|
||||
|
||||
#include <socks/sched.h>
|
||||
#include <mango/sched.h>
|
||||
|
||||
extern void switch_to(struct thread *from, struct thread *to);
|
||||
extern void prepare_stack(uintptr_t ip, uintptr_t *sp);
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef SOCKS_X86_64_VM_H_
|
||||
#define SOCKS_X86_64_VM_H_
|
||||
#ifndef MANGO_X86_64_VM_H_
|
||||
#define MANGO_X86_64_VM_H_
|
||||
|
||||
/* kernel higher-half base virtual address. */
|
||||
#define VM_KERNEL_VOFFSET 0xFFFFFFFF80000000
|
||||
@@ -1,5 +0,0 @@
|
||||
#ifndef SOCKS_X86_64_IRQ_H_
|
||||
#define SOCKS_X86_64_IRQ_H_
|
||||
|
||||
|
||||
#endif
|
||||
@@ -2,20 +2,20 @@
|
||||
|
||||
#include <arch/e820.h>
|
||||
#include <arch/pit.h>
|
||||
#include <socks/arg.h>
|
||||
#include <socks/clock.h>
|
||||
#include <socks/console.h>
|
||||
#include <socks/cpu.h>
|
||||
#include <socks/init.h>
|
||||
#include <socks/libc/stdio.h>
|
||||
#include <socks/machine/cpu.h>
|
||||
#include <socks/memblock.h>
|
||||
#include <socks/object.h>
|
||||
#include <socks/percpu.h>
|
||||
#include <socks/pmap.h>
|
||||
#include <socks/printk.h>
|
||||
#include <socks/types.h>
|
||||
#include <socks/vm.h>
|
||||
#include <mango/arg.h>
|
||||
#include <mango/clock.h>
|
||||
#include <mango/console.h>
|
||||
#include <mango/cpu.h>
|
||||
#include <mango/init.h>
|
||||
#include <mango/libc/stdio.h>
|
||||
#include <mango/machine/cpu.h>
|
||||
#include <mango/memblock.h>
|
||||
#include <mango/object.h>
|
||||
#include <mango/percpu.h>
|
||||
#include <mango/pmap.h>
|
||||
#include <mango/printk.h>
|
||||
#include <mango/types.h>
|
||||
#include <mango/vm.h>
|
||||
|
||||
#define PTR32(x) ((void *)((uintptr_t)(x)))
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <socks/init.h>
|
||||
#include <mango/init.h>
|
||||
|
||||
extern char __initcall0_start[];
|
||||
extern char __initcall1_start[];
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include <arch/irq.h>
|
||||
#include <arch/ports.h>
|
||||
#include <socks/cpu.h>
|
||||
#include <socks/libc/string.h>
|
||||
#include <socks/machine/cpu.h>
|
||||
#include <socks/machine/irq.h>
|
||||
#include <socks/panic.h>
|
||||
#include <socks/sched.h>
|
||||
#include <mango/cpu.h>
|
||||
#include <mango/libc/string.h>
|
||||
#include <mango/machine/cpu.h>
|
||||
#include <mango/machine/irq.h>
|
||||
#include <mango/panic.h>
|
||||
#include <mango/sched.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define MAX_ISR_HANDLERS 16
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "socks/machine/panic.h"
|
||||
#include "socks/vm.h"
|
||||
#include <socks/printk.h>
|
||||
#include <socks/libc/stdio.h>
|
||||
#include "mango/machine/panic.h"
|
||||
#include "mango/vm.h"
|
||||
#include <mango/printk.h>
|
||||
#include <mango/libc/stdio.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#define R_CF 0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <arch/irq.h>
|
||||
#include <arch/ports.h>
|
||||
#include <socks/clock.h>
|
||||
#include <socks/cpu.h>
|
||||
#include <socks/printk.h>
|
||||
#include <mango/clock.h>
|
||||
#include <mango/cpu.h>
|
||||
#include <mango/printk.h>
|
||||
|
||||
#define PIT_COUNTER0 0x40
|
||||
#define PIT_CMD 0x43
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include <socks/types.h>
|
||||
#include <socks/memblock.h>
|
||||
#include <socks/vm.h>
|
||||
#include <socks/printk.h>
|
||||
#include <socks/status.h>
|
||||
#include <socks/compiler.h>
|
||||
#include <socks/pmap.h>
|
||||
#include <mango/types.h>
|
||||
#include <mango/memblock.h>
|
||||
#include <mango/vm.h>
|
||||
#include <mango/printk.h>
|
||||
#include <mango/status.h>
|
||||
#include <mango/compiler.h>
|
||||
#include <mango/pmap.h>
|
||||
|
||||
/* some helpful datasize constants */
|
||||
#define C_1GiB 0x40000000ULL
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include <arch/irq.h>
|
||||
#include <arch/ports.h>
|
||||
#include <arch/serial.h>
|
||||
#include <socks/device.h>
|
||||
#include <socks/kext.h>
|
||||
#include <socks/libc/stdio.h>
|
||||
#include <socks/printk.h>
|
||||
#include <socks/tty.h>
|
||||
#include <mango/device.h>
|
||||
#include <mango/kext.h>
|
||||
#include <mango/libc/stdio.h>
|
||||
#include <mango/printk.h>
|
||||
#include <mango/tty.h>
|
||||
|
||||
#define COM1 0x3F8
|
||||
#define COM2 0x2F8
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <socks/machine/thread.h>
|
||||
#include <mango/machine/thread.h>
|
||||
|
||||
struct thread_ctx {
|
||||
uint64_t r15, r14, r13, r12, r11, r10, r9, r8;
|
||||
|
||||
Reference in New Issue
Block a user