equation314
e86229cb71
user: user rust programs are runnable
2018-12-02 19:44:05 +08:00
WangRunji
b5ced136f7
fix merge compile error
2018-12-02 00:58:15 +08:00
WangRunji
2afe8c731e
Merge remote-tracking branch 'equation314/arch-aarch64' into dev
...
# Conflicts:
# crate/memory/src/memory_set.rs
# kernel/Cargo.lock
# kernel/src/arch/aarch64/interrupt/handler.rs
# kernel/src/arch/aarch64/interrupt/mod.rs
# kernel/src/arch/aarch64/memory.rs
# kernel/src/arch/aarch64/mod.rs
# kernel/src/arch/aarch64/paging.rs
# kernel/src/consts.rs
# kernel/src/fs.rs
# kernel/src/lib.rs
# kernel/src/memory.rs
# kernel/src/process/context.rs
# tools/riscv-pk/.gitignore
# tools/riscv-pk/LICENSE
# tools/riscv-pk/Makefile.in
# tools/riscv-pk/README.md
# tools/riscv-pk/aclocal.m4
# tools/riscv-pk/bbl/bbl.ac
# tools/riscv-pk/bbl/bbl.c
# tools/riscv-pk/bbl/bbl.h
# tools/riscv-pk/bbl/bbl.lds
# tools/riscv-pk/bbl/bbl.mk.in
# tools/riscv-pk/bbl/logo.c
# tools/riscv-pk/bbl/payload.S
# tools/riscv-pk/bbl/raw_logo.S
# tools/riscv-pk/bbl/riscv_logo.txt
# tools/riscv-pk/config.h.in
# tools/riscv-pk/configure
# tools/riscv-pk/configure.ac
# tools/riscv-pk/dummy_payload/dummy_entry.S
# tools/riscv-pk/dummy_payload/dummy_payload.lds
# tools/riscv-pk/dummy_payload/dummy_payload.mk.in
# tools/riscv-pk/machine/atomic.h
# tools/riscv-pk/machine/bits.h
# tools/riscv-pk/machine/disabled_hart_mask.h
# tools/riscv-pk/machine/emulation.c
# tools/riscv-pk/machine/emulation.h
# tools/riscv-pk/machine/encoding.h
# tools/riscv-pk/machine/fdt.c
# tools/riscv-pk/machine/fdt.h
# tools/riscv-pk/machine/finisher.c
# tools/riscv-pk/machine/finisher.h
# tools/riscv-pk/machine/flush_icache.c
# tools/riscv-pk/machine/htif.c
# tools/riscv-pk/machine/htif.h
# tools/riscv-pk/machine/machine.ac
# tools/riscv-pk/machine/machine.mk.in
# tools/riscv-pk/machine/mcall.h
# tools/riscv-pk/machine/mentry.S
# tools/riscv-pk/machine/minit.c
# tools/riscv-pk/machine/misaligned_ldst.c
# tools/riscv-pk/machine/mtrap.c
# tools/riscv-pk/machine/mtrap.h
# tools/riscv-pk/machine/muldiv_emulation.c
# tools/riscv-pk/machine/uart.c
# tools/riscv-pk/machine/uart.h
# tools/riscv-pk/machine/uart16550.c
# tools/riscv-pk/machine/uart16550.h
# tools/riscv-pk/machine/unprivileged_memory.h
# tools/riscv-pk/machine/vm.h
# tools/riscv-pk/scripts/config.guess
# tools/riscv-pk/scripts/config.sub
# tools/riscv-pk/scripts/install.sh
# tools/riscv-pk/scripts/mk-install-dirs.sh
# tools/riscv-pk/scripts/vcs-version.sh
# tools/riscv-pk/util/snprintf.c
# tools/riscv-pk/util/string.c
# tools/riscv-pk/util/util.mk.in
2018-12-02 00:27:10 +08:00
equation314
7855b70bc0
aarch64: add origin raspberrypi config.txt
2018-12-01 23:30:53 +08:00
equation314
4f592336ff
aarch64: remove test functions
2018-12-01 22:39:21 +08:00
equation314
163e092c29
Merge branch 'mmu' into arch-aarch64
2018-12-01 22:31:29 +08:00
equation314
75b039c924
aarch64/mmu: move crate aarch64 to remote
2018-12-01 22:26:55 +08:00
equation314
5a83d6a20f
aarch64: add user program SFS image
2018-12-01 20:12:54 +08:00
equation314
a59a7fbe9a
aarch64/mmu: simply handle page fault
2018-12-01 20:00:35 +08:00
equation314
d6a54496f0
arch64/mmu: invalidate all icaches in InactivePageTable::with()
2018-12-01 19:43:58 +08:00
equation314
0eb33b661f
aarch64/mmu: fix some bugs
2018-12-01 19:31:46 +08:00
WangRunji
fcf5074500
impl M-mode kernel for riscv32
2018-12-01 17:37:37 +08:00
WangRunji
2f8cfabbca
remove redundant nightly features
2018-11-29 22:00:35 +08:00
WangRunji
a74b893bd2
update Makefile
2018-11-29 21:39:43 +08:00
equation314
f882a085d6
user: link created SFS image in kernel
2018-11-29 17:33:31 +08:00
equation314
94bc8353f7
user: create SFS image in Makefile
2018-11-29 12:49:58 +08:00
WangRunji
02eb7d9125
update 'riscv-pk' to upstream submodule
2018-11-29 00:00:52 +08:00
WangRunji
6921e9018d
fix NoMMU entry point
2018-11-27 11:26:37 +08:00
WangRunji
18640b7537
impl NoMMU
2018-11-27 01:23:07 +08:00
WangRunji
52fe93188d
disable delay allocating frame, remove memory_set_record
2018-11-27 01:18:30 +08:00
WangRunji
2db453556d
try to fix interrupt & deadlock on RV32
2018-11-26 16:58:45 +08:00
equation314
d30c7e59ca
aarch64: minor modify
2018-11-25 20:01:13 +08:00
equation314
264600f145
aarch64/mmu: add io remap
2018-11-25 18:27:31 +08:00
equation314
a8b334123a
aarch64/mmu: add memory region attribute config
2018-11-25 17:58:17 +08:00
equation314
f9e47b2fd8
aarch64/mmu: refactor PageTableFlags
2018-11-25 00:29:39 +08:00
equation314
de6354ddd3
aarch64/mmu: use ASID to avoid flush TLB frequently in context switch
2018-11-23 23:25:15 +08:00
equation314
55087fc5a2
aarch64/mmu: use both TTBR0_EL1 & TTBR1_EL1
2018-11-23 00:43:18 +08:00
WangRunji
46f0e85230
add ucore-i386-pic.img
user programs. reorganize imgs.
2018-11-22 18:06:39 +08:00
equation314
bb1c1abaa4
aarch64/mmu: can run on the real raspi3
2018-11-21 20:02:34 +08:00
equation314
a9de99d3a9
aarch64/mmu: remap kernel memory ranges at the end of memory::init()
2018-11-21 01:50:34 +08:00
equation314
99c5b3c3f8
Merge branch 'arch-aarch64' into mmu
2018-11-20 18:36:23 +08:00
equation314
13be52133d
aarch64: move kernel stack top to 0x100000
2018-11-20 18:32:26 +08:00
equation314
f398945ad3
aarch64: hard link user program
2018-11-20 18:29:51 +08:00
equation314
9e8124abbb
aarch64/mmu: mmu enabled
2018-11-20 16:46:16 +08:00
WangRunji
b1bdac7d0f
fix merge for aarch64. now it works!
2018-11-20 01:08:39 +08:00
WangRunji
2daf8c188d
Merge remote-tracking branch 'equation314/arch-aarch64' into dev
...
# Conflicts:
# .gitignore
# kernel/Cargo.lock
# kernel/Cargo.toml
# kernel/Makefile
# kernel/riscv32-blog_os.json
# kernel/src/consts.rs
# kernel/src/fs.rs
# kernel/src/lib.rs
# kernel/src/process/context.rs
# kernel/src/process/mod.rs
2018-11-20 00:15:19 +08:00
WangRunji
56fcad245a
update kernel to 2018 edition
2018-11-19 20:11:17 +08:00
WangRunji
c4935a1477
use pc-keyboard
crate and enable keyboard again for x86
2018-11-18 19:20:26 +08:00
lcy1996
76d2c6ec7b
Fix the bug of active_table_swap() wrongly force unlock in pg fault handler
2018-11-17 23:17:42 +08:00
lcy1996
b2fec2b16b
Fix a bug in context for smp
2018-11-17 21:34:21 +08:00
lcy1996
67035ac556
Fix a bug in pg fault handler caused by memory_set_record
2018-11-17 19:18:48 +08:00
lcy1996
00d0ea8a8b
Modified the code in pgfault
2018-11-17 16:54:21 +08:00
lcy1996
9d803e87d9
replace some unwrap() and comment the cow pgfault handler
2018-11-17 16:25:24 +08:00
WangRunji
df485d506e
simplify ProcessManager
...
- given that a proc can only be waited by its parent, wait_queue is no longer needed.
2018-11-17 12:58:40 +08:00
WangRunji
5478b9ba7b
no longer show normal page fault
2018-11-17 12:42:19 +08:00
WangRunji
ef75c8a072
fix unwrap panic. now user shell is working.
2018-11-17 12:40:51 +08:00
WangRunji
da399dca96
remove Process struct
2018-11-16 22:27:03 +08:00
WangRunji
205f90a264
Merge branch 'dev' into g4-merge
...
# Conflicts:
# crate/memory/src/cow.rs
# crate/memory/src/memory_set.rs
# crate/memory/src/paging/mod.rs
# crate/memory/src/swap/mod.rs
# crate/process/src/lib.rs
# crate/process/src/process_manager.rs
# crate/process/src/processor.rs
# crate/process/src/thread.rs
# crate/riscv
# kernel/Cargo.lock
# kernel/src/arch/riscv32/compiler_rt.rs
# kernel/src/arch/riscv32/consts.rs
# kernel/src/arch/riscv32/context.rs
# kernel/src/arch/riscv32/interrupt.rs
# kernel/src/arch/riscv32/memory.rs
# kernel/src/arch/riscv32/mod.rs
# kernel/src/arch/riscv32/paging.rs
# kernel/src/arch/x86_64/driver/ide.rs
# kernel/src/arch/x86_64/interrupt/handler.rs
# kernel/src/arch/x86_64/mod.rs
# kernel/src/console.rs
# kernel/src/consts.rs
# kernel/src/fs.rs
# kernel/src/lib.rs
# kernel/src/memory.rs
# kernel/src/process/context.rs
# kernel/src/process/mod.rs
# kernel/src/syscall.rs
# kernel/src/trap.rs
2018-11-16 18:58:29 +08:00
WangRunji
e06f6b8bc5
update Cargo.toml & Cargo.lock
2018-11-16 15:17:25 +08:00
WangRunji
d27ac65df3
fix load program slice error
2018-11-16 01:33:25 +08:00
WangRunji
5ce7d0a9c0
use user shell by default. fix kernel shell removing user thread.
2018-11-16 01:22:59 +08:00
WangRunji
21b0bdcbca
separate kernel shell to a mod, remove console mod
2018-11-16 00:49:42 +08:00
WangRunji
b3e5d1987e
update Cargo.lock
2018-11-16 00:30:15 +08:00
WangRunji
9b3294a5f2
fix clear bss when load user program. 'sh' works!
2018-11-16 00:17:05 +08:00
WangRunji
40b099ed79
clean riscv-pk in Makefile
2018-11-15 23:42:44 +08:00
WangRunji
44bf3fb07a
impl sys_exec
2018-11-15 23:41:22 +08:00
equation314
576ae1d911
add setup_page_table
2018-11-15 19:12:02 +08:00
lcy1996
f4305b382f
Add comment and report for expr4
2018-11-15 16:29:24 +08:00
koumingyang
ef213d60bb
mmu
2018-11-15 14:22:57 +08:00
lcy1996
eb00b2bfd3
merge conflict
2018-11-14 21:54:26 +08:00
lcy1996
a8da42d521
Add expr4 report and some trace for synctest
2018-11-14 21:45:56 +08:00
chenqiuhao
4d8d48cf4d
repair some bugs and move child control to processmanager
2018-11-14 18:36:47 +08:00
lcy1996
65cd42028c
Add illegal vma check in page fault hangler
2018-11-14 01:13:19 +08:00
lcy1996
c5499a62c5
Fix bug in swap in/out. Address ailign to 4K.
2018-11-14 00:32:59 +08:00
chenqiuhao
6652f8daf6
repair some bugs
2018-11-13 22:52:11 +08:00
chenqiuhao
8d6d3b7c37
debug for sleepkill
2018-11-13 19:56:17 +08:00
WangRunji
f97e8458b8
impl stdin & stdout as INode
2018-11-11 23:08:59 +08:00
lcy1996
5ee44588e0
Enlarge the physical and kernel heap memory. Fix the bug in map the kernel.
2018-11-09 11:08:45 +08:00
lcy1996
0b900b6f03
Code Transplanting: Blocking getchar
2018-11-08 19:40:28 +08:00
lcy1996
9adcea44d5
Code transplanting: Fix bugs. Pass test 'spin'
2018-11-08 19:21:13 +08:00
WangRunji
a589ae90f3
use SysError in syscalls
2018-11-08 17:33:13 +08:00
WangRunji
beb6533059
impl sys_getdirentry. 'ls' ok.
2018-11-08 16:56:01 +08:00
WangRunji
124a5e0d5d
impl sys_dup
...
- Fix exit_code: i32
- Convert Box<File> to Arc<Mutex<File>> in Context
2018-11-08 00:21:20 +08:00
WangRunji
16be828370
impl sys_fstat
2018-11-07 23:32:22 +08:00
WangRunji
128257c395
impl argc & argv for user process
2018-11-07 23:28:07 +08:00
equation314
5610d0bdb0
aarch64: context switch is runnable!
2018-11-07 22:07:59 +08:00
WangRunji
e27aea47e1
impl file syscalls, without test
2018-11-07 13:35:59 +08:00
WangRunji
200a574a1f
fix physical memory range on RV32
2018-11-07 13:16:52 +08:00
equation314
67b920cc16
aarch64: format paging.rs
2018-11-07 13:09:50 +08:00
koumingyang
a0b948fb53
add basic alloc
2018-11-07 12:00:57 +08:00
koumingyang
a13f39149b
add basic alloc
2018-11-07 10:44:24 +08:00
WangRunji
91bd411a8f
fit for multi-thread sfs
...
- use global root inode
- remove global IDE on x86
2018-11-07 02:00:40 +08:00
equation314
9fc13c8ebb
aarch64: implement syscall
2018-11-07 01:05:55 +08:00
equation314
a91534e34d
aarch64: implement context switch, but not tested
2018-11-06 21:44:12 +08:00
WangRunji
16fb733497
Blocking getchar
2018-11-05 22:55:59 +08:00
lcy1996
a145909998
Fix compile error after merge for the new processor.
2018-11-05 22:16:45 +08:00
lcy1996
fcdee71f9d
Merge confilt
2018-11-05 21:31:04 +08:00
lcy1996
c8ea2cb0cf
Fix bug and enable swap in/out and frame delayed allocating.
2018-11-05 20:37:05 +08:00
chenqiuhao
87506b000d
debug for process
2018-11-05 19:31:45 +08:00
equation314
3e1d8c5827
aarch64: implement ARM generic timer, can work in qemu
2018-11-04 18:15:26 +08:00
chenqiuhao
2002ddd5fa
move processor from wrj
2018-11-03 21:45:03 +08:00
lcy1996
b1425a53f9
finish frame delayed allocating
2018-11-03 14:33:36 +08:00
WangRunji
0a6b4fb8f2
Modify const. Update cargo.
2018-11-02 16:14:29 +08:00
WangRunji
ba4a24ba3b
Fix RV32 multi-core: Setup page table for other cores.
2018-11-02 16:13:58 +08:00
WangRunji
b7d6b2989d
Fix bugs. Pass test 'spin'
...
- Fix ACK IRQ on x86.
- Add process exit handler.
2018-11-01 21:10:19 +08:00
WangRunji
ed20aa45fd
Fix user process bug on RV32.
...
Set sstatus.SIE = 0 on the initial TrapFrame, to prevent interrupt on switching.
2018-11-01 19:53:30 +08:00
WangRunji
6fc23e1134
Ugly impl sys_wait(0)
2018-11-01 00:45:02 +08:00
WangRunji
74facd8e87
Use Vec to replace array in ProcessManager.
2018-11-01 00:16:32 +08:00
equation314
07aa9a0686
aarch64: implement IRQ & system timer, but don't work in qemu
2018-10-31 16:10:22 +08:00
WangRunji
182c595a20
Enable multi-core on RV32.
2018-10-31 11:46:50 +08:00
WangRunji
250f1385d3
Better debug print for TrapFrame on RV32
2018-10-31 11:39:42 +08:00
lcy1996
4f03eff015
Use SpinNoIrqLock to replace the spin::mutex
2018-10-31 11:11:06 +08:00
lcy1996
504401355f
Add expr3 report(not finiished.
2018-10-30 21:50:38 +08:00
equation314
8c19499112
aarch64: implement exception interface & synchronous exception handler
2018-10-30 20:44:54 +08:00
WangRunji
7229b49eb8
Use rust-lld for RV32. Remove riscv git submodule.
2018-10-30 13:30:20 +08:00
lcy1996
2c3de7b222
Merge branch 'OsTrain2018-g4' of github.com:oscourse-tsinghua/RustOS into lcy_issue1
2018-10-30 12:46:01 +08:00
lcy1996
edde416052
Finish swap for multi-user process
2018-10-30 12:45:09 +08:00
equation314
3386a793a5
aarch64: disable NEON
2018-10-29 23:05:16 +08:00
equation314
001254fd64
riscv32: change linker to rust-lld
2018-10-29 21:37:57 +08:00
equation314
ae5260db5c
aarch64: change linker to rust-lld
2018-10-29 21:34:29 +08:00
equation314
7746485861
aarch64: add target 'install' to Makefile
2018-10-29 19:14:54 +08:00
equation314
632baedabd
aarch64: can run on the real raspi3
2018-10-29 18:53:14 +08:00
equation314
2e094d08bc
common: add a logo
2018-10-29 13:41:25 +08:00
equation314
abf3418d24
aarch64: implement I/O by serial port
2018-10-29 13:38:27 +08:00
WangRunji
72dc3f62ad
Remove kernel stack from MemorySet.
2018-10-27 15:17:15 +08:00
equation314
addf49ffdb
aarch64: add crate bcm2837, implement GPIO
2018-10-27 02:45:47 +08:00
WangRunji
438e290b6d
Fix PageTable::get_entry -> Option.
2018-10-26 23:43:12 +08:00
equation314
cc936ded35
aarch64: bootable in qemu
2018-10-26 22:02:24 +08:00
WangRunji
a42d6086c6
Simplify IDE code.
2018-10-26 18:18:11 +08:00
WangRunji
81196729e4
Fix RV32 atomic.
...
- Fix __atomic_compare_exchange_4().
- Add patch for core::sync::atomic.
- Revert kernel Mutex.
2018-10-26 15:22:03 +08:00
chenqiuhao
ede69959e4
debug for compare exchange
2018-10-26 15:03:20 +08:00
equation314
174e0da3b6
aarch64: basic framework
2018-10-26 11:22:22 +08:00
equation314
1140d32aaa
add arch=aarch64 & board=raspi3 to Makefile
2018-10-26 11:22:26 +08:00
WangRunji
95ab9caba1
Add impl of atomic_fetch_*
2018-10-26 02:31:05 +08:00
WangRunji
0680023e35
Recover wait/sleep
2018-10-26 00:49:19 +08:00
WangRunji
85a1dca684
Use weak linkage to provide dependencies for process::thread.
2018-10-24 21:32:23 +08:00
WangRunji
80b161db98
Recover set_priority and fork
2018-10-24 21:29:41 +08:00
WangRunji
5db908b1c5
Separate ProcessManager to a mod.
2018-10-24 00:38:22 +08:00
WangRunji
f7eb09e856
Multicore processing WORKS! Basically ...
...
- Rewrite processor.rs
Refactor to `Processor` & `ProcessManager`
- Use Box<dyn> instead of generic.
- Wait/sleep/wakeup is not supported yet.
I'm considering to implement them with WaitQueue.
2018-10-24 00:28:29 +08:00
WangRunji
6741ba399b
Add arch::cpu::halt(). Halt when panic.
2018-10-24 00:23:40 +08:00
lcy1996
5f34cc54d8
Merge branch 'OsTrain2018-g4' of github.com:oscourse-tsinghua/RustOS into lcy_issue1
2018-10-23 00:00:27 +08:00
lcy1996
63349ade19
Finish add more comment for kernel and finish set user memory swappable.
2018-10-23 00:00:09 +08:00
chenqiuhao
9474ad7220
update atomic function and workaround the LLVM compiling bug(maybe)
2018-10-22 18:40:21 +08:00
WangRunji
5bc392f388
Enable RV32 IPI.
2018-10-21 21:47:17 +08:00
WangRunji
1b4edf3bb2
Merge branch 'rv32-smp-porting' into dev
...
# Conflicts:
# kernel/Makefile
2018-10-19 23:36:15 +08:00
WangRunji
72e92c07f9
Switch to RV64 GNU toolchain. Simplify compiler_rt.
2018-10-19 23:35:38 +08:00
WangRunji
f1771f8ef2
Finish x86 SMP startup. Support timer & IPI.
...
- Remove smp, apic mod.
Instead, use new bootloader & apic crate.
- Disable PIC & PIT.
Instead, use IOAPIC & APIC Timer.
2018-10-19 01:14:21 +08:00
maoyuchaxue
f27fd37d82
replaced spin::Mutex with sync::SpinLock, now spinlock works well.
2018-10-17 21:34:15 +08:00
maoyuchaxue
f7b7b1bcd6
added workaround for atomic ops
2018-10-17 19:37:53 +08:00
maoyuchaxue
cfda03a0f2
trying to add atomic implementations in rv32, but still buggy
2018-10-17 00:21:18 +08:00
lcy1996
0a81014007
Add page handler for swap in/out in riscv32's pagefault
2018-10-16 21:51:17 +08:00
maoyuchaxue
49cd04dce3
added rv32 smp booting, with slight modification to bbl
2018-10-14 22:28:01 +08:00
maoyuchaxue
6cf0d6db23
fixed setting in riscv-pk to enable rv32ia, added smp option in Makefile
2018-10-14 13:50:59 +08:00
lcy1996
0a7ec18701
Add page fault handler to riscv 32.
2018-10-11 21:30:35 +08:00
lcy1996
96cdf37b15
Add some comment for paging and add proposal doc
2018-10-09 21:11:14 +08:00
lcy1996
cef2d792be
Add part of comments for riscv32 module
2018-10-08 01:47:13 +08:00
lcy1996
2157e4bbcf
Add comment for interrutp and trap code
2018-10-06 01:45:56 +08:00
lcy1996
91455d163d
Finish comment riscv context.
2018-10-05 23:39:28 +08:00
lcy1996
5b4aefdb0d
Add comment for riscv32 context
2018-10-05 19:38:14 +08:00
lcy1996
e4300d3515
Add more comment in kernel but not finished
2018-10-05 10:58:15 +08:00