Re: threads and kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shriramana Sharma wrote:

> > When a system call is invoked, the process which has invoked is being
> > interrupted and all the information needed to continue this process is
> > stored for later use.  Now, the process executes higher privileged
> > code that determines what to do next from examining the stack of the
> > less privileged code.  It contains information about the request to be
> > served by the kernel.  When it is finished, it control is returned to
> > the program, restoring the saved state and continuing program
> > execution.
> 
> So technically the kernel instructions would be processed "in" the same
> process and thread that makes the system call, albeit with different
> privelege, right? Or is the process *making the system call* totally
> "paused", as in a "wait" situation when one process waits for another to
> finish?

The kernel is a completely different "process" in so far as it has a
separate task descriptor, and thus a different memory layout etc.

The system call is executed in the same "flow" in that the INT-80
instruction causes the CPU to start executing kernel code; after the
system call has completed, control will eventually return to the
calling process at the instruction after the INT-80.

In that sense, it's similar to a function call, but the similarity
largely stops there.

-- 
Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux