Guangdong University of Technology Panyu Campus-Next I want to praise a game
Our OS mainly refers to the book "RISC-V Architecture Programming and Practice" written by Ben Shu.
Other references:
"Design and Implementation of a 64-bit Operating System"--Tian Yu
riscv-xv6
make all:Compiled
make run:Start QEMU
make clean: Clear all generated files
make debug: Start QEMU and GDB debugging
Due to time limitations, our OS only implements simple interrupt processing, memory management, process scheduling functions, a small part of the file system and a few system calls. Since the bug was not successfully fixed in the end, our virtio driver still has problems and cannot be used. The file system is not fully completed. Therefore, the file system has not given documentation. Please forgive me.
We fixed the bug of the virtio driver, completed a basic file system and only supported elf file loaders that ran static linkers, and supported a small number of syscall and shell commands
Exception handling and interrupts
Memory management and page table mapping
Process management and scheduling
VFS virtual file system
ELF Loader
Qu Weikai is responsible for the development of code, Liang Sijun and He Chang are responsible for the debugging of bugs and the writing of documents.
.vscode:vscode相关
bootloader:opensbi生成的sbi固件,由于使用了QEMU默认的sbi固件,因此该文件夹内的opensbi固件未使用
doc:文档说明
include:头文件
LinkList.h:链表操作
buf.h:与文件系统相关,用于读写虚拟磁盘的缓冲区
csr.h:控制寄存器相关
fs.h:与文件系统相关,由于未完成,目前内容仅有超级块的定义
io.h:与读取写入相关
log.h:文件系统相关,磁盘日志
memory.h:mmu和内存管理相关
page_table.h:页表相关的宏定义
plic.h:plic相关
process.h:进程管理相关
pt_offset.h:与上下文现场保存相关
sbi.h:S模式下系统调用opensbi固件接口
scheduler.h:进程调度相关
sleeplock.h:睡眠锁
syscall.h:系统调用
timer.h:定时器
trap.h:中断和异常
uart.h:16550串口控制器
virtio.h:virtio设备驱动
VFS.h:虚拟文件系统相关
fat32.h:fat32文件系统相关
elf.h:elf格式定义
elf_loader.h:elf加载器
sysflags.h:系统调用使用标志
kernel:内核文件夹
driver:virtio驱动,存在问题
fs:文件系统相关
memeory:内存管理和mmu映射
process:进程管理
trap:中断和异常
boot.S:opensbi引导到跳转至内核
entry.S:汇编相关定义
linker.ld:链接脚本
main.c:内核主函数在内
lib:通用库,包含输出和基本函数
usr:与U模式相关Due to time limitations and our limited level, we did not complete the work within the specified time. However, we also learned a lot during this period. The school's operating system class focuses on theory, and the competition gave us a deeper understanding of the operating system from the practical level. During the writing of the work, we also learned a lot of ways to improve development efficiency, such as from the beginning of using the command line gdb debugging to the later learning to use vscode to connect to gdb debugging, which greatly improved the efficiency of our debugging. Although it is very regrettable that we failed to complete and test our OS, the knowledge we learned since the competition has benefited a lot, which has also achieved our goal of participating in the competition.