first user application
This commit is contained in:
7
run.sh
7
run.sh
@@ -3,14 +3,19 @@ set -xue
|
||||
|
||||
# QEMU path
|
||||
QEMU=qemu-system-riscv32
|
||||
OBJCOPY=/usr/bin/llvm-objcopy
|
||||
|
||||
# Path to clang and compiler flags
|
||||
CC=clang
|
||||
CFLAGS="-std=c11 -O2 -g3 -Wall -Wextra --target=riscv32-unknown-elf -fno-stack-protector -ffreestanding -nostdlib"
|
||||
|
||||
$CC $CFLAGS -Wl,-Tuser.ld -Wl,-Map=shell.map -o shell.elf shell.c user.c common.c
|
||||
$OBJCOPY --set-section-flags .bss=alloc,contents -O binary shell.elf shell.bin
|
||||
$OBJCOPY -Ibinary -Oelf32-littleriscv shell.bin shell.bin.o
|
||||
|
||||
# Build the kernel
|
||||
$CC $CFLAGS -Wl,-Tkernel.ld -Wl,-Map=kernel.map -o kernel.elf \
|
||||
kernel.c common.c
|
||||
kernel.c common.c shell.bin.o
|
||||
|
||||
# Start QEMU
|
||||
$QEMU -machine virt -bios default -nographic -serial mon:stdio --no-reboot \
|
||||
|
Reference in New Issue
Block a user