Operating System

Download Report

Transcript Operating System

1
L. Mohammad R.Alkafagee
OPERATING SYSTEM
7/17/2015
Lecture 3
JAVA VIRTUAL MACHINE
7/17/2015

Java consists of
Programming language specification.
 Application Program Interface.
 Virtual Machine Specification.

Class loader
L. Mohammad R.Alkafagee
Java
program.
class files
Java API.
Class files
Java
interpreter
Host system
(windows,linux
,etc )
2
JAVA VIRTUAL MACHINE (CONT.)
7/17/2015
UNIX Java
Platform
Windows Java
Platform
L. Mohammad R.Alkafagee
Program.
class
Java Hardware
Platform
3
THE JAVA DEVELOPMENT ENVIRONMENT
7/17/2015
Prog1.java
Prog2.java
Prog1.class
Class
loader
Java
interpreter
Prog2.class
Java
API
.class
files
L. Mohammad R.Alkafagee
Compile-time
environment
Java
compiler
Byte-codes move
through the local
system or network
Run-time
environment (java
platform
4
Host system
OPERATING SYSTEM OPERATIONS
7/17/2015
Interrupt Driven by hardware.
 Software error or request creates exception or
trap

L. Mohammad R.Alkafagee
Division by zero ,request for operating System service.
 Other process problems include infinite loop,
processes modifying each other or the operating system
.


Dual-mode operation allows OS to protect itself
and other system components .

User mode and kernel mode
5
OPERATING SYSTEM OPERATIONS
7/17/2015
Mode bit :
 1 -> User mode
 0 -> kernel mode

L. Mohammad R.Alkafagee
provided by hardware
 Provides ability to distinguish when system is
running user code or kernel code.

Some instructions designated as privileged, only
executable in kernel mode.
 System call changes mode to kernel ,return from
call resets it to user

6
TRANSITION FROM USER TO KERNEL MODE
7/17/2015

Timer to prevent infinite loop/process,
hopping resources.
L. Mohammad R.Alkafagee

Set interrupt after specific period
Operating system decrements counter
 When counter zero generate an interrupt


Set up before scheduling process to regain control
or terminate program that exceeds allocate time
7
TRANSITION FROM USER TO KERNEL MODE
(CONT.)
7/17/2015
User process executing
Kernel
[Kernel mode
(Mode bit = 0)]
Call system
call
Trap
Mode bit=0
L. Mohammad R.Alkafagee
User process [user mode( mode bit = 1)]
Return from system
call
return
Mode bit=1
Execute system call
8
SYSTEM CALLS
7/17/2015
Provide the interface between a process and the
operating system.
 These calls are generally available as a routines
written in C and C++,although low-level tasks,
may need to be written using assembly-language
instructions.
 Mostly accessed by programs via a high-level
Application Program Interface (API) rather
than direct system call use.
 Three common APIs are Win32 API for
windows ,POSIX API for UNIX, Linux, and
JAVA API for the Java Virtual
Machine(JVM)

L. Mohammad R.Alkafagee
9
7/17/2015
L. Mohammad R.Alkafagee
10
SYSTEM CALL PARAMETER PASSING
Three general methods used to pass parameters
to the Operating System OS



Simplest : pass the parameters in registers.
Block : parameters stored in a block or table ,in
memory, and address of block passed as a parameter
in a register
Stack :parameters placed ,or pushed ,onto stack by
the program and popped off the stack by the
Operating System
L. Mohammad R.Alkafagee

7/17/2015

Block and Stack methods do not limit the number
or length of parameters being passed.
11
TYPES OF SYSTEM CALLS

Process Control:
File Management:


Device Management:


request device, release device, read, write, reposition,
get/set device attributes.
Information Maintenance:


create file, delete file, open, close, read, write, reposition,
get/set file attributes.
L. Mohammad R.Alkafagee

Load, execute, create ,terminate, get/set process
attributes, wait for time, allocate, free memory.
7/17/2015

get/set time or date, get/set process, file, or device
attributes
Communication:

create, delete connection, send, receive messages,
transfer status information, attach remote devices
12
SYSTEM PROGRAMS
L. Mohammad R.Alkafagee
Some ask the system for info-date ,time ,amount of
available memory, disk space ,number of users.
 Other provide detailed performance, logging, and
debugging information,
 Typically these programs format and print the output to
the terminal or other output devices.

7/17/2015
System Programs provide a convenient
environment for program development and
execution. it can be divided into:
 File Management : Create ,Delete ,Copy, Rename,
Print and generally manipulated files and
directories.
 Status Information:

13
SYSTEM PROGRAMS (CONT.)
File Modification:

Programming-language support:


Program loading and execution:


compilers, assemblers , debuggers and interpreters.
Absolute loaders ,relocatable loaders ,linkage editors for
higher-level and machine language.
L. Mohammad R.Alkafagee
Text editors to create and modify files.
 Special commands to search contents of files or perform
transformations of the text.

7/17/2015

Communications: provide the mechanism for
creating a connections among processes, users, and
computer systems

Allow users to send message to one another’s screen,
browse web pages, send electronic-mail messages, transfer
files from one machine to another.
14