Principles of Operating Systems

CMSC 421-04 - Spring 2016


Homework 1

Chapters 1-4

50 points total

Due by 11:59PM EST on Sunday, February 28, 2016

Part I

25 points

Please provide written responses to the following questions. Each response should be at least 5-7 sentences in length. Each question is worth 5 points.

  1. Compare and contrast microkernel and monolithic kernel-based operating systems. Name one operating system that follows each of these models.
  2. What is the purpose of a system call? Give at least 3 examples of potential system calls in an OS and explain why each would be a system call.
  3. Describe what a context switch is. How does context switching differ between processes and between threads within a single process?
  4. Compare and contrast the use of shared memory and message passing for IPC in a user program. Be sure to include a discussion of what system calls may be involved in each.
  5. Describe a situation where a multithreaded program may see an increase in performance over a single-threaded program when running on a single-processor, single-core machine.

You must submit a PDF file of the answers to these questions on the Homework 1 assignment on Blackboard. You may prepare your responses in any word processing application of your choosing, but you must submit a PDF file. Do not submit Microsoft Word/Apple Pages/LibreOffice/OpenOffice.org documents with your responses. You must convert to a PDF file before submitting or you will lose points.

Part II

25 points

Complete the following programming assigment and submit your code using the GitHub repository that you will have created for this assignment. This assignment must be completed in the C programming language (you can choose to use C89/C90/ANSI-C, C99, or C11 as you see fit).

Throughout this semester, you will be building a shell for a Linux system as part of your homework assignments. While this shell will start out extremely basic in this assignment, you will be extending your shell program throughout the semester to give it more interesting capabilities. Please write the code this in mind as you proceed (extensibility is key).

For the first iteration of your shell program, you will only need to support a few very basic features of a full-fledged *nix shell. Specifically, you will need to have support for all of the following:

You are not expected to support any of the following features, however these may or may not be added in a future homework assignment.

The instructor will demonstrate the exact functionality expected to be implemented in your shell in-class on Thursday, February 18th.

Your shell program is not allowed to use any external libraries other than the system's C library. Do not try to use libraries like Readline. You will lose points for using external libraries to implement shell functionality!

When submitting your shell program, please be sure to include the source code of the shell program (in one or more C source code files), as well as a Makefile that can be used to build the shell. Your shell must be able to be built and run on a VM as has been set up for this course in your projects.

If you would like a template for use as a Makefile for your shell, I have provided one here.

To submit your project, you must first accept the assignment on GitHub. The link to do so is posted on the course Piazza page. Once you have done that, make sure that your project files (any source files and your Makefile) are in their own directory, then run the following commands in that directory (substituting the list of files you need to commit for your_files_go_here and your GitHub username for username, of course):

git init
git add your_files_go_here
git commit
git remote add origin git@github.com:UMBC-CMSC421-SP2016/shell-username.git
git push -u origin master

git tag hw1
git push origin --tags

Last modified Tuesday, 01-Sep-2020 18:43:36 EDT