An error occurred while loading the file. Please try again.
-
夏彦文 authored345f4fe7
TOOLPREFIX := riscv64-unknown-elf-
CC = $(TOOLPREFIX)gcc
AS = $(TOOLPREFIX)gas
LD = $(TOOLPREFIX)ld
CXX = $(TOOLPREFIX)g++
LD = $(TOOLPREFIX)ld
AR = $(TOOLPREFIX)ar
OBJCOPY = $(TOOLPREFIX)objcopy
OBJDUMP = $(TOOLPREFIX)objdump
platform := visionfive
# platform := qemu
mode := debug
ifeq ($(mode), debug)
CFLAGS += -DDEBUG
endif
K=kernel/src
U=xv6-user
T=target
# OBJS =
# ifeq ($(platform), visionfive)
# # set entry
# OBJS += $(KSYS)/entry_visionfive.o
# OBJS += \
# $(KFS)/sd_final.o
# # set linker
# linker = ./linker/visionfive.ld
# # init CFLAGS
# CFLAGS += -D visionfive
# else
# OBJS += $(KSYS)/entry_qemu.o
# OBJS += \
# $(KDV)/virtio_disk.o
# linker = ./linker/qemu.ld
# CFLAGS += -D QEMU
# endif
CFLAGS += -Wall -O0 -fno-omit-frame-pointer -ggdb -g -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax
CFLAGS += -I.
CFLAGS += -Ikernel/include
CFLAGS += -Ixv6-user/
# CFLAGS += -Ikernel
# CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
LDFLAGS = -z max-page-size=4096
image = $T/kernel.bin
dst=mnt_new
QEMU = qemu-system-riscv64
CPUS := 1
QEMUOPTS += -machine virt -m 8G -nographic -kernel target/kernel \
-smp $(CPUS) \
-bios default \
-drive file=fs.img,if=none,format=raw,id=x0 \
-device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
UPROGS=\
$U/_init\
$U/_sh\
$U/_cat\
$U/_echo\
$U/_grep\
$U/_ls\
$U/_kill\
$U/_mkdir\
$U/_xargs\
$U/_find\