ccccourse / sp109b

系統程式 -- 109 下學期 (陳鍾誠課程的學生習題與報告)
0 stars 38 forks source link

2021/6/16 系統程式 簽到及發問區! #9

Open ccckmit opened 3 years ago

ccckmit commented 3 years ago

請寫『姓名:到』!

ccckmit commented 3 years ago

02-ContextSwitch

https://gitlab.com/ccc109/sp/-/blob/master/10-riscv/03-mini-riscv-os/02-ContextSwitch/02-ContextSwitch--RISC-V%E7%9A%84%E5%85%A7%E6%96%87%E5%88%87%E6%8F%9B.md

guest@localhost:~/sp/10-riscv/03-mini-riscv-os$ cd 02-ContextSwitch/
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/02-ContextSwitch$ ls
02-ContextSwitch--RISC-V的內文切換.md  linux.md  os.elf  riscv.h  sys.h
lib.c                                  Makefile  os.h    run.md   sys.s
lib.h                                  os.c      os.ld   start.s
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/02-ContextSwitch$ make clean
rm -f *.elf
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/02-ContextSwitch$ make
riscv64-unknown-elf-gcc -nostdlib -fno-builtin -mcmodel=medany -march=rv32ima -mabi=ilp32 -T os.ld -o os.elf start.s sys.s lib.c os.c
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/02-ContextSwitch$ make qemu
Press Ctrl-A and then X to exit QEMU
qemu-system-riscv32 -nographic -smp 4 -machine virt -bios none -kernel os.elf
OS start
Task0: Context Switch Success !
QEMU: Terminated
ccckmit commented 3 years ago

03-MultiTasking

https://gitlab.com/ccc109/sp/-/tree/master/10-riscv/03-mini-riscv-os/03-MultiTasking

https://gitlab.com/ccc109/sp/-/blob/master/10-riscv/03-mini-riscv-os/03-MultiTasking/os.c

https://gitlab.com/ccc109/sp/-/blob/master/10-riscv/03-mini-riscv-os/03-MultiTasking/sys.s

https://gitlab.com/ccc109/sp/-/blob/master/10-riscv/03-mini-riscv-os/03-MultiTasking/task.c

https://gitlab.com/ccc109/sp/-/blob/master/10-riscv/03-mini-riscv-os/03-MultiTasking/user.c

guest@localhost:~/sp/10-riscv/03-mini-riscv-os$ cd 03-MultiTasking/
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/03-MultiTasking$ ls
03-MultiTasking--RISC-V的協同式多工.md  linux.md  os.elf  riscv.h  sys.h   task.h
lib.c                                   Makefile  os.h    run.md   sys.s   user.c
lib.h                                   os.c      os.ld   start.s  task.c
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/03-MultiTasking$ make clean
rm -f *.elf
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/03-MultiTasking$ make
riscv64-unknown-elf-gcc -nostdlib -fno-builtin -mcmodel=medany -march=rv32ima -mabi=ilp32 -T os.ld -o os.elf start.s sys.s lib.c task.c os.c user.c
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/03-MultiTasking$ make qemu
Press Ctrl-A and then X to exit QEMU
qemu-system-riscv32 -nographic -smp 4 -machine virt -bios none -kernel os.elf
OS start
OS: Activate next task
Task0: Created!
Task0: Now, return to kernel mode
OS: Back to OS

OS: Activate next task
Task1: Created!
Task1: Now, return to kernel mode
OS: Back to OS

OS: Activate next task
Task0: Running...
OS: Back to OS

OS: Activate next task
Task1: Running...
OS: Back to OS

OS: Activate next task
Task0: Running...
OS: Back to OS

OS: Activate next task
Task1: Running...
OS: Back to OS

OS: Activate next task
Task0: Running...
OS: Back to OS

OS: Activate next task
Task1: Running...
QEMU: Terminated
ccckmit commented 3 years ago

04-TimerInterrupt

https://gitlab.com/ccc109/sp/-/tree/master/10-riscv/03-mini-riscv-os/04-TimerInterrupt

https://gitlab.com/ccc109/sp/-/blob/master/10-riscv/03-mini-riscv-os/04-TimerInterrupt/os.c

https://gitlab.com/ccc109/sp/-/blob/master/10-riscv/03-mini-riscv-os/04-TimerInterrupt/timer.c

https://gitlab.com/ccc109/sp/-/blob/master/10-riscv/03-mini-riscv-os/04-TimerInterrupt/sys.s

guest@localhost:~/sp/10-riscv/03-mini-riscv-os/04-TimerInterrupt$ make clean
rm -f *.elf
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/04-TimerInterrupt$ make
riscv64-unknown-elf-gcc -nostdlib -fno-builtin -mcmodel=medany -march=rv32ima -mabi=ilp32 -T os.ld -o os.elf start.s sys.s lib.c timer.c os.c
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/04-TimerInterrupt$ make qemu
Press Ctrl-A and then X to exit QEMU
qemu-system-riscv32 -nographic -smp 4 -machine virt -bios none -kernel os.elf
OS start
timer_handler: 1
timer_handler: 2
timer_handler: 3
timer_handler: 4
timer_handler: 5
timer_handler: 6
timer_handler: 7
timer_handler: 8
timer_handler: 9
timer_handler: 10
timer_handler: 11
timer_handler: 12
timer_handler: 13
timer_handler: 14
QEMU: Terminated
ccckmit commented 3 years ago

https://gitlab.com/ccc109/sp/-/tree/master/10-riscv/03-mini-riscv-os/05-Preemptive

https://gitlab.com/ccc109/sp/-/blob/master/10-riscv/03-mini-riscv-os/05-Preemptive/user.c

guest@localhost:~/sp/10-riscv/03-mini-riscv-os/05-Preemptive$ make clean
rm -f *.elf
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/05-Preemptive$ make
riscv64-unknown-elf-gcc -nostdlib -fno-builtin -mcmodel=medany -march=rv32ima -mabi=ilp32 -T os.ld -o os.elf start.s sys.s lib.c timer.c task.c os.c user.c trap.c
guest@localhost:~/sp/10-riscv/03-mini-riscv-os/05-Preemptive$ make qemu
Press Ctrl-A and then X to exit QEMU
qemu-system-riscv32 -nographic -smp 4 -machine virt -bios none -kernel os.elf
OS start
OS: Activate next task
Task0: Created!
Task0: Running...
timer interruption!
timer_handler: 1
OS: Back to OS

OS: Activate next task
Task1: Created!
Task1: Running...
timer interruption!
timer_handler: 2
OS: Back to OS

OS: Activate next task
Task0: Running...
timer interruption!
timer_handler: 3
OS: Back to OS

OS: Activate next task
Task1: Running...
timer interruption!
timer_handler: 4
OS: Back to OS

OS: Activate next task
Task0: Running...
timer interruption!
timer_handler: 5
OS: Back to OS

OS: Activate next task
Task1: Running...
timer interruption!
timer_handler: 6
OS: Back to OS

OS: Activate next task
Task0: Running...
timer interruption!
timer_handler: 7
OS: Back to OS

OS: Activate next task
Task1: Running...
QEMU: Terminated
ccckmit commented 3 years ago

休息到 3:50

ccckmit commented 3 years ago

作業系統最常用的教科書

Abraham Silberschatz , Peter Raer Galvin , Greg Gagne 著 吳庭育、駱詩軒 譯

投影片 -- https://codex.cs.yale.edu/avi/os-book/OS10/slide-dir/index.html

ccckmit commented 3 years ago

RISC-V 書籍

SiFive 經典 RISC-V FE310 微控制器原理與實踐

ccckmit commented 3 years ago

請用 Google Meet 參加 Q&A 時間

https://meet.google.com/xhy-fvuk-qyf

zxc21949049 commented 3 years ago

110810508 曾智暐 到

ccckmit commented 3 years ago

請重新進來Google Meet 參加 Q&A 時間

https://meet.google.com/bfq-fkoz-wza