Andrew Chiu

@AndybnA

Joined on Dec 26, 2018

  • 測驗 ϵ - 1 解釋上述程式碼運作原理: 在主程式中,我們可以看到有四個進入點,分別是將 memory pool 做初始化的 mpool_init()、配空間的 mpool_alloc、將空間歸還 memory pool 的 mpool_repool、以及釋放整個 memory pool 的 mpool_free。 程式運作的核心概念是根據配置大小對 pool 做分類,在每一個類別 (pool) 中用 array 來區隔每個可配置區、然後用 linked-list 將配置出來 array 中每個元素串成 free list 做配置及釋放(repool)的管理。 struct mpool typedef struct { int cnt; /* actual pool count */
     Like  Bookmark
  • Phase 1 自動澆灌系統 預期完成時間:17. Oct, 2020 預期目標: 遠端控制澆水 水塔水位感測 根據水位決定是否由自來水口採水 Week 1
     Like  Bookmark
  • contributed by < Tao Chiu > IA-32e System Overview x86 Long Mode (IA-32e) Extends general registers to 64 bits, 8 additional registers for both integer and SSE. Does not support hardware task switching. the size of the physical address range is implementation-specific and indicated by CPUID.80000008H:EAX[bits 7-0] (3.3.1) A logical processor is in IA-32e mode whenever CR0.PG = 1 and IA32_EFER.LME = 1. This fact is reported in IA32_EFER.LMA[bit 10]. Software cannot set this bit directly; it is always the logical-AND of CR0.PG and IA32_EFER.LME.
     Like 2 Bookmark
  • contributed by < AndybnACT > khttpd 的實作問題與解決方法 編譯及載入 khttpd 完成後,可透過開啟網址 http://localhost:8081/,和 dmesg 檢查 khttpd 的運作,搭配閱讀原始程式碼,發現 khttpd 的實作存在若干嚴重問題。 http_server_worker 沒有被正確地釋放 首先,若是使用網頁瀏覽器開啟網頁,在卸載(rmmod)之後,接下來的操作(如:重新整理、關閉瀏覽器等…)都會導致 kernel page fault: [16029.728411] khttpd: module unloaded [16052.062048] BUG: unable to handle kernel paging request at ffffffffc0ebfb94
     Like  Bookmark
  • contributed by < AndybnACT > A basic memmove To implement a memmove, we need to consider if there is memory alaising (overlapped block) for input parameters. If there is an overlap and the address of destination is higher then the source parameter, then the copy of src to dst starts from high to low address. Otherwise, we start moving memory block from low to high. Then, we can implement the memmove function. Note that we copy data byte by byte to deal with objects of any sizes (e.g. char, int arrays). void *memmove_bs1(void *dest, const void *src, size_t n) { char* d = (char*) dest;
     Like  Bookmark
  • contributed by < AndybnACT > :penguin: 作業描述 作業要求 開發紀錄 queue.h 為了讓 q_insert_tail 和 q_size 有 $O(1)$ 的時間複雜度,增加指向串列尾端的指標(tail)、和表示元素數量(nr)的欄位。接下來,只要在後面實作的函式中適當地更新這些資訊即可。 typedef struct { list_ele_t *head; /* Linked list of elements */
     Like  Bookmark
  • contributed by < AndybnACT > 大數運算 第一次執行的時候發現費氏數列的計算結果不如預期。 Passed [-] f(93) fail input: 7540113804746346429 expected: 12200160415121876738
     Like  Bookmark