3.1 Kernel Organization

  • ancillary:付属物

System Process

  • Kernel Processes
    • swapper(0):kernel mode
      • メモリと補助記憶装置とのやり取り。
    • pagedaemon(2):kernel mode
      • キャッシュを書きだす。
  • User Process
    • init(1):user mode
      • ログインプロセスの準備など。
  • linuxのカーネルスレッド
    • swapper process(0)
    • keventd
    • kapmd
    • kswapd
    • pdflush
    • kblockd
    • ksoftirqd
    • (init)
  • wholly:完全に

System Entry

  • Hardware interrupt(asynchronous)
    • I/O device, clock, timer, etc.
  • Hardware trap(synchronous or asynchronous)
    • related to current executing process
    • illegal arithmetic operation, etc.
  • Software-initiated trap
    • scheduling, system call
    • hardware supported

Run-Time Organization

  • a top half
    • system call
    • processor priority levelを設定して割り込みをブロックする。
  • a bottom half
    • interrupts(never scheduled, cannot block)
  1. top half start I/O
  2. top half release CPU
  3. process begin to sleep
  4. bottom half notice the end of the I/O
  • process structure
    • pid, privilege, descriptors, memory map, resource, etc.
  • user structure
    • hardware Process Control Block(PCB), statistics, debug information, etc.
    • in rich OS, not needed?
  • relinquish:放棄する

Entry to Kernel


context switch (HP300)

handlers
  1. Syscall()
    1. system-call number
  2. Trap()
    1. type of trap, exception frame
  3. device-driver interrupt
    1. unit(board) number

Return from the Kernel


handler restore the context after completion

3.2 System Calls

  • system call handler
    • verify the parameters and copy to kernel space
    • call kernel routine

Result Handling

  • HP300 architecture
    • carry bit means success/fail
    • data register 0 means return value
    • in C global variable errno means return value
  • fail situation
    • system call error
    • interrupted(specification)
  • kernel must not modify process address space
  • system call does not perform any actions that cannot be repeated

Returning from a System Call

  1. システムコールからの戻りの際の処理。
    1. シグナルをチェックして、実行する。
    2. プライオリティが高いプロセスがあれば、コンテキストスイッチする。

3.3 Traps and Interrupts

Traps

  • 0 divideやmemory violationなどによって同期して発生。
  • page faultの場合は、ユーザプロセスはTrapの発生に気がつかない。

I/O Device Interrupts

  • cause
    • terminal
    • clocks
    • software-initiated interrupts
    • networking

非同期に発生するために、実行中のプロセスとは無関係。

Software Interrupts

3.4 Clock Interrupts

Statistics and Process Scheduling

Timeouts

3.5 Memory-Management Services

3.6 Timing Services

Real Time

Adjustment of the Time

External Representation

Interval Time

3.7 User, Group, and Other Identifiers

Host Identifiers

Process Groups and Sessions

3.8 Resource Services

Process Priorities

Resource Utilization

Resource Limits

Filesystem Quotas

3.9 System-Operation Services

Accounting

メンバーのみ編集できます