Skip to Main Content
Professional Assembly Language
book

Professional Assembly Language

by Richard Blum
February 2005
Intermediate to advanced content levelIntermediate to advanced
574 pages
13h 18m
English
Wrox
Content preview from Professional Assembly Language

Chapter 12. Using Linux System Calls

The previous chapter showed how assembly language routines can be stored as functions that can be accessed by any program. This chapter describes another technique for accessing functions that involves using software interrupts.

Most operating systems provide core functions that application programs can access. Linux is not different. The core of the Linux operating system provides many functions that applications can access to easily access files, determine user and group permissions, access network resources, and retrieve and display data. These functions are called system calls.

This chapter first describes how the Linux operating system provides system calls and then examines the resources that can be used. Next, examples are shown for incorporating system calls into your assembly language programs. If you use a lot of system calls in your applications, you will probably need a method to use for debugging. The strace application is a great tool to use for watching system calls in action. It is described in this chapter, along with examples of different ways to use it. Finally, you'll see a comparison between using Linux system calls and C library functions.

The Linux Kernel

The core of the Linux operating system is the kernel. Before discussing system calls, it helps to understand what is happening under the hood of the operating system that provides the system calls. This section provides a brief description of the Linux kernel and explains ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Introduction to 80x86 Assembly Language and Computer Architecture, 2nd Edition

Introduction to 80x86 Assembly Language and Computer Architecture, 2nd Edition

Richard C. Detmer

Publisher Resources

ISBN: 9780764579011Purchase book