All remaining assignments for this class are based on the creation and extension of a user-space
device driver for a remotely connected cloud device (called a Lion Cloud device). The vast majority
of code you will write and debug will be to provide a filesystem interface on top of the virtual
device (which is provided). At the highest level, you will translate file system commands into device
operations (see IC device interface specification below). The file system commands include open,
read, write , seek, dose and shutdown for files that are written to your file system driver. These
operations perform the same function with essentially the same arguments as the normal UNIX
I/O operations, with the caveat that they direct file contents to the LC storage device instead of the
local host/OS filesystem.
Note: This assignment description provides an overview of the assignment. The associated slides
(and in class presentation) provide more information, hints, and guidance for the project. Please
refer to those materials as well in completing this assignment.
You are to write a basic device driver that will sit between a virtual application and virtualized
hardware devices. The application makes use of the abstraction you will provide called the
LionCloud driver. The design of the system is shown in the figure here:
The LionCloud device is a software simulation of a storage device. It has a basic protocol by which
you communicate with it through a series of registers and data transfer region. You will
communicate with this device and place and get data in form of blocks. You will provide all the code
to talk to these devices and implement a simple flat filesystem (no directories).
Described in detail below, we can see three layers. The icloud_sim application is provided to you
and will call your device driver functions with the basic UNIX file operations (open, read, ...). You
are to write the device driver code to implement the file OS operations. Your code will
communicate with a virtual devices by setting registers and passing data through a virtual bus that
connects to one more more virtual cloud devices.
All of the code for application (called the simulator) and the virtual LionCloud devices is given to
you. Numerous utility functions are also provided to help debug and test your program, as well as
create readable output. A sample workload has been generated and will be used to extensively test
the program. Students that make use of all of these tools (which take a bit of time up front to figure
out) will find that the later assignments will become much easier to complete.
You are to write the driver that will implement the the basic UNIX file interface using the memory
system. You will write code to implement the filesystem, and make several design decisions that
will determine the structure and performance of the driver. In essence you will write code for the
read, write, open, close and other high level filesystem functions. Each function will translate the
call into low-level operations on the device (see below).
. LcFHandle Lcoperi( const char ‘path ); - This function will open a file (named path, e.g.,) in the
filesystem. If the file does not exist, it should be created and set to zero length. If it does exist, it
should be opened and its read/write postion should be set to the first byte (position O). Note
that there are no subdirectories in the fllesystem, just files (so you can treat the path as a
unique filename). The function should return a unique file handle used for subsequent
operations or -1 if a failure occurs.
. mt tcctose( LcFHondte fh ); - This function closes the file referenced by the file handle that
was previously open. The function should fail (and return -1) if the file handle is bad or the file
was not previously open.
•nt lcread( LcFHandle fh, char ‘buf, size_t len ); -Thisfunction should read count bytes
from the file referenced by the file handle at the current position. Note that if there are not
enough bytes left in the file, the function should read to the end of the file and return the
number of bytes read. If there are enough bytes to fulfill the read, the function should return
count . The function should fail (and return -1) if the file handle is bad or the file was not
previously open.
. tnt lcwrite( LcFHondte fh, char buf, size_t ten ); -Thefunctionshouldwrite count bytes
into the file referenced by the file handle. If the write goes beyond the end of the file the size
should be increased. The function should always return the number of bytes written, e.g.,
count . The function should fail (and return -1) if the file handle is bad or the file was not
previously open.
tnt lcseek( I.cFHandte fh, size_t off ); - The function should set the current position into
the file to toc , where O ¡s the first byte ¡n the file ( toc is an absolute position from the front of
the file). The function should fail (and return-i) if the bc is beyond the end of the file, the file
handle is bad or the file was not previously open.
tnt lcshutdown( void ); - The function should shut down the system, including powering off
the devices and closing all files.
You will implement your driver on top of the Lion Cloud device cluster, which is a collection of
virtual storage devices that communicate over a kind of virtual bus/network connection. You
will begin by powering on the bus, probing to find out how many devices are available (there
are a maximum of 16), then allocating space on the devices as the application creates and
writes file data to the devices. Each device is uniquely identified by is device Id (whose type is
LcDeviceld) which is discovered during the probe process. Each device has a two-level
addressing scheme, where it has a number of sectors (s) containing blocks (b); therefore each
device has sb total blocks. A block is a region of memory of IC_DEVICE_BLOCK_SIZE bytes, as
declared in the (see tcloud_controtter.h header file.
4-bits 8-bits 8-bits 8-bits 16-bits 16-bits
GOBi CO Ci C2 DO Dl
. You communicate with the devices system by sending requests and receiving responses
through a set of packed registers. These registers are set within a 64-bit value to encode the
opcode and arguments to the hardware device.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of