作業1
- mutex用法。注意,原有的mutex已經被廢除。
- 使用Eclipse CDT或KDevelop操作內核
- 查看內核消息:
- 直接查看:
tail -100 /var/log/messages(Debian)
或者tail -20 /var/log/syslog(Ubuntu) - 通用:
dmesg -T | tail -100 -r | less(僅限BSD/OS X)
或者dmesg -T | tail -100 | tac | less(僅限GNU)。
(逆序查看參考StackOverflow) - semaphore用法
- file_operations定義
作業2
- 無法使用
make menuconfig,需要安裝new curses函式庫:
sudo apt-get install libncurses5-dev libncursesw5-dev
(來自nixCraft) - Why you shouldn't parse the output of
ls(1) - 編譯內核依賴於
bc語言編譯器。安裝方法:
sudo apt-get install bc -
make: multithread other option - how to write system call
作業3
- 頭文件
sys/types.h中的pid_t gettid(void)將返回tgid。 - scheduling函數和[任務結構]( http://lxr.free-electrons.com/source/include/linux/sched.h#L1278)
