sp123

Embed Size (px)

Citation preview

  • 8/8/2019 sp123

    1/9

  • 8/8/2019 sp123

    2/9

    Part A

    Q 1. System software is different from operating system. How?

    Solu-System software is computer software designed to operate the computer

    hardware and to provide and maintain a platform for running application

    software.

    System software helps use the operating system and computer system. It includes

    diagnostic tools, compilers, servers, windowing systems, utilities, language

    translator, data communication programs, data management programs and more.

    The purpose of system software is to insulate the applications programmer as

    much as possible from the details of the particular computer complex being used,

    especially memory and other hardware features, and such accessory devices as

    communications, printers, readers, displays, keyboards, etc.

    operating system (OS) 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 forcomputing applications run on

    the machine. One of the purposes of an operating system is to handle the resource

    allocation and access protection of the hardware. This relieves the application

    programmers from having to manage these details. Operating systems offer a

    number of services to application programs and users. Applications access theseservices through application programming interfaces (APIs) orsystem calls.

    http://en.wikipedia.org/wiki/Computer_softwarehttp://en.wikipedia.org/wiki/Computer_hardwarehttp://en.wikipedia.org/wiki/Computer_hardwarehttp://en.wikipedia.org/wiki/Application_softwarehttp://en.wikipedia.org/wiki/Application_softwarehttp://en.wikipedia.org/wiki/Interface_(computer_science)http://en.wikipedia.org/wiki/Computer_hardwarehttp://en.wikipedia.org/wiki/User_(computing)http://en.wikipedia.org/wiki/Applications_(computing)http://en.wikipedia.org/wiki/Software_developmenthttp://en.wikipedia.org/wiki/Application_programming_interfaceshttp://en.wikipedia.org/wiki/System_callshttp://en.wikipedia.org/wiki/Computer_softwarehttp://en.wikipedia.org/wiki/Computer_hardwarehttp://en.wikipedia.org/wiki/Computer_hardwarehttp://en.wikipedia.org/wiki/Application_softwarehttp://en.wikipedia.org/wiki/Application_softwarehttp://en.wikipedia.org/wiki/Interface_(computer_science)http://en.wikipedia.org/wiki/Computer_hardwarehttp://en.wikipedia.org/wiki/User_(computing)http://en.wikipedia.org/wiki/Applications_(computing)http://en.wikipedia.org/wiki/Software_developmenthttp://en.wikipedia.org/wiki/Application_programming_interfaceshttp://en.wikipedia.org/wiki/System_calls
  • 8/8/2019 sp123

    3/9

    Q 2. Operating system rules the system give your comments? Give its

    architectural details?

    Solu-

    Operating systems offer a number of services to application programs and

    users. Applications access these services through application programming

    interfaces (APIs) orsystem calls. By invoking these interfaces, the

    application can request a service from the operating system, pass

    parameters, and receive the results of the operation. Users may also interact

    with the operating system with some kind of software user interface like

    typing commands by using command line interface (CLI) or using a

    graphical user interface. For hand-held and desktop computers, the userinterface is generally considered part of the operating system.

    Operating system architecture

    The computer architecture of a computing system defines itsattributes as seen by the programs that are executed in thatsystem, that is, the conceptual structure and functional behaviorof the machine hardware. Then, the computer architect definesthe functions to be executed in the hardware and the protocol tobe used by the software in order to exploit such functions. Notethat the architecture has nothing to do with the organization ofthe data flow, the logical design, the physical design, and theperformance of any particular implementation in the hardware.

    By Architecture we mean the order in which certain hardwareProcesses are carried out by the OS and has nothing to do withthe logical software flow of the Computer.

    http://en.wikipedia.org/wiki/Application_programming_interfaceshttp://en.wikipedia.org/wiki/Application_programming_interfaceshttp://en.wikipedia.org/wiki/System_callshttp://en.wikipedia.org/wiki/Command_line_interfacehttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Application_programming_interfaceshttp://en.wikipedia.org/wiki/Application_programming_interfaceshttp://en.wikipedia.org/wiki/System_callshttp://en.wikipedia.org/wiki/Command_line_interfacehttp://en.wikipedia.org/wiki/Graphical_user_interface
  • 8/8/2019 sp123

    4/9

    An Operating System is the layer between the hardware andsoftware, as in

    Q 3. Assemblers, compilers, linker and loader are termed as programming

    systems? Giveexamples?

    Solu-

    Assemblers-assembler is used to translate assembly language statements

    into the target computer's machine code. The assembler performs a more or

    less isomorphic translation (a one-to-one mapping) from mnemonic

    statements into machine instructions and data. This is in contrast with high-

    level languages, in which a single statement generally results in many

    machine instructions.

    There are two types of assemblers based on how many passes through the

    source are needed to produce the executable program.

    Assemblers are generally simpler to write than compilers forhigh-level

    languages, and have been available since the 1950s. Modern assemblers,

    especially forRISC based architectures, such as MIPS, Sun SPARC, and HP

    PA-RISC, as well as x86(-64), optimize instruction scheduling to exploit the

    CPU pipeline efficiently.

    Compiler-A compiler is a computer program (or set of programs) that

    transforms source code written in a computer language (thesource language)

    into another computer language (the target language, often having a binaryform known as object code). The most common reason for wanting to

    transform source code is to create an executable program. Eg are c,c++ vb ,c#

    complers.

    http://en.wikipedia.org/wiki/Isomorphismhttp://en.wikipedia.org/wiki/Mnemonichttp://en.wikipedia.org/wiki/High-level_languagehttp://en.wikipedia.org/wiki/High-level_languagehttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/Compiler&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/High-level_language&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/High-level_language&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/RISC&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/MIPS_architecture&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/SPARC&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/PA-RISC&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/X86&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/X86-64&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/Instruction_scheduling&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/CPU_pipeline&wsc=tc&wsi=41769a25d4efd90ahttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Object_codehttp://en.wikipedia.org/wiki/Executablehttp://en.wikipedia.org/wiki/Isomorphismhttp://en.wikipedia.org/wiki/Mnemonichttp://en.wikipedia.org/wiki/High-level_languagehttp://en.wikipedia.org/wiki/High-level_languagehttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/Compiler&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/High-level_language&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/High-level_language&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/RISC&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/MIPS_architecture&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/SPARC&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/PA-RISC&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/X86&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/X86-64&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/Instruction_scheduling&wsc=tc&wsi=41769a25d4efd90ahttp://wap.google.com/gwt/x?ei=zNmBS_TxBqTU6gOzvoHzDQ&expid=ctrl&source=m&u=http%3A%2F%2Fen.wikipedia.org/wiki/CPU_pipeline&wsc=tc&wsi=41769a25d4efd90ahttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Object_codehttp://en.wikipedia.org/wiki/Executable
  • 8/8/2019 sp123

    5/9

    Loader-A loader is a routine that loadsan object program and prepars it for

    exeqution.there are various loading schemes: absolute,relocating,and direct

    linking.in general,the loader must load,relocate,and link the object program.

    Example-if a user wished to employee a squqre root subroutine, he woule have

    to right his main program so that it would transfer to the loacation assigned tothe square root routine (sqrt).his program and subroutine would be assembled

    together.if a second user wished to use the same subroutine ,he also would

    assemble it along with his qwn program,and yhe complete machine language

    translation would be loaded into memory.

    Linker-linkeris the part of an operating system (OS) that loads and links the

    shared libraries for an executable when it is executed. The specific operating

    system and executable format determine how the dynamic linker functions and

    how it is implemented. Linking is often referred to as a process that is

    performed at compile time of the executable while a dynamic linker is inactuality a special loader that loads external shared libraries into a running

    process and then binds those shared libraries dynamically to the running

    process.

    Part B

    Q 4. Give application areas of various types of operating system with

    examples?Solu- operating system is a software component of a computer system that is

    responsible for the management of various activities of the computer and the

    sharing of computer resources. It hosts the several applications that run on a

    computer and handles the operations of computer hardware

    Types of Operating Systems

    Within the broad family of operating systems, there are generally four types,

    categorized based on the types of computers they control and the sort of

    applications they support. The categories are:

    Real-time operating systems:

    They are used to control machinery, scientific instruments and industrial

    systems. An RTOS typically has very little user-interface capability, and no

    http://en.wikipedia.org/wiki/Linker_(computing)http://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Shared_librarieshttp://en.wikipedia.org/wiki/Compile_timehttp://en.wikipedia.org/wiki/Linker_(computing)http://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Shared_librarieshttp://en.wikipedia.org/wiki/Compile_time
  • 8/8/2019 sp123

    6/9

    end-user utilities, since the system will be a sealed box when delivered for use..

    In a complex machine, having a part move more quickly just because system

    resources are available may be just as catastrophic as having it not move at all

    because the system is busy.

    Single-user, single-tasking operating system:

    As the name implies, this operating system is designed to manage the computer

    so that one user can effectively do one thing at a time. The Palm O.S. for Palm

    handheld computers is a good example of a modern single-user, single-task

    operating system.

    Embedded System:

    The operating systems designed for being used in embedded computer systems

    are known as embedded operating systems. They are designed to operate on

    small machines like PDAs with less autonomy. They are able to operatewith a limited number of resources. They are very compact and extremely

    efficient by design. Windows CE, FreeBSD and Minix 3 are some examples

    of embedded operating systems.

    Single-user, multi-tasking operating system:

    This is the type of operating system most people use on there desktop and

    laptop computers today. Windows 98 and the Mac O.S. are both examples

    of an operating system that will let a single user has several programs in

    operation at the same time. For example, it's entirely possible for a Windows

    user to be writing a note in a word processor while downloading a file fromthe Internet while printing the text of an e-mail message.

    Multi-user operating systems:

    A multi-user operating system allows many different users to take advantage of

    the computer's resources simultaneously. The operating system must make sure

    that the requirements of the various users are balanced, and that each of the

    programs they are using has sufficient and separate resources so that a problem

    with one user doesn't affect the entire community of users. Windows 2000 and

    Novell Netware can each support hundreds or thousands of networked users,but the operating systems themselves aren't true multi-user operating systems.

    The system administrator is the only user for Windows 2000 or Netware. The

    network support and the entire remote user logins the network enables are, in

    the overall plan of the operating system, a program being run by the

    administrative user

  • 8/8/2019 sp123

    7/9

    Q 5. Operating system can be divided into how many parts give details of

    each?

    Solu-

    A UNIX operating system consists of a kerneland somesystem programs. There

    are also some application programs for doing work.

    Kernel-The kernel is the heart of the operating system. It keeps track of files on

    the disk, starts programs and runs them concurrently, assigns memory and other

    resources to various processes, receives packets from and sends packets to the

    network, and so on. The kernel does very little by itself, but it provides tools with

    which all services can be built. It also prevents anyone from accessing the

    hardware directly, forcing everyone to use the tools it provides. This way the

    kernel provides some protection for users from each other. The tools provided by

    the kernel are used viasystem calls.

    System programs- The system programs use the tools provided by the kernel to

    implement the various services required from an operating system. System

    programs, and all other programs, run `on top of the kernel', in what is called the

    user mode. The difference between system and application programs is one ofintent: applications are intended for getting useful things done (or for playing, if it

    happens to be a game), whereas system programs are needed to get the system

    working. A word processor is an application; mount is a system program. The

    difference is often somewhat blurry, however, and is important only to compulsive

    categorisers.

    shell -A shell is a piece of software that provides an interface for users to an

    operating system shell which provides access to the services of a kernel. However,

    the term is also applied very loosely to applications and may include any software

    that is "built around" a particular component, such as web browsers and email

    clients that are "shells" for HTML rendering engines

    .

    Q 6. Machine language differs from assembly language give examples?Write a program to

    display your name using any of machine languages?

    Solu-

    Machine language-Machine code or machine language is a system of

    instructions and data executed directly by a computer's central processing

    http://en.wikipedia.org/wiki/Computerhttp://en.wikipedia.org/wiki/Central_processing_unithttp://en.wikipedia.org/wiki/Computerhttp://en.wikipedia.org/wiki/Central_processing_unit
  • 8/8/2019 sp123

    8/9

    unit. Machine code may be regarded as a primitive (and cumbersome)

    programming language or as the lowest-level representation of a compiled

    and/orassembledcomputer program.. Machine code is sometimes called

    native code when referring to platform-dependent parts of language features

    or libraries. Machine code should not be confused with so called "bytecode",which is executed by an interpreter.

    Example-

    The MIPS architecture provides a specific example for a machine code whose

    instructions are always 32 bits long. The general type of instruction is given by

    the op (operation) field, the highest 6 bits. J-type (jump) and I-type (immediate)

    instructions are fully specified by op. R-type (register) instructions include an

    additional field funct to determine the exact operation. The fields used in these

    types are:

    6 5 5 5 5 6 bits

    [ op | rs | rt | rd |shamt| funct] R-type

    [ op | rs | rt | address/immediate] I-type

    [ op | target address ] J-type

    rs, rt, and rd indicate register operands; shamt gives a shift amount; and the

    address or immediate fields contain an operand directly.

    For example adding the registers 1 and 2 and placing the result in register 6 is

    encoded:

    [ op | rs | rt | rd |shamt| funct]

    0 1 2 6 0 32 decimal

    000000 00001 00010 00110 00000 100000 binary

    Load a value into register 8, taken from the memory cell 68 cells after the

    location listed in register 3:

    [ op | rs | rt | address/immediate]

    http://en.wikipedia.org/wiki/Central_processing_unithttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Compiledhttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Bytecodehttp://en.wikipedia.org/wiki/Central_processing_unithttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Compiledhttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Bytecode
  • 8/8/2019 sp123

    9/9

    35 3 8 68 decimal

    100011 00011 01000 00000 00001 000100 binary

    Jumping to the address 1024:

    [ op | target address ]

    2 1024 decimal

    000010 00000 00000 00000 10000 000000 binary

    Assembly language-A program written in assembly language consists of a

    series of instructions--mnemonics that correspond to a stream of executable

    instructions, when translated by an assembler, that can be loaded into memory

    and executed.

    For example- an x86/IA-32 processor can execute the following binary

    instruction ('MOV') as expressed in machine language (see x86 assembly

    language):

    Hexadecimal: B0 61 (Binary: 10110000 01100001)

    The equivalent assembly language representation is easier to remember

    (example in Intel syntax, more mnemonic):

    MOV AL, 61h

    This instruction means:

    Move (really a copy) the hexadecimal value '61' into the processor register

    known as "AL". (The h-suffix means hexadecimal or = 97 in decimal)