The Linux OS

In order for computers to be flexible enough to do the many tasks they do, they need an operating system. An operating system, or OS, can be thought of as software that runs other software. If we think of computers as being a parade then the application software would be like the different floats. The OS would be the marshalls, in charge of every aspect of the floats design and also when the floats can go and how fast. A more technical explanation is that an OS moderates application requests for hardware or system resources on a computer. The operating system consists of the 1) the bootloader, which is software that handles the startup of the system. 2) The kernel, which manages memory, the CPU and other devices 3) Daemons - which are processes that run in the background 4) Networking - handling communication between other computers amongst others. In order to manage all of this, the OS needs to share memory, or free up new memory or fill memory. All of this requires going through the kernel, asking it’s permission, so to speak. The kernel is the master operator and all of these requests ultimately go through it. The OS achieves this by using system calls. If an application wants the OS to do something on its behalf, like print or save a file, it employs a syscall. To see a list of syscalls in the Linux OS, you can type m-a-n s-y-s-c-a-l-l-s. Some common syscalls are read and write. The Linux OS is really a family of operating systems all based on having similar core properties, or similar kernels. Just like the kernel in the middle of popcorn, the kernel is at the core of the operating system. The most basic kernel will have the kernel processes of 1) interprocess communication (IPC). This manages shared data between processes 2) virtual memory - which extends main memory by writing to a hard disk 3) scheduling - which decides on what task to run next. Now we know kind of what a kernel is and have a sense of how important one is. It’s so important that it is separated from the application (called user) memory space. This is so actions from programs don’t affect essential processes. An OS that uses the barest of processes is known as microlithic. Very little is in the kernel space of memory in this type of OS. The rest is for user processes. Linux is the opposite. It is MONOLITHIC. This means it not only puts scheduling, virtual memory management and IPC into the kernel space but more! This includes a file system, device drivers and system calls. The placement of device drivers in kernel space allows Linux to interrupt the device driver if need be, making the system more stable. The Linux kernel allows for modules to be loaded and unloaded during runtime. For completion sake there are also hybrid OSs which are between monolithic and microlithic. Windows and mac OS are considered hybrid. Back to Linux...Not only is Linux monolithic but it is also open sourced. The result of this is that there are a lot of different kinds of Linux or distributions. One of the most popular distributions of Linux is Ubuntu. Ubuntu is itself based on ANOTHER distribution called Debian. Specifically, it is based off of Debian’s “sid” development distribution, which means it is evolving constantly and unstable. If you are into cyber security in any capacity you may use a distribution of lInux known as Kali. It too is based off of Debian. The website distrowatch.com gives an idea of what distributions are the most popular. Ubuntu and Debian are 6th and 7th respectively as of the end of 2021. Ubuntu’s LTS (Long Term Support) variants come with 5 years of security updates. Debian is extremely stable and supports the most processor architectures than any other Linux distro. It can be slow to integrate new technology, however. The Number one downloaded distro is MX Linux which ALSO is based on Debian but it uses the stable branch of Debian, unlike Ubuntu. It aims to be current, easy to use and very GUI based. The distros occupying the 2nd and 3rd spot are EndeavorOS and Manjaro which are considered ARCH-based or like ARCH. I haven’t spoken about ARCH yet. It is different than all the Debian based Linux versions because you only install it once and then use the PACMAN package manager to keep it up to date. This is it’s weakness though because one thoughtless package error could make the whole OS unusable. The sites shodan.io can also allow you to compare the popularity of an os. Just type in os:linux or os:windows in the search field and you will get a sense of this. Opening up a terminal window in linux and typing the command u-n-a-m-e -a will give you information about the system that is running. Uname is a system call, which if you recall, is a request to the kernel directly. What will return is a row of information. The first item is the kernel name which will read Linux for Linux and maybe Darwin for Mac users. The second is the node name. This is the host name attached to the system by a network to identify it. Since machines can be a part of many different networks and it is assigned by the network, it is not always a constant. Also, the OS itself needs to use a different syscall to obtain this information. The syscall it uses is called gethostname and this gets the hostname of the calling PROCESS’S Unix Time Sharing namespace. The third entry is the kernel release and tells us the kernel version (the number before the dash) and the number after the dash has to do with patches. Also included is the version of OS and the system architecture that the kernel was packaged for. The fourth entry has some more kernel version information as well as the date when the kernel was compiled/built. If it has the letters SMP that stands for symmetric multiprocessing. SMP is when a computer has more than one CPU but has been configured to use them as one. If the letters SMP appear when you use the uname command, this means the kernel supports this type of system. Whether or not the kernel has been compiled for SMP can also be seen in the kernel configuration file. This file is most likely in your /boot directory and with config in the name. I had two in mine but I choose the one that had the same name as the release identifier. You can find this by typing in uname -r. The config file has lots of information about the kernel. The item that identifies SMP is called CONFIG_SMP. The machine hardware name, like x86_64 and amd64, the machine processor type, like i386 and AMD64 and the hardware platform are next. On my Linux, they are all the same. Finally, the last item is the operating system. Mine says GNU/Linux. What does the GNU mean? The Linux part refers to the kernel of the OS but the GNU refers to all of the rest of the OS. It is also open source and has a huge history of community contribution.

Comments

Popular posts from this blog

Nmap