Operating System: Three Easy Pieces --- LDE (Note)

ASIDE: Why System Calls Look Like Procedure Calls?

You may wonder why a call to a system call, such as open() or read() looks exactly like

a typical procedure call in C; that is, if it looks just like a procedure call, how does the

system know it is a sytem call, and do all the right stuff? The simple reason: it is a procedure

call, but hidden inside that procedure call is the famous trap instruction. More specifically,

when you call open() (for example), you are executing a procedure call into the C library.

Therein, whether for open() or any of the other syscall calls provided, the library uses an

agreed-upon calling convention with the kernel to put the arguments to open in well-known

locations.

时间: 2024-11-06 02:02:40

Operating System: Three Easy Pieces --- LDE (Note)的相关文章

Operating System: Three Easy Pieces --- Process (Note)

1. How can the operating system provide the illusion of a nearly-endless supply of said CPUs? The OS creates this illusion by virtualizing the CPU. The basic technique, known as the time- sharing the CPU, allows users to run as many concurrent proces

Operating System: Three Easy Pieces --- API (Note)

Aside: RTFM --- Read The Man Pages Many times in this book, when referring to a particular system call or library call, we will tell you to read the mannual pages, or man pages for short. Man pages are the original form of documantation that exist on

Operating System: Three Easy Pieces --- Locks (Note)

From the introduction to concurrency, we saw one of the fundamental problems in concurrent programming: we would like to execute a series of instructions atomically, but due to the presence of interrupts on a single processor (multiple threads execut

Operating System: Three Easy Pieces --- Mechanism: Limited Direct Execution (Note)

In order to virtualize the CPU, the operating system needs to somehow share the physical CPU among many jobs  running seemingly at the same time. The basic idea is simple: run one process for a little while, then run another, and so forth. By time sh

Operating System: Three Easy Pieces --- Locks: Pthread Locks (Note)

The name that the POSIX library uses for a lock is mutex, as it is used to provide mutual exclusion between threads, i.e., if one thread is in the critical sections, it excludes the others from entering until it has completed the section. Thus, when

Operating System: Three Easy Pieces --- Limited Directed Execution (Note)

In order to virtualize the CPU, the operating system needs to somehow share the physical CPU among many jobs running seemingly at the same time. The basic idea is simple: run one process for a little while, then run another one, and so forth. By time

Operating System: Three Easy Pieces --- Thread API (Note)

This chapter briefly covers the main properties of the thread API. Each part will be explained further in the subsequent chapters, as we know how to use the API. More details can be found in various books and online sources. We should note that the s

Operating System: Three Easy Pieces --- Page Fault (Note)

Recall that with TLB misses, we have two types of systems: Hardware managed TLBs (where the hardware looks in the page table to find the desired translation) and software managed TLBs ( where the OS does). In either type of systems, if a page is not

Operating System: Three Easy Pieces --- Beyond Physical Memory: Mechanisms (Note)

Thus far, we have assumed that an address space is unrealistically small and fits into the physical memory. In fact, we have been assuming that every address space of ervery running process fits into memory. We will now relax these big assumptions, a