← Course overviewFree lesson 1 of 3 · lesson 1 of 21Next lesson →

Unlock all 21 lessons of Linux System ProgrammingFull course ₹40,000 · paid

Price & syllabus
Free lesson · 27 min · no payment

Linux OS Architecture, Device Files, Libraries and Shells

A free lesson from Skill-Lync's Linux System Programming course, on Grow by Skill-Lync · Last updated 16 Nov 2026 · Session: “Week 1 Session 1”

What will you learn in this free Linux System Programming lesson?

The instructor describes the Linux architecture, device files in /dev, and character, block and network drivers, then the kernel's tasks and kernel versus user mode. It compares polling, interrupt-driven and DMA input and output, builds a static library with a small sum function, and compares bash, ksh and csh shells and chroot.

  • Device files and character, block, network drivers
  • Kernel mode versus user mode and system calls
  • Polling, interrupt-driven and DMA I/O
  • Static versus dynamic libraries and shell types

What comes after lesson 1?

The next free lesson is lesson 2, “How Shells and System Calls Work: fork, execve, Trap and open” (23 min). Later in Skill-Lync's Linux System Programming course (paid): lesson 4, Week 1 Session 4; lesson 5, Week 2 Session 1; lesson 6, Week 2 Session 2. The full course has 21 lessons (7 h 25 min of video); see the course overview or its price and syllabus.

Lesson transcript

Machine transcript of the lesson audio (lightly cleaned). Technical terms may contain errors; the video is the reference.

This is Week 1, Session 1, Linux System Programming, Introduction to Linux Operating System. So, in this week, the table of content or what we are going to cover is the Linux Operating System Architecture, what is kernel, how the system calls, help in user applications to talk to. We will be looking into the memory management, virtual memory, physical memory, then we will be looking into the tracers, S-trace and L-trace and about the interrupts. So, the learning objectives of Week 1 are the Linux Operating System Architecture and kernel.

We will be looking into the system calls, we will be looking about memory management, then the tracers, S-trace. So, S-trace is the system call tracer, then L-trace is library tracer, then we will be looking into the interrupts, types of interrupts and interrupt service routines. We will be discussing about Linux Operating System Architecture, the major components of Linux Operating System Architecture are hardware, then on the operating system we have the kernel, that is in this figure is mentioned as a kernel mode, so operating system means kernel here.

Then we have the user interface programs or user applications which lies in the user mode and above that we have the web browser, the email reader, music player, some documents or maybe some application which does socket programming and so on and so forth. So, above kernel, inside the user interface program, there are some libraries, again the user interface program in this figure is shell, so shell lies between the kernel and the applications and is a part of user mode. So, to start with, we will understand that what is a device driver, so basically device driver is a computer program that communicates with devices attached to the PC, PC is our laptop using the device file.

So, so the point is what is a device file, so the point is what is a device file, we will explore it deeper into it, but basically device file is used for communication between user space and kernel space and device files are located in slash dev directory. So, so it's something like that, so it's something like that, if we want to write to the hard disk from the program, we will be writing to the device file, if we want to read from some hardware, like we want to read from keyboard, then we will be reading from the device file.

So, this is a device file, this is about the device file, and the device driver is basically, sits in the kernel, there can be different device drivers, like we have character device drivers, block device drivers, network device drivers, for example, character device drivers, rewrites one character at a time, block device drivers, rewrites a block at a time, for example, 500, 512 bytes or more, a network device drivers, a network device drivers, a network device drivers, reads a byte stream at a time, right, so basically, if we look into the figure, we can see that every device has its device driver, for example, the devices here are printer, a camera, and a CD-ROM, so they have their own device drivers, and inside the kernel, we have the different drivers, and then it talks to the kernel, the rest of the operating system, or to the user program using the device file, so, for example, I'll just draw a sort of a figure, in which, which will explain that how the device driver actually fits in into the picture, here, so we have this user space application, then, we have our device driver, here, and then, it interacts with the physical devices, here, something like this, so we have the user space applications, in the user space, and the applications, from the user space, calls, and the system calls, like open, read, write, and close, and those, and those are called over the device file, kernel, kernel, has the device driver, which, it sits inside the kernel space, and there are the file operation structures, which maps to the read, write, IO CTLs, read, write calls, and then, we have the physical devices, which actually takes actions, based on the operations, which are called in the device driver, using the file operation, structure, so, now, we are going to discuss, so, now, we are going to discuss about the Linux kernel, if we talk about Linux kernel, Linux kernel is a big chunk of code, so, I'll say, somewhere around 10 million lines of code, as it reported to be, and, there are different tasks, which the Linux kernel does, for example, the kernel, does the process management, so, in the process management, we can say, the creation, destruction of processes, inter-process communication, using signals and pipes, those are done in the process management, in memory management, doing the virtual addressing, from, like, mapping from, like, mapping from physical to virtual memory space, for all processes, are provided by the Linux kernel, then, in the file system management, kernel builds a structured file system, on top of an unstructured hardware, for example, the kernel provided file systems are, ext, ntfs, and so on, we'll, look into the, about the file system later, then, kernel also provides the device control, like, kernel, kernel has the device drivers, for each of the peripheral devices, present on the system, the hard drive, or the keyboard, so, those devices are controlled by the kernel, and the, one of the major task, is the TCP IP stack, the networking, have you ever wondered, have you ever wondered, that how, a packet actually, travels, from your phone, to, or maybe, what happens, when you, browse a website, or, open an app, and, you place order, on, any of the shopping website, so, basically, the packets travel, from your device, to, the destination device, and vice versa, and, if there is a Linux, operating system, anywhere in between, that will, that will have a TCP IP stack, which, does networking, that is, we'll also look into this, that is, it creates the packet, it fills the destination address, it fills the destination port, and, the type of content, you want to see, or, you want to buy, and, then, it sends across, so, this whole processing, creation of packet, and, then, when the packet comes back, understanding, understanding the packet, and, delivering it, to, appropriate, application, is the task of, the Linux kernel, and, then, if we look into, the figure, on, the right side, so, the, on, the Linux kernel, we have the virtual file system, then, we have, the sockets, which are used for, the, networking, that is, creating a socket, and creating a TCP, or UDP, connection, then, we, have, the device drivers, like we discussed, the character device drivers, network device drivers, kernel also, provides, the IO, that is, input, output, and, in the memory management, kernel does, the caching, virtual memory, and, paging, and, on the process management, kernel, handles the signals, then, kernel, does, the process scheduling, as well, So, about the Linux kernel, the mode of operations, are, two, one is, the kernel mode, and, the user mode, so, kernel mode, is, a VIP mode, which is, we say, a privileged space, where, only, the privileged applications, can run, it has, strong security, and access checks, for example, in a shopping mall, building owner, or, the highly, VIPs, or, the VIPs, or, maybe, the security staff, can take, the important decisions, change, the infrastructure, or, like, which, or, which, other, people, normal, people, going to, the mall, cannot do, so, and, user mode, is, a non-privileged, mode, which, in which, the user applications, run, in, the kernel mode, kernel, runs, while, in, the user, mode, applications, run, for example, shell, command line, and, the GUI, and, for accessing, the kernel, like, access methods, for, the kernel mode, is, only, through, the system calls, and, through, the hardware interrupts, so, we have, somewhere, around, 400, plus, system calls, and, to access, the user, mode, are, there, there, there, there, there are noства, it is, only, there are layers, there are noства, it is, only, there are always, there are no suafire Like you can just log in onto the Linux operating system, you are into the user mode. Then about the size, so if we talk about a 1000 GB of a hard disk, 1 TB hard disk, the size of kernel mode is somewhere around 4 GB, while the size of user mode or user space rather I will say, kernel space and user space is 966 GB.

So somewhere in some text we say it as a kernel space or kernel mode, that's the same and user space and user mode, those are also the same. So maybe we can talk about this more like in kernel we have the concept of protection rings. So in kernel we have a concept of protection rings or protection domains and that's we were discussing about the sizes actually. So the protection rings in kernel means different levels are provided to access the resources. So Linux has 4 rings while Windows 7 or Windows Server 2008 uses 2 rings.

So in the inner most ring we have the kernel, that is in ring 0, then in ring 1 we have device drivers, again in ring 2 we have less privileged device drivers and in ring 3 we have the user space applications. So here we have the kernel, so here we have the kernel, then here we have the device drivers, then here again we have the device drivers and here we have the applications. And this one we have the device drivers and this one we have the device drivers and this one we can think that it's not there.

And the privileges basically starts from here, so this is the most privileged, this is less privileged, so basically we can say the privileges starts something like this. It goes from here and it goes from here and it goes from here. So the kernel is most privileged, that is privilege level 0, while the other privileged device driver is privileged level 1, it lies in ring 1. Then the application basically lies in ring 3. So if we talk about this, yeah I was telling about the sizes basically.

So this is how basically the size of, if we assume this is the hard disk. So this part we have the ROM and ROM lies from 0 to 1 MB. So ROM contains the system BIOS, so let me just point out it contains the system BIOS, then it contains the interrupt vector table. So we will just discuss about the IVTs as well, interrupt vector table. Then it has an SMM area and it has some expansion RAM slots as well. So ROM lies from 0 to 1 MB.

Then this is all in the kernel space we are talking about. Then it has some empty space, empty area here. And then it has some space till here, which is for SMM TSEG. This is again a term in the kernel. So it's system management RAM. So you can just look into it. And then, so it lies this SMM and ROM in this empty space area actually extends to till 2 GB. And this 2 GB, we say it as a MM CFG config base. So there are some applications which actually starts parsing the ROM area or the kernel space.

So they basically look for this address. MM config in kernel is a fixed marker. So it will have some sort of XXYY marker. So if user space application starts parsing the kernel mode, kernel space. So when it will find this fixed marker, it will say that, yes, I have found the MM config base. So after that we have the PCI config space. And PCI config space is 256 MB. So now the PCI config space is the place where we have the PCI slots. We have the GPUs plugged onto the PCI slots.

We will discuss about that as well. Then we have something called MMIO low. So it's all inside the kernel space and the kernel space actually ends here. So basically if we think that this hole till here is our kernel space and then we have our user space. So this is our user space which starts from 4 GB and it ends till 1 TB. Then at the end also we have something as MMIO high. And this is again the kernel space. So this is whole of basically the user space.

So now what happens is system calls from the user space actually goes into the kernel space something like this. So here is the system call interface. So this is the overall idea about the protection rings, about the system calls, about the user space. So maybe you can get a bit of idea about it. So now what are the different input output methods in kernel? So this means that methods by which CPU communicates with input output devices. Example printers and disk etc. So there are majorly three kinds of input output methods in kernel.

First is the polling method. So in polling method CPU tests each of the IO device in sequence and asks each one that it needs communication with the CPU or not. So IO devices can be our keyboard, hard disk, mouse and then display unit and so on. Then other method is the interrupt driven. We will discuss about interrupts as well in this week only. So in this method devices itself tells when they need to talk to the CPU. So devices generates an interrupt. So we will discuss about what interrupts are.

So and in that case CPU will stop doing whatever tasks it's doing. It fulfills the device request and then it returns to the present task. The third is the direct memory access based. So here we have the DMA controller which does the interrupt handling. We will look into this. So to compare these three methods. Disadvantage of polling method is that huge amount of processor time is wasted in looping. So it has to go to each device and test whether it needs communication or not and so on.

Disadvantage of interrupt driven is interrupt driven IO is that if high number of interrupts comes at the processor. Then it can halt the presently running task of the process of which the task CPU was running. But the advantage of the interrupt driven approach is that it increases the throughput. So if some high priority task is there it can be scheduled and executed immediately. So basically what is the kernel? A Linux kernel is a computer program that exposes operating system services to users or programs. So if we see in this figure we have the hardware like a CPU, disk, terminals, etc.

Then we have the Linux operating system which is the kernel. We say it a kernel mode. Then we have the system call interface for the system call. So open, close, read, write, fork. These are the system calls. And then we have some libraries which says that we have the library interface. And then we have the standard utilities like shell, editor, compiler. So the shell can actually call the system calls directly or can use the library. It can have the library interface. So if we talk about the libraries in the Linux operating system.

So there can be two types of libraries that is one is the static library and one is a dynamic library. So there can be the two types of libraries here. One is the static library and the other is the dynamic library. So dynamic libraries are prefixed, postfixed by .so extension while the static libraries are postfixed by .a extension in Linux. If we talk about Windows, we have .lib files as static libraries and we have .dll files as dynamic libraries. There can be there, please. I don't think so.

But what basically the library is, so that's what I'll be telling you, if we talk about the static library, for example, we write a program, a very simple program, we have int, sum, int a, int b, and then we just return a plus b. So if this is in file called total.c, so if we compile it with c, for example, g++-c, total.c, it will create an object file. So object file will be total.o, so this is on the shell. So now, the object file will have some symbols.

Symbols means that it will have this sum function in it. Name mangled, so name mangled means function name changed, because name mangling only happens in c++. C doesn't have the concept of name mangling. And then we can create a static library using the AR command. AR, the static library name may be libsum.a, because we have a extension, and we'll be creating it from total.o. So in that case, if we do ls here, we'll find that we have lib, so it will create libsum.a. So now, basically, the use of the static library is, if we club the static library to our program, then we do not need to write this sum function again.

So how it is done, let me just show you that as well. Now we have our application code. We have our int main. And we, in our int main, we just call cout sum, 2 and 3, right? And before that, we'll just assume that we have sum in place, right? Sum, int, and int. And then if we compile it with our static library, that is g++, let's suppose this is test.c. So if we compile it with our test.c, and our library libsum.a, so it'll have something as a.out, a.out, and if we run this a.out, the output will be 5.

So it means that we can actually create these static libraries and dynamic libraries, test those well, write a best and a better code, and then we can link it with our main program and use them. So these static libraries and dynamic libraries actually are very useful. A third party or a company actually can write those and provide those to another company and they can basically use those. So, on the Linux kernel, we'll be discussing about the types of shells. So we have majorly three types of shells.

The first is bash shell. So it comes in, it has a .bash profile file. So it lies in the home folder of the user. And it's executed for all shell logins. So what, like, the shell login means, when you are at a remote machine, log in via SSH. So before first time, command prompt arrives, the bash shell or the bash profile is executed. Then we have the ksh or the bond shell. It comes with the .profile file. And we have kcsh shell. It comes with the login file.

So it has in your home directory as something as bash rc. So, for example, if we see here, I have a bash rc file. So if bash rc is there, so it means it's a kcsh shell and it's executed for the non-shell logins. What the non-shell logins means that when you are already logged onto the machine, now you open a new terminal using xterm, vnc or kde, then bash rc file is executed. So let me just go into this bash rc file, how it looks like.

So vim is the editor in Linux. We have different editors as well. So this file basically tells about the size, history size we can set. Then it tells about the window size after each command we need to set. Then it tells about the root, chroot. So every process or a command in Linux has a root directory. So chroot is used to change the root directory of currently running process as well as its child process. So changing the root directory of currently running and its child processes, right?

So this is also called a jailed directory. So jailed means if a process or command that runs in a specified environment cannot access files outside its root directory, then this modifying the environment is known as the chroot jail or jailed directory. So advantages of the jail is that we can create a sort of a test environment and we can recover the system passwords and we can reinstall the bootloader as well. So this jail or the chroot command actually comes handy at that place. Then we can provide the different colors as well to our terminal.

Then this is used for setting the X term title and so on like different stuff. We can set the alias like for this command LL can be used for this command LA and LS minus CF. If we do just L, then we can just do that. So yeah, so these are the different purposes of this is end of session one. Week one. Week one.

Want the rest of Linux System Programming?

Get the full course syllabus and fees.

The full course is paid (₹40,000). We'll send the syllabus and call you back within one working day.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Full course · paid

Unlock the full Linux System Programming course

The remaining 18 lessons, mentor-reviewed projects and a certificate come with the paid course (₹40,000). Leave your details: we'll send the syllabus and fees and call you back.

Get the syllabus and fees

A counsellor calls you back within one working day.

By submitting you agree to our Terms and Privacy Policy.

Grow by Skill-Lync · free lesson

Start watching

Free, no payment. Leave your details once and every free lesson on Grow plays straight away. A Skill-Lync counsellor may call you about the full Linux System Programming course.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.