windows 98 help

Download Report

Transcript windows 98 help

Lab1
Operating Systems
Basics
Operating System CPIT 260
Instructor: Bashair Ali Alrashed
Objectives
•
•
•
•
•
•
To understand the basics of operating system.
To understand about device drivers.
Introduction to different operating systems.
To understand the role of an operating system.
To understand the core tasks of operating system
Defining program and a process
Operating System (OS)
• It is an interface between hardware and user, which is
responsible for the management and coordination of activities
and the sharing of the resources of a computer, that acts as a
host for computing applications run on the machine.
• An operating system or OS, is a fundamental component of a
computer system that manages activities and resources on the
machine
Operating System (OS)
• The most well known OS
include:
• System Software
programs that manage
the operation of a computer
• Application Software
programs that help the user
perform a particular task
System Software
• System Software are programs that
• Control the overall operation of the computer OS
• Interact directly with HW, device drivers, VGA driver, Driver
• Perform system management & maintenance, Norton Ghost, Ant
viruses.
• Are used to develop or maintain
other programs
• Language translators
• Interpreter or Compiler for high
level languages
Operating System
• Performs its work invisibly to control the internal functions of
a computer, e.g. maintaining files on the disk drive, managing
the screen, controlling which tasks the CPU performs and in
what order
• It interacts directly
with the computer HW
• Other SW normally
does not directly
interact with the HW,
but through the OS
Firmware (Boot up)
• OS components that are stored permanently on chip (ROM)
and not on the disk drive because its non-volatile storage and
capable of holding large quantities of data permanently.
• When a computer is powered-on, firmware is the first
program that it always executes
• Firmware consists of startup and a few low-level I/O routines
that assist the computer in finding out and executing the rest
of the OS
• On IBM-compatible PC’s, it is called BIOS
• Location of Operating System
s
s
s
s
ss P
s
s
s
The Role of an OS
• The 1st program that runs when a
typical computer is turned ON, and the
last one to finish running when the
computer is turned OFF
• It manages the HW and SW resources of
the computer system, often invisibly.
These include the processor, memory,
disk drives, etc.
• It provides a simple, consistent way for
applications to interact with the HW
without having to know all the details of
the HW
Open source describes practices in
production and development that promote
access to the end product's source
materials
OS Parts
The operating system comprises a set of software packages
that can be used to manage interactions with the hardware.
The following elements are generally included in this set of
software:
• The kernel, is a bridge between applications and the
actual data processing done at the hardware level.
• it’s represents the operating system's basic functions
• its responsibilities include managing the system's
resources (the communication between hardware and
software components)
• The shell, allowing communication with the operating
system via a control language, letting the user control
the peripherals without knowing the characteristics of
the hardware used, management of physical addresses,
etc. example: c> format a:
• The file system, allowing files to be recorded in a tree
structure.
Examples of Operating Systems
• Windows
• Linux
• Unix
• Mac OS
• Solaris
• DOS
Microsoft Operating Systems
• Windows 9x
• Windows 95 , Windows 98, Windows Millennium Edition,
OS/2 (developed jointly with IBM)
• Windows NT
•
•
•
•
•
Windows NT 3.1 (OS/2 3.0), Windows NT 3.5 (Windows 3.5),
Windows NT 3.51 (Windows 3.51), Windows NT 4.0
(Windows 4), Windows 2000 (Windows NT 5.0
Windows XP +Windows NT 5.1
Windows Server 2003
Windows 7 (Windows 6.1)
Windows CE (OS for handhelds, embedded devices,
and real similar to other versions of Windows)
• Windows CE 3.0, CE 5.0, CE 6.0, Windows mobile
Linux and Unix
• UNIX:
A popular multi-user, multitasking operating system developed at Bell Labs in
the early 1970s. After Unix System V, it ceased to be developed as a single
operating system, and was instead developed by various competing companies,
such as Solaris (from Sun Microsystems), AIX (from IBM), HP-UX (from
Hewlett-Packard), and IRIX (from Silicon Graphics). UNIX is a specification for
baseline interoperability between these systems, even though there are many
major architectural differences between them.
• LINUX:
Linux is a UNIX-like operating system that was designed to provide personal
computer users a free or very low-cost operating system comparable to
traditional and usually more expensive UNIX systems.
• Linux has never been certified as being a version of UNIX,
• A comprehensive list of differences between Linux and "UNIX" isn't possible,
because there are several completely different "UNIX" systems.
Linux and UNIX
• Pardus
• Linux-based operating system developed by the Turkey Scientific and
Technical Research Association. You can use it both in Turkish and
English.
• Peanut Linux
• Small but packed and nice looking Linux distribution, only 210 Mb
download installs to 600 Mb on your hard disk.
• Puppy Linux
• Small Linux distribution, only 60mb in size. Can boot from CD, USB
disk and run inside Windows or standalone.
• RedHat
• Non-free Linux editions for server computers, sold by annual
subscription.
• Other
xF
s’
• Mandriva, Suse, Ubuntu, Fedora ,Tiny linux, xandros, United Linux
etc.
Other Operating Systems
• Apple: Macontosh
• INTEL BASED : OS/2
• Java Operating System: jnode
Program vs. Process
Program
Set of instruction
It is static
Process
Process is active.
It is program in
execution
The contents are stored Every process occurs at a
on the Hard Disk
different memory
location
Process vs. Thread
Process
Thread
requires careful programming
easier to create
processes don't share the same
address space
don't require a separate address
space
It is program in execution
Unit of execution
consist of multiple threads.
It is a sub process
During the Context Switching
between the processes the cache
gets invalidated
where as in the context switching
of the threads the cache does not
invalidate.
independent
interdependent
Process vs. Thread
Fork (System Call)









For a process to start the execution of a different program
need a way to create new processes
We need process call forks, it creates a copy of itself.
Fork is come from Unix OS is created with the fork() it type of
system call
Usually a system call, implemented in the kernel.
The original process that calls fork() is the parent process, and the
newly created process is the child process.
Creates a separate address space for the child.
The child process has an exact copy of all the memory segments of
the parent process .Both the parent and child processes possess the
same code segments, but execute independently of each other.
Both processes return from the system call and execute the next
instruction
Usage
• The system call takes no arguments. Like fork()
• If it returns a negative value, the creation of a child
process was not successful.
• Otherwise, in the child process, the return value of fork()
is zero, whereas the return value in the parent process is
the process identifier of the newly created child process (a
positive value).
• Since both processes continue executing the same
program, they typically distinguish the parent from the
child by testing the return value of fork().
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
int main() {
pid_t pid;
/* fork a child process */
pid = fork();
if (pid < 0) { /* error occurred */
fprintf(stderr, "Fork Failed\n");
exit(-1);
}
else if (pid == 0) { /* child process */
printf("I am the child %d\n",pid);
execlp("/bin/ls","ls",NULL);
}
else { /* parent process */
/* parent will wait for the child to complete */
printf("I am the parent %d\n",pid);
wait(NULL);
printf("Child Complete\n");
exit(0);
}
}
The main purpose of OS
• To provide an environment for a computer user to execute
programs on computer hardware in a convenient and efficient
manner.
• To allocate the separate resources of the computer as needed
to solve the problem given. The allocation process should be
as fair and efficient as possible.
• As a control program it serves two major functions:
• supervision of the execution of user programs to prevent errors
and improper use of the computer,
• management of the operation and control of I/O devices.