Transcript OS_EX1
Operating Systems
Session 1
Administration
Contact details
TA: Alexander(Sasha) Apartsin
◦ [email protected]
◦ Office hours: E-mail
Homepage: www.cs.tau.ac.il/~apartzin
Resources:
◦ Everything at: msdn.microsoft.com
◦ Everything else at: www.google.com
Administration
Assignments
All homework assignments must be
performed individually.
Usually 2 weeks per assignment
Mostly Windows but few are Linux
You have to submit all assignments to be
able to approach the exam
Late submission fine:
◦ A point off the final grade
Submission guidelines
Submission by e-mail
See guidelines on the course’s Web page
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 Download 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