Myths about penguins

Introduction h4> This article is for those who like a little more to learn about Linux, but feel free to ask any or until thoughtful. We'll start with the biggest disappointment - no Linux operating system.

Linux does not h4> To begin, let us look at the terminology and how a computer works. We have a program. Their work provides the operating system (OS). Operating system provides the kernel. Here is a matryoshka: Core - & gt; OS - & gt; Program.
On the big secret, so that "I put myself Linux" there is a great terminological confusion. It is true to say, for example, "I put myself Debian GNU / Linux".
The fact that Linux - is a universal kernel. It can work with any operating system compatible with it. In short Linux - it's just the kernel.
Operating system to which we are all accustomed to and which stands on our servers and desktops called GNU. GNU compatible with the Linux kernel and it is this OS is paired with this nucleus in most distributions.
And what is the distribution? Distribution - is a ready set of "core + OS + Programs." Each distribution - it's just a well-oiled and assembled the puzzle of the core OS Linux + GNU + set of programs. Such as Debian GNU / Linux.

By the way the same Debian has a version with a different kernel, the assembly has a keyword kfreebsd - is Debian GNU with the kernel of FreeBSD.

In general Linux does not, there is a core cool beautiful and versatile. At the core of this make OS mainframe (1st place in the world), servers (1st place in the world), desktop (3 in the world) and network equipment (eg for home routers).

How did it all begin? H4> Apart from the fact that we have already installed Debian GNU / Linux, it should run like that. Rather someone has to run it. Together with Debian is a universal boot loader - GRUB. Grub can run not only Linux, but any operating system and supports protocols multiboot - freebsd, netbsd, openbsd, any Linux + GNU, but you can not GNU. In addition Grub can run MacOS and Windows without multiboot.

So how do you start our computer with Linux?
First launched motherboard and its built-in programs. They organize processor to access BIOS code and launching a processor (CPU). CPU begins executing code BIOS.
The only problem BIOS in this case - to find and run the boot loader. He finds a boot on one of the disks. Here's what he found BIOS - is not the GRUB, boot-loader is 512 bytes. He called stage1. This small 512 byte loader, the only thing that makes - GRUB loads with the same disc.
Well GRUB loaded and we have a greeting screen with a choice of options and OS boot countdown to download in the "default". We are waiting for those three seconds ...
Next GRUB does the following.
It loads the Linux kernel into memory and the so-called initramfs. initramfs - is the minimum image system GNU, necessary in order to load the system itself. This image contains drivers for working with iron and there are settings required to run the OS.
Kernel and initramfs loaded and GRUB transfers control to the entry point in the nucleus. The kernel is initialized. Run a module that detects and records the hardware, file systems, network interfaces, and so on. When the kernel has completed its prelude - it runs the / sbin / init from initramfs. This program makes one problem - the preparations for the launch of the operating system - build RAID, LVM, mount file systems.
When the / sbin / init done his job happens magical operation - Change Root. Kernel kills loaded into memory initramfs image and mounts the root filesystem our OS.
After control is passed to / sbin / init is already in our "real" system. He also performs only one task - to run the program from startup list.
Programs run, set up your network to run a graphical shell.
Well, our operating system is loaded.

In short, all steps boot GNU / Linux:

  1. BIOS - loads the boot-loader
  2. boot-loader 512 bytes - loads grub
  3. GRUB - loads the kernel and initramfs
  4. The kernel looks for and Starting equipment
  5. initramfs (/ sbin / init) is preparing to run all OS
  6. Change Root on this system
  7. / sbin / init program starts the present system
  8. We see a greeting to log in (one of the running programs in step 7, for example gdm)

    Why so complicated? H4> Oh no! Everything just seems hard - every single part is simple and performs its task a little, each piece is a breeze. Do not believe me?

    BIOS, which will drive and load the 512-byte memory is easy. If I knew the specification on my motherboard, I would have written it in a few hours.

    boot-loader, which loads GRUB to simply impossible - he even weighs only 512 bytes. I wrote it a few times - believe me 40 minutes to do enough "for the eyes." It is very simple.

    GRUB only thing that can - download OS. By the way GRUB inside broken into small pieces and simple.

    Core - the only thing that can - working with iron and file systems. It is way too inside broken into small pieces - modules. Each module - only performs its task.

    Initramfs - simple to outrageous - it only files with kernel modules need to work with iron and file systems. And small / sbin / init, which is written in bash and simply collects RAID as it is written in the configuration, which is also easy to ugliness.

    Change Root - operation, which is written in the code of the kernel Linux, looks like magic, but trust me - it is simple to outrageous - to bang a few pages of memory and use already running modules to mount the root FS.

    / Sbin / init of the present system? Yes, it's just a cycle for, which will be held on files from the /etc/rc*.d in the correct order and start each file.

    OS is not complicated. Complex programs in it. Himself GNU / Linux is simple and transparent. The core of the most separated from the system boot is separated from the rest. Everyone makes small businesses and the result is a flexible and versatile system. This is an example of correct and beautiful architecture of the OS.

    kernel and modules h4> Kernel Linux - not a monolith. It would be too complicated, and nobody likes (maybe except for the Hindus of "some companies"). It is divided into modules. Each module is able to work with than one - with what that one piece of iron or file system or something that one.

    I'm not just writing kernel modules and it's really easy because most of you have already done, and you just need to do "their part".

    And that's all I currently have installed? I do not know! H4> Nothing to be able to not have to. The installation program, the same Debian GNU / Linux will automatically find your drives and will offer to customize FS. In general, setting FS - is the only thing that will have to be configured when installing Linux. On the FS and your drives herself and put GRUB boot-loader, install the operating system itself, and the kernel itself will make the image initramfs.

    In the end, it will prompt you to put a ready set of programs, such as Desktop. Feel free to place and you will have a ready-made and customized computer for work.

    How to manage it that then? H4> This is also not difficult. A regular user of the control system need only two commands:
    apt-get install program
    apt-get remove program

    Debian GNU / Linux so easy to use that you do not even have to look for the right software - everything is found for you, given the name and put it in the repository.
    You just tell the OS - "put me chromium" (apt-get install chromium) and after a few seconds you will already have downloaded and installed your favorite browser.

    I want to write too, Linux! H4> Linux - the kernel, GNU - like OS, Debian - like distribution - fully open source. Anyone can write something of my own, debug "for yourself" or "cats" and send a patch (or currently fashionable pull-request) meinteyneram. They will look at your code and idea and if it is really necessary to people thing - include it in the kernel, OS or distribution (depending on what you have written there).

    Where did the story of tambourines and "sex with Linux" h4> Such stories mass and they express their outrage. And the reason is simple resentment - I want to customize (I'm an admin), but do not want to read the documentation. Generally in Linux and GNU everything is standardized and described. If you excuse me, pervert and want to run Linux on a strange file system - read - whether it is able to GRUB. You will see whether the GRUB run your OS (read the file with the kernel and initramfs). In the same document read, possibly in GRUB will need to add a special module for your "weird" FS.

    The second reason drums - do not read the documentation, only to iron. Now on the market weight of iron. Not all hardware is supported by all operating systems. Do not believe me? Windows works everywhere? Put Windows 7 on IBM System-Z, and I laugh. This is a problem of some hardware manufacturers - the lack of public documents and in consequence of which the lack of drivers. Now Linux can be run on any hardware. Oddities occur with non-standard (or very rare equipment) usually acquire additional from the computer. Such things as a web-camera or graphics tablets are no longer a problem for Linux - almost all manufacturers of such equipment or have written driver or open documents and did the developers Linux. Yet, before you buy a piece of metal - make sure that Linux is familiar with it.

    everything is perfect? But there is a difficulty h4> Difficulties have - the only difficulty, which until now I have to get - office document formats. Unfortunately MS, as the monopoly of office software market has preferred not to disclose these formats. But I'm out of the situation easily - Google Docs, it is even more convenient than MS Office.

    Epilogue h5> The system GNU, Linux kernel and numerous distributions - simple. In this article, I was able to quickly and briefly tell you about one of the main tasks of the system - its load. And you realize! This suggests that all is not as hard and do not have to fear.

    Good luck to you, beginner Linuxoid (and maybe a future developer of this wonderful operating system kernel and GNU).

    Source: geektimes.ru/post/247134/

Tags

See also

New and interesting