Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
CARE

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents
Up to --> The Operating System

· The Kernel
· Memory Management
· Processes
· Kernel Mechanisms
· Interrupts Exceptions and Traps
· System Calls
· Linux Data Structures

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Recommend Us
Surveys

Features
HOWTOs
News
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 141 guest(s) and 3 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  
Linux Tutorial - The Operating System - The Kernel - System Calls
  Interrupts Exceptions and Traps ---- Linux Data Structures  


System Calls

If you are a programmer, you probably know what a system call is and have used them many times in your programs. If you are not a programmer, you may not know what it is, but you still use them thousands of times a day. All "low-level" operations on the system are handled by system calls, including such actions as reading from the disk or printing a message on the screen. System calls are the user's bridge between user space and kernel space. This also means that they are the bridge between a user applicationand the system hardware.

Collections of system calls are often combined into more complex tasks and put into libraries. When using one of the functions defined in a library, you call a library function or make a library call. Even when the library routine is intended to access the hardware, it will make a system call long before the hardware is touched.

Each system call has its own unique identifying number. The kernel uses this number as an index into a table of system call entry points, which point to where the system calls reside in memory along with the number of arguments that should be passed to them.

When a process makes a system call, the behavior is similar to that of interrupts and exceptions. Like exception handling, the general purpose registers and the number of the system call are pushed onto the stack. Next, the system call handler is invoked, which calls the routine within the kernel that will do the actual work.

Although there are hundreds of library calls, each of these will call one or more systems calls. In total, there are about 150 system calls, all of which have to pass through this one point (referred to as a "call gate") to ensure that user code moves up to the higher privilege level at a specific location (address)within the kernel. Therefore, uniform controls can be applied to ensure that a process is not doing something it shouldn't.

As with interrupts and exceptions, the system checks to see whether a context switch should occur on return to user mode. If so, a context switch takes place. This is possible in situations where one process made a system call and an interrupt occurred while the process was in kernel mode. The kernel then issued a wake_up() to all processes waiting for data from the hard disk.

When the interrupt completes, the kernel may go back to the first process that made the system call. But, then again, there may be another process with a higher priority.

 Previous Page
Interrupts Exceptions and Traps
  Back to Top
Table of Contents
Next Page 
Linux Data Structures


MoreInfo

Test Your Knowledge

User Comments:


You can only add comments if you are logged in.

Copyright 2002-2009 by James Mohr. Licensed under modified GNU Free Documentation License (Portions of this material originally published by Prentice Hall, Pearson Education, Inc). See here for details. All rights reserved.
  
Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.


Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
You can choose larger fonts by selecting a different themes.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.09 Seconds