Events
• After the OS has booted, all entry to the kernel happens as the result
of an event
• event immediately stops current execution
• changes mode to kernel mode, event handler is called
• An event is an “unnatural” change in control flow
• Events immediately stop current execution
• Changes mode, context (machine state), or both
• The kernel defines a handler for each event type
• Event handlers always execute in kernel mode
• The specific types of events are defined by the machine
• In effect, the operating system is one big event handler
OS Control Flow
• When the processor receives an event of a given type, it
• transfers control to handler within the OS
• handler saves program state (PC, registers, etc.)
• handler functionality is invoked
• handler restores program state, returns to program
Categorizing Events
• Two kinds of events, interrupts and exceptions
• Exceptions are caused by executing instructions
• CPU requires software intervention to handle a fault or trap
• Interrupts are caused by an external event
• Device finishes I/O, timer expires, etc.
• Two reasons for events, unexpected and deliberate
• Unexpected events are, well, unexpected
• What is an example?
• Deliberate events are scheduled by OS or application
• Why would this be useful?
This gives us a convenient table:
• Terms may be used slightly differently by various OSes,
CPU architectures…
• No need to “memorize” all the terms
• Software interrupt – a.k.a. async system trap (AST), async
or deferred procedure call (APC or DPC)
• Will cover faults, system calls, and interrupts next
Faults
• Hardware detects and reports “exceptional” conditions
• Page fault, divide by zero, unaligned access
• Upon exception, hardware “faults” (verb)
• Must save state (PC, registers, mode, etc.) so that the faulting
process can be restarted
• Fault exceptions are a performance optimization
• Could detect faults by inserting extra instructions into code
(at a significant performance penalty
เหตุการณ์•หลังจากระบบปฏิบัติการที่มี booted เคอร์เนลรายการทั้งหมดที่เกิดขึ้นเป็นผลมาจากของเหตุการณ์•เหตุการณ์ทันทีหยุดการดำเนินการปัจจุบัน•เปลี่ยนโหมดเป็นโหมดเคอร์เนล จะเรียกตัวจัดการเหตุการณ์•เหตุการณ์เป็นการเปลี่ยนแปลง "ธรรมชาติ" ในการควบคุม•เหตุการณ์ทันทีหยุดการดำเนินการปัจจุบัน•เปลี่ยนแปลงโหมด บริบท (สภาพเครื่อง), หรือทั้งสองอย่าง•เคอร์เนลกำหนดตัวจัดการสำหรับแต่ละชนิดเหตุการณ์•ตัวจัดการเหตุการณ์ที่จะดำเนินการในโหมดเคอร์เนล•บางชนิดของเหตุการณ์ที่กำหนด โดยเครื่องจักร•ในผล ระบบปฏิบัติการเป็นตัวจัดการเหตุการณ์ใหญ่หนึ่งควบคุมระบบปฏิบัติการ•เมื่อตัวประมวลผลเหตุการณ์ชนิดกำหนด ที่ได้รับมัน•ถ่ายโอนการควบคุมการจัดการภายในระบบปฏิบัติการ•จัดการบันทึกสถานะโปรแกรม (PC ทะเบียน ฯลฯ)เรียกฟังก์ชันจัดการ••จัดการคืนค่าสถานะของโปรแกรม ส่งกลับไปยังโปรแกรมประเภทเหตุการณ์•สองชนิด interrupts และข้อยกเว้น•ข้อยกเว้นเกิดขึ้นจากการดำเนินการตามคำแนะนำ• CPU ต้องการแทรกแซงของซอฟต์แวร์การจัดการข้อบกพร่องหรือกับดัก•ขัดจังหวะที่เกิดจากเหตุการณ์ภายนอก•อุปกรณ์เสร็จสมบูรณ์ I/O การตั้งเวลาหมด อายุ ฯลฯ•สองสาเหตุเหตุการณ์ ไม่คาดคิด และกระทำ•คาดเหตุการณ์มี ดี ไม่คาดคิด•ตัวอย่างคืออะไร•เหตุการณ์กระทำที่ผลิต OS หรือโปรแกรมประยุกต์•เหตุนี้จะมีประโยชน์หรือไม่นี้ทำให้เราสะดวกตาราง:•เงื่อนไขอาจจะใช้แตกต่างกันเล็กน้อย โดย OSes ต่าง ๆสถาปัตยกรรมของ CPU ...• No need to “memorize” all the terms• Software interrupt – a.k.a. async system trap (AST), asyncor deferred procedure call (APC or DPC)• Will cover faults, system calls, and interrupts nextFaults• Hardware detects and reports “exceptional” conditions• Page fault, divide by zero, unaligned access• Upon exception, hardware “faults” (verb)• Must save state (PC, registers, mode, etc.) so that the faultingprocess can be restarted• Fault exceptions are a performance optimization• Could detect faults by inserting extra instructions into code(at a significant performance penalty
การแปล กรุณารอสักครู่..

เหตุการณ์
- หลัง OS มี booted ทั้งหมดเข้า kernel เกิดขึ้นเป็นผลของเหตุการณ์
-
- เหตุการณ์หยุดทันที ปัจจุบันการเปลี่ยนแปลงโหมดโหมดเคอร์เนล , สถานที่เกิด เรียกว่า
- เหตุการณ์ที่เป็น " ธรรมชาติ " การเปลี่ยนแปลงในการควบคุมแต่ละเหตุการณ์การหยุดทันที
-
การเปลี่ยนแปลงในปัจจุบัน โหมด บริบท ( สภาพเครื่อง ) หรือทั้งสอง
- เคอร์เนลกำหนดผู้ดูแลแต่ละเหตุการณ์ประเภท
- งานจัดการเสมอรันในโหมดเคอร์เนล
- ชนิดที่เฉพาะเจาะจงของเหตุการณ์ถูกกำหนดโดยเครื่อง
- ผล ระบบปฏิบัติการเป็นหนึ่งเหตุการณ์ใหญ่ผู้ดูแล
O
- การควบคุมการไหล เมื่อประมวลผลได้รับกรณีระบุชนิด , ควบคุมการรับส่งบริการเพื่อการจัดการ
บริการภายในระบบปฏิบัติการ ผู้ดูแลจะบันทึกสถานะรายการ ( PC , ทะเบียน , ฯลฯ )
-
จะเรียกผู้ดูแลการทํางาน- เจ้าหน้าที่รัฐกลับคืนโปรแกรมโปรแกรม
- แยกแยะเหตุการณ์สองชนิดของเหตุการณ์ การขัดจังหวะและข้อยกเว้น
- ข้อยกเว้นที่เกิดจากการแนะนํา
- CPU ต้องมีการแทรกแซงซอฟต์แวร์เพื่อจัดการกับความผิดหรือกับดัก
-
ขัดจังหวะที่เกิดจากเหตุการณ์ภายนอกเสร็จสิ้น - อุปกรณ์ I / O เวลาหมดอายุ ฯลฯ
- สองเหตุผลสำหรับเหตุการณ์ที่ไม่คาดคิดและโดยเจตนา
- เหตุการณ์ไม่คาดคิด , ดี , ที่ไม่คาดคิด
- อะไรคือตัวอย่าง ? การกำหนดโดยเหตุการณ์
-
- OS หรือโปรแกรมทำไม นี้เป็นประโยชน์ นี้จะช่วยให้เราสะดวก
แต่ละตารางเงื่อนไขอาจใช้แตกต่างกันเล็กน้อย โดย oses ต่างๆ
- CPU สถาปัตยกรรม . . . . . . . ไม่ต้อง " ท่องจำ " เงื่อนไขทั้งหมด
- ซอฟต์แวร์และระบบการขัดจังหวะหรือกับดัก ( AST ) , Async
การแปล กรุณารอสักครู่..
