~/workspace/SimpleKernel
☺ bash ./run.sh main 4c86b9db
-- Found brew /opt/homebrew/bin/brew
-- Found riscv64-unknown-elf-gcc /opt/homebrew/bin/riscv64-unknown-elf-gcc.
-- Found qemu /opt/homebrew/bin/qemu-system-riscv64
-- Found brew /opt/homebrew/bin/brew
-- Found riscv64-unknown-elf-gcc /opt/homebrew/bin/riscv64-unknown-elf-gcc.
-- Found qemu /opt/homebrew/bin/qemu-system-riscv64
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/homebrew/bin/riscv64-unknown-elf-gcc
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - no
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/bin/riscv64-unknown-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- SimpleKernelArch is riscv64
-- CMAKE_BUILD_TYPE is DEBUG
-- CMAKE_C_FLAGS is -march=rv64imafdc -Driscv64 -g -ggdb -O0 -ffreestanding -nostdlib -nostdinc -fexceptions -nostartfiles -fPIC -no-pie -Wall -Wextra -MMD
-- CMAKE_CXX_FLAGS is -march=rv64imafdc -Driscv64 -g -ggdb -O0 -ffreestanding -nostdlib -nostdinc -fexceptions -nostartfiles -fPIC -no-pie -Wall -Wextra -MMD
-- CMAKE_ASM_FLAGS is -march=rv64imafdc -Driscv64 -g -ggdb -O0 -ffreestanding -nostdlib -nostdinc -fexceptions -nostartfiles -fPIC -no-pie -Wall -Wextra -MMD
-- TOOLCHAIN_PREFIX is riscv64-unknown-elf-
-- CMAKE_OBJCOPY is /opt/homebrew/bin/riscv64-unknown-elf-objcopy
-- found asm files: /Users/cmz/workspace/SimpleKernel/src/arch/riscv64/boot/boot.S
-- found asm files: /Users/cmz/workspace/SimpleKernel/src/arch/riscv64/intr/intr_s.S
-- The C compiler identification is GNU 13.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - no
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/bin/riscv64-unknown-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- found asm files: /Users/cmz/workspace/SimpleKernel/src/libcxx/src/__dso_handle.S
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/cmz/workspace/SimpleKernel/build_riscv64
[ 3%] Building ASM object src/libcxx/CMakeFiles/libcxx.dir/src/__dso_handle.S.o
[ 6%] Building CXX object src/libcxx/CMakeFiles/libcxx.dir/src/cxxabi.cpp.o
[ 9%] Building CXX object src/libcxx/CMakeFiles/libcxx.dir/src/iostream.cpp.o
[ 12%] Building CXX object src/libcxx/CMakeFiles/libcxx.dir/src/new.cpp.o
[ 16%] Building CXX object src/libcxx/CMakeFiles/libcxx.dir/src/stack_chk.cpp.o
[ 16%] Built target libcxx
[ 19%] Building ASM object src/arch/riscv64/CMakeFiles/arch.dir/boot/boot.S.o
[ 22%] Building ASM object src/arch/riscv64/CMakeFiles/arch.dir/intr/intr_s.S.o
[ 25%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/clint.cpp.o
[ 29%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/intr.cpp.o
[ 32%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/page_fault.cpp.o
[ 35%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/plic.cpp.o
[ 38%] Building CXX object src/arch/riscv64/CMakeFiles/arch.dir/intr/timer.cpp.o
[ 38%] Built target arch
[ 41%] Building CXX object src/kernel/CMakeFiles/kernel.dir/allocator.cpp.o
[ 45%] Building CXX object src/kernel/CMakeFiles/kernel.dir/firstfit.cpp.o
[ 48%] Building CXX object src/kernel/CMakeFiles/kernel.dir/heap.cpp.o
[ 51%] Building CXX object src/kernel/CMakeFiles/kernel.dir/io.cpp.o
[ 54%] Building CXX object src/kernel/CMakeFiles/kernel.dir/kernel_main.cpp.o
[ 58%] Building CXX object src/kernel/CMakeFiles/kernel.dir/pmm.cpp.o
[ 61%] Building CXX object src/kernel/CMakeFiles/kernel.dir/slab.cpp.o
[ 64%] Building CXX object src/kernel/CMakeFiles/kernel.dir/test.cpp.o
[ 67%] Building CXX object src/kernel/CMakeFiles/kernel.dir/vmm.cpp.o
[ 67%] Built target kernel
[ 70%] Building CXX object src/drv/CMakeFiles/drv.dir/opensbi/opensbi.cpp.o
[ 74%] Building CXX object src/drv/CMakeFiles/drv.dir/sbi_console/sbi_console.cpp.o
[ 77%] Building CXX object src/drv/CMakeFiles/drv.dir/dtb/dtb.cpp.o
[ 77%] Built target drv
[ 80%] Building C object src/libc/CMakeFiles/libc.dir/src/stdio/vsprintf.c.o
[ 83%] Building C object src/libc/CMakeFiles/libc.dir/src/stdlib/atoi.c.o
[ 87%] Building C object src/libc/CMakeFiles/libc.dir/src/stdlib/itoa.c.o
[ 90%] Building C object src/libc/CMakeFiles/libc.dir/src/stdlib/strtol.c.o
[ 93%] Building C object src/libc/CMakeFiles/libc.dir/src/string/string.c.o
[ 96%] Building C object src/libc/CMakeFiles/libc.dir/src/math/math.c.o
[ 96%] Built target libc
[100%] Linking CXX executable ../bin/kernel.elf
/opt/homebrew/Cellar/riscv-gnu-toolchain/main/lib/gcc/riscv64-unknown-elf/13.2.0/../../../../riscv64-unknown-elf/bin/ld: warning: ../bin/kernel.elf has a LOAD segment with RWX permissions
Generating kernel debug...
Generating raw kernel...
nm...
readelf...
Disassembling...
[100%] Built target kernel.elf
OpenSBI v1.2
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|
Platform Name : riscv-virtio,qemu
Platform Features : medeleg
Platform HART Count : 1
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 10000000Hz
Platform Console Device : uart8250
Platform HSM Device : ---
Platform PMU Device : ---
Platform Reboot Device : sifive_test
Platform Shutdown Device : sifive_test
Firmware Base : 0x80000000
Firmware Size : 200 KB
Runtime SBI Version : 1.0
Domain0 Name : root
Domain0 Boot HART : 0
Domain0 HARTs : 0*
Domain0 Region00 : 0x0000000002000000-0x000000000200ffff (I)
Domain0 Region01 : 0x0000000080000000-0x000000008003ffff ()
Domain0 Region02 : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address : 0x0000000080200000
Domain0 Next Arg1 : 0x0000000082200000
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Boot HART ID : 0
Boot HART Domain : root
Boot HART Priv Version : v1.12
Boot HART Base ISA : rv64imafdch
Boot HART ISA Extensions : time,sstc
Boot HART PMP Count : 16
Boot HART PMP Granularity : 4
Boot HART PMP Address Bits: 54
Boot HART MHPM Count : 16
Boot HART MIDELEG : 0x0000000000001666
Boot HART MEDELEG : 0x0000000000f0b509
sbi console init.
BOOT_INFO init.
First Fit Allocator(kernel space): 0x0000000080200000(0x800 pages) init.
First Fit Allocator: 0x0000000080A00000(0x7800 pages) init.
BOOT_INFO reinit.
pmm init.
pmm test done.
paging enabled.
vmm init.
vmm test done.
SLAB Allocator Kernel: 0x0000000080200000(0x0000000800000000 bytes) init.
SLAB Allocator: 0x0000000080A00000(0x0000007800000000 bytes) init.
heap init.
heap test done.
clint init.
plic init.
intr init.
sepc: 0x000000008021D4BC, stval: 0x00000000C0000000, scause: 0x000000000000000D, all_regs(sp): 0x000000008020FD98, sie: 0x0000000000000202
sstatus: val: 0x8000000200006100, sie: disable, spie: disable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
pg_load_excp done: 0x00000000C0000000.
sepc: 0x000000008021D4F2, stval: 0x00000000C0000000, scause: 0x000000000000000F, all_regs(sp): 0x000000008020FD98, sie: 0x0000000000000202
sstatus: val: 0x8000000200006100, sie: disable, spie: disable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
pg_store_excp done: 0x00000000C0000000.
intr test done.
timer init.
sepc: 0x000000008021B138, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FD78, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
Kernel start: 0x0000000080200000, end 0x000000008023BA00, size: 0x3BA00 bytes, 0x3C pages.
Kernel start4k: 0x0000000080200000, end4k: 0x000000008023C000.
Simple Kernel.
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x000000008020FDB8, sie: 0x0000000000000222
sstatus: val: 0x8000000200006120, sie: disable, spie: enable, spp: S mode,
satp: val: 0x800000000008023E, ppn: 0x000000000008023E, asid: 0x0000000000000000, mode: SV39,
sscratch: 0x0000000000000000
sepc: 0x000000008021B1D6, stval: 0x0000000000000000, scause: 0x8000000000000005, all_regs(sp): 0x00