CMPSC 311- Introduction to Systems Programming Module: Assignment #3 TAGLINE Device Driver (v1.1)

Similar documents
CMPSC 311- Introduction to Systems Programming Module: Assignment #2 Cartridge HRAM Filesystem

CMPSC 311- Introduction to Systems Programming Module: Caching

CS 261 Fall Mike Lam, Professor Integer Encodings

CS-537: Midterm Exam (Spring 2009) The Future of Processors, Operating Systems, and You

bytes per disk block (a block is usually called sector in the disk drive literature), sectors in each track, read/write heads, and cylinders (tracks).

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

CMPSC 311- Introduction to Systems Programming Module: Debugging

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Quiz I

CMPSC 311- Introduction to Systems Programming Module: Caching

CMPSC 311- Introduction to Systems Programming Module: Debugging

I/O Management Intro. Chapter 5

Computer 2 App1. App3 API Library. App3. API Library. Local Clipboard

registers data 1 registers MEMORY ADDRESS on-chip cache off-chip cache main memory: real address space part of virtual addr. sp.

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

Omni Flow Computer Master Driver v1.x Omni Flow Computer Master Modicon Compatible Driver 1.x

2017/12/20 20:31 1/6 Lab 1 - Producer/Consumer in XINU

Name: Instructions. Problem 1 : Short answer. [63 points] CMU Storage Systems 12 Oct 2006 Fall 2006 Exam 1

Crash Consistency: FSCK and Journaling. Dongkun Shin, SKKU

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Image rescue Quick Start Guide

CSE 380 Computer Operating Systems

Laplink DiskImage : Server Edition

CSE380 - Operating Systems

Memory Management: The process by which memory is shared, allocated, and released. Not applicable to cache memory.

Lecture 8 Dynamic Memory Allocation

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

Offline Array Recovery Procedures SuperTrak SX6000 and UltraTrak

COMS Spring Homework 3

Chapter 9. Recovery. Database Systems p. 368/557

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Quiz I

Lab4 - Managing Database Storage Structures Using Enterprise Manager Database Express

Storage and File Structure

Announcements. Persistence: Crash Consistency

DtS Data Migration to the MSA1000

RAID SEMINAR REPORT /09/2004 Asha.P.M NO: 612 S7 ECE

EVE WORKSHOP A practical introduction to the Extensible VAX Editor (2nd Edition)

This is a combination of a programming assignment and ungraded exercises

Exercises for Introduction to Programming in C

PAS. Installation Guide. BG0608 Rev. A1. Copyright SATEC Ltd.

Robotics and Electronics Unit 5

Announcements. Persistence: Log-Structured FS (LFS)

LPI Linux-Linux Networking Administration. Download Full Version :

Using NCSL DAQ Software to Readout a LeCroy 4300B. Timothy Hoagland

Log Manager. Introduction

CS242 COMPUTER PROGRAMMING

IBM. Systems management Disk management. IBM i 7.1

Initial Bootloader > Flash Drive. Warning. If not used carefully this process can be dangerous

CSC443 Winter 2018 Assignment 1. Part I: Disk access characteristics

Linux Filesystems Ext2, Ext3. Nafisa Kazi

Distributed Systems. How do regular procedure calls work in programming languages? Problems with sockets RPC. Regular procedure calls

Introduction to Backup Wolf :

CMSC 201 Fall 2016 Homework 6 Functions

These copies should be placed on different disks, if possible. Disk 1 Disk 2 Disk 3

ECE264 Fall 2013 Exam 3, November 20, 2013

How to Restore a Windows System to Bare Metal

Outline. Review of Last Week II. Review of Last Week. Computer Memory. Review Variables and Memory. February 7, Data Types

ASSIGNMENT 5 Data Structures, Files, Exceptions, and To-Do Lists

OpenAMP Discussion - Linaro2018HK. Copyright 2018 Xilinx

File Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Lab 2: More Advanced C

Homework #2 Think in C, Write in Assembly

Database Systems. November 2, 2011 Lecture #7. topobo (mit)

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #34. Function with pointer Argument

Overview of Project V Buffer Manager. Steps of Phase II

CMPSC 311- Introduction to Systems Programming Module: Input/Output

CMPSC 311 Exam 2. March 27, 2015

RAID. Redundant Array of Inexpensive Disks. Industry tends to use Independent Disks

Server Systems and Motherboards

Outlines. Chapter 2 Storage Structure. Structure of a DBMS (with some simplification) Structure of a DBMS (with some simplification)

ME 172. Lecture 2. Data Types and Modifier 3/7/2011. variables scanf() printf() Basic data types are. Modifiers. char int float double

Buffer overflow prevention, and other attacks

CS 103 The Social Network

The Broadband Ham Net community has had a need for a stand alone time server for their meshes. This document will attempt to fill in this need.

CMPSC 311- Introduction to Systems Programming Module: Concurrency

CS 315 Data Structures Fall Figure 1

[537] Journaling. Tyler Harter

Using NCSL DAQ Software to Readout a CAEN V792 QDC. Timothy Hoagland

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

Project 1 Notes and Demo

Quiz I Solutions MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Department of Electrical Engineering and Computer Science

Using NCSL DAQ Software to Readout a CAEN V775 TDC. Timothy Hoagland

End-to-end Data Integrity for File Systems: A ZFS Case Study

This project must be done in groups of 2 3 people. Your group must partner with one other group (or two if we have add odd number of groups).

Agenda. Components of a Computer. Computer Memory Type Name Addr Value. Pointer Type. Pointers. CS 61C: Great Ideas in Computer Architecture

Partitioning a disk prior to Linux Installation

CMPSC 311- Introduction to Systems Programming Module: Build Processing

CSE 444 Homework 1 Relational Algebra, Heap Files, and Buffer Manager. Name: Question Points Score Total: 50

CS 61C: Great Ideas in Computer Architecture. Lecture 3: Pointers. Krste Asanović & Randy Katz

The UtePC/Yalnix Memory System

2 Installing the Software

Buffer Manager: Project 1 Assignment

Chapter 11: File System Implementation. Objectives

Getting Started With UNIX Lab Exercises

IBM i Version 7.3. Systems management Disk management IBM

Computer Engineering II Solution to Exercise Sheet 9

Study Guide for Test 2

TPMC901-SW-95. QNX4 - Neutrino Device Driver. User Manual. The Embedded I/O Company. 6/4/2 Channel Extended CAN-Bus PMC

Network File System (NFS)

Distributed Systems 8. Remote Procedure Calls

Transcription:

CMPSC 311- Introduction to Systems Programming Module: Assignment #3 TAGLINE Device Driver (v1.1) Professor Patrick McDaniel Fall 2015

Homework #3 This is extension of the previous where you add more code to the existing functions and process much more complex workloads. Initial extensions There are now up to maxlines number of taglines You will see multiple reads and writes per call int tagline_read(taglinenumber tag, TagLineBlockNumber bnum, uint8_t blks, char *buf); // Read a number of blocks from the tagline driver int tagline_write(taglinenumber tag, TagLineBlockNumber bnum, uint8_t blks, char *buf); // Write a number of blocks from the tagline driver

Homework #3 Each block will be stored twice A primary block which will be used for reads A backup block used for recovery disk 0 disk 1 disk 2 disk 3 Note: You must make sure that the blocks are on different disks!

Homework #3 Periodically a disk will fail, which causes the disk to be in a failed state. You will write code for: int raid_disk_signal(void); // A disk has failed which needs to be recovered Recovery: This will use the new raid command STATUS to figure out which disk failed. Format the failed disk (FORMAT bus command) Use copies of the lost blocks on other disks to reconstruct all of the lost data.

Recovery Use copies of the lost blocks on other disks to reconstruct all of the lost data. disk 0 disk 1 disk 2 disk 3

CMPSC 311- Introduction to Systems Programming Module: Assignment #2 TAGLINE Device Driver Professor Patrick McDaniel Fall 2015

Homework #2 Idea you are to maintain the correct file contents in an object stored on the TAGLINE device operating on top of a disk array. 3 things to know How the tagline works How file fixed sized block I/O works How to make the object stuff look like files

The Tagline Device Driver TAGLINE Application TAGLINE Operations TAGLINE Device Driver RAID Array Operations RAID Array Firmware DISK 1 DISK 2 DISK N

Assignment Basics You are to write the file operation functions defined in the tagline_driver.c Translate then tagline operations into RAID bus operations Maintain, in the storage device, the tagline contents You must insert data, read data, and maintain file information For this assignment: All blocks are exactly TAGLINE_BLOCK_SIZE size No tagline will be larger than MAX_TAGLINE_BLOCK_NUMBER The RAID array will contain RAID_DISKS with RAID_DISKBLOCKS blocks each A simulation of the tagline abstraction is provided for you that will exercise all of your code.

The tagline abstraction A tagline is storage abstraction somewhat similar to a basic data file, with several key differences. The basic idea is that the application will create, read, and write to a tagline in fixed sized blocks. (See tagline_driver.h) The "name" of a tagline is a 16-bit unsigned integer called the tag. This is assigned by the application and managed by your device driver. The tagline consists of a zero-indexed set of blocks that are read from and written to. Taglines initially have zero blocks. taglines are monotonically increasing, meaning that they are never deleted and they never shrink. Blocks can be overwritten however.

Tagline illustrated WRITE(tag=1, blks=2, start=0) tagline #1 0 1 WRITE(tag=1, blks=4, start=1) tagline #1 0 1 2 3 4 READ(tag=1, blks=3, start=2) tagline #1 0 1 2 3 4 WRITE(tag=1, blks=2, start=2) tagline #1 0 1 2 3 4

Tagline calls (to your code) You are to implement the following functions: int tagline_driver_init(uint32_t maxlines); int tagline_read(taglinenumber tag, TagLineBlockNumber bnum, uint8_t blks, char *buf); int tagline_write(taglinenumber tag, TagLineBlockNumber bnum, uint8_t blks, char *buf); int tagline_close(void); Key to assignment: how do you convert each of these functions into the corresponding object calls and buffer manipulation?

RAID Array You are to build a software layer that implements the tagline interface on top of the raid array system. The raid array is a collection of disks each with a set of fixed sized blocks that are written and read. Notes: Each block is of size RAID_BLOCK_SIZE For this assignment, you can assume that there are RAID_DISKS disks, each with RAID_DISKBLOCKS blocks The blocks are indexed 0 to RAID_DISKBLOCK-1 RAID Array Firmware DISK 1 DISK 2 DISK N

Using the RAID Array The array is driven by bus commands sent through: RAIDOpCode raid_bus_request(raidopcode request, void *buf); where the request and response are send in RAIDOpCode representing the data of the request: 64-bit integer 0 8 16 24 32 40 48 56 Bits Description ----- ------------------------------------------- 0-7 request type 8-15 number of blocks 16-23 disk number 24-30 unused (for now, always set to zero) 31 - status this is the result bit (0 success) 32-63 block ID

RAID Commands RAID_INIT - Initialize the RAID interface RAID_FORMAT - Format a disk in the array. This will zero the disk contents. RAID_READ - Read consecutive blocks in the disk array RAID_WRITE - Write consecutive blocks to the disk array RAID_CLOSE closes the array

What now? The real trick to all of this is that you have to: Initialize the disk array by calling the init & format functions On writes for new blocks, find a location on the disk to put it Then call the RAID commands to get it to store the data On writes for old blocks, figure out where you put it Then call the RAID commands to get it to overwrite the data On reads, return the previously stored data in those blocks Close the array when you are done Note, you are done when you see: [INFO] Tagline simulation completed successfully.

Simplifications Device driver will only receive requests for a single tagline (you only have to worry about one tagline) Any other tagline number other than the first you can return an error A tagline reads and writes will be for a single block You can return an error when any request asks for more or less than a single block

Getting started Get the file from the web: wget http://www.cse.psu.edu/~mcdaniel/cmpsc311-f15/docs/assign2-starter.tgz Change into your development directory and unpack the file: % cd ~/cmpsc311 % cp assign2-starter.tgz cmpsc311 % cd cmpsc311 % tar xvfz assign2-starter.tgz % cd assign2 % make Note: you may have to install libgcrypt-dev and libcurl4-gnutls-dev via apt-get.

Hints Use the logmessage interface to log information about how your program is running. Carefully read and understand the error messages that are being written to the log. Review the unit test function to see how the interfaces in the program should operate.

First functions The first functions you should write should create a request structure and extract a request structure: RAIDOpCode create_raid_request(?) {??? }??? extract_raid_response(raidopcode resp, ) {??? } Hint: use the bit operations to build up structure.