第6章インフラストラクチャーの抽象化層:オペレーティングシステム
LINK TO LEARNING学習リンク
Now that you’ve been introduced to the basics of operating systems, it may come as no surprise to you that operating systems come in all shapes and sizes. There are many different types of OSs (from batch operating systems to network operating systems), and each type handles many different functions (from file management to device management). This OS tutorial (https://openstax.org/r/76OStutorial) explains the different types. As you read along, consider how much you interact with an OS over the course of a single day—or how many different OSs you interact with.
英語のヒント
OSの基礎を学んだ今なら、OSにさまざまな形や規模があると聞いても、驚かないかもしれない。バッチOSからネットワークOSまで多くの種類があり、それぞれがファイル管理から機器管理まで、多様な機能を扱う。このOSの入門解説(https://openstax.org/r/76OStutorial)は、さまざまな種類を説明している。読み進めながら、一日のうちにどれだけOSとやり取りするか、あるいは何種類のOSとやり取りするかを考えてみよう。
OS Kernel FeaturesOSカーネルの機能
The kernel is the program that is running at all times on the computer and provides basic services for all parts of the OS. Typically, the kernel is not the only program that is running; there is usually either a system program/operating system or an application program running as well. Any program running on top of the OS is considered to be a process from the OS standpoint. It includes the program code, its current activity represented by the program counter, and a set of resources like open files and allocated memory. It also consists of address space, one or more threads of control executing in that address space, and an additional system state associated with it. The operating system uses processes to manage the execution of programs, ensuring they have the necessary resources while keeping them separate from each other to prevent interference.
英語のヒント
カーネルは、コンピューター上で常に動作し、OSのすべての部分に基本サービスを提供するプログラムである。通常、動作しているのはカーネルだけでなく、システムプログラム/OSかアプリケーションプログラムも動作している。OS上で実行されるどのプログラムも、OSの観点ではプロセスとみなされる。プロセスには、プログラムのコード、プログラムカウンターで表される現在の活動、開いているファイルや割り当て済みメモリなどの資源が含まれる。また、アドレス空間、その空間内で実行される一つ以上の制御スレッド、それらに付随する追加のシステム状態からも成る。OSはプロセスを使ってプログラムの実行を管理し、必要な資源を確保するとともに、互いを分離して干渉を防ぐ。
Software applications have to be compiled and linked with system libraries before they can run as executable programs on a machine. Each running program runs in its own process, and the OS can run, switch, and isolate processes from each other even though they are actually running on the same hardware. For a given application, the “machine” is the process abstraction provided by the OS. Processes provide user-friendly interfaces, rather than raw hardware, and an execution environment with restricted rights controlled by the OS.
英語のヒント
ソフトウェアアプリケーションは、機械上で実行可能プログラムとして動く前に、コンパイルし、システムライブラリと結合する必要がある。各プログラムは、それぞれ独自のプロセス内で動作する。実際には同じハードウェア上で動いていても、OSはプロセスを実行し、切り替え、互いに分離できる。あるアプリケーションにとっての「機械」は、OSが提供するプロセスという抽象化である。プロセスは、生のハードウェアではなく使いやすいインターフェースと、OSが制御する制限付きの権限を持つ実行環境を提供する。
An OS virtualizes the machine by providing easy-to-use abstractions of physical resources while masking limitations. In this context, a thread is a path of execution within a process, and a process may contain multiple threads. Thus, multithreading involves executing multiple threads (i.e., execution units that are part of a process and share the same resources) concurrently, which improves overall responsiveness and efficiency.
英語のヒント
OSは、物理資源の使いやすい抽象化を提供し、その制約を隠すことで、機械を仮想化する。ここでスレッドとは、プロセス内の実行の道筋であり、一つのプロセスに複数のスレッドが含まれることがある。したがってマルチスレッディングとは、プロセスの一部であり同じ資源を共有する実行単位である複数のスレッドを、並行して実行することである。これにより、全体の応答性と効率が高まる。
INDUSTRY SPOTLIGHT産業の現場から
Operating Systems and Health Careオペレーティングシステムと医療
In the fast-moving world of IT, it is crucial to think globally. This global perspective can be particularly useful when considering how IT and OSs affect health care. Namely, it can help us understand the role of OSs in patient care, medical research, and the efforts being made to make health care more widely accessible. The challenges associated with data sharing, privacy, and health-care disparities impact regions around the world differently.
英語のヒント
変化の速いITの世界では、世界的な視野で考えることが重要である。この視点は、ITやOSが医療に与える影響を考える際、特に役立つ。具体的には、患者のケア、医学研究、より多くの人が医療を利用できるようにする取り組みにおける、OSの役割を理解する助けになる。データ共有、プライバシー、医療格差に関わる課題は、世界の地域ごとに異なる影響を及ぼす。
As the delivery of health care becomes more integrated with technology, the choices made in designing how health-care IT systems use OSs can significantly impact people’s lives across the globe. These choices range from deciding how to take ethical considerations into account when using AI for diagnosis to creating IT solutions that respect cultural differences.
英語のヒント
医療の提供が技術とますます一体化するにつれて、医療ITシステムがOSをどう使うかという設計上の選択が、世界中の人々の生活に大きく影響する。この選択は、AIを診断に使うときに倫理的な配慮をどう取り入れるかという判断から、文化的な違いを尊重するITの仕組みを作ることまで、多岐にわたる。
Check out these initiatives from the World Health Organization (https://openstax.org/r/76WHO) and Centers for Disease Control and Prevention (https://openstax.org/r/76CDC) for examples in the health-care industry.
英語のヒント
医療分野の例として、世界保健機関(https://openstax.org/r/76WHO)と、米国疾病予防管理センター(https://openstax.org/r/76CDC)の、これらの取り組みを調べてみよう。
Imagine you’re considering entering the health-care IT field. Can you think of some ways that thinking globally and understanding the capabilities provided by OSs could improve your ability to solve problems and create solutions that work well for health-care systems in various countries?
英語のヒント
医療IT分野へ進むことを考えているとしよう。世界的な視野を持ち、OSの提供する能力を理解することは、さまざまな国の医療システムでうまく機能する解決策を作り、問題を解く力を、どのように高められるだろうか。いくつかの方法を考えられるか。
Hardware Managementハードウェアの管理
The ISA defines how the CPU is controlled by the software by abstracting the hardware details from the applications. The OS provides an abstract machine interface to the application programs and leverages the physical machine interface to do so. The OS communicates with input/output (I/O) hardware using device drivers, I/O ports, interrupts, direct memory access (DMA), and effective I/O scheduling. It provides abstractions to manipulate files (i.e., streams) and send messages to the network (i.e., sockets). Programming languages provide application programming interfaces (APIs) that leverage these abstractions (e.g., file I/O, socket libraries, and related APIs) so that the application program can access the underlying resources that are managed by the OS. One of the main responsibilities of the OS is to isolate hardware from programs by providing common services and background management functionality, for example, storage manager, network manager, and power manager.
英語のヒント
ISAは、アプリケーションからハードウェアの詳細を抽象化することで、ソフトウェアがCPUを制御する方法を定める。OSは、物理マシンのインターフェースを利用して、アプリケーションに抽象的なマシンのインターフェースを提供する。OSは、デバイスドライバー、入出力ポート、割り込み、ダイレクトメモリアクセス(DMA)、効果的な入出力スケジューリングを使って、入出力ハードウェアと通信する。また、ファイルを操作する抽象化であるストリームや、ネットワークへメッセージを送る抽象化であるソケットを提供する。プログラミング言語は、ファイル入出力、ソケットライブラリ、関連APIなど、これらの抽象化を利用するアプリケーションプログラミングインターフェース(API)を提供し、アプリケーションがOSの管理する基盤資源へアクセスできるようにする。OSの主要な役割の一つは、ストレージマネージャー、ネットワークマネージャー、電力マネージャーなどの共通サービスと、背後で働く管理機能を提供し、プログラムからハードウェアを分離することである。
The OS is the only system that should be able to directly access I/O devices (i.e., disks, network cards) and manipulate memory. Moreover, the CPU hardware provides a privileged instruction that can only be executed by the OS. The OS can use these instructions to establish an execution environment that limits access (to, for example, memory). The application cannot remove the restrictions because it must execute privileged instructions to do so.
英語のヒント
OSは、ディスクやネットワークカードなどの入出力機器に直接アクセスし、メモリを操作できる唯一のシステムであるべきだ。さらに、CPUのハードウェアは、OSだけが実行できる特権命令を提供する。OSはこれらの命令を使い、たとえばメモリへのアクセスを制限する実行環境を作れる。アプリケーションが制限を解除するには特権命令を実行しなければならないため、解除することはできない。
Certain operations are prohibited when running in user mode, such as changing the page table pointer (i.e., the pointers to memory pages that are cached for faster access), disabling interrupts (i.e., the interrupts that the OS received from I/O devices), interacting directly with hardware, and writing to kernel memory. Carefully controlled transitions between user mode and kernel mode include system calls, interrupts, and exceptions. The system call appears when the program requests a service from the kernel. The system interrupt manages the communication between the computer hardware and the system. The system throws an exception, which is an error that occurs at runtime.
英語のヒント
ユーザーモードで動作しているときは、いくつかの操作が禁止される。たとえば、ページテーブルポインター(高速アクセスのためにキャッシュされたメモリページへのポインター)の変更、割り込み(OSが入出力機器から受け取るもの)の無効化、ハードウェアとの直接のやり取り、カーネルメモリへの書き込みである。厳密に制御されるユーザーモードとカーネルモードの間の遷移には、システムコール、割り込み、例外がある。プログラムがカーネルへサービスを要求すると、システムコールが発生する。システム割り込みは、コンピューターハードウェアとシステム間の通信を管理する。システムは例外を送出する。例外とは、実行時に起こるエラーである。