‹

05 · Operating Systems

05 · Operating Systems

05 · ​ระบบปฏิบัติการ

This chapter is the floor directly above the machine — where one processor is made to behave like a room full of them, and where the machine stops being something a program owns.

​บท​นี้​คือ​ชั้น​ที่​วาง​อยู่​เหนือ​ตัว​เครื่อง​ขึ้น​มา​โดยตรง — ​ที่​ซึ่ง​โปรเซสเซอร์​ตัว​เดียว​ถูก​ทำให้​ทำตัว​เหมือน​มี​อยู่​เต็ม​ห้อง ​และ​ที่​ซึ่ง​เครื่อง​เลิก​เป็น​สมบัติ​ของ​โปรแกรม​ใด​โปรแกรม​หนึ่ง

How does one machine pretend to be many, safely?

​เครื่อง​เดียว​แสร้ง​ทำเป็น​หลาย​เครื่อง​อย่าง​ปลอดภัย​ได้​อย่างไร

Between June 1985 and January 1987, six patients treated with a radiation machine called the Therac-25 received massive overdoses; at least three died. The machine was not broken in any way an engineer could see. Its predecessor had carried hardware interlocks — physical devices that made the dangerous configuration impossible — and on the Therac-25 they had been removed, because software would check instead. Nancy Leveson and Clark Turner found that the software checked, but that two of its concurrent tasks shared variables with no synchronization, so an operator typing quickly could change the treatment mode after the check had read it and before the hardware had finished moving (Leveson & Turner, IEEE Computer, July 1993). They also record what the machine was running on: "The system is not built using a standard operating system or executive. Rather, the real-time executive was written especially for the Therac-25" — by a single programmer, in assembly language, over several years.

​ระหว่าง​เดือน​มิถุนายน 1985 ​ถึง​มกราคม 1987 ​ผู้ป่วย​หก​คน​ที่รักษา​ด้วย​เครื่อง​ฉายรังสี​ชื่อ Therac-25 ​ได้รับ​รังสี​เกินขนาด​อย่าง​รุนแรง ​อย่าง​น้อย​สาม​คน​เสียชีวิต ​ตัว​เครื่อง​ไม่​ได้เสีย​ใน​แบบ​ที่​วิศวกร​มองเห็น​ได้ ​เครื่อง​รุ่น​ก่อนหน้า​มี​กลไก​ล็อก​ฮาร์ดแวร์ (hardware interlock) — ​อุปกรณ์​ทางกายภาพ​ที่​ทำให้​การตั้งค่า​อันตราย​เกิดขึ้น​ไม่​ได้ — ​และ​ใน Therac-25 ​อุปกรณ์​เหล่านั้น​ถูก​ถอด​ออก ​เพราะ​จะ​ให้​ซอฟต์แวร์​ตรวจสอบ​แทน Nancy Leveson ​และ Clark Turner ​พบ​ว่า​ซอฟต์แวร์​ตรวจสอบ​จริง ​แต่​งาน (task) ​ที่ทำงาน​พร้อมกัน​สอง​งาน​ใช้​ตัวแปร​ร่วมกัน​โดย​ไม่​มี​การซิง​โคร​ไน​ซ์ ​ผู้ปฏิบัติงาน​ที่​พิมพ์​เร็ว​จึง​เปลี่ยน​โหมด​การรักษา​ได้ ​หลัง​การตรวจสอบ​อ่าน​ค่า​ไป​แล้ว ​แต่ก่อน​ฮาร์ดแวร์​เคลื่อนที่​เสร็จ (Leveson & Turner, IEEE Computer, July 1993) ​ทั้งสอง​ยัง​บันทึก​ไว้​ด้วยว่า​เครื่อง​รัน​อยู่​บน​อะไร — "​ระบบ​นี้​ไม่​ได้​สร้าง​ขึ้น​ด้วย​ระบบปฏิบัติการ​หรือ executive ​มาตรฐาน ​แต่ real-time executive ​ถูก​เขียน​ขึ้น​มา​เฉพาะ​สำหรับ Therac-25" — ​โดย​โปรแกรมเมอร์​คนเดียว ​เขียน​ด้วย​ภาษา​แอสเซมบลี ​ตลอดเวลา​หลาย​ปี

That last sentence is the reason this chapter exists. An operating system is not a convenience layer. It is the accumulated answer to three problems lethal to solve again from scratch: how one machine is shared, how concurrent things stay coherent, and how anything survives being switched off. Remzi and Andrea Arpaci-Dusseau call them virtualization, concurrency, and persistence (Operating Systems: Three Easy Pieces). The unifying idea is that an operating system is a machine that lies, carefully: every service it offers is a falsehood about the floor below, maintained well enough to be relied on.

​ประโยค​สุดท้าย​นั้น​คือ​เหตุผล​ที่​บท​นี้​มี​อยู่ ​ระบบปฏิบัติการ (operating system) ​ไม่​ใช่​ชั้น​อำนวยความสะดวก ​มัน​คือ​คำตอบ​สะสม​ของ​ปัญหา​สาม​ข้อ​ที่​อันตราย​ถึงตาย​หาก​ต้อง​แก้​ใหม่​จาก​ศูนย์ — ​เครื่อง​เดียว​ถูก​แบ่ง​กัน​ใช้​อย่างไร ​สิ่ง​ที่ทำงาน​พร้อมกัน​คง​ความสอดคล้อง​ไว้​อย่างไร ​และ​อะไร​รอด​จาก​การถูก​ปิด​เครื่อง Remzi ​และ Andrea Arpaci-Dusseau ​เรียก​สาม​ข้อ​นี้​ว่า ​การทำ​เสมือน (virtualization) ​การทำงาน​พร้อมกัน (concurrency) ​และ​ความคงอยู่​ของ​ข้อมูล (persistence) (Operating Systems: Three Easy Pieces) ​ไอเดีย​ที่​ร้อย​ทั้งหมด​เข้าด้วยกัน​คือ ​ระบบปฏิบัติการ​เป็น​เครื่อง​ที่​โกหก​อย่าง​ระมัดระวัง ​บริการ​ทุกอย่าง​ที่​มัน​เสนอ​คือ​ความเท็จ​เกี่ยวกับ​ชั้น​ข้างล่าง ​รักษา​ไว้​ดี​พอ​จะ​พึ่งพา​ได้

The first lie is arithmetic. Your laptop has a handful of processors and is running hundreds of programs, each written as though it had a machine to itself. The operating system multiplexes: it runs one program for a few milliseconds, saves every register, loads another's, and lets a hardware timer interrupt it so that no program can decline to give the machine back. The larger lie is about memory. The Atlas machine at Manchester, running in 1962, introduced a "one-level storage system": programs addressed a store far larger than physical memory, and hardware quietly moved pages between core and drum (Kilburn, Edwards, Lanigan & Sumner, 1962). Every process since has been handed the same fiction — virtual memory, as every descendant calls it: a private address space, starting at zero, that appears to be all its own. Two programs can both hold "address 4096" and never meet.

​คำ​โกหก​แรก​คือ​เรื่อง​เลขคณิต ​แล็ปท็อป​ของ​คุณ​มี​โปรเซสเซอร์​ไม่​กี่​ตัว ​แต่​รัน​โปรแกรม​อยู่​นับ​ร้อย ​แต่ละ​ตัวเขียน​ขึ้น​ราวกับ​มี​เครื่อง​ทั้ง​เครื่อง​เป็น​ของ​ตัวเอง ​ระบบปฏิบัติการ​ทำ multiplex — ​รัน​โปรแกรม​หนึ่ง​ไป​สอง​สาม​มิล​ลิ​วินาที ​บันทึก​ค่า​ใน​ทุก​รี​จิ​สเตอร์ ​โหลด​ค่า​ของ​อีก​โปรแกรม​เข้ามา ​และ​ปล่อย​ให้​ตัว​จับเวลา​ฮาร์ดแวร์​ขัดจังหวะ​มัน ​เพื่อ​ไม่​ให้​โปรแกรม​ไหน​ปฏิเสธ​ที่จะ​คืน​เครื่อง​ได้ ​คำ​โกหก​ที่​ใหญ่​กว่า​คือ​เรื่อง​หน่วยความจำ ​เครื่อง Atlas ​ที่ Manchester ​ซึ่ง​รัน​ใน​ปี 1962 ​เปิดตัว "​ระบบ​เก็บ​ข้อมูล​ชั้นเดียว" (one-level storage system) — ​โปรแกรม​อ้าง​ที่อยู่​ใน​พื้นที่​เก็บ​ข้อมูล​ที่​ใหญ่​กว่า​หน่วยความจำ​จริง​มาก ​และ​ฮาร์ดแวร์​ย้าย page ​ระหว่าง core ​กับ drum ​อย่าง​เงียบๆ (Kilburn, Edwards, Lanigan & Sumner, 1962) ​ทุก​โพรเซส (process) ​นับแต่​นั้น​ได้รับ​เรื่อง​แต่ง​เดียวกัน — ​หน่วยความจำ​เสมือน (virtual memory) ​อย่าง​ที่​ลูกหลาน​ทุก​ตัว​เรียก​กัน ​คือ​พื้นที่​ที่อยู่​ส่วนตัว ​เริ่ม​จาก​ศูนย์ ​ดูเหมือน​เป็น​ของ​มัน​เอง​ทั้งหมด ​โปรแกรม​สอง​ตัว​ถือ "address 4096" ​เดียวกัน​ได้​โดย​ไม่​มี​วัน​เจอกัน

A lie is only safe if it cannot be inspected from inside; here the operating system depends on the floor below. The kernel is not privileged because it is cleverer than your program; it is privileged because the processor refuses certain instructions unless a mode bit is set. Multics defined eight such rings of protection; x86 inherited the idea with four, of which mainstream systems use two — kernel and user (Multics protection). Chapter 04's instruction set does not know what a process is; it knows only that some instructions are forbidden in the outer mode, and that attempting one traps. Everything about isolation, security, and multi-tenancy is built from that single hardware gesture.

​คำ​โกหก​ปลอดภัย​ก็ต่อเมื่อ​มัน​ถูก​ตรวจสอบ​จาก​ข้างใน​ไม่​ได้ ​ตรงนี้​เอง​ระบบปฏิบัติการ​ต้อง​พึ่ง​ชั้น​ข้างล่าง ​เคอร์เนล (kernel) ​ไม่​ได้​มี​สิทธิพิเศษ​เพราะ​ฉลาด​กว่า​โปรแกรม​ของ​คุณ ​มัน​มี​สิทธิพิเศษ​เพราะ​โปรเซสเซอร์​ปฏิเสธ​คำสั่ง​เครื่อง​บาง​ตัว ​เว้นแต่​มี​การตั้ง mode bit ​ไว้ Multics ​นิยาม​วงแหวน​การป้องกัน (ring) ​แบบนี้​ไว้​แปด​ชั้น x86 ​รับ​ไอเดีย​นี้​มา​ด้วย​สี่​ชั้น ​และ​ระบบ​กระแส​หลัก​ใช้​จริง​สองชั้น — ​เคอร์เนล​กับ​ผู้ใช้ (Multics protection) instruction set ​ของ​บท​ที่ 04 ​ไม่​รู้​ว่า​โพรเซส (process) ​คือ​อะไร ​มัน​รู้​แค่​ว่า​คำสั่ง​เครื่อง​บาง​ตัว​ถูก​ห้าม​ใน​โหมด​นอก ​และ​การพยายาม​รัน​มัน​ทำให้เกิด trap ​ทุก​เรื่อง​เกี่ยวกับ isolation ​ความปลอดภัย ​และ multi-tenancy ​สร้าง​ขึ้น​จาก​ท่าที​เดียว​ของ​ฮาร์ดแวร์​ท่า​นี้

The second problem, concurrency, is the one that killed the Therac patients. Once two things run at once and touch the same data, correctness stops being a property of either one alone. Edsger Dijkstra gave the field its basic tool in 1965, the semaphore, in notes titled "Cooperating Sequential Processes", and used it to build the layered THE system (CACM, May 1968). But mutual exclusion trades one failure for another: a process holding one lock while waiting for a second can wait forever. Coffman, Elphick and Shoshani named the four conditions that must all hold for deadlock — mutual exclusion, hold-and-wait, no preemption, and circular wait — in ACM Computing Surveys in 1971 (System Deadlocks). Break any one and deadlock is impossible; that is still how it is handled. Notice what the operating system offers: not a removal of the difficulty but primitives correct enough to build on. The honest reading of the Therac-25 is that an engineer who declines them is re-deriving 1965 alone, under deadline.

​ปัญหา​ที่สอง ​การทำงาน​พร้อมกัน (concurrency) ​คือ​สิ่ง​ที่​ฆ่า​ผู้ป่วย Therac ​พอ​สอง​สิ่ง​ทำงาน​พร้อมกัน​และ​แตะ​ข้อมูล​ก้อน​เดียวกัน ​ความถูกต้อง​เลิก​เป็นคุณ​สมบัติ​ของ​ฝ่ายใดฝ่ายหนึ่ง​ลำพัง Edsger Dijkstra ​มอบ​เครื่องมือ​พื้นฐาน​ให้​วงการ​นี้​ใน​ปี 1965 ​คือ semaphore ​ใน​บันทึก​ชื่อ "Cooperating Sequential Processes" ​และ​ใช้​มัน​สร้าง​ระบบ THE ​ที่​แบ่ง​เป็น​ชั้น (CACM, May 1968) ​แต่ mutual exclusion ​แลก​ความล้มเหลว​แบบ​หนึ่ง​ไป​กับ​อีก​แบบ​หนึ่ง ​โพรเซส​ที่​ถือ​ล็อก (lock) ​ตัว​หนึ่ง​ไว้​ระหว่าง​รอ​ล็อก​ตัว​ที่สอง ​อาจ​รอ​ไป​ตลอดกาล Coffman, Elphick ​และ Shoshani ​ตั้งชื่อ​เงื่อนไข​สี่​ข้อ​ที่​ต้อง​เป็นจริง​พร้อมกัน​ทั้งหมด​จึง​จะ​เกิด deadlock — mutual exclusion, hold-and-wait, no preemption ​และ circular wait — ​ใน ACM Computing Surveys ​ปี 1971 (System Deadlocks) ​ตัด​ข้อ​ใด​ข้อ​หนึ่ง​ออก deadlock ​ก็​เป็นไปไม่ได้ ​นั่น​ยัง​คือ​วิธี​จัดการ​กับ​มัน​จนถึง​ทุกวันนี้ ​สังเกตว่า​ระบบปฏิบัติการ​เสนอ​อะไร​ให้ ​ไม่​ใช่​การกำ​จัด​ความยาก ​แต่​เป็น primitive ​ที่​ถูกต้อง​พอ​จะ​ต่อยอด​ได้ ​การอ่าน Therac-25 ​อย่าง​ตรงไปตรงมา​คือ ​วิศวกร​ที่​ปฏิเสธ​เครื่องมือ​เหล่านี้ ​กำลัง​นั่ง​คิดค้น​ปี 1965 ​ขึ้น​มา​ใหม่​คนเดียว ​ภายใต้ deadline

The third lie is that storage remembers. It does — but power can be cut between any two instructions, including the two that would have left the disk in a sensible state. The operating system's answer is fsync, which returns only when data has reached the device, and file systems that journal their intentions, so a half-finished operation can be replayed or undone. The abstraction leaks badly: fsync on a new file does not make the file's directory entry durable — you must sync the parent directory too. When Pillai and colleagues checked how eleven widely used applications behaved across crashes, they found sixty distinct crash vulnerabilities (All File Systems Are Not Created Equal, OSDI 2014). These were not amateur programs. The surface says "saved," and only the floor below knows whether that is true.

​คำ​โกหก​ที่สาม​คือ ​ที่เก็บ​ข้อมูล​จดจำ​ได้ ​มัน​จำได้​จริง — ​แต่​ไฟ​ถูก​ตัด​ได้​ระหว่าง​คำสั่ง​เครื่อง​สอง​ตัว​ใดๆ ​รวมถึง​สอง​ตัว​ที่จะ​ทิ้ง​ดิสก์​ไว้​ใน​สถานะ (state) ​ที่​สมเหตุสมผล ​คำตอบ​ของ​ระบบปฏิบัติการ​คือ fsync ​ซึ่ง​จะ return ​ก็ต่อเมื่อ​ข้อมูล​ไป​ถึง​อุปกรณ์​แล้ว ​และ​ระบบ​ไฟล์ (file system) ​ที่​จด journal ​ความตั้งใจ​ของ​ตัวเอง​ไว้ ​เพื่อให้ operation ​ที่​ค้าง​อยู่​ครึ่ง​เดียว​ถูก​เล่น​ซ้ำ​หรือ​ย้อนกลับ​ได้ ​นามธรรม (abstraction) ​ตัว​นี้​รั่ว​อย่าง​หนัก — fsync ​บน​ไฟล์​ใหม่​ไม่​ได้​ทำให้ directory entry ​ของ​ไฟล์​นั้น​คงทนถาวร​ไป​ด้วย ​คุณ​ต้อง sync ​ไดเรกทอรี​แม่​ด้วย ​เมื่อ Pillai ​และ​เพื่อนร่วมงาน​ตรวจสอบ​ว่า​แอปพลิเคชัน​ที่​ใช้​กัน​แพร่หลาย 11 ​ตัว​มี​พฤติกรรม​อย่างไร​เมื่อ​เครื่อง crash ​พวกเขา​พบ​ช่องโหว่​ตอน crash ​ที่​ต่างกัน 60 ​จุด (All File Systems Are Not Created Equal, OSDI 2014) ​โปรแกรม​พวก​นี้​ไม่​ใช่​ของ​มือสมัครเล่น ​ผิว (surface) ​บอก​ว่า "​บันทึก​แล้ว" ​มี​แต่​ชั้น​ข้างล่าง​เท่านั้น​ที่​รู้​ว่า​จริง​หรือเปล่า

One design rule holds the whole thing together: separate mechanism from policy. The kernel supplies the machinery to do a thing and leaves the decision of what to do to whoever is above it. Hydra stated it as a design principle in 1974 (Wulf et al., CACM 17, no. 6), and Butler Lampson's "Hints for Computer System Design" made it common sense by 1983. The reason is simple: policy changes far faster than mechanism, and a kernel that bakes in a scheduling preference or a security model must be rewritten when opinion moves. The interface that results is astonishingly narrow for what it carries: the x86-64 system call table in the current Linux source lists 385 entries (kernel source, checked 1 August 2026). Everything you have ever run passed through that door.

​กฎ​การออกแบบ​ข้อ​เดียว​ยึด​ทุกอย่าง​ไว้​ด้วยกัน ​คือ​แยก ​กลไก (mechanism) ​ออกจาก ​นโยบาย (policy) ​เคอร์เนล​จัดหา​กลไก​ให้​ทำ​สิ่ง​หนึ่ง ​และ​ปล่อย​การตัดสินใจ​ว่า​จะ​ทำ​อะไร​ให้​เป็นเรื่อง​ของ​สิ่ง​ที่อยู่​เหนือ​มัน​ขึ้นไป Hydra ​ระบุ​เรื่อง​นี้​เป็นหลัก​การออกแบบ​ตั้งแต่​ปี 1974 (Wulf et al., CACM 17, no. 6) ​และ "Hints for Computer System Design" ​ของ Butler Lampson ​ทำให้​มัน​เป็น​สามัญสำนึก​ภายใน​ปี 1983 ​เหตุผล​นั้น​ง่าย — ​นโยบาย​เปลี่ยน​เร็ว​กว่า​กลไก​มาก ​และ​เคอร์เนล​ที่​ฝัง​ความชอบ​เรื่อง scheduling ​หรือ​แบบจำลอง​ความปลอดภัย​ไว้​ตายตัว ​ต้อง​ถูก​เขียน​ใหม่​ทุกครั้งที่​ความเห็น​ขยับ ​อินเทอร์เฟซ​ที่​ได้​ออกมา​แคบ​เมื่อ​เทียบ​กับ​สิ่ง​ที่​มัน​แบก​ไว้ — ​ตาราง system call ​ของ x86-64 ​ใน Linux source ​ปัจจุบัน​มี 385 ​รายการ (kernel source, checked 1 August 2026) ​ทุกอย่าง​ที่​คุณ​เคย​รัน​ผ่าน​ประตู​บาน​นั้น​มา​แล้ว

The people here inherited each other directly. Fernando Corbató demonstrated the Compatible Time-Sharing System at MIT in 1961 and then led Multics, whose ambition was computing sold like electricity — a utility, always on, shared by strangers. Bell Labs pulled out in 1969, and Dennis Ritchie's account of what followed is unglamorous: the Labs refused to buy a replacement machine, so "it did not take long, therefore, for Thompson to find a little-used PDP-7" (Ritchie, The Evolution of the Unix Time-sharing System). Ken Thompson wrote the first Unix on it in about a month, in the summer of 1969, while his wife was away — "essentially one person for a month, it was just myself," he said later (oral history, 1989). Multics tried to specify everything; Unix was small because it had no budget to be large, and the small one spread. Thompson and Ritchie received the Turing Award in 1983, Corbató in 1990.

​คนใน​เรื่อง​นี้​สืบทอด​กัน​มา​โดยตรง Fernando Corbató ​สาธิต Compatible Time-Sharing System ​ที่ MIT ​ใน​ปี 1961 ​และ​นำ​ทีม Multics ​ต่อ ​ความทะเยอทะยาน​ของ​มัน​คือ​ขาย​การคำนวณ​อย่าง​ที่​ขาย​ไฟฟ้า — ​สาธารณูปโภค​ที่​เปิด​ตลอดเวลา ​แบ่ง​กัน​ใช้​ระหว่าง​คนแปลกหน้า Bell Labs ​ถอนตัว​ใน​ปี 1969 ​และ​เรื่องเล่า​ของ Dennis Ritchie ​ว่า​อะไร​เกิดขึ้น​ต่อมา​นั้น​ไม่​หรูหรา ​ทาง Labs ​ปฏิเสธ​จะ​ซื้อ​เครื่อง​ทดแทน ​ดังนั้น "​จึง​ไม่ต้อง​ใช้เวลานาน​นัก​ที่ Thompson ​จะ​หา PDP-7 ​เครื่อง​หนึ่ง​ที่​แทบ​ไม่​มี​ใคร​ใช้​เจอ" ("it did not take long, therefore, for Thompson to find a little-used PDP-7") (Ritchie, The Evolution of the Unix Time-sharing System) Ken Thompson ​เขียน Unix ​ตัว​แรก​ลง​เครื่อง​นั้น​ใน​เวลา​ประมาณ​หนึ่ง​เดือน ​ใน​ฤดูร้อน​ปี 1969 ​ขณะ​ภรรยา​ไม่​อยู่​บ้าน — "​โดย​พื้นฐาน​แล้ว​คือ​คน​คนเดียว​ทำเป็น​เวลา​หนึ่ง​เดือน ​มี​แค่​ผม​คนเดียว​เท่านั้น" ("essentially one person for a month, it was just myself") ​เขา​เล่า​ไว้​ใน​ภายหลัง (oral history, 1989) Multics ​พยายาม​ระบุ​ทุกอย่าง​ไว้​ล่วงหน้า ​ส่วน Unix ​เล็ก​เพราะ​ไม่​มี​งบ​ให้​ใหญ่ ​และ​ตัว​ที่​เล็ก​กว่า​นั่นเอง​ที่​แพร่​ออก​ไป Thompson ​กับ Ritchie ​ได้รับ​รางวัล Turing Award ​ใน​ปี 1983 ​ส่วน Corbató ​ได้รับ​ใน​ปี 1990

Connections

​เชื่อมโยง

Below is 04, which supplies everything that makes the illusion enforceable: privileged mode, the timer interrupt, and address-translation hardware. Above it, 06 compiles programs against the process abstraction described here. Chapter 07 carries the same instinct upward — hide the decision that will change, publish only the interface — and chapter 08 is largely the story of one application refusing to trust this floor's persistence guarantees and rebuilding them itself. Chapter 10 asks what happens to all of this when the "one machine" is a thousand of them, and chapter 11 treats the kernel boundary as the line an attacker is trying to cross.

​ชั้นล่าง​คือ​บท​ที่ 04 ​ซึ่ง​จัดหา​ทุกอย่าง​ที่​ทำให้​ภาพลวงตา​นี้​บังคับใช้​ได้​จริง — ​โหมด​สิทธิพิเศษ ​การขัดจังหวะ​ของ​ตัว​จับเวลา ​และ​ฮาร์ดแวร์​แปล​ที่อยู่ ​เหนือ​ขึ้นไป ​บท​ที่ 06 ​คอมไพล์​โปรแกรม​โดย​อิง​กับ abstraction ​ของ​โพรเซส​ที่​อธิบาย​ไว้​ใน​บท​นี้ ​บท​ที่ 07 ​พา​สัญชาตญาณ​เดียวกัน​ขึ้นไป​อีก​ชั้น — ​ซ่อน​การตัดสินใจ​ที่จะ​เปลี่ยนแปลง ​เผยแพร่​แค่​อินเทอร์เฟซ — ​และ​บท​ที่ 08 ​ส่วนใหญ่​คือ​เรื่อง​ของ​แอปพลิเคชัน​หนึ่ง​ตัว​ที่​ปฏิเสธ​จะ​เชื่อ​การรับประกัน​ความคงอยู่​ของ​ข้อมูล (persistence) ​ของ​ชั้นนี้ ​และ​สร้าง​มัน​ขึ้น​มา​ใหม่​เอง ​บท​ที่ 10 ​ถาม​ว่า​จะ​เกิด​อะไร​ขึ้นกับ​ทั้งหมด​นี้ ​เมื่อ "​เครื่อง​เดียว" ​กลายเป็น​เครื่อง​นับ​พัน ​และ​บท​ที่ 11 ​มอง​พรมแดน​ของ​เคอร์เนล​เป็น​เส้น​ที่​ผู้​โจมตี​พยายาม​ข้าม

Open questions

​คำถาม​ที่​ยัง​เปิด​อยู่

Is the kernel still the right place for the boundary? Microkernels, unikernels, and in-kernel virtual machines each move the line, and none has settled the argument. The process abstraction was designed for a machine whose interesting hardware was the CPU; today much of the work happens on accelerators the kernel barely schedules. And why, after sixty years, is concurrency still where careful engineers are most likely to be wrong?

​เคอร์เนล​ยัง​เป็นที่​ที่​ถูกต้อง​สำหรับ​วาง​พรมแดน​นี้​อยู่​หรือไม่ microkernel, unikernel ​และ virtual machine ​ที่อยู่​ใน​เคอร์เนล ​ต่าง​ขยับ​เส้น​นี้​กัน​ไป​คนละ​ทาง ​และ​ยัง​ไม่​มี​ตัว​ไหน​ยุติ​ข้อ​ถกเถียง​ได้ abstraction ​ของ​โพรเซส​ถูก​ออกแบบ​มา​สำหรับ​เครื่อง​ที่​ฮาร์ดแวร์​สำคัญ​คือ CPU ​แต่​ทุกวันนี้​งาน​ส่วนใหญ่​เกิดขึ้น​บน​ตัวเร่ง (accelerator) ​ที่​เคอร์เนล​แทบ​ไม่​ได้​จัด​คิว​ให้ ​และ​ทำไม​หลัง​ผ่าน​มา​หกสิบ​ปี ​การทำงาน​พร้อมกัน (concurrency) ​ยัง​เป็น​จุด​ที่​วิศวกร​ที่​รอบคอบ​มีโอกาส​ผิดพลาด​มาก​ที่สุด

Go deeper

​อ่าน​ต่อ

  • Remzi H. Arpaci-Dusseau & Andrea C. Arpaci-Dusseau, Operating Systems: Three Easy Pieces, version 1.10, 2023 — the clearest treatment of the three pieces, free online.
  • Dennis M. Ritchie & Ken Thompson, "The UNIX Time-Sharing System," Communications of the ACM 17, no. 7 (July 1974): 365–375 — the design that most systems still imitate.
  • Nancy G. Leveson & Clark S. Turner, "An Investigation of the Therac-25 Accidents," IEEE Computer 26, no. 7 (July 1993): 18–41 — the case every systems engineer should read once.
บทถัดไป · 7 / 1606 · Languages & Compilers
Size
Page
Font

The Tower of Abstractions — An Encyclopedia of the Computing Disciplines

❦
100 · The Map00 · แผนที่201 · Theory of Computation01 · ทฤษฎีการคำนวณ302 · Algorithms & Data Structures02 · อัลกอริทึมและโครงสร้างข้อมูล403 · Information & Coding03 · สารสนเทศและการเข้ารหัส504 · Computer Architecture04 · สถาปัตยกรรมคอมพิวเตอร์605 · Operating Systems05 · ระบบปฏิบัติการ706 · Languages & Compilers06 · ภาษาและคอมไพเลอร์807 · Software Engineering07 · วิศวกรรมซอฟต์แวร์908 · Databases08 · ฐานข้อมูล1009 · Networks09 · เครือข่าย1110 · Distributed Systems10 · ระบบกระจาย1211 · Security & Cryptography11 · ความปลอดภัยและวิทยาการรหัสลับ1312 · AI & Machine Learning12 · ปัญญาประดิษฐ์และการเรียนรู้ของเครื่อง1413 · HCI & Graphics13 · ปฏิสัมพันธ์มนุษย์–คอมพิวเตอร์ และกราฟิกส์1514 · The Frontier14 · พรมแดน1699 · Closing — The Tower, Seen Whole99 · ปิดเล่ม — หอคอยเมื่อมองทั้งหลัง