Transcript Slides

Operating Systems
Session 1
Administration
Contact details

TA: Alexander(Sasha) Apartsin
◦ [email protected]
◦ Office hours: E-mail

TA: Sasha Alperovich
◦ [email protected]
◦ Office hours: E-mail
Homepage: www.cs.tau.ac.il/~apartzin
 Resources:

◦ Everything at: www.microsoft.com
◦ Everything else at: www.google.com
Administration
Assignments
All homework assignments must be performed individually.
 Submitting and passing all homework assignments is
mandatory (for passing the course):

◦ Assignments who got 0 points on some question must
resubmit it within one week of grade publication
◦ Exercises without a final grade (a question was missing, project
won’t compile) must be resubmitted within a week.
◦ Resubmission: include the original hardcopy with the comments
you received and the required corrections
The final grade is not affected by the homework grades.
 The penalty of any late submission (or resubmission) is one
point off the final course grade.
 At least one exercise from the homework assignments will
be extremely helpful at the final exam.

Submission guidelines
Zip and send code(.h,*.c) by e-mail
 Don’t send binaries/object files
 Don’t forget to include .vcproj file for
Windows exercises
 Make sure you get a receipt (autogenerated reply e-mail)
 Submission e-mail:
[email protected]

Administration
Classes
Each class will consist of 2 parts:

Part I: Review of general OS concept and its
Windows/Unix implementation

Part II: “On-projector” development/coding
of a Windows application which makes use
of the presented concept
Administration
Windows Development Setup

Home
◦ A reasonable PC with XP/Vista
◦ Free Software from MS site:
 Visual C++ 2010 Express Edition

Visual Studio 2003 @ Lab
Windows Essentials
Windows Executables
EXE :Portable Executable File Format
 What Windows does when you click on
executable file?








Read and parse PE file header
Allocate resources (e.g. memory)
Locate and load libraries (DLL)
Map EXE segments (data, code) to the memory
Setup an environment (e.g. security)
Locate address of start function (main)
Call “main” function
Windows Essentials
Command Shell Processor
CMD.com
 Use special window: console window

◦ Makes system calls to read input from
console(e.g. “dir” string)
◦ Makes system calls to fetch list of the files in
current directory
◦ Makes system calls to print out results

In-class examples and assignments will be
windows console applications
Windows Essentials
Windows Objects & Handles

Windows object
◦ Window
◦ Process
◦ Device

Handles
◦
◦
◦
◦
Program that uses an object has a handle to it
Multiple handles to the same objects
Permissions can be associated with handle
Reference counting: OS free object’s resources if
there are no more handles to it
Windows Development
Let’s do some programming
Win32 files
CreateFile
 ReadFile
 WriteFile
 CloseHandle
