Operating System - HP-UX
1844065 Members
3072 Online
110227 Solutions
New Discussion

How shell->Kernel communication happens?

 
C.Krishna Prakash
Occasional Contributor

How shell->Kernel communication happens?

Hi,

Are(shell & kernel) they communicating thru machine langauge & how the communication happens....

Thanks in advance...
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: How shell->Kernel communication happens?

It happens quite well. And yes, ultimately it happens through machine language but essentially the answer to your question is "via system calls". All of the system calls are in section 2 of the man pages and they are the mechanism through which any application (including the shell) communicate with the kernel.
If it ain't broke, I can fix that.
dirk dierickx
Honored Contributor

Re: How shell->Kernel communication happens?

most shells are also available in source code, so you can always check out the code from bash or others.
Peter Godron
Honored Contributor

Re: How shell->Kernel communication happens?

Hi,
imagine a set of boxes, stacked within each other, like a russian doll.

The innermost box equates to the actual hardware of the machine(CPU/memory etc).

The next box is the kernel, which controls access and maintains control of the hardware.

The next bigger box is the application, one of which is a group of programs called shells, other may be C programs, browsers etc.

So, for an application to 'talk' to the memory, it needs to address the kernel, which is done via system calls, which may be dressed up as C functions, such as strcpy.
The request from the application is translated into machine-code and, via the kernel, executed.

A brief, but technical, overview at:
http://en.wikipedia.org/wiki/Kernel_%28computer_science%29

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.

So far you have not awarded any points to any answer (0 of 10) !

Dennis Handly
Acclaimed Contributor

Re: How shell->Kernel communication happens?

>Dirk: so you can always check out the code from bash or others.

Or use tusc to see the system calls.