Docsity

CMSC412 Fall 2007 Project Instructions and Overview - Prof. Ashok K. Agrawala, Study Guides, Projects, Research of Operating Systems

Partial preview of the text

Download CMSC412 Fall 2007 Project Instructions and Overview - Prof. Ashok K. Agrawala and more Study Guides, Projects, Research Operating Systems in PDF only on Docsity!

- CMSC412 Fall
  • CMSC
    • Project 0/

CMSC412 Fall 2007

Administrivia

  • Info:
    • http://www.cs.umd.edu/class/fall2007/cmsc
  • Recitation:
    • CSI 1121; Mon, Wed 11:00-11:
    • CSI 1121; Mon, Wed 12:00-12:
  • TA: Eric Hardisty

CMSC412 Fall 2007

Remarks (con’t)

  • Pointers:
    • The projects are all about GeekOS, so read the source!
    • Reading the source works well because it is heavily commented.
    • Post your questions on the forum.
    • Come to recitation with questions.
    • These projects are challenging, but can be accomplished if you...

CMSC412 Fall 2007

Remarks (con’t)

CMSC412 Fall 2007

Project 0

  • You should have at least started it by now!
  • Setup instructions are on the course web page:
    • Bochs
    • GeekOS base setup
  • Project requirements:
    • Resource restrictions on GeekOS processes:
      • of active processes

      • of syscalls by a single process

CMSC412 Fall 2007

Project 0

  • The Bochs simulation setup:
  • Alternatives: GeekOS Bochs (HW Emulation) Native OS HW

CMSC412 Fall 2007

Project 0 (con’t)

  • From lecture you have learned:
    • The OS is split into two user-level and kernel-level.
    • The two levels are connected by the system call boundary.
    • In GeekOS, user processes are kernel threads with a special User_Context structure attached.

CMSC412 Fall 2007

In more detail: Thread System

  • Each thread is a Kernel_Thread object: kthread.h
  • Current thread: g_CurrentThread global
  • User mode threads
    • Kernel_Thread objects with a populated User_Context
  • Transferring from user mode to kernel mode: syscall
  • Kernel vs user memory
    • Distinct views: one from the user and one from the kernel.
    • Kernel needs to access user memory (but not vice versa!)
    • Use Copy_From_User/Copy_To_User

CMSC412 Fall 2007

In more detail: System Calls

  • Software interrupt
    • The only interrupt callable from user level idt.c#Init_IDT
    • SYSCALL_INT: 0x
  • Operation: syscall.h; syscall.c; libc/process.c
    • Put arguments in registers on user side; raise INT.
    • Recover them on kernel side.
    • Call the appropriate Sys_XXX.
    • Return result/error code in appropriate register.
  • Use g_CurrentThread for information about who raised it

CMSC412 Fall 2007

In more detail: Interrupts

  • Types:
    • Illegal operations: result in kills
    • Faults: page faults etc: not of concern right now
    • Hardware interrupts.
    • Software interrupts (traps): syscall int
  • Interrupt handlers
    • src/geekos/int.c
    • On completion control returns back to the thread that was interrupted.