![Page 1: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/1.jpg)
Che-Wei [email protected] of Computer Science and Information Engineering, Chang Gung University
![Page 2: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/2.jpg)
![Page 3: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/3.jpg)
Hypervisor
© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 4: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/4.jpg)
© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 5: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/5.jpg)
} Oracle VirtualBox} VMWare Player} Parallels Desktop for Mac} QEMU (Quick EMUlator)
5© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 6: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/6.jpg)
![Page 7: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/7.jpg)
} On Ubuntu12.04◦ sudo apt-get update◦ sudo apt-get install make ◦ sudo apt-get install build-essential◦ sudo apt-get install vim◦ sudo apt-get install linux-headers-$(uname -r)
© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 8: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/8.jpg)
obj-m = hello.oKVERSION = $(shell uname -r)all:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modulesclean:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
Note: You have to use “tab” instead of “space” in the Makefile
© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 9: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/9.jpg)
#include <linux/init.h>#include <linux/module.h>#include <linux/sched.h>MODULE_LICENSE("Dual BSD/GPL");static int hello_init(void){return 0;
}static void hello_exit(void){
printk(KERN_ALERT "Goodbye, cruel world\n");}module_init(hello_init);module_exit(hello_exit);
© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 10: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/10.jpg)
} make} sudo insmod hello.ko} sudo modprobe hello.ko
ètry to also load other modules for undefined symbols
} sudo rmmod hello} dmesg
© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 11: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/11.jpg)
} Install a virtual machine on your computer} Install Linux and Windows 10 (or any Windows OS) on
the virtual machine} Implement a device driver ◦ Print “Hi, I am Student-ID, 2018” to the kernel buffer when
inserting the module◦ Print “Bye!” to the kernel buffer when removing the module◦ Hint: you can use the command dmesg to read the buffer
© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 12: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/12.jpg)
1. The steps for your implementation2. The problem you met, and how you solved it3. The bonus you have done4. The reference of this project
} The report is limited within 4 pages (Word or PDF)
© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 13: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/13.jpg)
} Implementation◦ The VM: 20%◦ The OS: 20% (10% for each)◦ The kernel module: 20%
} Report◦ 35% (Baseline is 20%)
} Bonus◦ Recompile and install the Linux kernel on the VM: 20%◦ Implement and test a system call on the Linux kernel: 20%
© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University
![Page 14: chewei@mail.cgu.edu.tw Department of Computer Science …}Project deadline: at 19:00 on 2019-12-26 èNO DELAY!}Send your report and the compiled kennel module to TA:](https://reader034.vdocuments.us/reader034/viewer/2022042216/5ebf0574cb616a244063c7f8/html5/thumbnails/14.jpg)
} Project deadline: at 19:00 on 2019-12-26èNO DELAY!} Send your report and the compiled kennel module to
TA:��� <[email protected]> èNot the source files} The title of the email: OS Project of StudentID} The title of the report: OS_StudentID_Name} The title of the driver: Module_StudentID.ko} Point deduction for wrong format: 10%
èDEMO might be requested© All Rights Reserved, Prof. Che-Wei Chang, Department of Computer Science and Information Engineering, Chang Gung University