Operating System NOtes
Operating System NOtes
.
Some important features of system software are:
• Written in low level code
• Close proximity to the hardware system
• Speed
• Tough to manipulate
Language Processors
Compiler : A software whose main job is to translate
the code written in one language to some another
language without changing the semantics or
meaning of the program.
The compiler is also said to make the target code
efficient and optimized in terms of time and
space.
A compiler performs the following operations
during compilation or translation of a program one
language to another.
• preprocessing
• lexical analysis
• parsing
• semantic analysis (syntax-directed translation)
• conversion of input programs to an intermediate
representation
• code optimization and code generation.
Some examples of compiler are gcc(C compiler), g++
(C++ Compiler ), javac (Java Compiler) etc.
Interpreter : A computer program that directly
executes instructions written in a programming or
scripting language without translating them into
another language or low-level machine code.
It do not require the program to be compiled into
a machine language program but translates high-
level instructions into an intermediate form and is
then executed. This characteristic makes
interpreter faster than compiler.
• Interpreter continuously translates the program
until the first error is met. If any error occurs it
stops executing. Hence debugging is easy but
increases the possibility of existence of bugs in a
program as codes that are not executed are never
checked for errors.
• Some examples of programming/scripting
language that use interpreters are PHP, Python,
Ruby etc.
Assembler : A program that converts assembly
language into low-level machine code.
Assembler takes basic commands and operations
of an assembly language and converts them into
binary code specific to a type of processor.
• Assemblers produce executable code that are
similar to the compilers.
• However, assemblers are much simpler as they only
convert low-level assembly language code to
machine code.
• Assembly languages are specific to a certain kind of
instructions of a processor, therefore assembly
languages for different processors may be different.
Linker: A computer program that links one or more
object files generated by a compiler and combines
them into one executable program.
Linker creates a single executable file by resolving
symbolic references found as it reads a object file.
Loader: A program that loads executable files or
machine codes of a program into the system
memory for executing them.
Part of the Operating Systems (O/S) of the
computer.
Loading a program involves calculating the size of
a program (instructions and data) and creating
memory space for it.
Initializes various registers to initiate execution.
Read the contents of executable file into memory.
Once the contents of the executable file or
program is loaded the operating system starts the
program by passing control to the loaded program
code.
All OS that support loading have loader to load
the programs in the main memory.
Operating Systems
• A program that acts as an intermediary between a
user of a computer and the computer hardware.
• A set of programs that coordinates all activities
among computer hardware resources.
• Operating system goals:
– Execute user programs and make solving user
problems easier.
– Make the computer system convenient to use.
– Use the computer hardware in an efficient
manner.
Main functions of an Operating
System
• Start up the computer
• Administrator security
• Control network
• Access the web
• Monitor performance and provide
housekeeping services
• Schedule jobs and configure devices
• Memory management
• Process management
• Provide user interface
Operating System Goals
Main goals are
– Efficiency
– Robustness
– Scalability
– Extensibility
– Portability
– Security
– Protection
– Interactivity
– Usability
Location of Operating System
• Resides on ROM chip in handhelds devices
like PDA, Mobile Phone.
partitioning method.
External fragmentation problem can be solved using
the technique known as Compaction.
Disadvantages of Paging
Suffers from internal fragmentation.
May not be good for a system having small RAM.
Segmentation
In Segmentation each job or process is divided into
several segments of different sizes, one for each
module that contains pieces that perform related
functions.
Each segment is actually a different logical address
space of the program.
When a process is to be executed, its corresponding
segments are loaded into the memory in a non-
contiguous manner.
Segmentation memory management works very
similar to paging but here segments are of variable-
length where as in paging pages are of fixed size.
A program segment contains the program's main
function, utility functions, data structures, and so on.