You are on page 1of 10

. What is the difference in features between kernel 2.2, 2.4 and 2.6 ? 2.

What are Static and Shared libraries ? 3. What is dynamic linking ? What is static linking ? 4. What are the advantages of Dynamic linking or Shared libraries ? 5. Does gcc search for both static and shared libraries ? Which is searched initially by gcc compiler ? 6. What should be done for Shared library based linking in gcc ? 7. What should be done for static library based linking in gcc ? 8. What is object file and what are symbols ? 9. Can you tell the memory layout based on Data,BSS,HEAP and STACK ? 10. What are the ways in which linux kernel can be compiled ? 11. How will get the driver added into the kernel ? What are Kconfig files ? 12. What is a kernel module ? 13. What is the difference between insmod and modprobe ? 14. How will you list the modules ? 15. How do you get the list of currently available drivers ? 16. How will you Access userspace memory from kernel ? What are the various methods ? 17. What is the use of ioctl(inode,file,cmd,arg) ApI ? 18. What is the use of the poll(file, polltable) API ? 19. What is the use of file->private_data in a device driver structure ? 20. What is a device number ? 21. What are the two types of devices drivers from VFS point of view ? 22. What are character devices ? 23. How does the character device driver adds and remove itself from the kernel ? What is the use of register_chrdev and unregister_chrdev ? 24. What is the role of interrupts in a device driver ? How are interrupts handled in device driver ? 25. How will you make interrupt handlers as fast as possible ? 26. What are the types of softirqs ? 27. Difference between Timer Softirq and Tasklet Softirq ? 28. What are tasklets ? How are they activated ? when and How are they initialized ? 29. What is task_struct and how are task states maintained ? 30. What is rwlock and spinlock ? Briefly explain about both of them ? 31. When will you use rwlock instead of spinlock ? 32. Can spinlock/rwlock be used in Interrupt handler ? 33. Tell about the Memory Layout of a Process in Linux . 34. How will you trace the system calls made into the kernel of lInux ? 35. What is mmap ? MMAP & malloc ? MMAP & brk ? MMAP adv & dis-adv. 36. Tell the relation between Malloc and MMAP 37. Advantages of MMAP over Read ? 38. Tell the role of brk() in malloc / Tell the relation between heap and brk? 39. Example of using MMAP and MUNMAP in C ? 40. Tell about the method/steps in Linux Kernel Compilation. 41. What is Kmalloc and how does it differ from normal malloc ? or Why can't we use malloc in kernel code ? 42. What happens as soon as a packet arrives from the network in Linux ? 43. What is a stack frame, stack pointer & frame pointer ? 44. What is a profiler ? Which one have you used ? 45. How do you determine the direction of stack growth ?

Describe initial process sequence while the system boots up. 1) BIOS 2) Master Boot Record (MBR) 3) LILO or GRUB 4) Kernel 5) init 6) Run Levels............. What is a shell? What are shell variables? A shell us an interface to the user of any operating system.............. Explain how the inode maps to data block of a file. There are 13 block addresses in inode. The file descriptions type of file, access rights............. Explain some system calls used for process management. The following are the system calls: fork() - For creating child process ............. Explain how to get/set an environment variable from a program. An environment variable can get using the function getenv().............. Describe how a parent and child process communicates each other. The inter communication between a child process and a parent process can be done through normal communication............. What is a Daemon? Daemon is the short form for Disk and Execution Monitor.............. What is 'ps' command for? The shortage for process status is ps. This command is used to display the currently running processes on Linux/Unix systems.............. How the Swapper works? Moving the information from fast access memory and slow access memory and vice versa is known as swapping.............. What is the difference between Swapping and Paging? Swapping performs the whole process to transfer to the disk, where as paging performs............. What is Expansion swap? Expansion swap is a part of hard disk. This is reserved for the purpose of storing chunks of a program............. What is Fork swap?

For creation of child process, fork() system call is invoked. At the time of processing the fork() call by parent............. What are the requirements for a swapper to work? The functionality of a swapper is on the scheduling priority which is highest. The swapper searches............. What is the principle of locality? The next most data item or instruction is the closest to the current data item or instruction.............. What is page fault? Its types. One of the critical parts of code in the Linux kernel. It has a major influence on memory subsystems performance.............. Difference between the fork() and vfork() system call. fork: Both the parent and child share all of the page tables until any one of them does a write.............. What is BSS(Block Started by Symbol)? UNIX linkers produce uninitialized data segments.............. What is Page-Stealer process? Explain the paging states for a page in memory. The pages that are eligible for swapping are found by the Page-Stealer............. Explain the phases of swapping a page from the memory. The phases of swapping a page from the memory are:............. What is Demand Paging? Explain the conditions for a machine to support Demand Paging. The process of mapping a large address space into a relatively small amount of physical memory is known as demand paging.............. Difference between Fault Handlers and the Interrupt handlers. Fault handlers can sleep, where as interrupt handlers cannot.............. What is validity fault? In what way the validity fault handler concludes? Validity fault is the result of non setting of valid bits in main memory at the time of refererring a page by a process .............. What is protection fault? Protection fault is a name of an error. This error occurs when accessing storage space is tried............. Explain how the Kernel handles both the page stealer and the fault handler.

When the memory shortage occurs then the page stealer and fault handler thrashes.............. What is ex and vi? Explain their purposes. ex the line editor mode of vi editor. It allows to............. What is kill()? Explain its possible return values. kill() is a system call which stops a process. The return values of kill() are:............. Explain the steps that a shell follows while processing a command. The sequence of executing commands by shell are as follows:............. What is the difference between cmp and diff commands? Provide an example for each. Byte by byte comparision performed for two files comparision and displays the first mismatch byte.............. What is the use of grep command? Provide an example Grep stands for regular expression. grep command is used to find the patterns in a text file provided by the user.............. Difference between cat and more command. The file contents are displayed by cat command.............. What is du command? What is its use? The du (disk usage) command is used to report the size of directory trees.............. Explain the various prompts that are available in a UNIX system. UNIX supports 4 prompts: PS1: default prompt............. Describe how the kernel differentiates device files and ordinary files. There are 2 device files. They are character device file and block device file.............. Explain how to switch to a super user status to gain privileges. The command ?su? is used to get super user status..............

Linux - What are Pipes? Explain use of pipes


NEXT>> Linux - What are Pipes? Explain use of pipes - August 21, 2008 at 22:00 pm by Rajmeet Ghai

What are Pipes? Explain use of pipes.


Answer A pipe is a chain of processes so that output of one process (stdout) is fed an input (stdin) to another. UNIX shell has a special syntax for creation of pipelines. The commands are written in sequence separated by |. Different filters are used for Pipes like AWK, GREP. e.g. sort file | lpr ( sort the file and send it to printer) Uses of Pipe

Several powerful functions can be in a single statement Streams of processes can be redirected to user specified locations using >

Linux - What are Pipes? Explain use of pipes - August 21, 2008 at 22:00 pm by Rajmeet Ghai

What are Pipes? Explain use of pipes.


Pipe is a symbol used to provide output of one command as input to another command. The output of the command to the left of the pipe is sent as input to the command to the right of the pipe. The symbol is |. For example: $ cat apple.txt | wc In the above example the output of apple.txt file will be sent as input for wc command which counts the no. of words in a file. The file for which the no. of words counts is the file apple.txt. Pipes are useful to chain up several programs, so that multiple commands can execute at once without using a shell script

Linux - What is Linux and why is it so popular?

NEXT>> Linux - What is Linux and why is it so popular? - August 21, 2008 at 22:00 pm by Rajmeet Ghai

What is Linux and why is it so popular?


Answer Linux is an operating system that uses UNIX like Operating system. However, unlike UNIX, Linux is an open source and free software. Linux was originally created by Linus Torvalds and commonly used in servers. Popularity of Linux is because of the following reasons

It is free and open source. We can download Linux for free and customize it as per our needs. It is very robust and adaptable. Immense amount of libraries and utilities

Linux - What is Linux and why is it so popular? - May 11, 2009 at 13:00 pm by Vidya Sagar

What is Linux and why is it so popular?


Linux is a multiuser, multitask GUI based open source operating system developed by Linus Torvalds Torvalds has invited the community to enhance the Linux kernel and thousands of system programmers worked on to enhance. Prior to Linux, there is UNIX. The desktop work stations from various companies were based on UNIX. Later a numerous companies entered and each one of them had their own UNIX version. As the proprietary authority is owned by each company and the lack of central authority weaken UNIX. As Linux is free and runs on any PC platform it gained the popularity very quickly. The following are few more reasons for its popularity: - People who are familiar with UNIX can work on Linux with ease and comfort. - People who want great control over network security and on operating system

How does the linux file system work?


Answer Linux file structure is a tree like structure. It starts from the root directory, represented by '/', and then expands into sub-directories. All the partitions are under the root directory. If a partition is mounted (The mount point defines the place of a particular data set in the file system) anywhere apart from a device, the system is not aware of the existence of that partition or device. Directories that are only one level below the root directory are often preceded by a slash, to indicate their position. Explain file system of linux. The root "/" filesystem, /usr filesystem, /var filesystem, /home filesystem, /proc filesystem. Answer Root "/" file system: The kernel needs a root file system to mount at start up. The root file system is generally small and should not be changed often as it may interrupt in booting. The root directory usually does not have the critical files. Instead sub directories are created. E.g. /bin (commands needed during bootup), /etc (config files) , /lib(shared libraries). /usr filesystem : this file system is generally large as it contains the executable files to be shared amongst different machines. Files are usually the ones installed while installing Linux. This makes it possible to update the system from a new version of the distribution, or even a completely new distribution, without having to install all programs again. Sub directories include /bin, /include, /lib, /local (for local executables) /var filesystem : this file system is specific to local systems. It is called as var because the data keeps changing. The sub directories include /cache/man (A cache for man pages), /games (any variable data belong to games), /lib (files that change), /log (log from different programs), /tmp (for temporary files) /home filesystem: - this file system differs from host to host. User specific configuration files for applications are stored in the user's home directory in a file. UNIX creates directories for all users directory. E.g /home/my_name. Once the user is logged in ; he is placed in his home directory. /proc filesystem : this file system does not exist on the hard disk. It is created by the kernel in its memory to provide information about the system. This information is usually about the processes. Contains a hierarchy of special files which represent the current state of the kernel .Few of the Directories include /1 (directory with information about process num 1, where 1 is the identification number), /cpuinfo (information about cpu), /devices (information about devices installed), /filesystem (file systems configured), /net (information about network protocols), /mem (memory usage)

What is Kernel? Explain the task it performs.


Answer Kernel is used in UNIX like systems and is considered to be the heart of the operating system. It is responsible for communication between hardware and software components. It is primarily used for managing the systems resources as well. Kernel Activities:

The Kernel task manager allows tasks to run concurrently. Managing the computer resources: Kernel allows the other programs to run and use the resources. Resources include i/o devices, CPU, memory. Kernel is responsible for Process management. It allows multiple processes to run simultaneously allowing user to multitask. Kernel has an access to the systems memory and allows the processes to access the memory when required. Processes may also need to access the devices attached to the system. Kernel assists the processes in doing so. For the processes to access and make use of these services, system calls are used.

What is Kernel? Explain the task it performs.


Kernel is the component that is responsible for managing the resources of a computer system. The tasks are: - Provides the abstraction level for resources such as memory, processors, and I/O devices. -Performs inter process communication -Responds to system calls -Provides methods for synchronization and communication between processes.

Explain each system calls used for process management in linux.


Answer System calls used for Process management:

Fork () :- Used to create a new process Exec() :- Execute a new program Wait():- wait until the process finishes execution Exit():- Exit from the process Getpid():- get the unique process id of the process Getppid():- get the parent process unique id Nice():- to bias the existing property of process

Explain each system calls used for process management in linux.


Process management uses certain system calls. They are explained below. 1. To create a new process fork () is used. 2. To run a new program = exec () is used. 3. To make the process to wait = wait () is used. 4. To terminate the process exit () is used. 5. To find the unique process id getpid () is used. 6. To find the parent process id getppid () is used. 7. To bias the currently running process property nice () is used.

What are the process states in Linux?


Answer Process states in Linux:

Running: Process is either running or ready to run Interruptible: a Blocked state of a process and waiting for an event or signal from another process Uninterruptible: a blocked state. Process waits for a hardware condition and cannot handle any signal Stopped: Process is stopped or halted and can be restarted by some other process Zombie: process terminated, but information is still there in the process table.

What are the process states in Linux?


The following are the process states: 1. Running: This is a state where a process is either in running or ready to run. 2. Interruptible: This state is a blocked state of a process which awaits for an event or a signal from another process 3. Uninterruptible: It is also a blocked state. The process is forced to halt for certain condition that a hardware status is waited and a signal could not be handled. 4. Stopped: Once the process is completed, this state occurs. This process can be restarted 5. Zombie: In this state, the process will be terminated and the information will still be available in the process table.

What is Linux Shell? What is Shell Script?


Answer Linux shell is a user interface used for executing the commands. Shell is a program the user uses for executing the commands. In UNIX, any program can be the users shell. Shell categories in Linux are: Bourne shell compatible, C shell compatible, nontraditional, and historical. A shell script, as the name suggests, is a script written for the shell. Script here means a programming language used to control the application. The shell script allows different commands entered in the shell to be executed. Shell script is easy to debug, quicker as compared to writing big programs. However the execution speed is slow because it launches a new process for every shell command executed. Examples of commands are cp, cn, cd. Linux - What is Linux Shell? What is Shell Script? - August 21, 2008 at 22:00 pm by Rajmeet Ghai

What is Linux Shell? What is Shell Script?


Linux shell is the user interface to communicate with Linux operating system. Shell interprets the user requests, executes them. Shell may use kernel to execute certain programs. Shell Script: A shell script is a program file in which certain Linux commands are placed to execute one after another. A shell script is a flat text file. Shell scripts are useful to accept inputs and provide output to the user. Everyday automation process can be simplified by a shell script.

You might also like