Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/linker-qemu.ld
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ SECTIONS

.bss ALIGN(4K): {
sbss = .;
.=ALIGN(4K);
*(.bss.stack)
*(.bss .bss.*)
*(.sbss .sbss.*)
.a=ALIGN(4k);
ebss = .;
}

Expand Down
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = [
"crates/timestamp",
"crates/vfscore",
"crates/cv1811-sd",
"crates/kcov",

# modules
"modules/logging",
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ all:
cp -R cargo .cargo
RUST_BACKTRACE=1 LOG=$(LOG) cargo build $(RUST_BUILD_OPTIONS) --features "$(features)" --offline
# cp $(SBI) sbi-qemu
# cp $(KERNEL_ELF) kernel-qemu
rust-objcopy --binary-architecture=riscv64 $(KERNEL_ELF) --strip-all -O binary os.bin
cp $(KERNEL_ELF) kernel-qemu
# rust-objcopy --binary-architecture=riscv64 $(KERNEL_ELF) --strip-all -O binary os.bin

fs-img:
rm -f $(FS_IMG)
dd if=/dev/zero of=$(FS_IMG) bs=1M count=300
mkfs.vfat -F 32 $(FS_IMG)
sudo mount $(FS_IMG) mount/ -o uid=1000,gid=1000
rm -rf mount/*
-cp -rf tools/testcase-final2023/* mount/
-cp -rf tools/testcase-bench/* mount/
sudo umount $(FS_IMG)

build:
Expand Down Expand Up @@ -99,7 +99,7 @@ debug: fs-img build
clean:
rm -rf target/

gdb:
gdb:rust addr2line
riscv64-elf-gdb \
-ex 'file $(KERNEL_ELF)' \
-ex 'set arch riscv:rv64' \
Expand Down
1 change: 1 addition & 0 deletions arch/src/riscv64/boards/qemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub fn init_device(hartid: usize, device_tree: usize) -> (usize, usize) {
// 开启SUM位 让内核可以访问用户空间 踩坑:
// only in qemu. eg: qemu is riscv 1.10 NOTE: k210 is riscv 1.9.1
// in 1.10 is SUM but in 1.9.1 is PUM which is the opposite meaning with SUM

unsafe {
sstatus::set_sum();
}
Expand Down
10 changes: 0 additions & 10 deletions cargo/config

This file was deleted.

50 changes: 0 additions & 50 deletions cargo/linker-cv1811h.ld

This file was deleted.

52 changes: 0 additions & 52 deletions cargo/linker-k210.ld

This file was deleted.

50 changes: 0 additions & 50 deletions cargo/linker-qemu.ld

This file was deleted.

50 changes: 0 additions & 50 deletions cargo/linker-riscv.ld

This file was deleted.

4 changes: 4 additions & 0 deletions crates/vfscore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ pub trait INodeInterface: DowncastSync + Send + Sync {
fn poll(&self, _events: PollEvent) -> VfsResult<PollEvent> {
Err(VfsError::NotSupported)
}

fn after_mmap(&self, _addr: usize, _size: usize) -> VfsResult<()> {
Err(VfsError::NotSupported)
}
}

impl_downcast!(sync INodeInterface);
Loading