Sunday, November 09, 2008

Linux Boot Process and Init Process

The BIOS is the lowest level interface between the OS and the Computer system. The BIOS performs the integrity check on memory and and seeks instruction on the MBR of Hard-disk.

The MBR points to the boot-loader. The Boot process identifies the operating systems and asks the user to choose an OS label which identifies which kernel to run and where it is located (Hard-drive or Partition).

The Boot-loader loads the Linux operating system Kernel.
The first thing the kernel does is to load the init process. Init it the root/parent of all the processes on the Linux operating system.

The first processes that init starts is a script /etc/rc.d/rc.sysinit

Based on the appropriate run-level, scripts are executed to start various processes to run the system and make it functional.

Why use or switch to Linux/Unix ?

Linux was modeled on the Unix operating system first developed by Dennis Ritchie and Ken Thompson at AT&T. Unix was developed to run the largest network in world, the AT&T telephone system, and it did. The Unix operating system was designed to be scalable, reliable, modular, secure and portable with network extensibility.

The development of Unix led to POSIX standard which defines much of Linux architecture.
Linux is
Multiuser
Multitasking
Network enabled operating system

The Linux/Unix OS was designed to support remote and secure multi-user access using ssh.

The use of Linux/Unix pipes, tees and redirection allow a modular approach to the design of Linux/Unix tools. They allow the capability of any tool to be extended, chaining input and output with other tools. In operating systems like DEC/VMS, paging and formatting capabilities were built into a tool, instead of leveraging the capabilities of standard Linux/Unix tool components like "more", "sort", "less" and "awk".

Linux/Unix shell scripts provide a batch scripting capability which can be scheduled, propagated to other systems or used to create new commands. GUI only interfaces may require physical point and clicks on each system to perform a task. While some debate GUI vs commands and scripts, Linux/Unix embraces both.

The system startup and shutdown is controlled by the system initialization configuration file /etc/inittab and the init scripts in /etc/rc.d/init.d/... The system startup and shutdown procedures are configurable and extensible. One may control which services are started upon system boot and which are terminated on system shutdown, as well as the sequence dependencies. This allows for the orderly shutdown of databases and other sensitive programs which should be shutdown by the application itself, rather than killed while processing, which could lead to data corruption or loss. The system can be booted to various "init" states allowing the system to operate in various configurations to support maintenance and system debugging. On many competing operating systems, the shutdown procedure is not extensible or modifiable.

Linux avoids the MS/Windows "DLL HELL", which causes Windows or its applications to fail when a newer or incompatible run-time dynamic linked library (DLL) is installed. (See Microsoft DLL database used to help avoid conflicts.) Linux employs version numbers in its run-time shared object libraries, which can therefore coexist on the system with different versions of the same libraries. The Linux RPM package management system also helps resolve dependencies and conflicts with files and libraries.

Network settings and many other MS/Windows parameters require a reboot to take effect. This is also true when MS/Windows registry settings are modified. Linux is modular enough to allow the particular service (i.e. networking) to be cycled without shutting down the entire computer. Linux also has many kernel parameters which can be set through the "/proc/" interface to allow dynamic changes to a running kernel. This greatly increases Linux system uptime and eliminates the time wasted performing system reboots.

The file system directory structure is completely configurable and not limited to drive letters such as A, C or D as a top level mount point. Thus MS/Windows has a limit of 23 mount points. (22 + Floppy: A, B & System: C & DVD/CD: D.) Note: MS/Windows Server 2003 Server and Datacenter Edition can use volume mount points to get around this limitation. Linux file system mount points can be created at anywhere in the directory hierarchy. Multi-user versions of MS/Windows such as the server edition will allow a single user to map a network file system to a letter which is a local mount point. The MS/Windows OS will not allow a second user to map the same letter. Thus if an application is configured to read data from this mount point, the application is immediately limited to operation by a single user. The Linux/Unix file system is network enabled (using NFS) to extend it's reach. Both directly attached storage and networked file systems are mountable at any point in the file system directory hierarchy and can be simultaneously used by all users on the system.

The kernel is at the heart of the Linux/Unix operating system. It is responsible for enabling multi-tasking, multi-user, multi-threading, multi-processing, security, interfacing with hardware and the network. It is this kernel which Linus Torvalds developed, based on the Posix/Unix design, which gives Linux its name. Shells, user applications and everything else interfaces with this kernel. Linux kernel development is currently supported by OSDL.org, a consortium of telecommunications and computer software and hardware companies. The source code is published under the GNU General Public License (GPL). This license for Open Source software has led to the rapid development, debugging, deployment and acceptance by allowing and defining terms under which people can copy, modify and share the source code.

Hardware vendors such as IBM, Hewlett Packard and SGI have bet their future on Linux. Oracle has made it their development platform and thus the platform of first release. Deployment of corporate enterprise software such as SAP and Oracle on Linux as a primary platform have ensured that Linux is a cornerstone of the corporate computing infrastructure. The open source license has rid Linux of any suspicion of monopoly extension or restrictive and expensive licensing structures. It is also the nature of the Linux open source kernel software to be more bug free and secure than its competitors, as it is reviewed by developers everywhere rather than by a limited group of security analysts. Linux has been deployed commercially on a vast array of hardware from PDA's (Sharp Zaurus) to laptops, wokstations, servers, mainframes (IBM S/390) and supercomputers (SGI Altix, Beowulf clusters) and is making its way into more devices each day (routers, satellites, automobiles, ...).

Future and advanced development is ensured as the source code is available to all. It is studied in universities and institutions worldwide. PhD candidates and corporate researchers use Linux to try advanced computing concepts. The improvements when made available, must compete with other advanced concepts, and those which withstand the rigors of first users, and scrutiny of the development community, are approved and included into the Linux kernel. Once adopted as part of Linux, they then must also continue to survive challengers. This will help ensure that Linux is always the best it can be. Developers who submit source code know that it will face scrutiny from a worldwide pool of developers and reviewers, which motivates them to put forth well-written code.

Linux is here to stay; it is getting stronger day by day, and that is good from a technical, financial and economic point of view.

Wednesday, September 03, 2008

Computer Architecture Input/Output-part 1

Function Of Input/Output Modules :

1. Control and Timing.
2. Processor Communication
3. Device Communication
4. Data Buffering.
5. Error Detection



Input/Output Module Structure

Data transferred to and from the module are buffered in one or more DATA REGISTERS.
STATUS REGISTER provide status information. They may also act as Control Register, to accept detailed control information from the processor.
The logic within the module interacts with the processor via a set of control lines. The processor uses the control lines to issue the commands to the I/O Modules. Some of the control lines may be used by the I/O Module (eg. for arbitration and status signals). The module must also be able to recognize and generate addresses associated with the devices it controls. Each I/O Module has a unique address or, if it controls more then one external device, a unique set of addresses.

An Input/Output Module that takes on most of the detailed processing burden, presenting a high-level interface to the processor, is usually referred to as an I/O CHANNEL or I/O PROCESSOR.

An I/O Module that is quite primitive and requires detailed control is usually referred to as an I/O CONTROLLER or DEVICE CONTROLLER.

Tuesday, September 02, 2008

Elements of Cache Design

Main elements of Cache design are
  1. Cache Size : The size of the cache should be small enough so that the overall cost per bit is close to that of main memory alone and large enough so that overall access time is close to that of cache alone. Large caches tend to be slightly slower than smaller ones because of the fact that The larger the cache the larger the number of gates involved in addressing the cache.
  2. Mapping Function : Direct, Associative or Set Associative.
  3. Replacement Algorithm : LRU (Least recently Used), FIFO, LFU (Least Frequently Used) or some Random one.
  4. Write Policy : Write Through, Write Back or Write Once.
  5. Line Size
  6. Number of Caches : Single or two level and Unified or split.