Product SiteDocumentation Site

B.3. Inner Workings of a Computer: the Different Layers Involved

Komputer sering dianggap sebagai sesuatu yang agak abstrak, dan antarmuka yang terlihat secara eksternal jauh lebih sederhana daripada kompleksitas internalnya. Kerumitan seperti itu sebagian berasal dari banyaknya bagian yang terlibat. Namun, potongan-potongan ini dapat dilihat dalam lapisan-lapisan, dimana suatu lapisan hanya berinteraksi dengan yang berada tepat di atas atau di bawahnya.
An end-user can get by without knowing these details… as long as everything works. When confronting a problem such as, “The internet doesn't work!”, the first thing to do is to identify in which layer the problem originates. Is the network card (hardware) working? Is it recognized by the computer? Does the Linux kernel see it? Are the network parameters properly configured? All these questions isolate an appropriate layer and focus on a potential source of the problem.

B.3.1. Lapisan Terdalam: Perangkat Keras

Let us start with a basic reminder that a computer is, first and foremost, a set of hardware elements. There is generally a main board (known as the motherboard), with one (or more) processor(s), some RAM, device controllers, and extension slots for option boards (for other device controllers). Most noteworthy among these controllers are IDE (Parallel ATA), SCSI and Serial ATA, for connecting to storage devices such as hard disks. Other controllers include USB, which is able to host a great variety of devices (ranging from webcams to thermometers, from keyboards to home automation systems) and IEEE 1394 (Firewire). These controllers often allow connecting several devices so the complete subsystem handled by a controller is therefore usually known as a “bus”. Option boards include graphics cards (into which monitor screens will be plugged), sound cards, network interface cards, and so on. Some main boards are pre-built with these features, and don't need option boards.

B.3.2. The Starter: the BIOS or UEFI

Perangkat keras, berdiri sendiri, tidak mampu melakukan tugas-tugas yang berguna tanpa perangkat lunak terkait yang menggerakkannya. Mengendalikan dan berinteraksi dengan perangkat keras adalah tujuan dari sistem operasi dan aplikasi. Ini, pada gilirannya, memerlukan perangkat keras yang fungsional untuk berjalan.
Simbiosis antara perangkat keras dan perangkat lunak ini tidak terjadi dengan sendirinya. Ketika komputer pertama kali dinyalakan, beberapa penyiapan awal diperlukan. Peran ini diambil oleh BIOS atau UEFI, sepenggal perangkat lunak yang ditanamkan ke dalam main board yang berjalan secara otomatis saat mulai dinyalakan. Tugas utamanya adalah mencari perangkat lunak yang bisa dilimpahi kendali. Biasanya, dalam kasus BIOS, ini termasuk mencari hard disk pertama yang memiliki sektor boot (juga dikenal sebagai master boot record atau MBR), memuat sektor boot tersebut, dan menjalankannya. Selanjutnya, BIOS biasanya tidak terlibat (sampat boot berikutnya). Dalam kasus UEFI, prosesnya melibatkan pemindaian disk untuk mencari partisi EFI terdedikasi yang memuat aplikasi-aplikasi EFI yang selanjutnya dapat dieksekusi.
The boot sector (or the EFI partition), in turn, contains another piece of software, called the bootloader, whose purpose is to find and run an operating system. Since this bootloader is not embedded in the main board but loaded from disk, it can be smarter than the BIOS, which explains why the BIOS does not load the operating system by itself. For instance, the bootloader (often GRUB on Linux systems) can list the available operating systems and ask the user to choose one. Usually, a time-out and default choice is provided. Sometimes the user can also choose to add parameters to pass to the kernel, and so on. Eventually, a kernel is found, loaded into memory, and executed.
The BIOS/UEFI is also in charge of detecting and initializing a number of devices. Obviously, this includes the IDE/SATA devices (usually hard disk(s) and CD/DVD-ROM drives), but also PCI devices. Detected devices are often listed on screen during the boot process. If this list goes by too fast, use the Pause key to freeze it for long enough to read. Installed PCI devices that don't appear are a bad omen. At worst, the device is faulty. At best, it is merely incompatible with the current version of the BIOS or main board. PCI specifications evolve, and old main boards are not guaranteed to handle newer PCI devices.

B.3.3. Kernel

Both the BIOS/UEFI and the bootloader only run for a few seconds each; now we are getting to the first piece of software that runs for a longer time, the operating system kernel. This kernel assumes the role of a conductor in an orchestra, and ensures coordination between hardware and software. This role involves several tasks including: driving hardware, managing processes, users and permissions, the filesystem, and so on. The kernel provides a common base to all other programs on the system.

B.3.4. The User Space

Although everything that happens outside of the kernel can be lumped together under “user space”, we can still separate it into software layers. However, their interactions are more complex than before, and the classifications may not be as simple. An application commonly uses libraries, which in turn involve the kernel, but the communications can also involve other programs, or even many libraries calling each other.