ccccourse / sp110b Goto Github PK
View Code? Open in Web Editor NEW課程:系統程式 -- 筆記、習題與報告
課程:系統程式 -- 筆記、習題與報告
從頭開始讀這本書
還有 參考資源
作業系統免費電子書 -- https://pages.cs.wisc.edu/~remzi/OSTEP/
有任何問題用文字在這個 issue 問,臉書也可以!
簽到範例:
從頭開始讀這本書
有任何問題用文字在這個 issue 問,臉書也可以!
簽到範例:
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ make
riscv64-unknown-elf-gcc -nostdlib -fno-builtin -mcmodel=medany -march=rv32ima -mabi=ilp32 -T os.ld -o os.elf start.s os.c
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ ls
Makefile os.c os.elf os.ld README.md start.s
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ make run
make: *** No rule to make target 'run'. Stop.
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ make qemu
Press Ctrl-A and then X to exit QEMU
qemu-system-riscv32 -nographic -smp 4 -machine virt -bios none -kernel os.elf
Hello OS!
從以下主題中擇一撰寫《程式專案+報告》,可以自製或研究他人專案
參考:https://github.com/ccc-c/c6/wiki/
注意事項:
若沒有宣告『來源』,會被嚴重扣分 (完全自創就請宣告完全自創)
另外,關於授權
README.md 一開頭一定要聲明『程式的原創性或修改來源』,否則會嚴重扣分,例如:
有引用外部文章或圖片時,請注意應使用合法授權的資料!
例如引用維基百科,應採用創作共用 CC:BY-SA 授權!
最常用的方式是在專案下加一個 LICENSE 檔案,像這樣
https://github.com/cccriscv/mini-riscv-os/blob/master/LICENSE
問問題可以用 Google Meet ---- https://meet.google.com/otw-auax-kne
或在本討論區留言
從頭開始讀這本書
有任何問題用文字在這個 issue 問,臉書也可以!
簽到範例:
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ make
riscv64-unknown-elf-gcc -nostdlib -fno-builtin -mcmodel=medany -march=rv32ima -mabi=ilp32 -T os.ld -o os.elf start.s os.c
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ ls
Makefile os.c os.elf os.ld README.md start.s
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ make run
make: *** No rule to make target 'run'. Stop.
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ make qemu
Press Ctrl-A and then X to exit QEMU
qemu-system-riscv32 -nographic -smp 4 -machine virt -bios none -kernel os.elf
Hello OS!
簽到範例:
簽到範例:
簽到範例:
例如:
簽到範例:
終端機 1
(base) $ gcc forever.c -o forever
(base) $ ./forever
^C
(base) $ ps
PID TTY TIME CMD
720 ttys000 0:00.01 /bin/bash -l
756 ttys001 0:00.01 /bin/bash -l
855 ttys002 0:00.02 /bin/bash -l
33663 ttys003 0:00.02 -bash
33687 ttys004 0:00.02 /bin/bash -l
(base) $ ps
PID TTY TIME CMD
33663 ttys003 0:00.02 -bash
33687 ttys004 0:00.02 /bin/bash -l
(base) $ ./forever
Terminated: 15
終端機 2
(base) $ ps
PID TTY TIME CMD
33663 ttys003 0:00.02 -bash
33687 ttys004 0:00.02 /bin/bash -l
33827 ttys004 0:10.42 ./forever
33833 ttys005 0:00.01 /bin/bash -l
(base) $ kill 33827
forever.c
(base) $ ./forever
^C
(base) $ ./forever &
[1] 34225
(base) $ ps
PID TTY TIME CMD
34190 ttys000 0:00.01 /bin/bash -l
34225 ttys000 0:05.99 ./forever
33663 ttys003 0:00.02 -bash
34045 ttys006 0:00.02 /bin/bash -l
(base) $ ./forever &
[2] 34242
(base) $ ps
PID TTY TIME CMD
34190 ttys000 0:00.01 /bin/bash -l
34225 ttys000 0:18.68 ./forever
34242 ttys000 0:04.94 ./forever
33663 ttys003 0:00.02 -bash
34045 ttys006 0:00.02 /bin/bash -l
(base) $ ./forever &
[3] 34257
(base) $ ps
PID TTY TIME CMD
34190 ttys000 0:00.02 /bin/bash -l
34225 ttys000 0:40.43 ./forever
34242 ttys000 0:26.66 ./forever
34257 ttys000 0:04.55 ./forever
33663 ttys003 0:00.02 -bash
34045 ttys006 0:00.02 /bin/bash -l
(base) $ kill 34225
(base) $ ps
PID TTY TIME CMD
34190 ttys000 0:00.02 /bin/bash -l
34242 ttys000 0:38.87 ./forever
34257 ttys000 0:16.78 ./forever
33663 ttys003 0:00.02 -bash
34045 ttys006 0:00.02 /bin/bash -l
[1] Terminated: 15 ./forever
(base) $ kill 34242
(base) $ ps
PID TTY TIME CMD
34190 ttys000 0:00.02 /bin/bash -l
34257 ttys000 0:25.33 ./forever
33663 ttys003 0:00.02 -bash
34045 ttys006 0:00.02 /bin/bash -l
[2]- Terminated: 15 ./forever
(base) $ kill 34257
(base) $ ps
PID TTY TIME CMD
34190 ttys000 0:00.02 /bin/bash -l
33663 ttys003 0:00.02 -bash
34045 ttys006 0:00.02 /bin/bash -l
[3]+ Terminated: 15 ./forever
(base) $ ps
PID TTY TIME CMD
34190 ttys000 0:00.02 /bin/bash -l
33663 ttys003 0:00.02 -bash
34045 ttys006 0:00.02 /bin/bash -l
sp/09-posix/02-thread/georgeMary.c
(base) $ gcc georgeMary.c -o georgeMary -lpthread
(base) $ ./georgeMary
----------------
George
Mary
----------------
George
Mary
----------------
George
----------------
George
Mary
/sp/09-posix/02-thread/race.c
(base) $ gcc race.c -o race -lpthread
(base) $ ./race
counter=4484060
(base) $ ./race
counter=-4016974
(base) $ ./race
counter=-3538358
norace.c
(base) $ gcc norace.c -o norace
(base) $ ./norace
counter=0
(base) $ ./norace
counter=0
(base) $ ./norace
counter=0
(base) $ ./norace
counter=0
deadlock.c
base) $ gcc deadlock.c -o deadlock
(base) $ ./deadlock
A lock x
B lock y
(base) $ gcc -w philospher.c -o philospher
(base) $ ./philospher
Switch=false
Think 0 1
Eat 0 1
Think 1 1
Think 0 2
Eat 1 1
Think 2 1
Eat 0 2
Think 1 2
Eat 2 1
Think 0 3
Eat 1 2
Think 2 2
Eat 0 3
Think 1 3
Eat 2 2
Think 0 4
Eat 1 3
Think 2 3
Eat 0 4
Think 1 4
Eat 2 3
Think 0 5
Eat 1 4
Think 2 4
Eat 0 5
Think 1 5
Eat 2 4
Eat 1 5
Think 2 5
Eat 2 5
函式庫
1987 sudo apt install libgsl-dev
1989 sudo apt-get install libblas-dev
1992 gcc svd1.c -o svd1 -lgsl -lblas
1994 ./svd1
cmake : build.sh
mkdir build
cd build
cmake ..
make
# ./hello_cmake
cmake 自建 http://jotmynotes.blogspot.com/2016/10/updating-cmake-from-2811-to-362-or.html
簽到範例:
簽到範例:
函數範例: plus3.c
int plus3(int n) {
return n+3;
}
編譯
$ gcc -c -fPIC plus3.c -o plus3.o
$ objdump -d plus3.o
....
仿照
https://gitlab.com/ccc110/sp/-/blob/master/06-obj/02-jit/03-objdump/jitAdd.c
寫一個 jitPlus3.c
然後編譯執行
從頭開始讀這本書
有任何問題用文字在這個 issue 問,臉書也可以!
簽到範例:
簽到範例:
參考: https://github.com/ccc-c/c6/wiki/
補充:
簽到範例:
可以用 github, github wiki, hackmd, .... 或任何你想用的工具撰寫,最好能在網路上直接看到。
注意:
若沒有宣告『來源』,會被嚴重扣分 (完全自創就請宣告完全自創)
另外,關於授權
README.md 一開頭一定要聲明『程式的原創性或修改來源』,否則會嚴重扣分,例如:
有引用外部文章或圖片時,請注意應使用合法授權的資料!
例如引用維基百科,應採用創作共用 CC:BY-SA 授權!
最常用的方式是在專案下加一個 LICENSE 檔案,像這樣
https://github.com/cccriscv/mini-riscv-os/blob/master/LICENSE
從頭開始讀這本書
有任何問題用文字在這個 issue 問,臉書也可以!
簽到範例:
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ make
riscv64-unknown-elf-gcc -nostdlib -fno-builtin -mcmodel=medany -march=rv32ima -mabi=ilp32 -T os.ld -o os.elf start.s os.c
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ ls
Makefile os.c os.elf os.ld README.md start.s
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ make run
make: *** No rule to make target 'run'. Stop.
guest@localhost:~/sp/11-riscv/mini-riscv-os/01-HelloOs$ make qemu
Press Ctrl-A and then X to exit QEMU
qemu-system-riscv32 -nographic -smp 4 -machine virt -bios none -kernel os.elf
Hello OS!
參考:
範例
s=0;
i=1;
do {
s = s + i;
i = i + 1;
} while (i <= 10);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.