Top Banner
For OS Experiments
19
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: For OS Experiments. What Do We Need? A Computer &

For OS Experiments

Page 2: For OS Experiments. What Do We Need? A Computer &

What Do We Need?

Page 3: For OS Experiments. What Do We Need? A Computer &

A Computer&

Page 4: For OS Experiments. What Do We Need? A Computer &

What?

You Have Only A Computer!

http://ben047.pixnet.net/blog/post/9988186-%E8%BD%89%E5%AF%84%E5%88%86%E4%BA%AB%EF%BC%9A-%E7%AA%AE%E7%9A%84%E5%AE%9A%E7%BE%A9

Page 5: For OS Experiments. What Do We Need? A Computer &

You Need Virtual Machines

Page 6: For OS Experiments. What Do We Need? A Computer &

How to Use ?

Page 7: For OS Experiments. What Do We Need? A Computer &

It’s Your Job

Page 8: For OS Experiments. What Do We Need? A Computer &

Virtual Machines

Hypervisor

Hypervisor

Page 9: For OS Experiments. What Do We Need? A Computer &

Virtual Machines on Host OS

Page 10: For OS Experiments. What Do We Need? A Computer &

Examples of VMOracle VM VirtualBoxVMWare PlayerQEMU (Quick EMUlator)

Page 11: For OS Experiments. What Do We Need? A Computer &

How to Build Drivers

Page 12: For OS Experiments. What Do We Need? A Computer &

Commands to Download ToolsOn Ubuntu12.04

sudo apt-get updatesudo apt-get install make sudo apt-get install build-essentialsudo apt-get install vimsudo apt-get install linux-headers-$(uname -r)

Page 13: For OS Experiments. What Do We Need? A Computer &

Makefile

obj-m = hello.o

KVERSION = $(shell uname -r)

all:

make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules

clean:

make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean

Page 14: For OS Experiments. What Do We Need? A Computer &

hello.c#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);

Page 15: For OS Experiments. What Do We Need? A Computer &

Compile and Use Itmakesudo insmod hello.kosudo modprobe hello.ko

try to also load other modules for undefined symbols

sudo rmmod hellodmesg

Page 16: For OS Experiments. What Do We Need? A Computer &

RequirementsInstall a virtual machine on your computerInstall Linux and Windows 7 (or Windows XP) on the

virtual machineImplement a device driver

Print “Hi, I am Student-ID” 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

Page 17: For OS Experiments. What Do We Need? A Computer &

Report1. The steps for your implementation

2. The problem you met and how you solved it

3. The bonus you have done

4. The reference of this project

The report is limited within 4 pages

Page 18: For OS Experiments. What Do We Need? A Computer &

GradingImplementation

The VM: 20%The OS: 20% (10% for each)The driver: 20%

Report40% (the baseline is 30%)

BonusRecompile the Linux kernel on the VM: 10%Implement a system call on the Linux kernel: 10%

Page 19: For OS Experiments. What Do We Need? A Computer &

Submission Project deadline: at 15:00 on 2014/01/17

NO DELAY!Send your report and the compiled device driver

(module) to TA: 蔡宗佑 [email protected] title of the email: OS Project of Student-IDThe title of the report: OS_Name_Student-IDThe title of the driver: Driver_Student-ID.koPoint deduction for wrong format: 10%

DEMO might be requested