Benefit of Kernel


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Benefit of Kernel
# 1  
Old 10-13-2012
Java Benefit of Kernel

So I was wondering what are the benefits of Unix kernel?

It does Process Management, File Management, Main Memory Management and Disk Management!

Why couldn't operating system take care of these things? why did we need another intermediate Smilie
# 2  
Old 10-13-2012
The kernel is the operating system. The intermediates you are thinking about are things like device drivers. You need some but not necessarily all drivers to accomplish a given task.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 10-13-2012
Let's put it this way: The Kernel hides a lot of "complexities" which would have made programming a computer a lot more complicated.

Back before operating systems (and kernels) were there people had to program for an explicit machine, sometimes in binary, and sometimes in assembly, which was a really simple way of coding.

Then, it was still horrible because people were still coding for just one machine and even then people had to think of all the possible "complexities" when using hardware - which bit for which function/value, when to send a bit, how long to wait.... basically even now if you want to go deep into stuff like "Process Management", "Disk Management" and "Ethernet" you can still find all that complexity is still there - Which bit, which signal, how long, hardware features, etc. And the complexities is not just about the bits. Each manufacturer wants to be different to say alive and so to encourage their hardware, they'd change one (but usually a lot) little thing, which in turn would be a lot to think about in terms of coding.

Now many programmers aren't bothered with these really fine details. Yeah, go ahead and ask the average Computer Science expert about the hardware on an really detailed level (what happens in the wires and the chips, electrical voltage, etc.), they would have to refer something - They might be able to give a partial answer skipping details on some of this stuff, but no one would have a "perfect" complete answer unless their specialization is on Computer Hardware itself. That's because NOW they don't have to worry about such an amount of detail of hardware.

Why?

Because those details have now been taken care of by something else. Now all they need to do is use the computer for what it's supposed to be used for - Making a Calculator, Making a Word Processor, etc. That something else is the Operating System (I'll get to Kernel, just wait).

For example, to make a program, say a Calculator on your computer (Let's say the program runs on MS-DOS) as , now all they need think about is:
1. Print a message asking the users for the numbers as input
2. Input the numbers
3. Input the operation they wanted to do (addition, subtraction, multiplication, division, etc)
4. Perform the operation
5. Print the output as a message

With an operating system, the programmer now literally has a function for each of the steps. The program is small, and he can finish this in less than 10 minutes. But if he was still working on Assembly he'd have to go like:
1. Initialize the Display for the appropriate Graphics Mode
2. Set a routine to read from the keyboard
3. Pixel by pixel, print the message to ask for input
4. With the routine in step 2, read the keyboard input AND detect the enter key being pressed to mark the end of input. Also make sure that the input is typed properly, and store the input into the proper location.
5. Perform the calculation. If it's addition/subtraction it's a one liner, else you have tons of work (and many a research paper suggesting the "optimal" way of doing multiplication, division, etc.)
6. The result is a binary number (Cause all the calculations in the previous step are only possible in binary), now you have to get each Decimal digit of the result (also be careful of negative numbers!)
7. And display that number on the screen, pixel by pixel.

It looks like only two more steps are added, but if you try to do it, it'll take days and months before you finish that program, and your head will probably be spinning after that. The operating system takes care of details such as printing "pixel by pixel", "initialize the display", "routine for the keyboard", etc. allowing programmers to just focus on the actual job to be done.

The Operating system does this by various ways. Some put this stuff as routines in assembly itself and leave the programmers with exposed routines to make things a lot simpler. Others implement a few simple operations in assembly and using these operations, implement the rest of the Operating System in a better language using these operations.

Another thing about operating systems is that they are supposed to provide functionality, but sometimes some functions are actually built on top of other functions. Take TCP/IP communication. It's a protocol to communicate using IP packets. And better yet you can use it over your wired ethernet and even over your wi-fi. NOW, someone has to code the protocol for everyone to use, but this code is based on the code used to use the Ethernet device and the Wi-Fi Device. That code depends on a lot of things (remember those "bits" and the "manufacturer" thing I was talking about earlier?)

And now we finally come to your answer (the short version) : An operating system has a lot of functions and purposes which are sometimes built on top of other functions and purposes (like the TCP/IP example above). The lowermost functions have to perform to the best possible, else the rest of the Operating system won't be awesome. So that functionality is put in the "kernel" - Process Management, File management, etc. Putting stuff in the "kernel" means various tradeoffs (making code with lots of "complexities" besides other stuff) based on how it's made which have to be planned really, really carefully. Putting stuff outside the kernel, which might make things a lot less complex, still has it's tradeoffs like performance, response, etc. to deal with.

There's a lot more design and technical stuff to go here, but I hope at least the short version helped.
These 2 Users Gave Thanks to roman015 For This Post:
# 4  
Old 10-14-2012
Lightbulb

Thanks.

so kernels are planned very very carefully, taking care of the complexities so that while making operating systems these complexities can be avoided!!

Last edited by DukeNuke2; 10-14-2012 at 05:32 PM..
# 5  
Old 10-14-2012
Your welcome.

P.S - Don't forget to press the Thanks button on the corner of the post if you found it useful.
This User Gave Thanks to roman015 For This Post:
# 6  
Old 10-14-2012
Quote:
Originally Posted by mahinkhan22
so kernels are planned very very carefully, taking care of the complexities so that while making operating systems these complexities can be avoided!!
The kernel is the operating system, at least the critical part of it.
This User Gave Thanks to Corona688 For This Post:
# 7  
Old 10-14-2012
Quote:
Originally Posted by Corona688
The kernel is the operating system, at least the critical part of it.
but there is a kernel and there is an operating system on the same machine! right?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Linux

Unload kernel module at boot time (Debian Wheezy 7.2, 3.2.0-4-686-pae kernel)

Hi everyone, I am trying to prevent the ehci_hcd kernel module to load at boot time. Here's what I've tried so far: 1) Add the following line to /etc/modprobe.d/blacklist.conf (as suggested here): 2) Blacklisted the module by adding the following string to 3) Tried to blacklist the module... (0 Replies)
Discussion started by: gacanepa
0 Replies

2. Solaris

Which file is read by kernel to set its default system kernel parameters values?

Hi gurus Could anybody tell me which file is read by kernel to set its default system kernal parameters values in solaris. Here I am not taking about /etc/system file which is used to load kernal modules or to change any default system kernal parameter value Is it /dev/kmem file or something... (1 Reply)
Discussion started by: girish.batra
1 Replies

3. Linux

Supermicro(dual core) server getting rebooted after "decompressing the kernel;booting the kernel" me

supermicro(dual core) server getting rebooted after "decompressing the kernel;booting the kernel" message comes. I tried giving acpi=off to the kernel command line but same problem.It shows everything ok and no problem with memory and processors and power supplies.Wt could be the reason? It has... (1 Reply)
Discussion started by: pankajd
1 Replies

4. Shell Programming and Scripting

what can i benefit as mechatronics eng.

hello , first i need to know what is a shell and what is a script ,and how can i benefit from shell and script programing as an mechatronics engineer? Thank you for ur time (1 Reply)
Discussion started by: abu_malek
1 Replies

5. Solaris

Benefit for authentication with Active Directory?

Hello all, I heard that we can use Solaris to authenticate user with Active Directory. However, I do not see the point why we need to do that?? what's the benefit to authenticate user with Active Directory??? Example, I have Solaris and I limited only 10 users can access Solaris production... (1 Reply)
Discussion started by: Smith
1 Replies

6. SuSE

max number of slabs per kernel module (kernel 2.6.17, suse)

Hi All, Is there a max number of slabs that can be used per kernel module? I'm having a tough time finding out that kind of information, but the array 'node_zonelists' (mmzone.h) has a size of 5. I just want to avoid buffer overruns and other bad stuff. Cheers, Brendan (4 Replies)
Discussion started by: Brendan Kennedy
4 Replies

7. Programming

kernel-kernel call communication

hi all! i have developed a mechanism in system.c to count how many times each kernel call is called. The results are held in an array in system.c . What i want to do is to create a new kernel call which will print this array. I need help in passing the array from system.c to the new kernel call. ... (5 Replies)
Discussion started by: aureliano
5 Replies
Login or Register to Ask a Question