Unix foundations


The Kernel interacts with processes and devices


Download 1.51 Mb.
bet6/9
Sana18.06.2023
Hajmi1.51 Mb.
#1583315
1   2   3   4   5   6   7   8   9
Bog'liq
process

The Kernel interacts with processes and devices

  • BACK

Mode,Space & Context

  • By modes: some critical resources can be protected.
    • Kernel Mode: More privileged, kernel functions
    • User Mode: Less privileged, user functions
  • Virtual Memory
    • VM space
    • Address Translation Maps
    • Memory Management Unit

Kernel data

  • Current process & Context switch
  • One instance of the kernel
  • Global data structure
  • Pre-process objects
  • System call, Mode Switch
  • User area: info. about a process
  • Kernel stack:

Context

  • UNIX kernel is re-entrant: several processes may be involved in kernel activities concurrently.
  • Execution context
    • Process context:
    • System context (Interrupt context):

Execution mode and Context

Executing in Kernel Mode

  • 3 types of events:
  • Dispatch table
  • System context: interrupts
  • Process context: traps, exceptions & software interrupts

The System Call Interface

  • syscall(): the starting point
  • in kernel mode, but in process context.
  • Copy arguments , save hardware context on the kernel stack.
  • Use system call number to index dispatch vector
  • Return results in registers, restore hardware context, to user mode, control back to the library routine.

UNIX Interrupt Handling

  • Interrupt handler(interrupt service routine):
    • runs in kernel mode and system context,
    • not permitted to block.
  • the time used to service an interrupt charged to the interrupted process
  • The clock interrupt handler charges the clock tick to the current process
  • ipl(interrupt priority level)- specified for each interrupt and saved in interrupt register of the processor status word
  • Interrupts are preemptive

Download 1.51 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling