100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

McGill University COMP 310 – ECSE 427 Operating Systems: Assignment #1: Building an OS Shell_ Answered | Updated Fall 2024/2025.

Rating
-
Sold
-
Pages
7
Uploaded on
15-10-2025
Written in
2025/2026

McGill University COMP 310 – ECSE 427 Operating Systems: Assignment #1: Building an OS Shell_ Answered | Updated Fall 2024/2025.

Institution
Course









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

Uploaded on
October 15, 2025
Number of pages
7
Written in
2025/2026
Type
Other
Person
Unknown

Subjects

Content preview

Operating Systems COMP 310 – ECSE 427 McGill University


Assignment #1: Building an OS Shell
Due: October 3, 2024 at 23:59



1. Infrastructure Description
Welcome to the first OS assignment where we will build an OS Shell!
This is the first of a series of three assignments that build upon each other. By the end of the semester,
you will have a running simulation of a simple Operating System and you will get a good idea of how the
basic OS modules work.
You will use the C programming language in your implementation, since most of the practical operating
systems kernels are written in the C/C++ (e.g., including Windows, Linux, MacOS, and many others).
The assignment is presented from a Linux point of view using a server like Mimi. Our grading infrastructure
will pull your code from GitLab automatically and will run the unit tests for this assignment every day on
the Mimi server. The autograder may not run for the first few days as we take all the administrative steps
to set it up.

Starting shortly after the team registration deadline, you will receive a daily report stating whether your
code passes the unit tests. Please make sure your assignment runs on our server, as this is the reference
machine we use for grading. To get your code picked up by our grading infrastructure we will rely on
GitLab. It is mandatory to use GitLab for this coursework. For more information about GitLab and the
grading infrastructure, please refer to the tutorial posted on MyCourses as part of Lab 1.

For local development, and quicker testing turn-around, you can use the SOCS server
mimi.cs.mcgill.ca, which you can reach remotely using ssh or putty. You need a SOCS account
to access the mimi servers, and you need to either be on campus or connected to the McGill VPN. If you
do not have a SOCS account (e.g., you might not have one if you are an ECSE student) please follow the
instructions here to obtain one.

To get started, fork the following repository, which contains the starter code and the testcases for this
assignment.

https://gitlab.cs.mcgill.ca/mkopin/comp310-ecse427-coursework-f24

IMPORTANT: If you have already forked your repository before the release date of the assignment,
please make sure that your version of the starter code is up-to-date (i.e., sync your fork with the upstream
repository mkopin/comp310-ecse427-coursework-f24) before starting to work on the code.



1.1 Starter files description:
We provided you with a simple shell to start with, which you will enhance in this assignment. Take a
moment to get familiar with the code.


Kopinsky Assignment #1
This study source was downloaded by 100000901736981 from CourseHero.com on 10-15-2025 13:21:24 GMT -05:00
Page 1 of 7

https://www.coursehero.com/file/251973264/Assignment-1-Fall2024-1pdf/

, Operating Systems COMP 310 – ECSE 427 McGill University


Compiling your starter shell
• Use the following command to compile: make mysh
• Re-compiling your shell after making modifications: make clean; make mysh
• Note: The starter code compiles and runs on Mimi and on our server. If you’d like to run the code
in your own Linux virtual machine, you may need to install build essentials to be able to compile C code:
sudo apt-get install build-essential

Your code should be able to compile in any environment with a C compiler so long as you do not
hardcode assumptions about the machine into your code. For example, write `sizeof(int)` rather than
assuming that this value is 4.


Running your starter shell
• Interactive mode: From the command line prompt type: ./mysh
• Batch mode: You can also use input files to run your shell. To use an input file, from the
command line prompt type: ./mysh < testfile.txt

Starter shell interface. The starter shell supports the following commands:

COMMAND DESCRIPTION

help Displays all the commands
quit Exits / terminates the shell with “Bye!”
set VAR STRING Assigns a value to shell memory
print VAR Displays the STRING assigned to VAR
run SCRIPT.TXT Executes the file SCRIPT.TXT


More details on command behavior:

• The commands are case sensitive.
• If the user inputs an unsupported command the shell displays “Unknown command”.
• set VAR STRING first checks to see if VAR already exists. If it does exist, STRING overwrites the
previous value assigned to VAR. If VAR does not exist, then a new entry is added to the shell memory
where the variable name is VAR and the contents of the variable is STRING. For now, each value
assigned to a variable is a single alphanumeric token (i.e., no special characters, no spaces, etc.). For
example:
▪ set x 10 creates a new variable x and assigns to it the string 10.
▪ set name Bob creates a new variable called name with string value Bob.
▪ set x Mary, replaced the value 10 with Mary.

• print VAR first checks to see if VAR exists. If it does not exist, then it displays the error “Variable
does not exist”. If VAR does exist, then it displays the STRING. For example: print x from the above
example will display Mary.

• run SCRIPT.TXT assumes that a text file exists with the provided file name, in the current
directory. It opens that text file and then sends each line one at a time to the interpreter. The


Kopinsky Assignment #1
This study source was downloaded by 100000901736981 from CourseHero.com on 10-15-2025 13:21:24 GMT -05:00
Page 2 of 7

https://www.coursehero.com/file/251973264/Assignment-1-Fall2024-1pdf/
$11.33
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
elam17799
4.0
(1)

Get to know the seller

Seller avatar
elam17799 Brighton College
Follow You need to be logged in order to follow users or courses
Sold
7
Member since
1 year
Number of followers
0
Documents
123
Last sold
1 week ago
Explore thousands of course and professor reviews

Explore thousands of course and professor reviews from Canada Universities and Colleges students. Feel free to inbox me for any paper you wish to have.

4.0

1 reviews

5
0
4
1
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions