Monday, March 21, 2011

Input Output Management

Input Output Management
·        Managing input & output in Windows XP involves many operating system components.
·        User-mode processes interact with an environment subsystem and not directly with kernel-mode components.
·        The environment subsystem pass input & output request to the input & output manager, which interacts with devices drivers to handle such request.
·         Several device drivers, organized into a driver stack, cooperate to fulfill an input & output request.
·        The plug and play manager dynamically recognizes when new devices are added to the system and allocates and deallocates  resources, such as input & output ports or DMA channels, to them.
·        The power manger administers the operating system’s power management policy.


BUFFERING

·        Buffer overflow weakness is one of the many disadvantages of this type of security computer.
·        Buffer overflow attacks occur when the excessive Attacker provide input on the plan on the run.
·        Buffer overflow results from the weakness of the programming language c, c + +, fortran, and assembly, which does not automatically check the limit input when the program is executed.
·        The program is so complex, until programmers themselves do not know the weaknesses of the program.
·        Relies on external data to control the program.
·        Buffer is provided at the memory allocation, such as arrays or pointers in C. in the language C and C + +, there is no automatic restrictions on buffer, where users can write through the input buffer. For example:
int main () {
int buffer [10];
buffer [20] = 10;
}
·        Program in C above is a valid program, and each compiler to compile without error.
·        A process is a program in execution.


Spoiling Techniques
·        In computer science, spooling refers to a process of transferring data by placing it in a temporary working area where another program may access it for processing at a later point in time.
·        The normal English verb "spool" can refer to the action of a storage device that incorporates a physical spool or reel, such as a tape drive.
·        Spooling refers to copying files in parallel with other work.
·        The most common use is in reading files used by a job into or writing them from a buffer on a magnetic tape or a disk.
·        Spooling is useful because devices access data at different rates. The buffer provides a waiting station where data can rest while the slower device catches up.
·        This temporary working area would normally be a file or storage device.
·        The most common spooling application is print spooling: documents formatted for printing are stored onto a buffer (usually an area on a disk) by a fast processor and retrieved and printed by a relatively slower printer at its own rate.
·        Spooler or print management software may allow priorities to be assigned to jobs, notify users when they have printed, distribute jobs among several printers, allow stationery to be changed or select it automatically, generate banner pages to identify and separate print jobs, etc.
·        The temporary storage area to which E-mail is delivered by a Mail Transfer Agent and in which it waits to be picked up by a Mail User Agent is sometimes called a mail spool.

Memory Management

Objectives Memory Management :
Ø To provide a detailed description of various ways of
     organizing memory hardware.
Ø To discuss various memory-management techniques,
     including paging and segmentation.
Ø To provide a detailed description of the Intel Pentium, which supports both pure segmentation and segmentation with paging.

Concept Memory Management
Ø Program must be brought (from disk) into memory and placed within a process for it to be run.
Ø Main memory and registers are only storage CPU can access directly.
Ø Register access in one CPU clock (or less).
Ø Main memory can take many cycles.
Ø Cache sits between main memory and CPU registers.
Ø Protection of memory required to ensure correct operation.


Virtual Memory Implementation:
virtual memory  is a memory management technique developed for multitasking kernels. This technique virtualizes a computer architecture's various hardware memory device (such as RAM modules and disk storage drives), allowing a program to be designed as though:
  • ·        There is only one hardware memory device and this "virtual" device acts like a RAM module.
  • ·        The program has, by default, sole access to this virtual RAM module as the basis for a contiguous working memory.
  • ·        When the kernel detects a page fault it will generally adjust the virtual memory range of the program which triggered it, granting it access to the memory requested. This gives the kernel discretionary power over where a particular application's memory is stored, or even whether or not it has actually been allocated yet.


Segmentation

Ø Memory-management scheme that supports user view of memory
Ø A program is a collection of segments. A segment is a logical unit
such as:
  • -         main program,
  • -         procedure,
  • -         function,
  • -         method,
  • -         object,
  • -         local variables, global variables,
  • -         common block,
  • -         stack,
  • -         symbol table, arrays


PAGING
  • Ø  Logical address space of a process can be noncontiguous;  process is allocated physical memory whenever the latter is   available
  • Ø  Divide physical memory into fixed-sized blocks called frames (size is power of 2, between 512 bytes and 8,192 bytes)
  • Ø  Divide logical memory into blocks of same size called pages
  • Ø Keep track of all free frames
  • Ø To run a program of size n pages, need to find n free frames and load program
  • Ø Set up a page table to translate logical to physical addresses
  • Ø Internal fragmentation


Explain Memory Relocations Of Paging System
Paging permits a program to be allocated noncontiguous blocks of memory. We divide programs into pages which are blocks of small, fixed size. We then divide the physical memory into frames which are blocks of size equal to page size. We use a page-table to map program pages to memory frames.
The page size (S) is defined by the hardware. Generally it ranges from 512 words/page to 4096 words/page.

Wednesday, February 16, 2011

PROCESS MANAGEMENT

Briefing on communications among processes

  • Mechanism for processes to communicate and to synchronize their actions.
  • Message system – processes communicate with each other without resorting to shared variables.
  • IPC facility provides two operations:
  • send(message) – message size fixed or variable
  • receive(message)
  • If P and Q wish to communicate, they need to:
  • establish a communication link between them.
  • exchange messages via send/receive.



Mutual Exclusion

  • Mutual exclusion algorithms are used in concurrent programming to avoid the simultaneous use of a common resource, such as a global variable, by pieces of computer code called critical sections.
  • A critical section is a piece of code in which a process or thread accesses a common resource.
  • The critical section by itself is not a mechanism or algorithm for mutual exclusion.
  • A program, process, or thread can have the critical section in it without any mechanism or algorithm which implements mutual exclusion.


Synchronization

  • Message passing may be either blocking or non-blocking
  • Blocking is considered synchronous
  • Blocking send has the sender block until the message is received
  • Blocking receive has the receiver block until a message is available
  • Non-blocking is considered asynchronous
  • Non-blocking send has the sender send the message and continue
  • Non-blocking receive has the receiver receive a valid message or null
  • Synchronization is timekeeping which requires the coordination of events to operate a system in unison.
  • The familiar conductor of an orchestra serves to keep the orchestra in time.


Deadlock

  • Deadlock can arise if four conditions hold simultaneously.
  • Mutual exclusion: only one process at a time can use a resource.
  • Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes.
  • No preemption: a resource can be released only voluntarily by the process holding it, after that process has completed its task.



Recognize interaction and synchronization among process

  • Many systems provide hardware support for critical section code
  • Uniprocessors – could disable interrupts
  • Currently running code would execute without Preemption.
  • Generally too inefficient on multiprocessor systems
  • Operating systems using this not broadly scalable
  • Modern machines provide special atomic hardware instructions
  • Atomic = non-interruptable
  • Either test memory word and set value or swap contents of two memory words