Saturday, March 26, 2011

CG- colour model

Color Models:

 A color model is an abstract mathematical model describing the way colors can be represented as tuples of numbers, typically as three or four values or color components. When this model is associated with a precise description of how the components are to be interpreted (viewing conditions, etc.), the resulting set of colors is called color space. This section describes ways in which human color vision can be modeled.

A color model is an orderly system for creating a whole range of colors from a small set of primary colors. There are two types of color models, those that are subtractive and those that are additive. Additive color models use light to display color while subtractive models use printing inks. Colors perceived in additive models are the result of transmitted light. Colors perceived in subtractive models are the result of reflected light.

The Two Most Common Color Models:
There are several established color models used in computer graphics, but the two most common are the RGB model (Red-Green-Blue) for computer display and the CMYK model (Cyan-Magenta-Yellow-Black) for printing.


1) RGB Color Model-*Additive color model
                                *For computer displays
                                *Uses light to display color
                                *Colors result from transmitted light
                                *Red+Green+Blue=White



rgb.gif






2) CMYK Color Model-*Subtractive color model
                                    *For printed material
                                    *Uses ink to display color
                                    *Colors result from reflected light
                                    *Cyan+Magenta+Yellow=Black

cmyk.gif
 

In the RGB model notice that the overlapping of additive colors (red, green and blue) results in subtractive colors (cyan, magenta and yellow). In the CMYK model notice that the overlapping of subtractive colors (cyan, magenta and yellow) results in additive colors (red, green and blue).





refer :  http://www.sketchpad.net/basics4.htm
           http://en.wikipedia.org/wiki/Color_model
          http://en.wikipedia.org/wiki/RGB_color_model

CG- dithering techniques...

Dithering - A technique used in quantization processes such as graphics and audio to reduce or remove the correlation between noise and signal.

Dithering is used in computer graphics to create additional colors and shades from an existing palette by interspersing pixels of different colors. On a monochrome display, areas of Grey are created by varying the proportion of black and white pixels. In color displays and printers, colors and textures are created by varying the proportions of existing colors. The different colors can either be distributed randomly or regularly. The higher the resolution of the display, the smoother the dithered color will appear to the eye.


Dithering doesn't reduce resolution. There are three types: regular dithering which uses a very regular predefined pattern; random dither where the pattern is a random noise; and pseudo random dither which uses a very large, very regular, predefined pattern.


Dithering is used to create patterns for use as backgrounds, fills and shading, as well as for creating halftones for printing. When used for printing is it very sensitive to paper properties. Dithering can be combined with rasterising. It is not related to anti-aliasing.


Dithering technique:
 Dither algorithm performs an optimal adding of a sequence of images as far as resolution is concerned. The principle is that, at sub-pixel level, shifts between individual input images are nearly randomly distributed. For example, a star in the first image may be centered  perfectly in the middle of a pixel, whereas it will be across two pixels in the second one, and so on. Since it is easy to know the exact shift between the images, it is possible to create an output image with a finer sampling, in which resolution may be increased with respected to each input image. In fact, energy from each input pixel is dropped in the output image.

  Fig. 1: Random Number Generated  
                      


                  
   
Fig. 2: Algorithm Generated


Figure 1 shows a dither pattern generated by a random number generator, even with a randomized seed.  Note that the distribution of points is not very uniform.  Indeed, there are some points that could result in sensor noise not being eliminated but in fact being reinforced due to insufficient difference in positions.

Figure 2 shows the dither pattern that results from the use of this algorithm. It achieves maximize separation from one frame to another with a minimum overall movement of the guide star.

  
Usage :

Dither should be added to any low-amplitude or highly-periodic signal before any quantization or re-quantization process, in order to De-correlate the quantization noise with the input signal and to prevent non-linear behavior (distortion); the lesser the bit depth, the greater the dither must be. The results of the process still yield distortion, but the distortion is of a random nature so its result is effectively noise. Any bit-reduction process should add dither to the waveform before the reduction is performed.

 

 

refer : http://www.hiddenloft.com/notes/dithering1.htm

          http://en.wikipedia.org/wiki/Dither

          http://www.astrosurf.org/buil/us/spe9/lrgb22.htm


CG- halftone shading...

Halftone is the reprographic technique that simulates continuous tone imagery through the use of dots, varying either in size, in shape or in spacing. "Halftone" can also be used to refer specifically to the image that is produced by this process.
 Where continuous tone imagery contains an infinite range of colors or greys, the halftone process reduces visual reproductions to a binary image that is printed with only one color of ink. This binary reproduction relies on a basic optical illusion—that these tiny halftone dots are blended into smooth tones by the human eye.
At a microscopic level, developed black and white photographic film also consists of only two colors, and not an infinite range of continuous tones.






Left : Halftone dots.     
Right : How the human eye would see this sort of arrangement from a sufficient distance.





refer:   http://en.wikipedia.org/wiki/Halftone

Saturday, March 12, 2011

CG - Midpoint ellipse algorithm

Midpoint ellipse algorithm is a method for drawing ellipses in computer graphics. This method is modified from Bresenham's algorithm. The advantage of this modified method is that only addition operations are required in the program loops. This leadsto simple and fast implementation in all processors.

An ellipse with center at the origin and axes parallel to the x - y axes has the formula
f(x, y) = (x.x/a.a  +  y.y/b.b) -1=0

where a and b are the radii, and where f is positive if a point (x,y) lies outside the ellipse, is negative
if a point is inside the ellipse, and is zero if a point is on the ellipse.


Let us consider one quarter of an ellipse. The curve is divided into two regions. In
region I, the slope on the curve is greater than -1 while in region II less than -1.
dy/dx = -1
Region II
Region I
a
b
x
y
m = -1




Friday, March 11, 2011

CS-Preface

A preface is an introduction to a book or other literary work written by the work's author. An introductory essay written by a different person is a foreword and precedes an author's preface. The preface often closes with acknowledgements of those who assisted in the project.

A preface generally covers the story of how the book came into being, or how the idea for the book was developed; this is often followed by thanks and acknowledgments to people who were helpful to the author during the time of writing.

A preface is usually signed (and the date and place of writing often follow the typeset signature); a foreword by another person is always signed. Information essential to the main text is generally placed in a set of explanatory notes, or perhaps in an "Introduction" that may be paginated with Arabic numerals, rather than in the preface. The term preface can also mean any preliminary or introductory statement. It is sometimes abbreviated pref.

Preface comes from the Latin, meaning either "spoken before" (prae + fatia) or "made before" (prae + factum). While the former source of the word could have preface meaning the same as prologue, the latter strongly implies an introduction written before the body of the book.

Preface is:
1. a preliminary statement in a book by the book's author or editor, setting forth its purpose and scope, expressing acknowledgment of assistance from others, etc.
2. an introductory part, as of a speech.

CS- Back matter

Back Matter
Follow the body of your report with appendices and references. 
I. Appendices
Present supporting material--such as details of testing procedures, extended calculations, computer documentation, instructions, data tables, side issues, or large figures--in your appendices. 

II. References
List any sources of information--articles, books, interviews--you've used.

CS- Copyright notice:

Copyright is a set of exclusive rights granted to the author or creator of an original work, including the right to copy, distribute and adapt the work. Copyright does not protect ideas, only their expression. In most jurisdictions copyright arises upon fixation and does not need to be registered. Copyright owners have the exclusive statutory right to exercise control over copying and other exploitation of the works for a specific period of time, after which the work is said to enter the public domain. Uses covered under limitations and exceptions to copyright, such as fair use, do not require permission from the copyright owner. All other uses require permission. Copyright owners can license or permanently transfer or assign their exclusive rights to others.

Initially copyright law only applied to the copying of books. Over time other uses such as translations and derivative works were made subject to copyright. Copyright now covers a wide range of works, including maps, sheet music, dramatic works, paintings, photographs, sound recordings, motion pictures and computer programs.


A copyright notice, either as symbol or phrase, informs users of the underlying claim to copyright ownership in a published work.
Copyright law is different from country to country, and a copyright notice is required in about 20 countries for a work to be protected under copyright. Before 1989 all published works in the US had to contain a copyright notice, the © symbol followed by the publication date and copyright owner's name, to be protected by copyright. This is no longer the case and use of a copyright notice is now optional in the US, though they may still be used as a deterrent against infringement, or as a notice that the owner intends on holding their claim to copyright.

A copyright notice or copyright symbol is an identifier placed on copies of the work to inform the world of copyright ownership. While use of a copyright notice was once required as a condition of copyright protection, it is now optional. Use of the copyright notice is the responsibility of the copyright owner and does not require advance permission from, or registration with the Copyright Office.

Because prior law did contain such a requirement, however, the use of a copyright notice or copyright symbol is still relevant to the copyright status of older works.

Copyright notice was required under the 1976 Copyright Act. This requirement was eliminated when the United States adhered to the Berne Convention, effective March 1, 1989. Although works published without copyright notice before that date could have entered the public domain in the United States, the Uruguay Round Agreements Act (URAA) restores copyright in certain foreign works originally published without copyright notice.

How Is A Copyright Symbol Useful

Use of the copyright notice may be important because it informs the public that the work is protected by copyright, identifies the copyright owner, and shows the year of first publication. Furthermore, in the event that a work is infringed, if a proper notice of copyright appears on the published copy or copies to which a defendant in a copyright infringement suit had access, then no weight shall be given to such a defendant's defense based on innocent infringement. Innocent infringement occurs when the infringer did not realize that the work was protected. The use of the copyright notice is the responsibility of the copyright owner and does not require advance permission from, or registration with, the Copyright Office.

Correct Form For The Copyright Symbol

The notice for visually perceptible copies should contain all the following three elements:
  1. The copyright symbol © (the letter C in a circle), or the word "Copyright," or the abbreviation "Copr."
  2. The year of first publication of the work. In the case of compilations or derivative works incorporating previously published material, the year date of first publication of the compilation or derivative work is sufficient. The year date may be omitted where a pictorial, graphic, or sculptural work, with accompanying textual matter, if any, is reproduced in or on greeting cards, postcards, stationery, jewelry, dolls, toys, or any useful article.
  3. The name of the owner of copyright in the work, or an abbreviation by which the name can be recognized, or a generally known alternative designation of the owner.

Example: copyright © 2002 John Doe

The © or "C in a circle" notice or symbol is used only on visually perceptible copies.
refer : http://inventors.about.com/od/copyrights/a/CopyrightNotice.htm
          http://en.wikipedia.org/wiki/Copyright_notice


Sunday, March 6, 2011

DS-operations on queue.

Operations:
The main primitive operations of a queue are known as:
Add - adds a new node
Remove - removes a node
Additional primitives can be defined:
IsEmpty - reports whether the queueis empty
IsFull - reports whether the queue is full
Initialise - creates/initialises the queue
Destroy - deletes the contents of the queue (may be implemented by re-initialising
the queue)

Common operations from the C++ Standard Template Library include the following:
bool empty() - Returns True if the queue is empty, and False otherwise.
T& front() - Returns a reference to the value at the front of a non-empty queue. There is also a constant version of this function, const T& front().
void pop() - Removes the item at the front of a non-empty queue.
void push(const T& foo) - Inserts the argument foo at the back of the queue.
size_type size() - Returns the total number of elements in the queue.
 
 
Some other Operations on queue are :
1. enqueue - insert item at the back of queue 
2. dequeue - return (and virtually remove) the front item from queue 
3. init - intialize queue , reset all variables.

refer : http://en.wikipedia.org/wiki/Queue_%28data_structure%29
          http://harvestsoft.net/files/queue.pdf
          http://hamilton.bell.ac.uk/swdev2/notes/notes_13.pdf

Saturday, March 5, 2011

DS- multi linked list

Multi-Linked lists

A multiple linked list has several pointers in each node. They are used to traverse the nodes in different orders, for example one set of links ordered by date of birth and another ordered alphabetically by name.

A list can have two pointers without having a backward pointer. For instance, we may want to keep a set of data ordered on more than one "key". A key is a unique data item included in a record which distinguishes one record from all other records included in the list.  Suppose we want to be able to access customer accounts in order by account number (integer) and by customer name (string). We can in fact have one list that is ordered both ways. We need two pointer fields.  Each node of the list will have the form:

refer: http://frank.mtsu.edu/~csci217/manual/lab10/lab10.html#D

image006.jpg
 
Now, let's assume that we have a class called MultiListClass and that we wish to implement this list with a dummy header node.

 Here is an example list which implements the multi-linked list:

image007.jpg
Insertion and deletion require about twice the work since two sets of pointers must be adjusted: one for the name and one for the account number.  Essentially, you perform the same adjustments as in a singly linked list but you do it twice.

DS- doubly linked list (page 2)

Doubly-Linked Lists — linked lists containing integer values or pointers to data, with the ability to iterate over the list in both directions.

Each element in the list contains a piece of data, together with pointers which link to the previous and next elements in the list. Using these pointers it is possible to move through the list in both directions (unlike the Singly-Linked Lists which only allows movement through the list in the forward direction).

The data contained in each element can be either integer values, by using one of the Type Conversion Macros, or simply pointers to any type of data.

While adding or removing a node in a doubly-linked list requires changing more links than the same operations on a singly-linked list, the operations are simpler and potentially more efficient (for nodes other than first nodes) because there is no need to keep track of the the previous node during traversal or no need to traverse the list to find the previous node, so that its link can be modified.

refer : http://en.wikipedia.org/wiki/Doubly-linked_list
          http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html

DS- doubly linked list (page 1)

A doubly-linked list is a linked data structure that consists of a set of sequentially-linked records called nodes. Each node contains two fields, called links, that are references to the previous and to the next node in the sequence of nodes.


plsss...refer : http://richardbowles.tripod.com/cpp/linklist/doublist.htm


A doubly linked list is one where there are links from each node in both directions:





current
position





Data




Data




Data




Data


NULL
NULL




DS- link list v/s array (page 2 )

3)Memory allocation:
Most often, arrays are static. The drawback to this approach is that large arrays require large amounts of memory, which may go unused.
On the other hand, linked lists are usually dynamic. They can grow and shrink as needed at runtime. Due to this trait, linked lists are more appealing when the number of elements is unknown.

4) Accessing elements:
The elements within arrays are accessed by their indices. Thus, data access is easy and fast if you know which element to retrieve. If you don’t know the index of the element needed, but the elements are sorted based on some key value, you can perform highly efficient search algorithms to locate specific elements.

Linked lists are usually traversed element by element until a match is found. Because the memory for linked lists is not guaranteed to be contiguous, this list traversal is the only method for searching the list (without involving the use of other data structures as indices ). 


5) Making the decision:
If your data is best represented using a multidimensional structure, or the number of elements is known in advance and will remain consistent, an array is best. If your data is easily represented in one dimension, and the number of elements is unknown or is expected to change often throughout the operation of your program, a linked list is more efficient.

also refer :
http://geeksforgeeks.org/?p=10245
http://geekexplains.blogspot.com/2008/05/array-vs-linked-list-advantages-and.html

DS- link list v/s array ( page 1)

Arrays and linked lists are among the most common data structures, and each is applicable in different situations.

1) An array is an ordered arrangement of data elements that are accessed by their referencing indices.
A linked list is a group of items, each of which contains a pointer pointing to the next item.


2)Sizing:
Arrays can be one-dimensional or multidimensional, depending upon your requirements. For example, you could use a one-dimensional array to store the scores of all students in a class for one test. A multidimensional array would be better to store the scores of all students for all tests throughout the semester. Figure A provides an example of a one-dimensional array, and Figure B shows a multidimensional array.

Figure A
One-dimensional array


Figure B
Multidimensional array


In Figure B, the scores may be averaged by test (across), by student (down), or by class (entire array), while each unique score is maintained.

In contrast to arrays, linked lists are, by their very nature, one-dimensional. They can be singly linked lists, as shown in Figure C, where traversal of the list can be done in only one direction, or doubly linked lists, such as in Figure D, where each element points to both the previous element and the next element in the list.

Figure C
Singly linked list

Tuesday, March 1, 2011

CG-Bresenham’s circle drawing algorithm.

Bresenham's circle algorithm calculates the locations of the pixels in the first 45 degrees. It assumes that the circle is centered on the origin. So for every pixel (x,y) it calculates we draw a pixel in each of the 8 octants of the circle :

PutPixel(Center X + X, Center Y + Y)
PutPixel(Center X + X, Center Y - Y)
PutPixel(Center X - X, Center Y + Y)
PutPixel(Center X - X, Center Y - Y)
PutPixel(Center X + Y, Center Y + X)
PutPixel(Center X + Y, Center Y - X)
PutPixel(Center X - Y, Center Y + X)
PutPixel(Center X - Y, Center Y - X)

So let's get into the actual algorithm. Given a radius for the circle we perform this initialisation:

d := 3 - (2 * RADIUS)
x := 0
y := RADIUS
 Now for each pixel we do the following operations:

Draw the 8 circle pixels
if d < 0 then
    d := d + (4 * x) + 6
else
  begin
    d := d + 4 * (x - y) + 10
    y := y - 1;
  end;
 And we keep doing this until x = y. Note that the values added to the decision variable in this algorithm (x and y) are constantly changing, so we cannot precalculate them. The muliplications however are by 4, and we can accomplish this by shifting left twice.

Thursday, February 24, 2011

Graphics Workstation

A workstation is a high-end microcomputer designed for technical or scientific applications. Intended primarily to be used by one person at a time, they are commonly connected to a local area network and run multi-user operating systems. The term workstation has also been used to refer to a mainframe computer terminal or a PC connected to a network.


Computer intended for use by one person, but with a much faster processor and more memory than an ordinary personal computer. Workstations are designed for powerful business applications that do large numbers of calculations or require high-speed graphical displays.


Historically, workstations had offered higher performance than personal computers, especially with respect to CPU and graphics, memory capacity and multitasking capability. They are optimized for the visualization and manipulation of different types of complex data such as 3D mechanical design, engineering simulation (e.g. computational fluid dynamics), animation and rendering of images, and mathematical plots. Consoles consist of a high resolution display, a keyboard and a mouse at a minimum, but also offer multiple displays, graphics tablets, 3D mice (devices for manipulating and navigating 3D objects and scenes), etc. Workstations are the first segment of the computer market to present advanced accessories and collaboration tools.

 The term workstation is also sometimes used to mean a personal computer connected to a mainframe computer, to distinguish it from “dumb” display terminals with limited applications.

Workstation class graphics include:
  • Advanced technology including full floating point precision for superior image quality, high performance for large datasets and dual display/ultra-high resolution support.
  • Application certification for OpenGL and DirectX support on Windows® and Linux® .
  • Robust software and hardware compatibility testing to maximize uptime and productivity.
  • Support for workstation users with direct links to engineering resources.
refer : http://www.dell.com/content/topics/global.aspx/solutions/en/precision_graphics?c=us&l=en&cs=18


SHORT NOTE: INPUT DEVICES

Input Devices

  Any hardware device that sends data to the
computer, without any input devices, a
computer would only be a display device
and not allow users to interact with it,
much like a TV. To the right is a
Logitech trackball mouse, an example of an
input device. Below is a full listing of
all the different computer input devices
found on a computer.

Midpoint circle algorithm (explanation)

The midpoint circle algorithm is an algorithm used to determine the points needed for drawing a circle. The algorithm is a variant of  Bresenham's line algorithm, and is thus sometimes known as Bresenham's circle algorithm, although not actually invented by Bresenham.

 Advantages:
The midpoint method is used for deriving efficient scan-conversion algorithms to draw geometric curves on raster displays.
 The method is general and is used to transform the nonparametric equation f(x,y) = 0, which describes the curve, into an algorithms that draws the curve.


Disadvantages:
-time consumption is high
-the distance between the pixels is not equal so we wont get smooth circle.

The algorithm starts accordingly with the circle equation x2 + y2 = r2. So, the center of the circle is located at (0,0). We consider first only the first octant and draw a curve which starts at point (r,0) and proceeds upwards and to the left, reaching the angle of 45°.
The "fast" direction here is the y direction. The algorithm always does a step in the positive y direction (upwards), and every now and then also has to do a step in the "slow" direction, the negative x direction.





refer : http://en.wikipedia.org/wiki/Midpoint_circle_algorithm

Tuesday, February 22, 2011

OS-ASSEMBLER

Definition -

An assembler is a program that takes basic computer instructions and converts them into a pattern of  bits that the computer's processor can use to perform its basic operations.
It is a computer program to translate between lower-level representations of computer programs.


Typically a modern assembler creates object code by translating assembly instruction mnemonics into opcodes, and by resolving symbolic names for memory locations and other entities.
The use of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most assemblers also include macro facilities for performing textual substitution—e.g., to generate common short sequences of instructions as inline, instead of called subroutines.
Assemblers are generally simpler to write than compilers for high-level languages, and have been available since the 1950s. Modern assemblers, especially for RISC architectures, such as SPARC or POWER, as well as x86 and x86-64, optimize Instruction scheduling to exploit the CPU pipeline efficiently.

A program written in assembly language consists of a series of mnemonic statements and meta-statements (known variously as directives, pseudo-instructions and pseudo-ops), comments and data. These are translated by an assembler to a stream of executable instructions that can be loaded into memory and executed. Assemblers can also be used to produce blocks of data, from formatted and commented source code, to be used by other code.

OS-COMPILER

A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for wanting to transform source code is to create an executable program.

The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language or machine code).



refer:     http://www.personal.kent.edu/~rmuhamma/Compilers/MyCompiler/compilerIntro.htm
             http://www.webopedia.com/TERM/C/compiler.html
             http://whatis.techtarget.com/definition/0,,sid9_gci211824,00.html


OS-LOADER

LOADER:

 A loader is the part of an operating system that is responsible for loading programs, one of the essential stages in the process of starting a program, it means loader is a program that places programs into memory and prepares them for execution. Loading a program involves reading the contents of executable file, the file containing the program text, into memory, and then carrying out other required preparatory tasks to prepare the executable for running. Once loading is complete, the operating system starts the program by passing control to the loaded program code.

LOADER is an operating system utility that copies programs from a storage device to main memory, where they can be executed. In addition to copying a program into main memory, the loader can also replace virtual addresses with physical addresses.
Most loaders are transparent, i.e., you cannot directly execute them, but the operating system uses them when necessary.

In a computer operating system , a loader is a component that locates a given program (which can be an application or, in some cases, part of the operating system itself) in offline storage (such as a hard disk ), loads it into main storage (in a personal computer, it's called random access memory ), and gives that program control of the computer (allows it to execute its instructions).
A program that is loaded may itself contain components that are not initially loaded into main storage, but can be loaded if and when their logic is needed. In a multitasking operating system, a program that is sometimes called a dispatcher juggles the computer processor's time among different tasks and calls the loader when a program associated with a task is not already in main storage. (By program here, we mean a binary file that is the result of a programming language compilation, linkage editing, or some other program preparation process.)




Monday, February 21, 2011

OS- LINKER

  A linker or link editor is a program that takes one or more objects generated by a compiler and combines them into a single executable program.

Many operating system environments allow dynamic linking, that is the postponing of the resolving of some undefined symbols until a program is run. That means that the executable code still contains undefined symbols, plus a list of objects or libraries that will provide definitions for these.

Linkers can take objects from a collection called a library. Some linkers do not include the whole library in the output; they only include its symbols that are referenced from other object files or libraries. Libraries exist for diverse purposes, and one or more system libraries are usually linked in by default.

The linker also takes care of arranging the objects in a program's address space. This may involve relocating code that assumes a specific base address to another base. Since a compiler seldom knows where an object will reside, it often assumes a fixed base location (for example, zero). 

Linking is the process of combining various pieces of code and data together to form a single executable that can be loaded in memory.
Linking can be done at compile time, at load time (by loaders) and also at run time (by application programs). The process of linking dates back to late 1940s, when it was done manually. Now, we have linkers that support complex features, such as dynamically linked shared libraries.

Linkers and loaders perform various related but conceptually different tasks:
  • Program Loading.:  This refers to copying a program image from hard disk to the main memory in order to put the program in a ready-to-run state. In some cases, program loading also might involve allocating storage space or mapping virtual addresses to disk pages.
  • Relocation.:  Compilers and assemblers generate the object code for each input module with a starting address of zero. Relocation is the process of assigning load addresses to different parts of the program by merging all sections of the same type into one section. The code and data section also are adjusted so they point to the correct runtime addresses.
  • Symbol Resolution.: A program is made up of multiple subprograms; reference of one subprogram to another is made through symbols. A linker's job is to resolve the reference by noting the symbol's location and patching the caller's object code.

    So a considerable overlap exists between the functions of linkers and loaders.
    One way to think of them is: the loader does the program loading; the linker does the symbol resolution; and either of them can do the relocation.

Sunday, February 20, 2011

OS- CONTEXT SWITCHING

A context switch is the computing process of storing and restoring state (context) of a CPU so that execution can be resumed from the same point at a later time. This enables multiple processes to share a single CPU. The context switch is an essential feature of a multitasking operating system.

A context switch can mean a register context switch, a task context switch, a thread context switch, or a process context switch.


The scheduler is the part of the operating systems that manage context switching, it perform context switching in one of the following conditions:
  1. Multitasking: Within a preemptive multitasking operating system, the scheduler allows every task (according to its priority level) to run for some certain amount of time, called its time slice where a timer interrupt triggers the operating system to schedule another process for execution instead.
    If a process will wait for one of the computer resources or will perform an I/O operation, the operating system schedules another process for execution instead.
  2. Interrupt handling: Some CPU architectures (like the Intel x86 architecture) are interrupt driven. When an interrupt occurs, the scheduler calls its interrupt handler in order to serve the interrupt after switching contexts; the scheduler suspended the currently running process till executing the interrupt handler.
  3. User and kernel mode switching: Context switching can be described in slightly more detail as the kernel suspending execution of one process on the CPU and resuming execution of some other process that had previously been suspended. When a transition between user mode and kernel mode is required in an operating system, a context switch is not necessary; a mode transition is not by itself a context switch. However, depending on the operating system, a context switch may also take place at this time.
for more details visit:   http://www.linfo.org/context_switch.html
                                  http://simple.wikipedia.org/wiki/Context_switch
                                  http://en.wikipedia.org/wiki/Context_switch









OS- Spooling and Buffering

SPOOLING:


Acronym for simultaneous peripheral operations on-line, spooling refers to putting jobs in a buffer, a special area in memory or on a disk where a device can access them when it is ready. 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.

pls do refer :        http://www.webopedia.com/TERM/S/spooling.html
                           http://www.techterms.com/definition/spooling

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.

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 most common spooling application is print spooling .



BUFFERING:

buffer- A temporary storage area, usually in RAM. The purpose of most buffers is to act as a holding area, enabling the CPU to manipulate data before transferring it to a device.

Buffers are commonly used when burning data onto a compact disc, where the data is transferred to the buffer before being written to the disc.
Another common use of buffers is for printing documents. When you enter a PRINT command, the operating system copies your document to a print buffer (a free area in memory or on a disk) from which the printer can draw characters at its own pace. This frees the computer to perform other tasks while the printer is running in the background. Print buffering is called spooling.


A Buffer is a region of memory used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device (such as a keyboard) or just before it is sent to an output device (such as a printer). However, a buffer may be used when moving data between processes within a computer. This is comparable to buffers in telecommunication. Buffers can be implemented in either hardware or software, but the vast majority of buffers are implemented in software. Buffers are typically used when there is a difference between the rate at which data is received and the rate at which it can be processed, or in the case that these rates are variable, for example in a printer spooler.

Buffering: is reading and writing data from hdd takes long time.so to improve the speed for data processing the data next required by processor is stored is cache memory or cpu register.for e.g. to cut certain line from text file to copy into another file.cut data get stored in to buffer (cpu register) to get back stored into another file.



OS- MULTIPROCESSING

Multiprocessing is running a system with more than one processor.
Multiprocessing is the use of two or more central processing units (CPUs) within a single computer system.

Multiprocessing can be said to be either asymmetric or symmetric.
Asymmetric multiprocessing designates some processors to perform system tasks only, and others to run applications only. This is a rigid design that results in lost performance during those times when the computer needs to run many system tasks and no user tasks, or vice versa.
Symmetric multiprocessing, often abbreviated SMP, allows either system or user tasks to run on any processor, which is more flexible and therefore leads to better performance. SMP is what most multiprocessing PC motherboards use.

Multiprocessing operating systems enable several programs to run concurrently.
UNIX is one of the most widely used multiprocessing systems.

A system can be both multiprocessing and multiprogramming, only one of the two, or neither of the two.

 For more details refer : http://en.wikipedia.org/wiki/Multiprocessing

Saturday, February 19, 2011

OS- MULTITASKING


DEFINITION - 

Multitasking, in an operating system, is allowing a user to perform more than one computer task (such as the operation of an application program) at a time. The operating system is able to keep track of where you are in these tasks and go from one to the other without losing information.


Multitasking operating systems allow more than one program to run at a time. They can support either preemptive multitasking, where the OS *doles out time to applications (virtually all modern OSes) or cooperative multitasking, where the OS waits for the program to give back control (Windows 3.x, Mac OS 9 and earlier).

A multitasking operating system is any type of system that is capable of running more than one program at a time. Most modern operating systems are configured to handle multiple programs simultaneously, with the exception of some privately developed systems that are designed for use in specific business settings. As with most types of communications technology, the multitasking operating system has evolved over time, and is likely to continue evolving as communication demands keep growing in many cultures.



 for more details visit :      http://en.wikipedia.org/wiki/Computer_multitasking


*doles = distributes something.

OS- MULTIPROGRAMMING

Multiprogramming is one of the more basic types of parallel processing that can be employed in many different environments. Essentially, multiprogramming makes it possible for several programs to be active at the same time, while still running through a single processor.

Multiprogramming is very different from the multiprocessing because even though there may be several programs currently active, the uniprocessor is not simultaneously executing commands for all the programs. Instead, the processor addresses each program, executes a single command, then moves on to the next program in the queue. The previous program remains active, but enters into a passive state until the uniprocessor returns to the front of the queue and executes a second command. 

Multiprogramming is the rapid switching of the CPU between multiple processes in memory. It is done only when the currently running process requests I/O, or terminates. It was commonly used to keep the CPU busy while one or more processes are doing I/O. It is now mostly
 super ceded by multitasking, in which processes also lose the CPU when their time quantum expires.
Multiprogramming makes efficient use of the CPU by overlapping the demands for the CPU and its I/O devices from various users. It attempts to increase CPU utilization by always having something for the CPU to execute.
The prime reason for multiprogramming is to give the CPU something to do while waiting for I/O to complete. If there is no DMA, the CPU is fully occupied doing I/O, so there is nothing to be gained (at least in terms of CPU utilization) by multiprogramming. No matter how much I/O a program does, the CPU will be 100% busy. This of course assumes the major delay
is the wait while data is copied. A CPU could do other work if the I/O were slow for other reasons (arriving on a serial line, for instance).

Friday, February 18, 2011

MCA timetable..



MON
TUES
WED
THURS
FRI
9:15
CS (Pracs-BOTH BATCHES)
DS
P&S
OS
OS (PRACS-2)
DS (PRACS-1)
10:15
CS (Lec- Shirin maam)
DS
CS
DS

11:15
CS (Lec- Rashmi maam)
OS
OS (PRACS-1)
CG (PRACS-2)


12:40
FM
CG

CG (PRACS-1)
DS (PRACS-2)

DS
1:40
OS
FM

CG
DS
2:40
P&S
FM
FM
CG
CG
3:40
P&S
FM (TUT)
OS

P&S (TUT)