CS 453: Operating Systems Programming Project 5 (100 points) Linux Device Driver

Size: px
Start display at page:

Download "CS 453: Operating Systems Programming Project 5 (100 points) Linux Device Driver"

Transcription

1 CS 453: Operating Systems Programming Project 5 (100 points) Linux Device Driver 1 Setup In this assignment, we will write a simple character driver called booga. Please do a git pull --rebase in your backpack to get the p5 project folder that contains the starter code and scripts for this project. Note that, you will only be able to test this assignment on your own VM as you will need to have root access. 2 Caution NOTE: You MUST build against the Kernel version specified in class. If you are unclear what version to build against please ask do NOT just assume. The only time you will need to use root in this project is to load and unload the drivers. You should not use the root account for building, test, etc. 3 The Booga Driver 3.1 The main driver (60 points) The booga driver is a simple character driver that supports the open, read and write operations. The driver supports four minor numbers: 0, 1, 2, and 3. The device files are: /dev/booga0, /dev/- booga1, dev/booga2, /dev/booga3. You can also create a link from /dev/booga to /dev/booga0. On reading from /dev/booga0, /dev/booga1, /dev/booga2 and /dev/booga3 the driver gives a stream of one of the following phrases: booga! booga! googoo! gaagaa! neka! maka! wooga! wooga! Note that the driver may only output part of a phrase if the number of bytes requested by the user is not a multiple of the length of the chosen phrase. Also each new phrase is separated from the previous one by a single space. The driver is unpredictable as to what phrase it says. In order to do this we will use a random number generator. However, we cannot call any standard C library functions in the kernel (e.g.

2 random()). Linux actually has a device driver that generates strong random numbers by observing hardware noise, interrupts and other system activity. In the user space, the random device driver can be accessed via /dev/random. In your device driver code, you will need to include the header file <linux/random.h and the function that you will call has the following prototype. extern void get random bytes(void *buf, int nbytes); Here is a sample code on how to use the above function. char randval; get_random_bytes(&randval, 1); choice = (randval & 0x7F) % 4; /* the bitwise AND is to guarantee positive numbers */ On writing to booga devices /dev/booga0, /dev/booga1, /dev/booga2, the booga device driver works like /dev/null (so it pretends to write the buffer but doesn t actually write to any device). However if a process tries to write to /dev/booga3, it suffers from sudden death! You cannot call the system call kill() from inside the kernel space so you will have to figure out how to terminate a process from inside the kernel. Search the kernel sources for ideas. Use the SIGTERM signal instead of SIGKILL for terminating the process. 3.2 Get Booga Stats from /proc (10 points) Create /proc entries for the booga driver. It reports on the number of bytes read/written since the driver was loaded, number of times it was opened from each supported minor number, and the number of times each of the four strings was selected. So if we output 1000 characters with the string booga! booga! in it, then we count that as one more instance of the phrase for this purpose. If the driver outputs an incomplete phrase, we will still count it as another instance of that phrase being selected. Here is a sample output. [amit@kohinoor booga]# cat /proc/driver/booga bytes read = 300 bytes written = 200 number of opens: /dev/booga0 = 4 times /dev/booga1 = 0 times /dev/booga2 = 1 times /dev/booga3 = 1 times strings output: booga! booga! = 0 times googoo! gaagaa! = 1 times wooga! wooga! = 1 times neka! maka! = 1 times 3.3 Thread-safety (10 points) Protect the updating of structure used to track the statistics using semaphores. See the example in lab/device-management/linux-device-drivers/example4 for an example on how to use a 2

3 semaphore in kernel code. 3.4 Testing (20 points) For testing, use the provided test-booga.c program, which lets you read or write n bytes from the booga device. Develop and use a plan for fully testing your driver and document it as part of your submission. 4 Notes Here are the prototypes of the functions that your driver would need to implement. static int booga_open (struct inode *inode, struct file *filp); static int booga_release (struct inode *inode, struct file *filp); static ssize_t booga_read (struct file *filp, char *buf, size_t count, loff_t *f_pos); static ssize_t booga_write (struct file *filp, const char *buf, size_t count, loff_t *f_pos); static int init booga_init(void); static void exit booga_exit(void); Note that the print messages will not show on the screen if you are testing under X Windows. The messages are, however, logged in the file /var/log/messages. You can open another terminal and watch the output to the system messages file with the command: tail -f /var/log/messages Another approach would be to invoke a virtual system console. following keys: Ctrl-Alt-F2 to use a virtual test console Ctrl-Alt-F1 to go back to the X Windows console In the virtual system console, the system messages will show up on screen. Under Linux, you can use the In the directory linux device drivers/booga, I have provided a test program called test-booga.c. You should use this program to test your driver. While testing your program, the following situations may arise: The system hangs and you have to hit the reset button. The system spontaneously reboots. Oops! The kernel prints an oops message (a milder version of the infamous General Protection Fault). You will get a stack trace with it that should help in narrowing down the cause. Here is a sample session with the booga driver. Note that the characters returned by the driver do not contain any newline characters. The output shown below was modified to fit the width of this page. 3

4 booga]# ls Makefile booga.o booga_unload main.o test-booga booga.h booga_load main.c oops test-booga.c booga]# sudo./booga_load booga]# /sbin/lsmod Module Size Used by booga (unused) nfsd (autoclean) lockd (autoclean) [nfsd] sunrpc (autoclean) [nfsd lockd] 3c59x (autoclean) opl (unused) sb uart [sb] sound [opl3 sb uart401] soundlow [sound] soundcore [sb sound] [amit@kohinoor booga]# test-booga read neka! maka! neka! maka! neka! maka! neka! maka! neka! maka! neka! maka! neka! maka! neka! maka! neka [root@kohinoor booga]# test-booga read wooga! wooga! wooga! wooga! wooga! wooga! wooga! wooga! wooga! wooga! wooga! wooga! wooga! wooga! wo [amit@kohinoor booga]# sudo./booga_unload [amit@kohinoor booga]# /sbin/lsmod Module Size Used by nfsd (autoclean) lockd (autoclean) [nfsd] sunrpc (autoclean) [nfsd lockd] 3c59x (autoclean) opl (unused) sb uart [sb] sound [opl3 sb uart401] soundlow [sound] soundcore [sb sound] [root@kohinoor booga]# Here is a sample write session. [amit@kohinoor booga]: test-booga 4

5 Usage: test-booga <minor number> <buffersize> <read write> booga]: test-booga write Attempting to write to booga device Wrote 100 bytes. [amit@kohinoor booga]: test-booga write Attempting to write to booga device Wrote 100 bytes. [amit@kohinoor booga]: test-booga write Attempting to write to booga device Wrote 100 bytes. [amit@kohinoor booga]: test-booga write Attempting to write to booga device Terminated [amit@kohinoor booga]: 5 Recommended Plan You may find it easier to start from one of the driver examples from the linux driver examples folder. Define the file operations struct (similar to the example driver). Define booga init and booga exit. Let the booga read, booga open, booga release functions be stubs for now. Compile and check if you can load and unload the module successfully. Now decide how you will represent the booga device. One way is to define a struct that keeps track of some of the information. typedef struct Booga_Dev { char *data; unsigned int number; /* minor number */ } The space for this structure would need to be allocated (typically in booga init()). The data points to a buffer that is allocated and filled in booga read(). Remember that you need to use the user space. Do not use memcpy(). copy to user(...) kernel function to copy the data to Test the writing part of the booga driver separately and as the last step. 5

6 6 Required files for submission Make sure to include a README file that contains your name, date, assignment number and observations about the assignment. The test plan can be part of the README file or in a separate file that you mention in the README file. Please submit the files below. README Makefile booga.c booga.h booga load booga unload test-booga.c Additional test scripts or programs that you may have created 7 Submitting the Project Open up a terminal or console and navigate to the backpack folder for the class. Navigate to the subdirectory that contains the source files that you worked on for the project/homework. Suppose that we are submitting three files README.md, main.c and utility.c and one folder named include. Clean up your directory make clean Remove any other unnecessary files that were generated by you or the auto-grader. Add all your changes to Git (this would be specific to your project) git add main.c utility.c include/ README.md Commit your changes to Git git commit -a -m "Finished project p5" Create a new branch for you code git branch p5_branch Switch to working with this new branch git checkout p5_branch (You can do both steps in one command with git checkout -b p5_branch ) Push your files to the Backpack server git push origin p5_branch Switch back to the master branch git checkout master Here is an example workflow for submitting your project. Replace p1 with p5 in the example below. [spanter@valkyrie shane(master) ]$ git checkout -b p1_branch Switched to a new branch p1_branch 6

7 shane(p1_branch) ]$ git push origin p1_branch Total 0 (delta 0), reused 0 (delta 0) To git@nullptr.boisestate.edu:shane * [new branch] p1_branch -> p1_branch [spanter@valkyrie shane(p1_branch) ]$ git checkout master Switched to branch master Your branch is up-to-date with origin/master. Help! I want to submit my code again! No problem just checkout the branch and hack away! [spanter@valkyrie shane(master) ]$ git branch -r origin/head -> origin/master origin/master origin/p1_branch [spanter@valkyrie shane(master) ]$ git checkout p1_branch Branch p1_branch set up to track remote branch p1_branch from origin. Switched to a new branch p1_branch [spanter@valkyrie shane(p1_branch) ]$ touch foo.txt [spanter@valkyrie shane(p1_branch) ]$ git add foo.txt [spanter@valkyrie shane(p1_branch) ]$ git commit -am "Adding change to branch" [p1_branch 1e32709] Adding change to branch 1 file changed, 0 insertions(+), 0 deletions(-) create mode foo.txt [spanter@valkyrie shane(p1_branch) ]$ git push origin p1_branch Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 286 bytes 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To git@nullptr.boisestate.edu:shane 36139d1..1e32709 p1_branch -> p1_branch [spanter@valkyrie shane(p1_branch) ]$ git checkout master Switched to branch master Your branch is up-to-date with origin/master. [spanter@valkyrie shane(master) ]$ We highly recommend reading the section on branches from the Git book here: Git Branches in a Nutshell 7

8 8 Reference Linux Device Drivers, 3rd edition by Alessandro Rubini and Jonathan Corbet (O Reilly, Can be downloaded from the Internet. You may find the material from the first three chapters useful for this assignment. 8

3 Threadsafe Bounded List Wrapper Library Monitor

3 Threadsafe Bounded List Wrapper Library Monitor CS 453: Operating Systems Project 4 (100/110 points) Thread-safe Monitor Library Due Date (on class home page) 1 Introduction In this project, we will create a thread-safe bounded version of the linked-list

More information

Shell Project, part 3 (with Buddy System Memory Manager) ( points)

Shell Project, part 3 (with Buddy System Memory Manager) ( points) CS 453: Operating Systems Project 6 Shell Project, part 3 (with Buddy System Memory Manager) (120 140 points) Due Date -On Class Home Page 1 Introduction In the last release of the mini-shell we will provide

More information

Shell Project Part 1 (140 points)

Shell Project Part 1 (140 points) CS 453: Operating Systems Project 1 Shell Project Part 1 (140 points) 1 Setup All the programming assignments for Linux will be graded on the onyx cluster(onyx.boisestate.edu). Please test your programs

More information

Linux drivers - Exercise

Linux drivers - Exercise Embedded Realtime Software Linux drivers - Exercise Scope Keywords Prerequisites Contact Learn how to implement a device driver for the Linux OS. Linux, driver Linux basic knowledges Roberto Bucher, roberto.bucher@supsi.ch

More information

CS5460/6460: Operating Systems. Lecture 24: Device drivers. Anton Burtsev April, 2014

CS5460/6460: Operating Systems. Lecture 24: Device drivers. Anton Burtsev April, 2014 CS5460/6460: Operating Systems Lecture 24: Device drivers Anton Burtsev April, 2014 Device drivers Conceptually Implement interface to hardware Expose some high-level interface to the kernel or applications

More information

2 Initialize a git repository on your machine, add a README file, commit and push

2 Initialize a git repository on your machine, add a README file, commit and push BioHPC Git Training Demo Script First, ensure that git is installed on your machine, and you have configured an ssh key. See the main slides for instructions. To follow this demo script open a terminal

More information

About SJTUG. SJTU *nix User Group SJTU Joyful Techie User Group

About SJTUG. SJTU *nix User Group SJTU Joyful Techie User Group About SJTUG SJTU *nix User Group SJTU Joyful Techie User Group Homepage - https://sjtug.org/ SJTUG Mirrors - https://mirrors.sjtug.sjtu.edu.cn/ GitHub - https://github.com/sjtug Git Basic Tutorial Zhou

More information

CS 390 Software Engineering Lecture 5 More Git

CS 390 Software Engineering Lecture 5 More Git CS 390 Software Engineering Lecture 5 More Git Reference: Scott Chacon and Ben Straub, Pro Git, published by Apress, available at https://git-scm.com/book/en/v2. Outline Finish local repository Remote

More information

CS 261 Recitation 1 Compiling C on UNIX

CS 261 Recitation 1 Compiling C on UNIX Oregon State University School of Electrical Engineering and Computer Science CS 261 Recitation 1 Compiling C on UNIX Winter 2017 Outline Secure Shell Basic UNIX commands Editing text The GNU Compiler

More information

Section 1: Tools. Kaifei Chen, Luca Zuccarini. January 23, Make Motivation How... 2

Section 1: Tools. Kaifei Chen, Luca Zuccarini. January 23, Make Motivation How... 2 Kaifei Chen, Luca Zuccarini January 23, 2015 Contents 1 Make 2 1.1 Motivation............................................ 2 1.2 How................................................ 2 2 Git 2 2.1 Learn by

More information

Laboratory Assignment #3. Extending scull, a char pseudo-device

Laboratory Assignment #3. Extending scull, a char pseudo-device Laboratory Assignment #3 Extending scull, a char pseudo-device Value: (See the Grading section of the Syllabus.) Due Date and Time: (See the Course Calendar.) Summary: This is your first exercise that

More information

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017 GETTING STARTED WITH Michael Lessard Senior Solutions Architect June 2017 Agenda What is Git? Installation of Git Git basis Github First steps with Git 2 WHAT IS GIT? What is Git? Started in 2005 Created

More information

- Knowledge of basic computer architecture and organization, ECE 445

- Knowledge of basic computer architecture and organization, ECE 445 ECE 446: Device Driver Development Fall 2014 Wednesdays 7:20-10 PM Office hours: Wednesdays 6:15-7:15 PM or by appointment, Adjunct office Engineering Building room 3707/3708 Last updated: 8/24/14 Instructor:

More information

This is an open book, open notes exam. But no online or in-class chatting.

This is an open book, open notes exam. But no online or in-class chatting. Principles of Operating Systems Fall 2017 Final 12/13/2017 Time Limit: 8:00am - 10:00am Name (Print): Don t forget to write your name on this exam. This is an open book, open notes exam. But no online

More information

Section 1: Tools. Contents CS162. January 19, Make More details about Make Git Commands to know... 3

Section 1: Tools. Contents CS162. January 19, Make More details about Make Git Commands to know... 3 CS162 January 19, 2017 Contents 1 Make 2 1.1 More details about Make.................................... 2 2 Git 3 2.1 Commands to know....................................... 3 3 GDB: The GNU Debugger

More information

git Version: 2.0b Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command:

git Version: 2.0b Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command: Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command: git --help Get common commands and help git --help How to use git

More information

So#ware(Project. Lecture'4. Wouter'Swierstra. So#ware(project( (Lecture(4 1

So#ware(Project. Lecture'4. Wouter'Swierstra. So#ware(project( (Lecture(4 1 So#ware(Project Lecture'4 Wouter'Swierstra So#ware(project( (Lecture(4 1 Last%&me Risks So(ware-architecture So#ware(project( (Lecture(4 2 Working(effec,vely(with(git(and(GitHub. So#ware(project( (Lecture(4

More information

HW2d Project Addenda

HW2d Project Addenda HW2d Project Addenda CS 320 Note the following differences between the project description for Harvard s CS 175 class and our class: 1. The CS 175 due date is not applicable. 2. The starter code location

More information

Introduction to Supercomputing

Introduction to Supercomputing Introduction to Supercomputing TMA4280 Introduction to development tools 0.1 Development tools During this course, only the make tool, compilers, and the GIT tool will be used for the sake of simplicity:

More information

OPERATING SYSTEMS ASSIGNMENT 4 FILE SYSTEMS

OPERATING SYSTEMS ASSIGNMENT 4 FILE SYSTEMS OPERATING SYSTEMS ASSIGNMENT 4 FILE SYSTEMS The xv6 file system provides Unix-like files, directories, and pathnames, and stores its data on an IDE disk for persistence. The file-system addresses several

More information

Linux Device Drivers. 3. Char Drivers. 1. Introduction 2. Kernel Modules 3. Char Drivers 4. Advanced Char Drivers 5. Interrupts

Linux Device Drivers. 3. Char Drivers. 1. Introduction 2. Kernel Modules 3. Char Drivers 4. Advanced Char Drivers 5. Interrupts Linux Device Drivers Dr. Wolfgang Koch Friedrich Schiller University Jena Department of Mathematics and Computer Science Jena, Germany wolfgang.koch@uni-jena.de Linux Device Drivers 1. Introduction 2.

More information

Basics of Git GitHub

Basics of Git GitHub Basics of Hub Why this Webinar? You registered for Microsoft codefundo++ Deadline to submit your idea is Oct 12th, 23:59 IST Getting you started with & Hub Agenda What is Version Control? What is the difference

More information

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48 Git and GitHub Dan Wysocki February 12, 2015 Dan Wysocki Git and GitHub February 12, 2015 1 / 48 1 Version Control 2 Git 3 GitHub 4 Walkthrough Dan Wysocki Git and GitHub February 12, 2015 2 / 48 Version

More information

Git for Newbies. ComMouse Dongyue Studio

Git for Newbies. ComMouse Dongyue Studio Git for Newbies ComMouse Dongyue Studio 2018.4.25 Contents What is Git? Git Quick Start Git Branch Git Workflow Git in Practice What is Git? What is Git? A Version Control System (VCS) An Open-sourced

More information

CS 423 Operating System Design: Introduction to Linux Kernel Programming (MP1 Q&A)

CS 423 Operating System Design: Introduction to Linux Kernel Programming (MP1 Q&A) CS 423 Operating System Design: Introduction to Linux Kernel Programming (MP1 Q&A) Professor Adam Bates Fall 2018 Learning Objectives: Talk about the relevant skills required in MP1 Announcements: MP1

More information

How to git with proper etiquette

How to git with proper etiquette How to git with proper etiquette Let's start fixing how we use git here in crew so our GitHub looks even more awesome and you all get experience working in a professional-like git environment. How to use

More information

Virtual File System (VFS) Implementation in Linux. Tushar B. Kute,

Virtual File System (VFS) Implementation in Linux. Tushar B. Kute, Virtual File System (VFS) Implementation in Linux Tushar B. Kute, http://tusharkute.com Virtual File System The Linux kernel implements the concept of Virtual File System (VFS, originally Virtual Filesystem

More information

Git Workflows. Sylvain Bouveret, Grégory Mounié, Matthieu Moy

Git Workflows. Sylvain Bouveret, Grégory Mounié, Matthieu Moy s Sylvain Bouveret, Grégory Mounié, Matthieu Moy 2017 [first].[last]@imag.fr http://recherche.noiraudes.net/resources/git/git-workflow-slides.pdf 1 / 16 Goals of the presentation Global history: multiple

More information

Kernel Modules. Kartik Gopalan

Kernel Modules. Kartik Gopalan Kernel Modules Kartik Gopalan Kernel Modules Allow code to be added to the kernel, dynamically Only those modules that are needed are loaded. Unload when no longer required - frees up memory and other

More information

CS 3013 Operating Systems WPI, A Term Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007

CS 3013 Operating Systems WPI, A Term Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007 CS 3013 Operating Systems WPI, A Term 2007 Craig E. Wills Project 2 (30 pts) Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007 Introduction This assignment is intended to help you learn

More information

Effective Programming Practices for Economists. 7. Version Control, Part II: Git with a Shared Repository

Effective Programming Practices for Economists. 7. Version Control, Part II: Git with a Shared Repository Effective Programming Practices for Economists 7. Version Control, Part II: Git with a Shared Repository Hans-Martin von Gaudecker Department of Economics, Universität Bonn Collaboration Science in general

More information

Outline. OS Interface to Devices. System Input/Output. CSCI 4061 Introduction to Operating Systems. System I/O and Files. Instructor: Abhishek Chandra

Outline. OS Interface to Devices. System Input/Output. CSCI 4061 Introduction to Operating Systems. System I/O and Files. Instructor: Abhishek Chandra Outline CSCI 6 Introduction to Operating Systems System I/O and Files File I/O operations File Descriptors and redirection Pipes and FIFOs Instructor: Abhishek Chandra 2 System Input/Output Hardware devices:

More information

Software Project (Lecture 4): Git & Github

Software Project (Lecture 4): Git & Github Software Project (Lecture 4): Git & Github Wouter Swierstra, Atze Dijkstra Feb 2016 Wouter Swierstra, Atze Dijkstra Software Project (Lecture 4): Git & Github Feb 2016 1 / 45 Wouter Swierstra, Atze Dijkstra

More information

CS360 Midterm 2 Spring, 2016 James S. Plank March 10, 2016

CS360 Midterm 2 Spring, 2016 James S. Plank March 10, 2016 CS360 Midterm 2 Spring, 2016 James S. Plank March 10, 2016 In all of these questions, please assume the following: Pointers and longs are 4 bytes. The machine is little endian, but that doesn't matter

More information

Lab 4: Interrupts and Realtime

Lab 4: Interrupts and Realtime Lab 4: Interrupts and Realtime Overview At this point, we have learned the basics of how to write kernel driver module, and we wrote a driver kernel module for the LCD+shift register. Writing kernel driver

More information

Final Step #7. Memory mapping For Sunday 15/05 23h59

Final Step #7. Memory mapping For Sunday 15/05 23h59 Final Step #7 Memory mapping For Sunday 15/05 23h59 Remove the packet content print in the rx_handler rx_handler shall not print the first X bytes of the packet anymore nor any per-packet message This

More information

SYSTEM CALL IMPLEMENTATION. CS124 Operating Systems Fall , Lecture 14

SYSTEM CALL IMPLEMENTATION. CS124 Operating Systems Fall , Lecture 14 SYSTEM CALL IMPLEMENTATION CS124 Operating Systems Fall 2017-2018, Lecture 14 2 User Processes and System Calls Previously stated that user applications interact with the kernel via system calls Typically

More information

Linux Device Drivers Interrupt Requests

Linux Device Drivers Interrupt Requests Overview 1 2 3 Installation of an interrupt handler Interface /proc 4 5 6 7 primitive devices can be managed only with I/O regions, most devices require a more complicated approach, devices cooperate with

More information

Pebbles Kernel Specification September 26, 2004

Pebbles Kernel Specification September 26, 2004 15-410, Operating System Design & Implementation Pebbles Kernel Specification September 26, 2004 Contents 1 Introduction 2 1.1 Overview...................................... 2 2 User Execution Environment

More information

Workspace for '5-linux' Page 1 (row 1, column 1)

Workspace for '5-linux' Page 1 (row 1, column 1) Workspace for '5-linux' Page 1 (row 1, column 1) Workspace for '5-linux' Page 2 (row 2, column 1) ECEN 449 Microprocessor System Design Introduction to Linux 1 Objectives of this Lecture Unit Learn basics

More information

Linux Kernel Modules & Device Drivers April 9, 2012

Linux Kernel Modules & Device Drivers April 9, 2012 Linux Kernel Modules & Device Drivers April 9, 2012 Pacific University 1 Resources Linux Device Drivers,3rd Edition, Corbet, Rubini, Kroah- Hartman; O'Reilly kernel 2.6.10 we will use 3.1.9 The current

More information

Programming Assignment 1

Programming Assignment 1 CMSC 417 Computer Networks Fall 2017 Programming Assignment 1 Assigned: September 6 Due: September 14, 11:59:59 PM. 1 Description In this assignment, you will write a UDP client and server to run a simplified

More information

Version control system (VCS)

Version control system (VCS) Version control system (VCS) Remember that you are required to keep a process-log-book of the whole development solutions with just one commit or with incomplete process-log-book (where it is not possible

More information

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013 The Embedded I/O Company TIP675-SW-82 Linux Device Driver 48 TTL I/O Lines with Interrupts Version 1.2.x User Manual Issue 1.2.5 November 2013 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek, Germany

More information

A Brief Introduction to Git. Sylverie Herbert (based on slides by Hautahi Kingi)

A Brief Introduction to Git. Sylverie Herbert (based on slides by Hautahi Kingi) A Brief Introduction to Git Sylverie Herbert (based on slides by Hautahi Kingi) Introduction Version control is better than mailing files back and forth because: Nothing that is committed to version control

More information

The Embedded I/O Company TIP700-SW-82 Linux Device Driver User Manual TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC

The Embedded I/O Company TIP700-SW-82 Linux Device Driver User Manual TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC The Embedded I/O Company TIP700-SW-82 Linux Device Driver Digital Output 24V DC Version 1.2.x User Manual Issue 1.2.1 February 2009 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 Phone: +49 (0) 4101 4058 0 25469

More information

Laboratory Assignment #3. Extending scull, a char pseudo-device. Summary: Objectives: Tasks:

Laboratory Assignment #3. Extending scull, a char pseudo-device. Summary: Objectives: Tasks: Laboratory Assignment #3 Extending scull, a char pseudo-device Value: (See the Grading section of the Syllabus.) Due Date and Time: (See the Course Calendar.) Summary: This is your first exercise that

More information

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b Git Cheat Sheet Git Basics Rewriting Git History git init Create empty Git repo in specified directory. Run with no arguments to initialize the current directory as a git repository. git commit

More information

Operating Systems 16 - CS 323 Assignment #2

Operating Systems 16 - CS 323 Assignment #2 Operating Systems 16 - CS 323 Assignment #2 Scheduler March 18, 2016 1 Objectives 1. Learn about scheduling in the Linux kernel 2. Understand the tradeoffs involved in scheduling 3. Work on the codebase

More information

Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm

Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm 15-123 Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm The Assignment Summary: In this assignment we are planning to manipulate

More information

Device Drivers. CS449 Fall 2017

Device Drivers. CS449 Fall 2017 Device Drivers CS449 Fall 2017 Software Layers User-level I/O so7ware & libraries Device-independent OS so7ware Device drivers Interrupt handlers User OperaEng system (kernel) Hardware Device Drivers User

More information

Unix (Linux) Device Drivers

Unix (Linux) Device Drivers Unix (Linux) Device Drivers Kernel module that handles the interaction with an specific hardware device, hiding its operational details behind a common interface Three basic categories Character Block

More information

CS 0449 Project 4: /dev/rps Due: Friday, December 8, 2017, at 11:59pm

CS 0449 Project 4: /dev/rps Due: Friday, December 8, 2017, at 11:59pm CS 0449 Project 4: /dev/rps Due: Friday, December 8, 2017, at 11:59pm Project Description Standard UNIX and Linux systems come with a few special files like /dev/zero, which returns nothing but zeros when

More information

DEAD-SIMPLE VERSION CONTROL FOR YOUR TEAM GIT WITH MATTHEW REIDSMA GRAND VALLEY STATE UNIVERSITY

DEAD-SIMPLE VERSION CONTROL FOR YOUR TEAM GIT WITH MATTHEW REIDSMA GRAND VALLEY STATE UNIVERSITY DEAD-SIMPLE VERSION CONTROL FOR YOUR TEAM WITH GIT MATTHEW REIDSMA GRAND VALLEY STATE UNIVERSITY WHO DOESN T USE VERSION CONTROL? VERSION CONTROL WHO? OH BOY. WHY YOU NEED VERSION CONTROL GIT GIT WHY GIT

More information

Character Device Drivers

Character Device Drivers Character Device Drivers 張大緯 CSIE, NCKU The information on the slides are from Linux Device Drivers, Third Edition, by Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman. Copyright 2005 O Reilly

More information

CS 378 (Spring 2003)

CS 378 (Spring 2003) Department of Computer Sciences THE UNIVERSITY OF TEXAS AT AUSTIN CS 378 (Spring 2003) Linux Kernel Programming Yongguang Zhang (ygz@cs.utexas.edu) Copyright 2003, Yongguang Zhang This Lecture Device Driver

More information

Submitting your Work using GIT

Submitting your Work using GIT Submitting your Work using GIT You will be using the git distributed source control system in order to manage and submit your assignments. Why? allows you to take snapshots of your project at safe points

More information

Introduction to Supercomputing

Introduction to Supercomputing Introduction to Supercomputing TMA4280 Introduction to UNIX environment and tools 0.1 Getting started with the environment and the bash shell interpreter Desktop computers are usually operated from a graphical

More information

Lab 09 - Virtual Memory

Lab 09 - Virtual Memory Lab 09 - Virtual Memory Due: November 19, 2017 at 4:00pm 1 mmapcopy 1 1.1 Introduction 1 1.1.1 A door predicament 1 1.1.2 Concepts and Functions 2 1.2 Assignment 3 1.2.1 mmap copy 3 1.2.2 Tips 3 1.2.3

More information

CSE 333 SECTION 3. POSIX I/O Functions

CSE 333 SECTION 3. POSIX I/O Functions CSE 333 SECTION 3 POSIX I/O Functions Administrivia Questions (?) HW1 Due Tonight Exercise 7 due Monday (out later today) POSIX Portable Operating System Interface Family of standards specified by the

More information

Finish up OS topics Group plans

Finish up OS topics Group plans Finish up OS topics Group plans Today Finish up and review Linux device driver stuff Walk example again See how it all goes together Discuss talking to MMIO RTOS (on board) Deferred interrupts Discussion

More information

Version Control. Collaborating with git. Tim Frasier

Version Control. Collaborating with git. Tim Frasier Version Control Collaborating with git Tim Frasier Copyright Tim Frasier 2015 This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information. Setting

More information

Intermediate Programming, Spring Misha Kazhdan

Intermediate Programming, Spring Misha Kazhdan 600.120 Intermediate Programming, Spring 2017 Misha Kazhdan Outline Unix/Linux command line Basics of the Emacs editor Compiling and running a simple C program Cloning a repository Connecting to ugrad

More information

Project 4: Synchronization

Project 4: Synchronization Project 4: Synchronization CS 311 For this project, you ll implement variations of two of the classic synchronization problems: Dining Philosophers and The Sleeping Barber. You ll use Pthreads mutex and

More information

Version Control: Gitting Started

Version Control: Gitting Started ting Started Cai Li October 2014 What is Version Control? Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. Local Version

More information

Revision Control and GIT

Revision Control and GIT Revision Control and GIT On UD HPC Community Clusters William Totten Network & Systems Services Why use revision control You can go back in time It makes it easy to try things out which might not work

More information

Loadable Kernel Module

Loadable Kernel Module Instituto Superior de Engenharia do Porto Mestrado em Engenharia Eletrotécnica e de Computadores Arquitetura de Computadores Loadable Kernel Module The objective of this lesson is to analyze, compile and

More information

Tizen Project Guideline. SKKU Embedded Software Lab.

Tizen Project Guideline. SKKU Embedded Software Lab. 1 Tizen Project Guideline Tizen Project Process 2 Assume that you have done flashing Tizen images. 1. Preparation Install Tizen Development Environments 2. Github 1. Sign in Github 2. Make an Organization

More information

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco CS 326 Operating Systems C Programming Greg Benson Department of Computer Science University of San Francisco Why C? Fast (good optimizing compilers) Not too high-level (Java, Python, Lisp) Not too low-level

More information

FAQ Q: Where/in which branch do I create new code/modify existing code? A: Q: How do I commit new changes? A:

FAQ Q: Where/in which branch do I create new code/modify existing code? A: Q: How do I commit new changes? A: FAQ Q: Where/in which branch do I create new code/modify existing code? A: We strongly recommend only modifying the source code within the local master branch: Git Repository View Woped repository Branches

More information

Project 5 File System Protection

Project 5 File System Protection Project 5 File System Protection Introduction This project will implement simple protection in the xv6 file system. Your goals are to: 1. Implement protection in the xv6 file system. 2. Understand how

More information

Git. A Distributed Version Control System. Carlos García Campos

Git. A Distributed Version Control System. Carlos García Campos Git A Distributed Version Control System Carlos García Campos carlosgc@gnome.org Carlos García Campos carlosgc@gnome.org - Git 1 A couple of Quotes For the first 10 years of kernel maintenance, we literally

More information

/dev/hello_world: A Simple Introduction to Device Drivers under Linux

/dev/hello_world: A Simple Introduction to Device Drivers under Linux Published on Linux DevCenter (http://www.linuxdevcenter.com/) See this if you're having trouble printing code examples /dev/hello_world: A Simple Introduction to Device Drivers under Linux by Valerie Henson

More information

RF-IDs in the Kernel -- Episode III: I want to File Away

RF-IDs in the Kernel -- Episode III: I want to File Away What s on the menu Software Comprehension and Maintenance June 2005 RF-IDs in the Kernel -- Episode III: I want to File Away Achilleas Anagnostopoulos (archie@istlab.dmst.aueb.gr) Department of Management

More information

CS 326: Operating Systems. Process Execution. Lecture 5

CS 326: Operating Systems. Process Execution. Lecture 5 CS 326: Operating Systems Process Execution Lecture 5 Today s Schedule Process Creation Threads Limited Direct Execution Basic Scheduling 2/5/18 CS 326: Operating Systems 2 Today s Schedule Process Creation

More information

MaRTE OS Misc utilities

MaRTE OS Misc utilities MaRTE OS Misc utilities Daniel Sangorrin daniel.sangorrin@{unican.es, gmail.com} rev 0.1: 2008-5-12 1. Circular Memory Buffer This is a generic software component that allows the user to write some data

More information

NPTEL Course Jan K. Gopinath Indian Institute of Science

NPTEL Course Jan K. Gopinath Indian Institute of Science Storage Systems NPTEL Course Jan 2012 (Lecture 17) K. Gopinath Indian Institute of Science Accessing Devices/Device Driver Many ways to access devices under linux Non-block based devices ( char ) - stream

More information

CSE 15L Winter Midterm :) Review

CSE 15L Winter Midterm :) Review CSE 15L Winter 2015 Midterm :) Review Makefiles Makefiles - The Overview Questions you should be able to answer What is the point of a Makefile Why don t we just compile it again? Why don t we just use

More information

Scrivere device driver su Linux. Better Embedded 2012 Andrea Righi

Scrivere device driver su Linux. Better Embedded 2012 Andrea Righi Scrivere device driver su Linux Agenda Overview Kernel-space vs user-space programming Hello, world! kernel module Writing a character device driver Example(s) Q/A Overview What's a kernel? The kernel

More information

Basic OS Progamming Abstrac7ons

Basic OS Progamming Abstrac7ons Basic OS Progamming Abstrac7ons Don Porter Recap We ve introduced the idea of a process as a container for a running program And we ve discussed the hardware- level mechanisms to transi7on between the

More information

CS155: Computer Security Spring Project #1

CS155: Computer Security Spring Project #1 CS155: Computer Security Spring 2018 Project #1 Due: Part 1: Thursday, April 12-11:59pm, Parts 2 and 3: Thursday, April 19-11:59pm. The goal of this assignment is to gain hands-on experience finding vulnerabilities

More information

Exercise 1: Basic Tools

Exercise 1: Basic Tools Exercise 1: Basic Tools This exercise is created so everybody can learn the basic tools we will use during this course. It is really more like a tutorial than an exercise and, you are not required to submit

More information

Software Engineering

Software Engineering Software Engineering CSC 331/631 - Spring 2018 Version Control with Git Paul Pauca March 27 SE Theory: Version Control Systems Link to video lectures (Soft Dev Proc part 1 of 3) Watch these short videos

More information

Programming Assignment 0

Programming Assignment 0 CMSC 17 Computer Networks Fall 017 Programming Assignment 0 Assigned: August 9 Due: September 7, 11:59:59 PM. 1 Description In this assignment, you will write both a TCP client and server. The client has

More information

Project Introduction

Project Introduction Project 1 Assigned date: 10/01/2018 Due Date: 6pm, 10/29/2018 1. Introduction The sliding window protocol (SWP) is one of the most well-known algorithms in computer networking. SWP is used to ensure the

More information

GIT. CS 490MT/5555, Spring 2017, Yongjie Zheng

GIT. CS 490MT/5555, Spring 2017, Yongjie Zheng GIT CS 490MT/5555, Spring 2017, Yongjie Zheng GIT Overview GIT Basics Highlights: snapshot, the three states Working with the Private (Local) Repository Creating a repository and making changes to it Working

More information

Building CircuitPython

Building CircuitPython Building CircuitPython Created by Dan Halbert Last updated on 2018-05-18 03:47:12 AM UTC Guide Contents Guide Contents Introduction Linux Setup Install a Real or Virtual Linux Machine Native Linux Linux

More information

Basic OS Progamming Abstrac2ons

Basic OS Progamming Abstrac2ons Basic OS Progamming Abstrac2ons Don Porter Recap We ve introduced the idea of a process as a container for a running program And we ve discussed the hardware- level mechanisms to transi2on between the

More information

REVISION HISTORY NUMBER DATE DESCRIPTION NAME

REVISION HISTORY NUMBER DATE DESCRIPTION NAME i ii REVISION HISTORY NUMBER DATE DESCRIPTION NAME iii Contents 1 The structure of a Linux kernel module 1 1.1 Install XV6...................................................... 1 1.2 Compile and load a

More information

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University Prof. Sunil P. Khatri Lab exercise created and tested by: Abbas Fairouz, Ramu Endluri, He Zhou,

More information

Linux Kernel Development (LKD)

Linux Kernel Development (LKD) Linux Kernel Development (LKD) Session 2 CISTER Framework: Laboratory 2 Paulo Baltarejo Sousa pbs@isep.ipp.pt 2017 1 Introduction The goal of the CISTER framework is to create a set of tools that help

More information

Parallel System Architectures 2016 Lab Assignment 1: Cache Coherency

Parallel System Architectures 2016 Lab Assignment 1: Cache Coherency Institute of Informatics Computer Systems Architecture Jun Xiao Simon Polstra Dr. Andy Pimentel September 1, 2016 Parallel System Architectures 2016 Lab Assignment 1: Cache Coherency Introduction In this

More information

Design and Implementation of an Asymmetric Multiprocessor Environment Within an SMP System. Roberto Mijat, ARM Santa Clara, October 2, 2007

Design and Implementation of an Asymmetric Multiprocessor Environment Within an SMP System. Roberto Mijat, ARM Santa Clara, October 2, 2007 Design and Implementation of an Asymmetric Multiprocessor Environment Within an SMP System Roberto Mijat, ARM Santa Clara, October 2, 2007 1 Agenda Design Principle ARM11 MPCore TM overview System s considerations

More information

Introduction Reading Writing scull. Linux Device Drivers - char driver

Introduction Reading Writing scull. Linux Device Drivers - char driver Overview 1 2 3 4 Major, minor File Operations The file Structure The inode structure Registraction simplest driver, suitable for most simple devices, follow the book. Jernej Figure: Vičič. (Simple Character

More information

CS 143A. Principles of Operating Systems. Instructor : Prof. Anton Burtsev

CS 143A. Principles of Operating Systems. Instructor : Prof. Anton Burtsev CS 143A Principles of Operating Systems Instructor : Prof. Anton Burtsev (aburtsev@uci.edu) Assistants : Junjie Shen junjies1@uci.edu Vikram Narayanan narayav1@uci.edu Biswadip Maity (Deep) Email : maityb@uci.edu

More information

Git Tutorial. André Sailer. ILD Technical Meeting April 24, 2017 CERN-EP-LCD. ILD Technical Meeting, Apr 24, 2017 A. Sailer: Git Tutorial 1/36

Git Tutorial. André Sailer. ILD Technical Meeting April 24, 2017 CERN-EP-LCD. ILD Technical Meeting, Apr 24, 2017 A. Sailer: Git Tutorial 1/36 ILD Technical Meeting, Apr 24, 2017 A. Sailer: Git Tutorial 1/36 Git Tutorial André Sailer CERN-EP-LCD ILD Technical Meeting April 24, 2017 LD Technical Meeting, Apr 24, 2017 A. Sailer: Git Tutorial 2/36

More information

Programming refresher and intro to C programming

Programming refresher and intro to C programming Applied mechatronics Programming refresher and intro to C programming Sven Gestegård Robertz sven.robertz@cs.lth.se Department of Computer Science, Lund University 2018 Outline 1 C programming intro 2

More information

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands Table Of Contents 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands Getting onto the Zoo Type ssh @node.zoo.cs.yale.edu, and enter your netid pass when prompted.

More information

Git, the magical version control

Git, the magical version control Git, the magical version control Git is an open-source version control system (meaning, it s free!) that allows developers to track changes made on their code files throughout the lifetime of a project.

More information

NPTEL Course Jan K. Gopinath Indian Institute of Science

NPTEL Course Jan K. Gopinath Indian Institute of Science Storage Systems NPTEL Course Jan 2012 (Lecture 18) K. Gopinath Indian Institute of Science Spinlocks & Semaphores Shared data betw different parts of code in kernel most common: access to data structures

More information