代码拉取完成,页面将自动刷新
CC = gcc.exe
ASM = nasm.exe
PYTHON = python.exe
LD = ld.exe
STRIP = strip.exe
OBJFORM = win32
MAKE = mingw32-make.exe
CFLAGS := -c -m32 -nostdlib -fno-stack-protector -fno-builtin -W -Wall -Wstrict-prototypes -Wmissing-prototypes
LDFLAGS = -Ttext 0xc0400000 -e ___main -m i386pe -s
EXEFLAG = -m32 -nostdlib -fno-stack-protector -fno-builtin -W -Wall -Wstrict-prototypes -Wmissing-prototypes
BUILD_PATH = build
KERNEL_PATH = kernel
LIB_PATH = lib
DEV_PATH = device
FS_PATH = filesystem
DEVOBJS := $(BUILD_PATH)/8254.o $(BUILD_PATH)/8259A.o $(BUILD_PATH)/CMOS.o $(BUILD_PATH)/KBController.o $(BUILD_PATH)/PowerMgr.o $(BUILD_PATH)/HardDisk.o
LIBOBJS := $(BUILD_PATH)/rtl.o $(BUILD_PATH)/heap.o $(BUILD_PATH)/handle.o $(BUILD_PATH)/hal.o
KEROBJS := $(BUILD_PATH)/spinlock.o $(BUILD_PATH)/interrupt.o $(BUILD_PATH)/thread.o $(BUILD_PATH)/process.o $(BUILD_PATH)/memory.o $(BUILD_PATH)/syscall.o
FSOBJS := $(BUILD_PATH)/file.o
OBJS := $(BUILD_PATH)/main.o $(BUILD_PATH)/kernel.o $(DEVOBJS) $(LIBOBJS) $(KEROBJS) $(FSOBJS)
EXE = main.exe
ARCH = x86
IMG = hd.img
VM = qemu.exe
.PHONY:clean init build reexec rebuild exec
build:init $(EXE)
$(PYTHON) MakeDisk.py $(IMG) 0 arch/$(ARCH)/mbr.bin 2 arch/$(ARCH)/loader.bin 16 $(EXE)
init:arch/$(ARCH)/mbr.bin arch/$(ARCH)/loader.bin
arch/$(ARCH)/mbr.bin:arch/$(ARCH)/mbr.S
$(ASM) arch/$(ARCH)/mbr.S -f bin -o arch/$(ARCH)/mbr.bin
arch/$(ARCH)/loader.bin:arch/$(ARCH)/loader.S
$(ASM) arch/$(ARCH)/loader.S -f bin -o arch/$(ARCH)/loader.bin
$(EXE):$(OBJS)
$(LD) $(OBJS) $(LDFLAGS) -o $(EXE)
$(BUILD_PATH)/main.o:$(KERNEL_PATH)/main.c
$(CC) $(CFLAGS) $< -o $@
$(DEVOBJS): $(BUILD_PATH)/%.o:$(DEV_PATH)/%.c $(DEV_PATH)/%.h
$(CC) $(CFLAGS) $< -o $@
$(LIBOBJS): $(BUILD_PATH)/%.o:$(LIB_PATH)/%.c $(LIB_PATH)/%.h
$(CC) $(CFLAGS) $< -o $@
$(KEROBJS): $(BUILD_PATH)/%.o:$(KERNEL_PATH)/%.c $(KERNEL_PATH)/%.h
$(CC) $(CFLAGS) $< -o $@
$(FSOBJS): $(BUILD_PATH)/%.o:$(FS_PATH)/%.c $(FS_PATH)/%.h
$(CC) $(CFLAGS) $< -o $@
$(BUILD_PATH)/kernel.o:$(KERNEL_PATH)/kernel.S
$(ASM) $< -f $(OBJFORM) -o $@
rebuild:clean build
reexec:rebuild
$(VM) -hda $(IMG)
exec:build
$(VM) -hda $(IMG) -hdb .\a.exe
clean:
$(RM) $(OBJS) $(IMG) $(EXE) arch/$(ARCH)/mbr.bin arch/$(ARCH)/loader.bin
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。