GithubHelp home page GithubHelp logo

sp110b's People

Contributors

ccckmit avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sp110b's Issues

系統程式 第 18 週 -- 簽到討論區

  1. https://www.sifive.com/software
    • 方法 1 : Download Freedom Studio
    • 方法 2 : 下載 GNU Embedded Toolchain + QEMU
    • 方法 3: 直接使用 kinmen6.com 上的環境 ssh [email protected] 密碼 kinmen6110b

從頭開始讀這本書

有任何問題用文字在這個 issue 問,臉書也可以!

簽到範例:

  1. 陳鍾誠 在 e320
  2. 史奴比 在 家

系統程式 第 16 週 -- 簽到討論區

  1. https://www.sifive.com/software
    • 方法 1 : Download Freedom Studio
    • 方法 2 : 下載 GNU Embedded Toolchain + QEMU
    • 方法 3: 直接使用 kinmen6.com 上的環境 ssh [email protected] 密碼 kinmen6110b

從頭開始讀這本書

有任何問題用文字在這個 issue 問,臉書也可以!

簽到範例:

  1. 陳鍾誠 在 e320
  2. 史奴比 在 家

示範

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!

期中作業:請繳交一份《程式專案+報告》!2022/6/17 24:00 截止繳交

從以下主題中擇一撰寫《程式專案+報告》,可以自製或研究他人專案

參考:https://github.com/ccc-c/c6/wiki/

  1. 自己寫一份小型的 C 語言的標準函式庫,例如:
    • 以 getc, putc 為基礎,寫出 gets/puts/scanf/printf/....
    • 自己寫一套記憶體管理的 malloc 與 free 函式庫
  2. 組譯器:
  3. 虛擬機:
    • 題目1:JIT, 把 c6 的虛擬機目的碼用 JIT 立即編譯的方式,轉成你 CPU 的機器碼後立刻執行
    • 題目2:JIT, 把 c6 的虛擬機目的碼用 JIT 立即編譯的方式,轉成只有 if, goto 的 C 語言,然後再呼叫 gcc 去編譯這個 c 語言檔案後執行。(例如:hello.o => hello.o.c => ./hello.o.o
    • 題目3:JIT, 把 c6 的虛擬機目的碼用 JIT 立即編譯的方式,轉成 LLVM 的中間碼 (文字檔或二進位都行),LLVM 去將中間碼轉成執行檔後執行。(例如:hello.o => hello.ir => ./hello.ir.o
    • 題目4:自製一個 RISC-V 的虛擬機,可以在你電腦的處理器上面執行。
  4. 編譯器:
  5. 解譯器:
    • 題目 1 :研究 minilisp 解譯器後寫成報告
  6. 作業系統:
  7. 網路程式 (web server, crawler, ftp client/server, telnet client/server, mail client/server, bbs client/server, 直播 client/server)
  8. 檔案系統
  9. 資料庫

注意事項:

  1. 若你有使用外部資源,或者圖片,請一定要標示 來源或套件名稱。
  2. 若你的程式碼 (C/ASM) 是修改自別人的,或者網路上的,也務必要聲明。
    • 我的程式是修改自 github 的 某某專案,網址為 ....
  3. 若你某個期末作業主要部分 (例如是個 Compiler),完全沒有用別人的東西,也請你標示出來
  4. 應該寫一份報告,說明你的程式設計原理與使用方式,就像 github 專案中的 README.md 那樣

若沒有宣告『來源』,會被嚴重扣分 (完全自創就請宣告完全自創)

另外,關於授權

README.md 一開頭一定要聲明『程式的原創性或修改來源』,否則會嚴重扣分,例如:

  1. 本程式修改自某某 github 專案 ...
  2. 本程式完全是原創作品,沒有修改自任何來源,也沒有剪貼自其他程式作品。

有引用外部文章或圖片時,請注意應使用合法授權的資料!

例如引用維基百科,應採用創作共用 CC:BY-SA 授權!

維基百科:CC BY-SA 3.0協議文本

最常用的方式是在專案下加一個 LICENSE 檔案,像這樣

https://github.com/cccriscv/mini-riscv-os/blob/master/LICENSE

系統程式 第 16 週 -- 簽到討論區

問問題可以用 Google Meet ---- https://meet.google.com/otw-auax-kne

或在本討論區留言

  1. https://www.sifive.com/software
    • 方法 1 : Download Freedom Studio
    • 方法 2 : 下載 GNU Embedded Toolchain + QEMU
    • 方法 3: 直接使用 kinmen6.com 上的環境 ssh [email protected] 密碼 kinmen6110b

從頭開始讀這本書

有任何問題用文字在這個 issue 問,臉書也可以!

簽到範例:

  1. 陳鍾誠 在 e320
  2. 史奴比 在 家

示範

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!

系統程式 第 9 週 -- 簽到討論區

終端機 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

期末作業:請繳交你對本課程的學習筆記! 2022/6/17 24:00 截止繳交

可以用 github, github wiki, hackmd, .... 或任何你想用的工具撰寫,最好能在網路上直接看到。

注意:

  1. 若你有使用外部資源,或者圖片,請一定要標示 來源或套件名稱。
  2. 若你的程式碼 (C/ASM) 是修改自別人的,或者網路上的,也務必要聲明。
    • 我的程式是修改自 github 的 某某專案,網址為 ....
  3. 若你某個期末作業主要部分 (例如是個 Compiler),完全沒有用別人的東西,也請你標示出來
  4. 應該寫一份報告,說明你的程式設計原理與使用方式,就像 github 專案中的 README.md 那樣

若沒有宣告『來源』,會被嚴重扣分 (完全自創就請宣告完全自創)

另外,關於授權

README.md 一開頭一定要聲明『程式的原創性或修改來源』,否則會嚴重扣分,例如:

  1. 本程式修改自某某 github 專案 ...
  2. 本程式完全是原創作品,沒有修改自任何來源,也沒有剪貼自其他程式作品。

有引用外部文章或圖片時,請注意應使用合法授權的資料!

例如引用維基百科,應採用創作共用 CC:BY-SA 授權!

維基百科:CC BY-SA 3.0協議文本

最常用的方式是在專案下加一個 LICENSE 檔案,像這樣

https://github.com/cccriscv/mini-riscv-os/blob/master/LICENSE

系統程式 第 15 週 -- 簽到討論區

  1. https://www.sifive.com/software
    • 方法 1 : Download Freedom Studio
    • 方法 2 : 下載 GNU Embedded Toolchain + QEMU
    • 方法 3: 直接使用 kinmen6.com 上的環境 ssh [email protected] 密碼 kinmen6110b

從頭開始讀這本書

有任何問題用文字在這個 issue 問,臉書也可以!

簽到範例:

  1. 陳鍾誠 在 e320
  2. 史奴比 在 家

示範

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.