Operating System logos: Apple OS, Linux, Windows, ios, Android, BSD Unix. Legal fair use: http://smallbusiness.chron.com/fair-use-logos-2152.html Ort Braude College Logo

OPERATING SYSTEMS 31261
COURSE HOME PAGE

ORT BRAUDE COLLEGE OF ENGINEERING
Electronic and Electrical Engineering Department

Site owner: Samy Zafrany

Operating Systems

line separator

COURSE PROGRAM

line separator

LECTURE NOTES

Course lecture notes are based on the book slides, but contain some modifications and adaptations to our special course program. The course slides are prepared during this semester and are subject to more changes and modifications, so it is not advised to print them at this early stage.

line separator

COURSE PROJECTS


Project 1: Python Programming

You will be redirected to the Python web site.
Goto Python Course home page for materials on the Python programming language.

Project 2: Python Programming

You will be redirected to the Python web site. The project is NOT to be submitted. It is for you to gain experience and expertise with the Python programming language, so please try first to solve it (use the hints), before reading the solutions below.
Goto Python Course home page for materials on the Python programming language.

Project 3: File System

Solutions

It is the student responsibility to do anything he can to solve these problems before reading the solutions. Just by reading and understanding the solutions is not enough for gaining programming expertise!

Project 4: Linux Operating System Starter


Unix: Some say the learning curve is steep, but you only have to climb it once.
-- Karl Lehenbauer

Project 5: Linux System Programming

Final Course Project: Windows Process Monitor

line separator

EXAMS

line separator

TUTORIALS

  1. Unix Tutorial 1 (www.Tutorialspoint.com)
  2. Unix Tutorial 2
  3. Unix Tutorial 3 (Idaho State University)
    PDF Version
  4. Unix Tutorial 4 (Surrey University, UK)
  5. Bash Guide for Beginners
  6. Advanced Bash-Scripting Guide
  7. Steve's Bourne / Bash shell scripting tutorial
  8. BASH Reference Manual
  9. The Little Book of Semaphores, Allen B. Downey
  10. Operating System Course Notes by Dr. John T. Bell,
    Department of Computer Science, University of Illinois, Chicago
  11. The Art of Unix Programming by: Eric Steven Raymond
  12. The ever useful and neat subprocess module

line separator

VIDEO TUTORIALS

  1. Computer Science 162 - Lecture 1: Operating Systems and System Programming
  2. Principles of Operating System - Barbara Hecker
  3. The Little Book of Semaphores Lecture by Allen B. Downey - Book and Video
  4. Unix System Calls
  5. Introduction to Multiprocessing in Python - Python Conference 2009
  6. Linux CBT Nuggets
  7. MIT 6.01SC Introduction to Electrical Engineering and Computer Science
  8. 6 Lessons From Dropbox - One Million Files Saved Every 15 Minutes
  9. How Dropbox Did It and How Python Helped at PyCon 2011

line separator

PROGRAMMING LANGUAGES

In todays market a programmer is expected to master and use five or six languages simultaneously! Almost all work environments are operating on multiple programming languages paradigms. We will be using a mix of programming languages: C/C++, Python, and a little BASH
  1. C/C++ Programming Languages: Daniel Geva Web Site
    This is the official 31616 course web site of the C/C++ programming languages (owned by Daniel Geva). We will be writing a few operating system programs in C, so if you haven't written C code lately, please visit this course and refresh your C skills soon.
  2. Python Programming Language, sofware installation
    Every modern operating system contains a shell programming layer which is essential for writing system programs and system administration. In recent years, the general purpose Python programming language, has also proved to be an excellent choice for Unix and Windows system programming. We will therefore use Python for many of our system programming projects. Please install the needed Python software from this Python software link. This link also contains tutorials, books, and other links to useful and interesting materials. In the first two weeks of the course we will have a quick review of the Python language and solve two or three problem sets in Python.
  3. BASH - Bourne Again Shell
    This is the traditional standard Linux Scripting language for performing system tasks. Although we encourgae the usage of Python for system programming, many big and small companies are still maintaining huge BASH code bases, and most likely students that go to work for these companies will sooner or later will have to deal with this kind of scripting languages. We will try to cover a basic introduction to this language and may write a couple of simple scripts in this language.

LINUX OPERATING SYSTEM

Following is a list of options to access and work on a Linux operating system. Please read and choose one (or more) of the methods that fit you best.

Working with the college Linux server: brdlinux.braude.ac.il

The simplest method for practicing and doing your Unix homework projects is to use the Braude College Linux server: brdlinux.braude.ac.il.
  1. Every student has a Unix account in this server with login name 'uxxxxx', which is the letter 'u' + the last 5 letters of ID number.
  2. The initial password will be sent to the student email address
  3. After your first login, you may change your initial password with the Unix 'passwd' command.
  4. If you do not have a Linux account or having problems with your account, send email to: samyz.ort.braude@gmail.com with subject: Linux acount, and send me your full name (English) and ID number. I will try to fix the problem as soon as possible.
  5. Connection to your Linux account from any Windows computer is done with the Putty.exe program.
  6. After copying a Python file from Windows to Linux, in most cases you will need to convert it from Windows format to Unix format and make it executable. For this you will need to run the following two commands:
        # Change to the directory of the file:
        u12345@brdlinux:~> cd /home/u12345/bin
        u12345@brdlinux:~/bin> dos2unix file.py
        u12345@brdlinux:~/bin> chmod +x file.py
        # Make sure the first line of your program is:  #!/usr/bin/python
        # now you can run file.py like any Linux program !
        u12345@brdlinux:~> file.py arg1 arg2 arg3 ...
    
  7. Note that with this method we do not have any access to graphical programs (like fancy editors and development environments) and we will be limited to command line mode only. But this is OK as one of the course goals is to teach the power of the command line interface and also how to survive without graphical user interfaces.
  8. If your account is locked or does not exist, please notify me at samyz.ort.braude@gmail.com
  9. However, if you want to get a direct contact with the full power of the Linux operating system, then it is highly recommended that you install a full Linux system on top of your Windows PC as explained in the next option:

Linux Operating System on VirtualBox for your Windows Laptop or Home PC

It is possible to install a virtual Linux operating system on top of your Windows OS. This option will enable you to run Linux as an application on your Windows OS and have access to the full power of the Linux operating system (all graphical user Desktops and interfaces). This is however a bit slow since it runs on top of a virtual machine.
  1. There are many Linux distributions to choose from, but we suggest only three of them that seem to be very popular. My personnal recommendation (Samy) is to choose OpenSuSe, but VirtualBox allows you to install more than one Linux (so you can actually try OpenSuSe and CentOS at the same time).
  2. Install VirtualBox (Oracle) on your laptop or pc from this link https://www.virtualbox.org/
  3. Download an ISO disk image of Linux to a temporary directory in your pc. Make sure it matches your pc architecture (i386 or x86_64).
  4. Go to VirtualBox and install OpenSuSe (or Centos, Ubuntu, or whatever Linux distribution you like). You will be asked to enter the ISO file that you have downloaded before.
  5. We will be doing some work on Linux operating system, especially getting familiar with Linux command line shells (in simple text terminals) playing with system programs, and writing some simple shell scripts for system programming.
  6. Here are a few YouTube videos that explain how to install OpenSuse on VirtualBox:
  7. HOW TO CREATE A SHARED FOLDER BETWEEN WINDOWS AND LINUX ?

    With a shared folder you will be able to edit a Python file in windows (at the "C:\shared" folder) and execute it from your ~/shared Linux directory.

    More details can be found in: http://umairj.com/211/sharing-file-with-a-linux-machine-on-virtualbox

  8. If you own a DropBox account then A more recommended alternative to a shared folder is to link your DropBox account to your Linux account. Details can be found in: Install Dropbox on Linux via command line
    This way is easier for sharing files between your Windows and Linux systems.
  9. If time allows: we will write new C Linux system calls, and compile a new Linux Kernel, and then test it. This will be done in the virtual environment alone and should not be attempted at the college laboratories.

Linux on VMWARE

Second option to install a virtual Linux operating system on top of your Windows OS is by using the VMWARE Virtual Machine Player. Here is a professional document that describes this: Live CD Linux system for PC. Thanks to Tsur Trigger (Braude student in EE department) for contributing this comprehensive document that describes how to do install several Linux distributions on you windows PC (simultaneously!) and how to have access to the full power of the Linux operating system (all graphical user Desktops and interfaces). You have a chance to test several flavours of Linux and get to decide which one you like.

Linux on a diskonkey

Installation of Linux on a diskonkey can be obtained from http://www.pendrivelinux.com/. It is possible to install the full Linux operating system on a flash drive (diskonkey) and boot from this drive. I have not tried it yet, but heard it is very stable and work faster than the virtual option. if you try it and find a particular good configuration, please let me know and I will share it with all students. The downside of this option is the fact that your do not see your Windows and cannot exchange files with it. But you get a full real Linux.

MinGW - Minimalist GNU for Windows

This is a popular set of Unix tools for Windows. It can be downloaded from: Mingw on sourgeforge web site
This is another good option for practicing Unix on your Windows platform, but it is not the real thing. It does however provide you with a large group of powerfull Unix tools for your Windows pc. For example, you get the gcc compiler for compiling C/C++ code on your pc for free. You can use this port for practicing BASH and unix command line. Use Google to see plenty of examples. Quotation: MinGW: A native Windows port of the GNU Compiler Collection (GCC), with freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All of MinGW's software will execute on the 64bit Windows platforms.

bin.zip - A minimal set of Unix commands for DOS

This is probably the simplest and fastest way to use a limited set of Unix commands on your DOS window. Unzip this package to "C:\bin". You will find about 90 Unix commands there. To be able to use them like any other dos commands, add "C:\bin" to your PATH:
        C:\> set PATH="C:\bin";%PATH%
You can add "C:\bin" to your PATH permanently by:
        Computer -> System Properties -> Advanced System Settings -> Environement Variables -> Path -> Edit
This is a quick way to get acquainted with the basic Unix command line philosophy, but it is of course very limited and does not give you the BASH abilities and the other Unix system engines. Use Google and the Unix tutorials to understand the usage of the Unix commands such as: ls, cp, rm, mv, cat, grep, less, du, df, find, printenv, file, diff, ...

line separator

Kernighan's Law: Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.