Dharanyadevi blogspot subsume with E-books, Notes, Lab Manual, Question Banks, Interview Tips, Viva Questions, Basics and Interview Questions for engineering students. For Any Help Contact dharanyadevi@gmail.com

SEARCH

Image

Tuesday, June 26, 2012

Operating System:Interview, Viva and Basic Questions Part 6

Q1.Explain the meaning of Kernel.

The kernel is the essential center of a computer operating system, the core that provides basic services for all other parts of the operating system.

As a basic component of an operating system, a kernel provides the lowest-level abstraction layer for the resources.

The kernel's primary purpose is to manage the computer's resources and allow other programs to run and use the resources like the CPU, memory and the I/O devices in the computer.

The facilities provides by the kernel are :

  • Memory management
    The kernel has full access to the system's memory and must allow processes to access safely this memory as they require it.
  • Device management
    To perform useful functions, processes need access to the peripherals connected to the computer, which are controlled by the kernel through device drivers
  • System calls
    To actually perform useful work, a process must be able to access the services provided by the kernel.

Types of Kernel:

  • Monolithic kernels
    Every part which is to be accessed by most programs which cannot be put in a library is in the kernel space:

    Device drivers

    Scheduler

    Memory handling

    File systems

    Network stacks
  • Microkernels
    In Microkernels, parts which really require to be in a privileged mode are in kernel space:
    -Inter-Process Communication,

    -Basic scheduling

    -Basic memory handling

    -Basic I/O primitives

Due to this, some critical parts like below run in user space:

  • The complete scheduler
  • Memory handling
  • File systems
  • Network stacks

Q2.Explain the meaning of Kernel.

Kernel is the core module of an operating system. It is the kernel that loads first and retain in main memory of the computer system. It provides all essential operations /services those are needed by applications. Kernel takes the responsibility of managing the memory, task, disk and process.

Q3.What is a command interpreter?


The part of an Operating System that interprets commands and carries them out.

A command interpreter is the part of a computer operating system that understands and executes commands that are entered interactively by a human being or from a program. In some operating systems, the command interpreter is called the shell.

The BIOS is looking for the files needed to load in case of Windows is the Command.com. The required files are Command.com, IO.sys, and Msdos.sys to get Windows started. They reside in the Root of the C Drive.

Q4.What is a daemon?

In Unix and some other operating systems, a daemon is a computer program that runs in the background, It is not under the direct control of a user.

They are usually initiated as background processes. Daemons have names that end with the letter "d".
E.g. syslogd, sshd

In a Unix, the parent process of a daemon is usually the init process (PID=1). Processes usually become daemons by forking a child process and then having their parent process immediately exit, thus causing init to adopt the child process.

Q5.Explain the basic functions of process management.


The basic functions of the OS wrt the process management are :

  • Allocating resources to processes,
  • enabling processes to share and exchange information,
  • protecting the resources of each process from other processes and
  • enabling synchronisation among processes.

Q6.What is a named pipe?

A connection used to transfer data between separate processes, usually on separate computers.
Its a pipe that an application opens by name in order to write data into or read data from the pipe.
They are placed in the /dev directory and are treated as special files.
Using a named pipe facilitates interprocess communications.

Q7.What is pre-emptive and non-preemptive scheduling?

Tasks are usually assigned with priorities. At times it is necessary to run a certain task that has a higher priority before another task although it is running. Therefore, the running task is interrupted for some time and resumed later when the priority task has finished its execution. This is called preemptive scheduling.

Eg: Round robin
In non-preemptive scheduling, a running task is executed till completion. It cannot be interrupted.
Eg First In First Out

Q8.What is a semaphore?

A semaphore is a variable. There are 2 types of semaphores:

Binary semaphores
counting semaphores

Binary semaphores have 2 methods associated with it. (up, down / lock, unlock)
Binary semaphores can take only 2 values (0/1). They are used to acquire locks. When a resource is available, the process in charge set the semaphore to 1 else 0.

Counting Semaphore may have value to be greater than one, typically used to allocate resources from a pool of identical resources.

Q9.What is difference between binary semaphore and mutex?

The differences between binary semaphore and mutex are:

  • Mutex is used exclusively for mutual exclusion. Both mutual exclusion and synchronization can be used by binary.
  • A task that took mutex can only give mutex.
  • From an ISR a mutex can not be given.
  • Recursive taking of mutual exclusion semaphores is possible. This means that a task that holds before finally releasing a semaphore, can take the semaphore more than once.
  • Options for making the task which takes as DELETE_SAFE are provided by Mutex, which means the task deletion is not possible when holding the mutex.

Q10.Explain the meaning of mutex.


A mutex and the binary semaphore are essentially the same. Both can take values: 0 or 1. However, there is a significant difference between them that makes mutexes more efficient than binary semaphores.

A mutex can be unlocked only by the thread that locked it. Thus a mutex has an owner concept.

Q11.Explain the meaning of virtual memory.


Virtual memory is an approach to make use of the secondary storage devices as an extension of the primary storage of the computer.

It is the process of increasing the apparent size of a computer's RAM by using a section of the hard disk storage as an extension of RAM.

Logically-assigned memory that may or may not exist physically. Through the use of paging and the swap area, more memory can be referenced and allocated than actually exists on the system, thus giving the appearance of a larger main memory than actually exists.

Q12.What is RTOS?

A certain capability within a specified time constraint is guaranteed by an operating system called ‘real time operating system’. For example, certain object availability for a robot when it is assembled is ensured by a real time operating system. For making an object available within a designated time, the operating system would terminate with a failure. This is called a ‘hard’ real time operating system. The assembly line will be continued for functioning, but the output of production might be lower as the objects appearance is failed in a designated time, which causes the robot to be temporarily unproductive. This is called ‘soft’ real time operating system. Some of the real time operating systems qualities can be valuated by operating systems such as Microsoft’s Windows 2000, IBM’s OS/390 up to some extent. It means that, if an operating system does not qualify certain characteristics of the operating system enables to be considered as a solution to a certain real time application problem.

There is a requirement of real time operating system in small embedded systems which are bundled as part of micro devices. The requirements of real time operating systems are considered for some kernels. Since device drivers also needed for a suitable solution, a real time operating system is larger than just a kernel.

Q13.What is the difference between hard real-time and soft real-time OS?

Critical task completion on time is guaranteed by a hard real time system. The tasks needed for delays in the system are to be bounded by retrieving the stored data at the time which takes the operating system to complete any request.

A critical task obtains a priority over other tasks and maintaining that priority until the completion of the task. This is performed by a soft real time system. The system kernel delays need to be bounded as in the case of hard real time system

Q14.What type of scheduling is there in RTOS?

The tasks of real time operating system have 3 states namely, ‘running’, ’ready’, ‘blocked’. Only one task per CPU is being performed at a given point of time. In systems that are simpler, the list is usually short, two or three tasks at the most.

The designing of scheduler is the real key. Usually to minimize the worst-case length of time spent in the scheduler’s critical section, the data structure of the ready list in the scheduler is designed. This is done during the inhibition of preemption. All interrupts are disabled in certain cases. The data structure choice depends on the tasks on the ready list can perform at the maximum.

Q15.What is interrupt latency?

The time between a device that generates an interrupt and the servicing of the device that generated the interrupt is known as interrupt latency. Many operating systems’ devices are serviced soon after the interrupt handler of the device is executed. The effect of interrupt latency may be caused by the interrupt controllers, interrupt masking, and the methods that handle interrupts of an operating system

Q16.What is priority inheritance?

Priority inversion problems are eliminated by using a method called priority inheritance. The process priority will be increased to the maximum priority of any process which waits for any resource which has a resource lock. This is the programming methodology of priority inheritance.

When one or more high priority jobs are blocked by a job, the original priority assignment is ignored and execution of critical section at the highest priority level of jobs it blocks is performed. The job returns to the original priority level soon after executing the critical section. This is the basic idea of priority inheritance protocol

Q17.What is spin lock?

In a loop a thread waits simply (‘spins’) checks repeatedly until the lock becomes available. This type of lock is a spin lock. The lock is a kind of busy waiting, as the threads remains active by not performing a useful task. The spin locks are to release explicitly, although some locks are released automatically when the tread blocks

18.What is an operating system? What are the functions of an operating system?

An operating system is an interface between hardware and software. OS is responsible for managing and co-ordinating the activities of a computer system.

Functions of an operating system: Every operating system has two main functions –

1. Operating system makes sure that the data is saved in the required place on the storage media. Programs are loaded into the memory properly, and the file system of OS will keep the files in the order.

2. OS enables the hardware and software to interact and perform functionality like, printing, scanning, mouse operations, web cam operations. OS allows application softwares to interact with the hardware

Q19.What is paging? Why paging is used?

OS performs an operation for storing and retrieving data from secondary storage devices for use in main memory. Paging is one of such memory management scheme. Data is retrieved from storage media by OS, in the same sized blocks called as pages. Paging allows the physical address space of the process to be non contiguous. The whole program had to fit into storage contiguously.

Paging is to deal with external fragmentation problem. This is to allow the logical address space of a process to be noncontiguous, which makes the process to be allocated physical memory.

Q20.Difference between a process and a program

- A program is a set of instructions that are to perform a designated task, where as the process is an operation which takes the given instructions and perform the manipulations as per the code, called ‘execution of instructions’. A process is entirely dependent of a ‘program’.

- A process is a module that executes modules concurrently. They are separate loadable modules. Where as the program perform the tasks directly relating to an operation of a user like word processing, executing presentation software

Q21.What is the meaning of physical memory and virtual memory?

Physical memory is the only memory that is directly accessible to the CPU. CPU reads the instructions stored in the physical memory and executes them continuously. The data that is operated will also be stored in physical memory in uniform manner.

Virtual memory is one classification of memory which was created by using the hard disk for simulating additional RAM, the addressable space available for the user. Virtual addresses are mapped into real addresses.

Q22.What is the difference between socket and pipe?

Sockets:
Socket is a part of OSI layer model. Communication among different layers is performed through sockets. Application layer serves through some sockets to the presentation layer and upper application layer.

Sockets are used in Secure Socket Layer networks.

Communication is in bi-directional in sockets.

Pipes:
Pipes are related to processing in CPU.

Pipes are the segments for processes in execution. By processing multiple processes simultaneously, the productivity can be improved.

Communication is uni-directional in pipes

Q23.What are the difference between THREAD, PROCESS and TASK?

A program in execution is known as ‘process’. A program can have any number of processes. Every process has its own address space.

Threads uses address spaces of the process. The difference between a thread and a process is, when the CPU switches from one process to another the current information needs to be saved in Process Descriptor and load the information of a new process. Switching from one thread to another is simple.

A task is simply a set of instructions loaded into the memory. Threads can themselves split themselves into two or more simultaneously running tasks.

Q24.Difference between NTFS and FAT32

The differences are as follows:

NTFS:

- Allows the access local to Windows 2000, Windows 2003, Windows NT with service pack 4 and later versions may get access for some file.
- Maximum partition size is 2TB and more.
- Maximum size of file is upto 16TB
- File and folder encryption is possible.

FAT 32:

- Allows the access local to Windows 95, Windows 98, Windows ME, Windows 2000, Windows xp on local partition.
- Maximum partition size is 2TB
- Maximum size of file is upto 4GB
- File and folder encryption is not possible

Q25.Differentiate between RAM and ROM

RAM:

- Volatile memory
- Electricity needs to flow continuously
- Program information is stored in RAM
- RAM is read / write memory
- Cost is high

ROM:

- Permanent memory
- Instructions are stored in ROM permanently.
- BIOS has information to boot the system
- ROM is read only memory
- Access speed is less

Q26.What is DRAM? In which form does it store data?

DRAM – Dynamic Random Access Memory. One of the read / write memory. DRAM is cheap and does the given task. DRAM has cells made up of a capacitor and a transistor, where the data resides. Capacitors need to recharge for every couple of milliseconds. The process of recharging cells tends to performance slow down of DRAM as compared with speedier RAM types

Q27.What is cache memory? Explain its functions

Cache memory is RAM. The most recently processing data is stored in cache memory. CPU can access this data more quickly than it can access data in RAM. When the microprocessor starts processing the data, it first checks in cache memory.

The size of each cache block ranges from 1 to 16 bytes. Every location has an index that corresponds to the location which has data to access. This index is known as address. The locations have tags; each contains the index and the datum in the memory that is needed to be cached.

Q28.What is the function of SMON?

The SMON background process performs all system monitoring functions on the oracle database.

Each time oracle is re-started, SMON performs a warm start and makes sure that the transactions that were left incomplete at the last shut down are recovered.

SMON performs periodic cleanup of temporary segments that are no longer needed

Q29.Explain different types of segment.

There are four types of segments used in Oracle databases:

- data segments
- index segments
- rollback segments
- temporary segments

Data Segments:
There is a single data segment to hold all the data of every non clustered table in an oracle database. This data segment is created when you create an object with the CREATE TABLE/SNAPSHOT/SNAPSHOT LOG command. Also, a data segment is created for a cluster when a CREATE CLUSTER command is issued.

The storage parameters control the way that its data segment's extents are allocated. These affect the efficiency of data retrieval and storage for the data segment associated with the object.

Index Segments:
Every index in an Oracle database has a single index segment to hold all of its data. Oracle creates the index segment for the index when you issue the CREATE INDEX command. Setting the storage parameters directly affects the efficiency of data retrieval and storage.

Rollback Segments
Rollbacks are required when the transactions that affect the database need to be undone. Rollbacks are also needed during the time of system failures. The way the roll-backed data is saved in rollback segment, the data can also be redone which is held in redo segment.

A rollback segment is a portion of the database that records the actions of transactions if the transaction should be rolled back. Each database contains one or more rollback segments. Rollback segments are used to provide read consistency, to rollback transactions, and to recover the database.

Types of rollbacks:
- statement level rollback
- rollback to a savepoint
- rollback of a transaction due to user request
- rollback of a transaction due to abnormal process termination
- rollback of all outstanding transactions when an instance terminates abnormally
- rollback of incomplete transactions during recovery.

Temporary Segments:
The SELECT statements need a temporary storage. When queries are fired, oracle needs area to do sorting and other operation due to which temporary storages are useful.

The commands that may use temporary storage when used with SELECT are:
GROUP BY, UNION, DISTINCT, etc.

Q30. Explain SGA memory structures.

SGA (System Global Area) is a dynamic memory area of an Oracle Server. In SGA,the allocation is done in granuels. The size of the SGA is dependent on SGA_MAX_SIZE parameter.

The memory structures contained by SGA are:-

Shared Pool -
this memory structure is divided into two sub-structures which are Library Cache and Data Dictionary Cache for storing recently used PL/SQL statements and the recent data definitions. The maximum size of the Shared Pool depends on the SHARED_POOL_SIZE parameter.

Database Buffer Cache –
This memory structure improves the performance while fetching or updating the recently used data as it stores the recently used datafiles. The size of this block is decided by DB_BLOCK_SIZE.

Redo Log Buffer –
This memory structure is used to store all the changes made to the database and it's primarily used for the data recovery purposes. The size of this block is decided by LOG_BUFFER.

Java Pool –
This memory structure is used when Java is installed on the Oracle server. Size that can be used is stored in parameter named JAVA_POOL_SIZE.

Large Pool –
This memory structure is used to reduce the burden of the Shared Pool, as the Session memory for the Shared Server, as the temporary storage for the I/O and for the backup and restore operations or RMAN. Parameter that stores the maximum size is LARGE_POOL_

Q31.What is SQL Loader? Explain the files used by SQL Loader to load file.

SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle database. SQL*Loader supports various load formats, selective loading, and multi-table loads.

When a control file is fed to an SQL*Loader, it writes messages to the log file, bad rows to the bad file and discarded rows to the discard file.

Control file
The SQL*Loader control file contains information that describes how the data will be loaded. It contains the table name, column datatypes, field delimiters, etc.
controlfile.sql should be used to generate an accurate control file for a given table.

Log File
The log file contains information about the SQL*loader execution. It should be viewed after each SQL*Loader job is complete


Q32.Explain the methods provided by SQL Loader.

Conventional Path Load and Direct Path Load are the two methods of loading data.

Conventional Path Load is the default loading method and uses the SQL’s INSERT statements. It takes the following form:
INSERT INTO TABLE T partition (P) VALUES ...
The row is loaded if it maps with the portioned else an error log is written.

Direct Path Load: This method is faster than the conventional load method. In this method, the data to be loaded is parsed as per the description in the loader control file. It converts data for each input field with its corresponding data type and builds pairs in the form of pairs). The SQL *Loader then uses these pairs to build index keys and formats the oracle data blocks as per the pairs. These blocks are then written into the database. This reduces the processing load as compared to INSERT

Q33.What is the physical and logical structure of oracle?

Logical Database structures
Logical structures include tablespaces, schema objects, data blocks, extents and segments.

Tablespaces
Database is logically divided into one or more tablespaces. Each tablespace creates one or more datafiles to physically store data.

Schema objects
Schema objects are the structure that represents database's data. Schema objects include structures such as tables, views, sequences, stored procedures, indexes, synonyms, clusters and database links.

Data Blocks
Data block represents specific number of bytes of physical database space on disk.

Extents
An extent represents continuous data blocks that are used to store specific data information.

Segments
A segment is a set of extents allocated for a certain logical structure.

Physical database structure
The physical database structure comprises of datafiles, redo log files and control files

Datafiles
Datafiles contain database's data. The data of logical data structures such as tables and indexes is stored in datafiles of the database. One or more datafiles form a logical unit of database storage called a tablespace.

Redo log files
The purpose of these files is to record all changes made to data. These files protect database against failures.

Control files
Control files contain entries such as database name, name and location of datafiles and redo log files and time stamp of database creation

Q34.Explain the categories of oracle processes i.e. user, data writing processes, logging processes and monitoring processes.

  • User process – User process is used in invocation of application software.
  • Data writing process - A database writer process is used to write buffer content into a datafile. They are specifically used to write “dirty block” to data files from the buffer.
  • Logging processes - Log writer is used to write the redo log buffer from system global area to online redo log file. Only those redo entries are written hat have been copied into the buffer since the last time it wrote.
  • Monitoring process - this can be either a system monitor process or a process monitor process. System monitor process is mainly used for crash recovery and cleaning up of temporary segments. Process monitor is used to clean all resources acquired by a failed process

Q35.What is a compiler?

A compiler is a program that takes a source code as an input and converts it into an object code. During the compilation process the source code goes through lexical analysis, parsing and intermediate code generation which is then optimized to give final output as an object code

Q36.Explain loader and linker.

A loader is a program used by an operating system to load programs from a secondary to main memory so as to be executed.

Usually large applications are written into small modules and are then compiled into object codes. A linker is a program that combines these object modules to form an executable

Q37.Explain the types of memory.

The basic types of memories that a computer has are:

  • RAM Random access memory
  • ROM Read Only memory
  • Cache Memory
  • Other than these a computer also has secondary storage devices like a hard disk which also contribute towards it memory.

Q38.Define compactions.

Compaction is the process of reducing the amount of data needed for the storage or transmission of a given piece of information

Q39.What is dirty bit?

A dirty bit is a flag that indicates whether an attribute needs to be updated. Such situations usually occur when a bit in a memory cache or virtual memory page that has been changed by a processor but has not been updated in the storage

Q40.What is page fault and when does it occur?

A page is a fixed length memory block used as a transferring unit between physical memory and an external storage. A page fault occurs when a program accesses a page that has been mapped in address space, but has not been loaded in the physical memory

Q41.Define Thread.

Threads are small processes that for parts of a larger process. A thread is contained inside a process. Different threads in the same process share some resources

Q42.What are the advantages of using Thread?

Some advantages of using threads are:

- A process switching takes a longer time than that by threads.
- They can execute in parallel on a multiprocessor.
- Threads can share address spaces

Q43.Compare Thread and process.

Threads
Share address space
Have direct access to data segment of its process
Can communicate with other threads of the same process
Have no overhead
If a main thread gets affected, other threads to can get affected

Processes
Have own address space
Have own copy of data segment of the parent process
Processes must use IPC for communication within sibling processes
Have considerable overhead
Change in a parent process has no effect on the child processes

What are the different types of memory?

The memory types are:

SIMM - Single-Line Memory Modules: Used to store single row of chips which are soldered onto Printed Circuit Board.

DIMM – Dual-Line Memory Modules: Used to store two rows of chips which are soldered onto printed circuit board and enables to contain two times memory than SIMM

DRAM – Dynamic Random Access Memory: It holds data for short time period and will be refreshed periodically.

SDRAM - Static RAM – Holds data and refreshing does not required. It is faster than DRAM.

Flash Memory: A non volatile, rewritable and solid state memory which performs the functions of both RAM and hard disk combined. Data is retained in the memory, in case of power loss. It is ideal for printers, cellular phones, digital cameras, pagers.

Shadow RAM: Allows the moving of selected parts of BIOS code that is available in ROM to the faster RAM.

7 comments:

  1. Superb, what a website it is! This website provides helpful data
    to us, keep it up.

    Feel free to surf to my blog colon flush

    ReplyDelete
  2. You should take part in a contest for one
    of the greatest blogs on the web. I am going to highly recommend this blog!



    my web site ... saffron extract supplement (saffronextractreview123.weebly.com)

    ReplyDelete
  3. It's in fact very complicated in this busy life to listen news on Television, thus I only use world wide web for that reason, and get the newest information.

    Here is my webpage :: blue painters tape

    ReplyDelete
  4. I visited various blogs except the audio feature for audio
    songs present at this web site is genuinely wonderful.


    Take a look at my page; wagner 518080 control spray max hvlp sprayer

    ReplyDelete
  5. It's genuinely very complicated in this active life to listen news on TV, therefore I simply use web for that reason, and obtain the most recent news.

    Have a look at my blog: natural colon cleanse

    ReplyDelete
  6. Unquestionably believe that which you said.
    Your favorite justification seemed to be on the internet
    the simplest thing to be aware of. I say to you, I certainly get irked while people consider worries that they just do not know about.

    You managed to hit the nail upon the top as well as defined out
    the whole thing without having side-effects ,
    people could take a signal. Will likely be back to get more.

    Thanks

    Feel free to visit my page ... acid reflux remedies ()

    ReplyDelete

Refer this site 2 ur frndz