OS - Windows and UNIX-Linux
OS - Windows and UNIX-Linux
Operating Systems
Windows Operating System
Learning Objectives
• Additional features
• Modular structure
• New components added to executive process
• Objects
• Abstract data types manipulated by special services
• System resources managed uniformly
• Remote procedure call
• Application calls remote services
• Regardless of location on network
Understanding Operating Systems 9
Portability
• Operates on different platforms
• Different processors or configurations
• Minimum amount of recoding
• System guidelines to achieve goal
• Written in a standardized, high-level language
• Available in all machines
• Accommodate ported hardware
• Minimize direct code interaction with hardware
• Reduce incompatibility errors
• Isolate hardware-dependent code into modules
• Easily modifiable when ported
Understanding Operating Systems 10
Portability (cont'd.)
• Windows features
• Modular code
• Written in C (most of code)
• Graphic component and some networking portions written in C++
• Code communicating directly with hardware written in Assembly
language
• Hardware abstraction layer (HAL)
• Dynamic-link library
• Provides isolation from vendors’ hardware dependencies
• Process:
• Combination of executable program, private memory
area, and operating system allocated resources as the
program executes
• Requires at least one execution thread
• Thread
• Process entity: roughly equated to a task
• Threads
• Thread components called thread’s context
• Actual data forming context varies from one processor to another
• Kernel
• Schedules threads for execution on a processor
• Thread actually executes code
• Overhead incurred by thread is minimal
• Unitasking
• Process with single thread
Understanding Operating Systems 25
Processor Management (cont'd.)
(figure 14.4)
Unitasking in Windows. Here’s
how a process with a single
thread is scheduled for
execution on a system with a
single processor.
© Cengage Learning 2014
• Multithreading
• Systems with multiple processors
• Process has as many threads as CPUs available
• All threads belonging to one process: share global variables,
heap, and environment strings
• I/O system
• Packet driven
• I/O request represented by I/O request packet (IRP)
• IRP
• Data structure controlling how I/O operation processed at each step
• I/O manager:
• Creates an IRP representing each I/O operation
• Passes IRP to appropriate driver
• Disposes packet when operation complete
Understanding Operating Systems 31
Device Management (cont'd.)
• I/O manager
• Determines driver called to process request
• Based on file object’s name
• Driver object
• Represents individual driver in system
• Created by I/O manager when driver loaded into system
• May have multiple device objects connected to it
• Device object
• Physical, logical, or virtual device on the system
• Describes device characteristics
Understanding Operating Systems 35
Device Management (cont'd.)
(table 14.2)
Example showing how a device object is created from an instruction to
read a file, illustrated in Figure 14.6.
© Cengage Learning 2014
• Opening file
• Process supplies file’s name and type of access required
• File objects bridge gap
• Between physical devices’ characteristics and directory
structures, file system structures, and data formats
• File object
• Memory-based representation of shareable physical resources
• Contains only data unique to an object handle
• File
• Contains data to be shared
• New file object created with new set of
handle-specific attributes
• Each time process opens a handle
(table 14.3)
Description of the attributes shown in Figure 14.8.
© Cengage Learning 2014
Understanding Operating Systems 46
File Management (cont'd.)
• Networking
• Integral part of Windows operating system executive
• Provides services: user accounts and resource security
• Implements communication between computers
• Named pipes: provide high-level interface for passing data
between two processes (regardless of locations)
• Mailslots: provide one-to-many and many-to-one
communication mechanisms
• Redirector
• Coded in C programming language
• Implemented as loadable file system driver
• Not dependent on system’s hardware architecture
• Function
• Direct I/O request from user or application to remote
server with appropriate file or resource
• SMB protocol
• High-level specification
• Formatting messages sent across network
• OSI model correlation
• Application layer (Layer 7); Presentation layer (Layer 6)
• API called NetBIOS interface
• Passes I/O requests structured in SMB format to remote computer
• SMB protocols and NetBIOS API
• Adopted in several networking products before appearing in Windows
• Active Directory
• Database storing many information types
• General-purpose directory service for heterogeneous network
• Built entirely around DNS and LDAP
• Groups machines into domains
• Each domain gets a DNS domain name (e.g., pitt.edu)
• Each domain must have at least one domain controller
• Domain can have more than one domain controller
• Active Directory clients use standard DNS and LDAP protocols: locate
objects on the network
Understanding Operating Systems 53
(figure 14.9)
Active Directory clients use standard DNS and LDAP protocols to locate
objects on the network.
© Cengage Learning 2014
• Built-in security
• Necessary element for managers of Web servers and networks
• Requires authentication mechanism allowing client to prove
identity to server
• Client supplies authorization information
• Server uses information: determines specific access rights given
to client
• Provides data integrity using various methods
• Windows operating systems feature Kerberos security
Understanding Operating Systems 58
Security Terminology (cont'd.)
• Kerberos security
• Authentication (mutual), data integrity, and data privacy
• Each domain has own Kerberos server
• Microsoft implemented standard Kerberos protocol
• Microsoft separates distributed security services users
from their providers
• Supports many options without unusable complexity
(figure 14.10)
Requests from an application flow through these security stops on the
way to and from the network.
© Cengage Learning 2014
• Windows 8
• Offers same default screen
• All devices running the operating system
• Laptop or desktop users
• Can switch between tile-populated Start screen and
Desktop screen
• Command-line interface
• Available from most Windows desktops
• Use Help feature: learn a command’s syntax
Courtesy XKCD.com
Linux
• Linux: A kernel for a Unix-like operating system.
• commonly seen/used today in servers, mobile/embedded devices, ...
• GNU: A "free software" implementation of many Unix-like
tools
• many GNU tools are distributed with the Linux kernel
• distribution: A pre-packaged set of Linux software.
• examples: Ubuntu, Fedora
• key features of Linux:
• open source software: source can be downloaded
• free to use
• constantly being improved/updated by the community
Linux Desktop
• X-windows
• window managers
• desktop environments
• Gnome
• KDE
• How can I try out Linux?
• CSE Virtual machine
• CSE basement labs
• attu shared server
Things you can do in Linux
• Load the course web site in a browser
• Install and play games
• Play MP3s
• Edit photos
• IM, Skype
Shell
• shell: An interactive program that uses user input to manage the
execution of other programs.
• A command processor, typically runs in a text window.
• User types commands, the shell runs the commands
• Several different shell programs exist:
• bash : the default shell program on most Linux/Unix systems
• We will use bash
• Other shells: Bourne, csh, tsch
• Why should I learn to use a shell when GUIs exist?
Why use a shell?
• Why should I learn to use a shell when GUIs exist?
• faster
• work remotely
• programmable
• customizable
• repeatable
Shell commands
command description
exit logs out of the shell
ls lists files in a directory
pwd print the current working directory
cd changes the working directory
man brings up the manual for a command
$ pwd
/homes/iws/rea
$ cd CSE391
$ ls
file1.txt file2.txt
$ ls –l
-rw-r--r-- 1 rea fac_cs 0 2016-03-29 17:45 file1.txt
-rw-r--r-- 1 rea fac_cs 0 2016-03-29 17:45 file2.txt
$ cd ..
$ man ls
$ exit
Relative directories
directory description
. the directory you are in ("working directory")
.. the parent of the working directory
(../.. is grandparent, etc.)
~ your home directory
(on many systems, this is /home/username )
~username username's home directory
~/Desktop your desktop
Directory commands
command description
ls list files in a directory
pwd print the current working directory
cd changes the working directory
mkdir create a new directory
rmdir delete a directory (must be empty)
• some commands (cd, exit) are part of the shell ("builtins")
• others (ls, mkdir) are separate programs the shell runs
Shell commands
• many accept arguments or parameters
• example: cp (copy) accepts a source and destination file path
• a program uses 3 streams of information:
• stdin, stdout, stderr (standard in, out, error)
• input: comes from user's keyboard
• output: goes to console
• errors can also be printed (by default, sent to console like
output)
• parameters vs. input parameters: before Enter is pressed; sent
in by shell-input: after Enter is pressed; sent in by user
Command-line arguments
• most options are a - followed by a letter such as -c
• some are longer words preceded by two - signs, such as --count
• options can be combined: ls -l -a -r can be ls -
lar
• many programs accept a --help or -help option to give
more information about that command (in addition to man
pages)
• or if you run the program with no arguments, it may print help info
• for many commands that accept a file name argument, if
you omit the parameter, it will read from standard input
(your keyboard)
Shell/system commands
command description
man or info get help on a command
clear clears out the output from the console
exit exits and logs out of the shell
command description