# OSDI ###### tags: `Operating System` ###### members: @李睦樂 @吳宥毅 @謝翔丞 @高笙祐 @陳宥安 ### Time: 7/12/2021 - 7/19/2021 ## 1. Successes Last Week * What you managed/plan to accomplish this week - hopefully in line with goals - if not that's okay too. ## 2. Progress and Problems Last Week * What have you done last week ? * What problems encountered last week ? * What caused you to be slow on a particular task? What roadblocks did you encounter? * 陳宥安 * 完成Lab0中linux環境設置、套件安裝、run and debug * 學linux基本指令 * ref: https://jasonblog.github.io/note/linux_tools/linux_basic.html * 謝翔丞 * linker script基本教學 * https://blog.louie.lu/2016/11/06/10%E5%88%86%E9%90%98%E8%AE%80%E6%87%82-linker-scripts/ * 吳宥毅 * http://opass.logdown.com/posts/248172-linker-loader-library * .bss的一些資料 * https://en.wikipedia.org/wiki/.bss * https://blog.gtwang.org/programming/memory-layout-of-c-program/ * stack memory structure * https://dotnettutorials.net/lesson/stack-vs-heap-memory/ * 高笙祐 * 如何安裝gdb: * https://hackmd.io/@O3vqd41hS8qfFYxGORVmnw/Alvie ## 3. Not Resolved Problems * 謝翔丞 * 不清楚如何實際操作在rpi上 * 1.要先用讀卡機將SD卡接上電腦(? * 2.沒有針針to usb 的線要怎麼辦(咪挺助教講到的那個線) ## 4. Goals for next week * Read https://pages.cs.wisc.edu/~remzi/OSTEP/vm-intro.pdf * Figure out what is bss, section, stack memory structure, linker * Figure out how to use Makefile to compile a program. What is $@ in Makefile ? * Lab1: requirement 1 * Initialize rpi3 after booted by bootloader. * 可以執行 main * Use debugger, compile with -g flag --- ### Time: 7/19/2021 - 7/26/2021 ## 2. Progress and Problems Last Week * What have you done last week ? * Complete Lab 0 (吳宥毅 Complete Lab 0 tutorial step by step) * AARCH64-ELF套件下載處:https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/aarch64-elf/ https://hackmd.io/EC8edab1Tm-fc-1kIjssJA (陳宥安) * What problems encountered last week ? * Makefile ref: https://hackmd.io/@sysprog/SySTMXPvl * 我在執行gdb時有遇到一個問題,它顯示沒有aarch-gdb這個指令,需要在前面加上./(我完全不知道為什麼抱歉)我輸入 ./aarch-gdb就可以了 (吳宥毅) (resolved) * What caused you to be slow on a particular task? * 陳宥安 * 在開啟QEMU並跑AARCH64-GDB後,gdb卡住 * 助教回答:程式跑不到main,再想解決辦法。 * 謝翔丞 * 在makefile的時候不斷碰到"缺少分隔符"的問題,原先以為是自己用空白取代tab的關係,但是改完問題依然存在 (resolved) * 經由助教提點後才發現是其中沒有使用symbolic link的部分 * make完突然迷途羔羊,不確定下一步的方向(持續更新) (resolved) * 不確定如何執行main(持續更新) * make時遇到許多相關套件未下載 (resolved) * 依循錯誤訊息裝載即可 * 高笙祐 * https://hackmd.io/@O3vqd41hS8qfFYxGORVmnw/rJqTXqSCd ## 4. Goals for next week * 了解basic initialization 在做的事情(demo,說明自己是怎麼完成這個basic init) * 了解UART/GPIO設定 * 確認rpi4和3在UART/GPIO的差別,並且找看看有沒有相關的document (如果同學有找的新的rpi4 document請放上來) * https://datasheets.raspberrypi.org/bcm2711/bcm2711-peripherals.pdf 應該是這個 * https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/README.md (來源) * 用qemu去mini UART lab (demo) * 確認連接GPIO線材(下星期教如何在rpi4板子上接線) * Makefile instruction document (高笙祐) * https://hackmd.io/@O3vqd41hS8qfFYxGORVmnw/SkcT0TjA_ ### Time: 7/26/2021 - 8/2/2021 ## 1. Successes Last Week * What you managed/plan to accomplish this week - hopefully in line with goals - if not that's okay too. * lab1-1 completed tutorial: (高笙祐) https://hackmd.io/@O3vqd41hS8qfFYxGORVmnw/rJqTXqSCd * 會議記錄(22/7/2021): https://drive.google.com/file/d/1l1Z6P2AcgfpQrijXSMLiFMvemhcppN41/view?usp=sharing ## 2. Progress and Problems Last Week * What have you done last week ? * rpi4的GPIO對應 https://www.etechnophiles.com/raspberry-pi-4-gpio-pinout-specifications-and-schematic/ * 謝翔丞 * Lab1-2紀錄 * https://hackmd.io/0_8rjCtgQFaKTdq3kIlP9w * GPIO的一點小東西 * https://www.slideshare.net/raspberrypi-tw/raspberry-pigpiolookinside * LinkerScript的一點小東西 * http://wen00072.github.io/blog/2014/03/14/study-on-the-linker-script/#assign-prov * 接線的參考HACKMD * https://hackmd.io/@oscarshiang/rpi_uart#%E5%8F%83%E8%80%83%E8%B3%87%E6%96%99 * 陳宥安 * 一些自己寫的筆記: https://hackmd.io/@iammrchen/BJfuimpCu * 高笙祐 * 過程: https://hackmd.io/@O3vqd41hS8qfFYxGORVmnw/ByAfiCAR_ ## 3. Not Resolved Problems *rpi3的一些register跟rpi4的register不太一樣,如:GPPUD ## 4. Goals for next week * USB serial * 可能是 https://www.ruten.com.tw/item/show?22025704351102 * 弄清楚rpi4 GPIO的設定 (看rpi4 document) * https://datasheets.raspberrypi.org/bcm2711/bcm2711-peripherals.pdf * 編譯rpi4的qemu * https://wiki.qemu.org/Hosts/Linux#Building_QEMU_for_Linux * 把改好GPIO設定的lab 1 code放到rpi4 qemu上面跑,看看有沒有問題 (跑mini UART lab code) * 接線的參考HACKMD https://hackmd.io/@oscarshiang/rpi_uart#參考資料 * 燒 lab 1程式進去 rpi 4 ### Time: 8/3/2021 - 8/10/2021 ## 1. Successes Last Week * What you managed/plan to accomplish this week - hopefully in line with goals - if not that's okay too. ## 2. Progress and Problems Last Week * What have you done last week ? * What problems encountered last week ? * Problem * qemu沒有rpi4的machine type,rpi4的code無法在電腦模擬 * Solution: * 換rpi3的板子 * What caused you to be slow on a particular task? What roadblocks did you encounter? ## 3. Not Resolved Problems * rpi4 for qemu https://www.raspberrypi.org/forums/viewtopic.php?t=246886 ## 4. Goals for next week * 寫lab1-3 了解shell及編寫code * 請看以下OS的有關memory allocation chapter * https://pages.cs.wisc.edu/~remzi/OSTEP/vm-api.pdf * https://pages.cs.wisc.edu/~remzi/OSTEP/vm-mechanism.pdf * https://pages.cs.wisc.edu/~remzi/OSTEP/vm-segmentation.pdf * https://pages.cs.wisc.edu/~remzi/OSTEP/vm-freespace.pdf * https://pages.cs.wisc.edu/~remzi/OSTEP/vm-paging.pdf * 寫lab3 模擬allocator的function ### Time: 8/11/2021 - 8/18/2021 ## 1. Successes Last Week * What you managed/plan to accomplish this week - hopefully in line with goals - if not that's okay too. ## 2. Progress and Problems Last Week * What have you done last week ? * What problems encountered last week ? * What caused you to be slow on a particular task? What roadblocks did you encounter? * 陳宥安:shell撰寫 https://hackmd.io/@iammrchen/Sk6zlwC1K * 不連續的page沒辦法組合成空的記憶體空間 (吳宥毅) ## 3. Not Resolved Problems ## 4. Goals for next week * 上傳code到自己的github * 記錄一下buddy system概念,實做,優缺點(吳宥毅) * https://hackmd.io/@yuiwu/SkuIg9XlF (持續更新中) * 完成實作shell的lab (高笙祐) * https://hackmd.io/@O3vqd41hS8qfFYxGORVmnw/ry_WuVGgY (已完成) * 拿到rpi3板子之後,做booting lab * 記錄一下做booting lab (謝翔丞) * https://hackmd.io/czd_bBimQce9yBYWnAeD_A (持續更新中) * 讀OS book的有關memory allocation chapter (參考上個星期的連結)並且summarize這些章節到hackmd (陳宥安) * https://hackmd.io/@iammrchen/SyPDTANxK (Updating) ### Time: 8/19/2021 - 8/26/2021 ## 1. Successes Last Week * What you managed/plan to accomplish this week - hopefully in line with goals - if not that's okay too. ## 2. Progress and Problems Last Week * What have you done last week ? * What problems encountered last week ? * What caused you to be slow on a particular task? What roadblocks did you encounter? ## 3. Not Resolved Problems * Body system * 還沒有實際run過 * 還不確定那些function是可以在rpi3跑(在沒有library的情況下) * Shell * 無法透過terminal互動 ## 4. Goals for next week * 大家都要做: * Body system (吳宥毅) update hackmd * https://hackmd.io/@yuiwu/SkuIg9XlF * Booting (謝翔丞) update hackmd * https://hackmd.io/czd_bBimQce9yBYWnAeD_A * Shell (高笙祐) update hackmd * https://hackmd.io/@O3vqd41hS8qfFYxGORVmnw/ry_WuVGgY * Reading these chapters (吳宥毅) * https://hackmd.io/DKy4Fx57Txa2GBdKfbcZzg (完成) * https://pages.cs.wisc.edu/~remzi/OSTEP/cpu-intro.pdf * https://pages.cs.wisc.edu/~remzi/OSTEP/cpu-api.pdf * https://pages.cs.wisc.edu/~remzi/OSTEP/cpu-mechanisms.pdf * 如果上面的事情都已經做完了,再去看Interrupt and exception lab這一個lab怎麼做 (everybody) ### Time: 8/27/2021 - 9/2/2021 ## 1. Successes Last Week * What you managed/plan to accomplish this week - hopefully in line with goals - if not that's okay too * 會議記錄: https://drive.google.com/file/d/1mJ73253oHud4XCtmOQP49dX34OFnIL8w/view?usp=sharing ## 2. Progress and Problems Last Week * What have you done last week ? * What problems encountered last week ? * What caused you to be slow on a particular task? What roadblocks did you encounter? ## 3. Not Resolved Problems * Booting * requirment 2 還沒做完 * 可以不做,跟後面lab比較相關 * kernal8.img燒入sd卡後putty沒有畫面 * 接線問題 * 大家回去試接看看 * Shell * 無法透過terminal互動(模擬可以,但接上板子後不行) ## 4. Goals for next week * 大家都要做: * 完成booting and body_system * 讀OS 書https://hackmd.io/DKy4Fx57Txa2GBdKfbcZzg * 做Lab 4 Interrupt and exception (了解user/kernel mode), interrput and trap 有什麼不一樣? 記錄一下實作的流程和方法放在hackmd * 如何實做一個 System call * https://grasslab.github.io/osdi/en/labs/lab3.html * You might notice that when you execute `irq` command in the shell, CPU takes an exception. That because you use `msr` to write core timer register which is a privilege operation. To enable the timer, now you have to rely on the kernel in EL1. You can use `svc` to perform a system call. In EL1’s synchronous exception handler, you check `ESR_EL1` to identify the exception is a system call then enable the timer. ### Time: 9/3/2021 - 9/9/2021 ## 1. Successes Last Week * What you managed/plan to accomplish this week - hopefully in line with goals - if not that's okay too * 會議記錄: https://drive.google.com/file/d/1xoNgrkMvyEVFBZlxc1Y24UaNj77SuIwh/view?usp=sharing ## 2. Progress and Problems Last Week * What have you done last week ? * What problems encountered last week ? * What caused you to be slow on a particular task? What roadblocks did you encounter? ## 3. Not Resolved Problems * lab4 * 組語code要放在哪裡? * start.S * b 1b meaning? * b:代表暫停,回到後面指定的行數 * 1b:回到label 1的地方 * 低階mode到高階mode才需要vector table? * 因為高階到低階只需要return回去,是被系統保護的過程 * vector table 重複指令的用意 * 範例剛好用重複的 * exception entry? * c function, do exception things, write it yourself * 呼叫exception handler的流程? * svc -> exception handler load corresponding address, defined in vector table -> jump to exception handler, do context saving * exception entry要放在哪裡? * .c裡面,宣告extern ## Goals for next week * 大家都要做: * 讀OS書 https://pages.cs.wisc.edu/~remzi/OSTEP/ * 高笙祐:Ch7, 8, 10 * https://hackmd.io/@O3vqd41hS8qfFYxGORVmnw/HJFGXWXMY * 陳宥安:Ch26, 27 * 吳宥毅:Ch28, 29 * https://hackmd.io/FOgj8Zp4QiKUbAXJkdR9Zw * 謝翔丞:Ch30, 31 * 做Lab 4 Interrupt and exception (了解user/kernel * 如何實做一個 System call