A brief understanding of what the Linux Kernel does
When people refer to Linux, they are often refering to the entire operating system, ie user and system applications and the user interfaces to use them, such as Gnome. In reality Linux refers to the Kernel at the heart of it all, the one originally developed by Linus Torvalds. As my project involves working with the Kernel and making changes (hacking) to it I decent understanding of what it does is essential. In this post I outline (very briefly and crudely) the main functions of the Kernel.
The kernel serves one main purpose, I means for applications to access the underlying hardware and resources they need to run. This might not seem like a complex thing but in reality it is a hugely elaborate task. Computer hardware is both complex and varied, no programmer wants to have to concern themselves with the intricacies of how a hard drive works or whether it's data is stored in RAM or swap, and so it is the Kernels task to provide a level of abstraction between the hardware and software aka a "Linux virtual machine".
Some of the more obvious abstractions it provides include:
Filesystem,
One of the most basic functions of most software is the ability to read and write files, but as I mentioned above no programmer wishes to have to bother with the intricacies of how a hard drive works or what form of media the file is stored in. And so the Kernel provides abstractions the programmer can use to carry out these tasks, for example in C we have the open(), close(), read() and write() system calls. With these the programmer can carry out file operations without worrying about how many cylinders the hard drive has or whether the partition is Ext2 or FAT16 because the Kernel will take care of these for them.
Process scheduling,
If you were to open your OS's process monitor/task manager/activity monitor or what ever you r choice of OS calls it you are likely to find that there are tens of processes running at any one time. Whilst writing this post there were 65 processes running on my laptop, but even the latest fancy intel processor in my laptop can only process 2 things at a time. So how does a computer manage to run 65 processes at once without grinding to halt. Logic would say that with only 2 processes able to be processed at once that the other 63 would have to wait for those 2 to finish before they could all vie for processor time themselves. This is where once again the kernel comes in to play. The kernel's scheduler allocates CPU time to each one, so that if you look over a longer timescale (a few seconds) you have the illusion that the computer is running several programs at the same time. The idea is to allow each process a small amount of processing time before another process is given the same opportunity. This gives the illusion of multitasking, when in reality several processes are swapped in and out of the COU very quickly, usually quick enough for the user not to notice.
I'll be spending quite a bit of expanding on this particular topic in the future as it is the focus of my final year project.
Memory managment,
One of the oft forgotten functions of the kernel is memory management. Each process runs under the illusion that it has it's own address space. In reality, it's sharing the available memory with every other process, and if the system is running low on memory, some of its address space may even extend to a swap partition on the hard drive. An important aspect of memory management is security, ensuring that processes can only access the parts of memory they are allowed to, an important aspect of any multiprocess system.
I will finish this later..