Everyone:

Welcome to CSE 30341 Operating System Principles, which (as the syllabus states) is a course that "introduces all aspects of modern operating systems", including topics such as "process structure and synchronization, interprocess communication, memory management, file systems, security, I/O, and distributed systems". What this means is that we will be exploring the key ideas behind operating systems such as Linux, Windows, and macOS and studying the underlying abstractions these systems provide to user applications.

TL;DR

For this week, you need to setup your GitHub repository, read about basic hardware and operating system concepts, and submit your responses to the Reading 01 Quiz.

Course Overview

Last semester, most of you took the CSE 20289 Systems Programming course where you learned about how to use a Unix system and how to program applications in that environment. Throughout the course, you experienced and practiced the Unix Philosophy:

  1. Write programs that do one thing and do it well.

  2. Write programs to work together.

  3. Write programs to handle text streams, because that is a universal interface.

You did this by writing shell scripts, Python applications, and utilities in C. You even wrote a HTTP client that took advantage of multiple processes!

In this class, we will take the next step and explore what data structures, algorithms, and mechanisms are necessary at the operating system level to support such applications. That is, we will discuss how the operating system kernel provides different abstractions that allow us to safely and efficiently execute multiple programs that communicate with each other while accessing different hardware resources. In short, we will uncover the magic that powers the Unix Philosophy.

For this course, we will focus on three main ideas:

  1. Virtualization: How does the operating system represent the underlying hardware resources?

  2. Concurrency: How does the operating system coordinate multiple streams of execution?

  3. Persistence: How does the operating system organize data?

To explore these topics and apply the concepts learned in class, you will implement four programming projects throughout the semester: implement a scheduling process queue, implement a message bus, implement malloc, and implement a filesystem. These projects will require some design work, extensive testing, and utilization of the skills you learned in both CSE 20289 Systems Programming and CSE 20312 Data Structures.

Additionally, you will have weekly reading assignments (the first one is below). These will automatically be graded by the continuous integration system provided by GitHub.

Of course, there will be two exams: a Exam 01 and Exam 02. Each will be taken online and only cover the material since the last exam.

Task 1: Slack

For communication outside of our meeting time, we will be using Slack, specifically the #cse-30341-fa21 channel:

https://nd-cse.slack.com/messages/cse-30341-fa21/

There is a class mailing list, but most day-to-day communication (including office hours and homework help) should take place on Slack.

Be aware of the following:


Task 2: GitHub

All of your work will be submitted to GitHub using git. Your third task is to setup your GitHub repository by doing the following:

  1. Sign-in or create a GitHub account if you do not already have one.

  2. Fork the class assignments repository from the following template:

    https://classroom.github.com/a/hE2GapAV

    This will create a private cse-30341-fa21-assignments-$USERNAME repository under your own account and linked to the nd-cse-30341-fa21 organization.

  3. Once this is done, you can clone your git repository to your local machine (or the student machines):

    $ git clone git@github.com:nd-cse-30341-fa21/cse-30341-fa21-assignments-$USERNAME.git
    

    Note, that GitHub has recently shutdown password authentication.

    To remotely access your repository from the command-line, you have two options:

    1. Setup a Personal Access Token: With this method, GitHub will generate an application specific passsword that you can use with HTTPS. As the PAT is a long string of characters, it is recommended that you use it in conjunction with a password manager or keyring.

    2. Setup SSH Keys: With this method, you generate a local public and private key pair on your computer and then upload the public key to GitHub. When accessing GitHub from the command-line, you will use the private key to authenticate to the server. This is the recommended way to setup your repository as it will allow for passwordless access.

    Setup SSH Keys

    Here is a quick tutorial on how to Setup SSH Keys on the student machines (if you have not already):

    1. Generate SSH keys if you don't have them yet:

      # Accept the defaults, don't make a password if you want to go passwordless
      $ ssh-keygen
      
    2. Copy the contents of ~/.ssh/id_rsa.pub to the SSH Keys section of your GitHub settings page:

      https://github.com/settings/keys

      # Copy and paste the contents of this file into GitHub
      $ cat ~/.ssh/id_rsa.pub
      
    3. Edit/create ~/.ssh/config to use this key with GitHub:

      # Add the following to your config (replace $NETID with your netid)
      $ $EDITOR ~/.ssh/config
      Host github.com
              User git
              Hostname github.com
              PreferredAuthentications publickey
              IdentityFile /escnfs/home/$NETID/.ssh/id_rsa
      

    Once this is done, you should be able to do git operations without a password. You will need to accept the host key the first time by typing in "yes".

    Please update the README.md file to include your name and NetID so it is straightforward to identify your account.

GitHub Repository

You are responsible for ensuring that your GitHub assignments repository is in proper order, which means you have the correct settings and permissions set. Failure to properly configure your repository will adversely impact your grade.

Task 3: Reading

The readings for Tuesday, August 24 are

  1. Operating Systems: Three Easy Pieces

    1. A Dialogue on the Book
    2. Introduction to Operating Systems

  2. A Basic Guide to Linux Boot Process

    Optional: 6 Stages of Linux Boot Process (Startup Sequence), An introduction to the Linux boot and startup processes, and Systemd Boot Process a Close Look in Linux.

Note: Don't worry if you don't get the readings done by Tuesday, as this is the first week of class.

Task 4: Quiz

Once you have done the readings, answer the following Reading 01 Quiz questions:

Program

In addition to a dredd quiz, each reading will also have a short C program associated with each assignment. For this week, you are to modify program.c in reading01 to print out True or False for each of the following statements:

  1. Students cannot drop any readings.
  2. There are six group projects in this course.
  3. There are two in-class exams in this course.
  4. Students are expected to attend class regularly and on-time.
  5. There are no deadlines in this class.
  6. There are both in-person and online office hours available to students.
  7. Students are expected to be respectful of their fellow classmates and the instructional staff.
  8. There is no video capture for this class.
  9. Students may consult online references or copy from resources if properly cited.
  10. Students may consult or copy from solutions found online or from other students.
  11. Students must wear a mask in class.
  12. Students may change where they sit in class whenever they want.

Note: Simply print True or False for each question (each answer on its own line with no trailing space).

To test your program.c, you should be able to use make:

$ make test-program
gcc -Wall -g -std=gnu99 -o program program.c
curl -sLO https://raw.githubusercontent.com/nd-cse-30341-fa21/cse-30341-fa21-assignments/master/reading01/test_program.sh
chmod +x test_program.sh
./test_program.sh
Checking reading01 program ...
   Score 3.00 / 3.00
  Status Success

Submission

To check your quiz answers, you will need create a answers.json or answers.yaml file in the reading01 folder of your assignments repository:

  1. For this class, you must use a separate git branch for each assignment. This means that the work for each reading and challenge must be done in a separate branch. To create and checkout a new branch, you can do the following:

    $ git checkout master         # Make sure we are in master branch
    $ git pull --rebase           # Make sure we are up-to-date with GitHub repository
    
    $ git checkout -b reading01   # Create reading01 branch and check it out
    

    Once you do the above, you should see the following output for the git-branch command:

    $ git branch
      master
    * reading01
    

    The * indicates that we are currently on the reading01 branch.

  2. You can either hand-write the answers file using your favorite text editor or you can use the online form to generate the JSON data.

    A hand-written answers.yaml may look like the following:

    q1: [telemetry]
    q2:
      - scalability
      - processor
      - mouse
      - keyboard
    
    q3:
      - functions
      - call
      - awesome
      - lame
    
    q4: toomanythreads
    
    q5:
      - iOS
      - monitoring
      - iphones
      - NSA
    
    q6: [init, bios, kernel, bootloader, mbr]
    

    The equivalent answers.json generated using the online form may look like the following:

    {
      "q1": "telemetry",
      "q2": [
        "scalability",
        "processor",
        "mouse",
        "keyboard"
      ],
      "q3": [
        "functions",
        "call",
        "awesome",
        "lame"
      ],
      "q4": "toomanythreads",
      "q5": [
        "iOS",
        "monitoring",
        "iphones",
        "NSA"
      ],
      "q6": [
        "init",
        "bios",
        "kernel",
        "bootloader",
        "mbr"
      ]
    }
    

    You may use either format. To determine which symbols correspond to which response, take a look at the Reading 01 Quiz file.

    To check your answers, you can use the provided .scripts/check.py script:

    $ cd reading01                        # Go into reading01 folder
    $ $EDITOR answers.json                # Edit your answers.json file
    
    $ ../.scripts/check.py                # Check reading01
    Checking reading01 quiz ...
          Q1 0.00
          Q2 0.12
          Q3 0.00
          Q4 0.00
          Q5 0.00
          Q6 0.10
       Score 0.23 / 3.00
      Status Failure
    

    This script will check your reading01/answers.json file to dredd, which is the automated grading system. dredd will take your answers and return to you a score as shown above. Each reading is worth 3.0 points.

    Note: You may check your quiz answers as many times as you want; dredd does not keep track of who checks what or how many times. It simply returns a score.

    To test both the quiz and the program.c, you can simply type in make:

    $ make
    Checking reading01 quiz ...
          Q1 0.50
          Q2 0.50
          Q3 0.50
          Q4 0.50
          Q5 0.50
          Q6 0.50
       Score 3.00 / 3.00
      Status Success
    
    Checking reading01 program ...
       Score 3.00
      Status Success
    
  3. Once you have your answers file and your program.c, you need to add and commit each file, and push your commits to GitHub:

    $ git add answers.json                # Add answers.json to staging area
    $ git commit -m "Reading 01: Quiz"    # Commit quiz
    
    $ git add program.c                   # Add program.c to staging area
    $ git commit -m "Reading 01: Program" # Commit program
    
    $ git push -u origin reading01        # Push branch to GitHub
    

    Note: You may edit and commit changes to your branch as many times as you wish. Just make sure all of your work goes in the appropriate branch and then perform a git push when you are done.

  4. When you are ready for your final submission, you need to create a pull request via the GitHub interface:

    • First, go to your repository's Branches page and then press the New pull request button for the appropriate branch:

    • Next, edit the pull request title to "Reading 01", write a comment if necessary and then press the "Create pull request" button.

    • Finally, assign the pull request to the teaching assistant assigned to you for the given week and make sure all the checks have passed.

    • Every commit on GitHub will automatically submit your quiz or code to dredd and the results of each run is displayed in the Checks tab of each commit as shown below:

Graders

Please refer to the Reading 01 TA List to determine who your grader is for this week.

Once you have made the pull request, the instructor or teaching assistant can verify your work and provide feedback via the discussion form inside the pull request. If necessary, you can update your submission by simply committing and pushing to the appropriate branch; the pull request will automatically be updated to match your latest work.

When all work is graded, the grader will merge your branch and close the pull request.

Note: Please do not merge your own pull request. This makes it more difficult for the graders to keep track of what needs to be graded.