LightMySky
به انگلیسی

What an Operating System Is: Privilege and System Calls

An operating system manages resources and provides services. In the user/kernel protection model studied here, user code cannot execute restricted hardware-control instructions. System calls enter the kernel for checked services. CPU privilege, permission to request a service, and ordinary library calls are distinct.

شروع یادگیری این موضوعبه حساب کاربری نیازی نیست. پیشرفت در همین مرورگر ذخیره می‌شود.

کارهایی که یادگیرنده بعد از این درس می‌تواند انجام دهد

  • Trace what happens on a system call, from the trap to the return
  • Distinguish restricted hardware-control instructions from user-mode requests for permitted OS services
  • Distinguish a library call that stays in user mode from a system call, and explain why their costs depend on the work performed

۱ · بخوان

Multiple cores do not create the need for an OS; a single-core computer can use one too. An OS manages resources and provides services. Here we study protected user programs and a kernel. An app saving a file requests an OS service rather than controlling the storage device itself. Other systems can use different protection arrangements.

prepare read requesttrap into kernel modecheck and handle requestreturn result or errorresume in user mode
For this file-read model, the program prepares a request, enters kernel mode, receives a checked result or error, and resumes in user mode.

CPU privilege restricts particular hardware-control instructions. In our model, user code cannot directly change memory-protection control registers, disable hardware interrupts, or operate unassigned device controls. It can perform ordinary arithmetic. These restrictions differ from permission to ask the OS for a service. An authorized user program can request a clock change without executing privileged instructions itself.

Protection limits what one user program can do to another's memory and shared resources. If every program could change memory protection or issue unrestricted device commands, one could damage another's data. The kernel checks requests and uses controlled interfaces. Protection reduces these risks; it does not guarantee that the kernel, drivers or every program will be free of faults.

Creating a folder is an ordinary request available to an app with suitable permissions. The app remains user-mode software, but the request can enter the kernel to update the file system. Permission to request the action is not permission to execute restricted CPU instructions. Calling a service does not give the app permanent kernel privilege.

Entering kernel mode does not mean a request must be approved. The kernel checks arguments, file permissions and other policy rules. A file-read request may return an error, read cached data, or wait for storage. The system-call interface controls entry; the checks decide which requested work is allowed.

request enters kernelcheck permissionpermitted result or error

A library function can compute entirely in user mode or wrap a system call. Kernel entry, checks and return add work compared with an otherwise similar user-only call, but total cost depends on the task. Ordinary desktop apps also depend on OS services. Install a suitable OS before those apps on an empty desktop disk; firmware and bare-metal software can execute without an installed OS.

In this protection model, user programs request checked kernel services. CPU privilege differs from service permission. A library function may stay in user mode or invoke a system call.

Original lesson, questions and flashcards written for this dataset.

Original readings and flashcards written for this dataset.

۲ · ببین

به انگلیسی

دور از صفحه‌نمایش

چاپ کاربرگکاغذ A4، با یک صفحهٔ جواب‌ها برای بزرگ‌ترها. بدون صفحه‌نمایش، بدون اینترنت.

جایگاه این موضوع

سپس تمرین

۸ سؤال پشت این درس منتظرند، هر کدام با پاسخ توضیح‌داده‌شده. هر پاسخ آسمان را پر می‌کند: ستاره‌ها هنگام یادگیری روشن می‌شوند و وقتی زمان برگشتن است کمرنگ می‌شوند.

شروع یادگیری این موضوع