Courses/Computer Science/CPSC 457.F2013/Lecture Notes/SystemCalls

From wiki.ucalgary.ca
< Courses‎ | Computer Science‎ | CPSC 457.F2013‎ | Lecture Notes
Revision as of 01:46, 26 September 2013 by Cmah (talk | contribs) (System Calls)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

System Calls

We will work from our previous discussion of x86 assembly language programming and see how system calls are made (i.e., their calling convention on x86/Linux), how they are defined, how they can be traced, and how they differ from "normal" function calls.


Notes

We saw how we could talk directly to the kernel via the syscall interface

  • now let's write a program using write(2)
  • compare this with our assembly version mywrite.asm
  • what is the nature of this interface? (combined API and privilege transition mechanism)
  • where are the parts documented?
    • manual pages for syscall definitions (syntax and semantics)
    • show locations of syscall number definitions: /usr/include/asm/unistd_32.h
  • what is the actual mechanism?


Links to kernel code:

Scribe Notes

Readings

  • MOS: 1.6: System Calls (you should have read this already)
  • LKD: Chapter 5. System Calls (this describes how to add a system call to your OS, something you'll have an opportunity to practice in your tutorials later and in HW3)