1. Homepage
  2. Programming
  3. CS-537: Introduction to Operating Systems - Project 2a: Shell

CS-537: Introduction to Operating Systems - Project 2a: Shell

Engage in a Conversation
USUniversity of Wisconsin MadisonCS 537CS537Introduction to Operating SystemsShell

Project 2a: Shell (Linux) CourseNana.COM

Important Dates and Other Stuff CourseNana.COM

This project is to be done by yourself. Tests: Tests will be made available shortly. CourseNana.COM

Questions? CourseNana.COM

Send questions using piazza or use office hours. If the question is about your code, copy all of of your code into your handin directory (details below) and include your login in your email (you are free to modify the contents of your handin directory prior to the due date). Do not put code snippets into piazza (unless they are very short). Also include all other relevant information, such as cutting and pasting what you typed and the results from the screen. In general, the more information you give, the more we can help. CourseNana.COM

Overview CourseNana.COM

The basic project description is found here. Please read this carefully in order to understand exactly what to do. CourseNana.COM

This project is to be done on the lab machines (listed here ), so you can learn more about programming in C on a typical UNIX-based platform (Linux). CourseNana.COM

Differences CourseNana.COM

There are some modifications to that basic description above. They are:
There is no need to do parallel commands. However, you can if you like; it's not too bad, really.
CourseNana.COM

There is a special built-in command called if you need to add, which we describe below. The if-statement CourseNana.COM

The if statement can be used like in the snipped below. CourseNana.COM

prompt> if some_command == 0 then some_other_command fi
In this example the wish shell should compare the return code of some_command to the number provided (0) CourseNana.COM

and run some_other_command, if they are equal.
If statements should always follow the following form and be specified in a single line:
if COMMAND OPERATOR CourseNana.COM

CONSTANT then COMMAND fi CourseNana.COM

Example: CourseNana.COM

Imagine you have a very basic binary named one that always returns 1, e.g. CourseNana.COM

int main() { CourseNana.COM

return 1; } CourseNana.COM

and then some binary named hello that prints to stdout, e.g., CourseNana.COM

#include "stdio.h" CourseNana.COM

int main() {
printf!("Hello World!");
CourseNana.COM

return 0; } CourseNana.COM

Now the following command should run hello print "Hello World!" on the screen: promt> if one == 1 then hello fi
However, the following line should not run hello and not print anything to the screen: promt> if one != 1 then hello fi CourseNana.COM

More details: CourseNana.COM

The left side of the operator is always a command and the right side is a constant. You can also implement support for comparing commands to commands or constants to constants, but that is not required.
The if statement should allow equal (
==) and not-equal (!=) operators. You can implement others, e.g. less-than or greater-than, but this is not required for the project. CourseNana.COM

Return codes are integers, so you do not need to support string or floating point comparisons. Again, you can add that if it brings you joy, but we will not test for it.
You only need to support ASCII characters. It is fine if you shell crashes on some obscure unicode character.
CourseNana.COM

The shell should never crash (except for the case of non-ASCII characters being passed to it). When an invalid command is given or the if statement is used incorrectly, the shell should terminate properly and return a non-zero error code. CourseNana.COM

Notes
Before beginning: If you don't remember much about the Unix/C environment, read this tutorial. It has CourseNana.COM

some useful tips for programming. CourseNana.COM

This project should be done alone. Copying code (from others) is considered cheating. Read this for more info on what is OK and what is not. Please help us all have a good semester by not doing this. CourseNana.COM

Handing It In CourseNana.COM

You should turn in one file, wish.c , which we will compile and test. CourseNana.COM

The handin directory is ~cs537-$sec/handin/$login/p2a where $sec is your section and $login is your login. For example, Remzi's login is remzi and he is section 1, and thus he would copy his beautiful code into ~cs537-1/handin/remzi/p2a. Copying of these files is accomplished with the cp program, as follows: CourseNana.COM

prompt> cp wish.c ~cs537-1/handin/remzi/p2a/
When done, type ls ~cs537-1/handin/remzi/p2a to see that all the files are in place correctly. CourseNana.COM

Finally, in your p2a directory, please include a README file. In there, describe what you did a little bit. There is no particular requirement for the length of the README; just get in the habit of writing a little bit about what you did, so that another human could understand it. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
US代写,University of Wisconsin代写, Madison代写,CS 537代写,CS537代写,Introduction to Operating Systems代写,Shell代写,US代编,University of Wisconsin代编, Madison代编,CS 537代编,CS537代编,Introduction to Operating Systems代编,Shell代编,US代考,University of Wisconsin代考, Madison代考,CS 537代考,CS537代考,Introduction to Operating Systems代考,Shell代考,UShelp,University of Wisconsinhelp, Madisonhelp,CS 537help,CS537help,Introduction to Operating Systemshelp,Shellhelp,US作业代写,University of Wisconsin作业代写, Madison作业代写,CS 537作业代写,CS537作业代写,Introduction to Operating Systems作业代写,Shell作业代写,US编程代写,University of Wisconsin编程代写, Madison编程代写,CS 537编程代写,CS537编程代写,Introduction to Operating Systems编程代写,Shell编程代写,USprogramming help,University of Wisconsinprogramming help, Madisonprogramming help,CS 537programming help,CS537programming help,Introduction to Operating Systemsprogramming help,Shellprogramming help,USassignment help,University of Wisconsinassignment help, Madisonassignment help,CS 537assignment help,CS537assignment help,Introduction to Operating Systemsassignment help,Shellassignment help,USsolution,University of Wisconsinsolution, Madisonsolution,CS 537solution,CS537solution,Introduction to Operating Systemssolution,Shellsolution,