├── .gitignore ├── Makefile ├── README.md ├── os ├── Cargo.toml ├── Makefile ├── crate │ ├── buddy-allocator │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── lib.rs │ └── riscv │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CODE_OF_CONDUCT.md │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── asm.S │ │ ├── asm.h │ │ ├── asm32.S │ │ ├── assemble.sh │ │ ├── build.rs │ │ ├── check-blobs.sh │ │ ├── ci │ │ ├── install.sh │ │ └── script.sh │ │ └── src │ │ ├── addr.rs │ │ ├── asm.rs │ │ ├── interrupt.rs │ │ ├── lib.rs │ │ ├── paging │ │ ├── frame_alloc.rs │ │ ├── mod.rs │ │ ├── page_table.rs │ │ └── recursive.rs │ │ └── register │ │ ├── fcsr.rs │ │ ├── macros.rs │ │ ├── mcause.rs │ │ ├── mcycle.rs │ │ ├── mcycleh.rs │ │ ├── mepc.rs │ │ ├── mie.rs │ │ ├── minstret.rs │ │ ├── minstreth.rs │ │ ├── mip.rs │ │ ├── misa.rs │ │ ├── mod.rs │ │ ├── mscratch.rs │ │ ├── mstatus.rs │ │ ├── mtvec.rs │ │ ├── mvendorid.rs │ │ ├── satp.rs │ │ ├── scause.rs │ │ ├── sepc.rs │ │ ├── sie.rs │ │ ├── sip.rs │ │ ├── sscratch.rs │ │ ├── sstatus.rs │ │ ├── stval.rs │ │ ├── stvec.rs │ │ ├── time.rs │ │ └── timeh.rs ├── opensbi │ └── virt.elf ├── riscv32-os.json └── src │ ├── boot │ ├── entry.asm │ └── linker.ld │ ├── clock.rs │ ├── consts.rs │ ├── context.rs │ ├── init.rs │ ├── interrupt.rs │ ├── io.rs │ ├── lang_items.rs │ ├── lib.rs │ ├── main.rs │ ├── memory │ ├── frame_allocator │ │ └── mod.rs │ └── mod.rs │ ├── process │ ├── mod.rs │ ├── structs.rs │ └── switch.asm │ ├── sbi.rs │ └── trap │ └── trap.asm └── rust-toolchain /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/.gitignore -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/Makefile -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/README.md -------------------------------------------------------------------------------- /os/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/Cargo.toml -------------------------------------------------------------------------------- /os/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/Makefile -------------------------------------------------------------------------------- /os/crate/buddy-allocator/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/buddy-allocator/Cargo.toml -------------------------------------------------------------------------------- /os/crate/buddy-allocator/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/buddy-allocator/README.md -------------------------------------------------------------------------------- /os/crate/buddy-allocator/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/buddy-allocator/src/lib.rs -------------------------------------------------------------------------------- /os/crate/riscv/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/.gitignore -------------------------------------------------------------------------------- /os/crate/riscv/.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/.travis.yml -------------------------------------------------------------------------------- /os/crate/riscv/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /os/crate/riscv/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/Cargo.toml -------------------------------------------------------------------------------- /os/crate/riscv/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/README.md -------------------------------------------------------------------------------- /os/crate/riscv/asm.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/asm.S -------------------------------------------------------------------------------- /os/crate/riscv/asm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/asm.h -------------------------------------------------------------------------------- /os/crate/riscv/asm32.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/asm32.S -------------------------------------------------------------------------------- /os/crate/riscv/assemble.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/assemble.sh -------------------------------------------------------------------------------- /os/crate/riscv/build.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/build.rs -------------------------------------------------------------------------------- /os/crate/riscv/check-blobs.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/check-blobs.sh -------------------------------------------------------------------------------- /os/crate/riscv/ci/install.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/ci/install.sh -------------------------------------------------------------------------------- /os/crate/riscv/ci/script.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/ci/script.sh -------------------------------------------------------------------------------- /os/crate/riscv/src/addr.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/addr.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/asm.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/asm.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/interrupt.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/interrupt.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/lib.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/paging/frame_alloc.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/paging/frame_alloc.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/paging/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/paging/mod.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/paging/page_table.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/paging/page_table.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/paging/recursive.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/paging/recursive.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/fcsr.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/fcsr.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/macros.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/macros.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mcause.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mcause.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mcycle.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mcycle.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mcycleh.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mcycleh.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mepc.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mepc.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mie.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mie.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/minstret.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/minstret.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/minstreth.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/minstreth.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mip.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mip.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/misa.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/misa.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mod.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mscratch.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mscratch.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mstatus.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mstatus.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mtvec.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mtvec.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/mvendorid.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/mvendorid.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/satp.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/satp.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/scause.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/scause.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/sepc.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/sepc.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/sie.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/sie.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/sip.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/sip.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/sscratch.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/sscratch.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/sstatus.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/sstatus.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/stval.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/stval.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/stvec.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/stvec.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/time.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/time.rs -------------------------------------------------------------------------------- /os/crate/riscv/src/register/timeh.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/crate/riscv/src/register/timeh.rs -------------------------------------------------------------------------------- /os/opensbi/virt.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/opensbi/virt.elf -------------------------------------------------------------------------------- /os/riscv32-os.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/riscv32-os.json -------------------------------------------------------------------------------- /os/src/boot/entry.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/boot/entry.asm -------------------------------------------------------------------------------- /os/src/boot/linker.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/boot/linker.ld -------------------------------------------------------------------------------- /os/src/clock.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/clock.rs -------------------------------------------------------------------------------- /os/src/consts.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/consts.rs -------------------------------------------------------------------------------- /os/src/context.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/context.rs -------------------------------------------------------------------------------- /os/src/init.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/init.rs -------------------------------------------------------------------------------- /os/src/interrupt.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/interrupt.rs -------------------------------------------------------------------------------- /os/src/io.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/io.rs -------------------------------------------------------------------------------- /os/src/lang_items.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/lang_items.rs -------------------------------------------------------------------------------- /os/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/lib.rs -------------------------------------------------------------------------------- /os/src/main.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/main.rs -------------------------------------------------------------------------------- /os/src/memory/frame_allocator/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/memory/frame_allocator/mod.rs -------------------------------------------------------------------------------- /os/src/memory/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/memory/mod.rs -------------------------------------------------------------------------------- /os/src/process/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/process/mod.rs -------------------------------------------------------------------------------- /os/src/process/structs.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/process/structs.rs -------------------------------------------------------------------------------- /os/src/process/switch.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/process/switch.asm -------------------------------------------------------------------------------- /os/src/sbi.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/sbi.rs -------------------------------------------------------------------------------- /os/src/trap/trap.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LearningOS/rcore_step_by_step/HEAD/os/src/trap/trap.asm -------------------------------------------------------------------------------- /rust-toolchain: -------------------------------------------------------------------------------- 1 | nightly-2019-09-02 --------------------------------------------------------------------------------