DOC PREVIEW
UMD CMSC 412 - Project 0/1

This preview shows page 1-2-3-4-5 out of 15 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CMSC412dun dun dun...Project 0/1Administrivia•http://www.cs.umd.edu/class/fall2008/cmsc412•CSI 1121; Mon, Wed 11:00-11:50•Me: Aaron Schulman ([email protected])Why are we here?•To get you started on the project and answer your questions.•Give you background material.•Show you how the concepts you learn in lecture apply to GeekOS.•Come with questions.Why are operating systems such a big deal?Semester project•Read the source•It is heavily commented.•Post your questions on the forum.•Come to recitation with questions.•These projects are challenging, but funStart EarlyThat’s what they all saySetup build environment•Setup instructions are on the web page:•QEMU, Compilers, Debuggers•Linux, Mac and Linuxlab•Cygwin•GeekOS buildGeekOS emulation environmentGeekOSQEMU (Hardware Emulator)Linux/MacReal HardwareProject 0•Go home, order DP Dough, start project•Project requirements:•Resource restrictions on GeekOS processes:•# of active processes•# of syscalls by a single processProject 0•The OS is split into two user-level and kernel-level.•The two levels are connected by the system call boundary.System calls•Software interrupt•The only interrupt callable from user level idt.c Init_IDT•SYSCALL_INT: 0x90•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 itThread 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_UserThe system queues•Thread_Queue structure•Run queue:•Threads which are ready to run, but not currently running.•GeekOS has a single run queue for now...•Wait queues:•Threads that are waiting for a specific event or on a specific device; e.g. Keyboard IO, network IO, other threads: •geekos/kthread.c Join()•Spend 2 mins: follow the Get_Key syscall to see how the thread eventually gets to the keyboard wait queueInterrupts•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.Interrupts•When you don’t want to receive them:•When you are modifying global data structures; queues etc.•When you want to make some operation atomic.•Disable_Interrupts() / Enable_Interrupts():•include/geekos/int.h•Use caution•Enable_Interrupts() when atomic operation finished•See places where this has been done: e.g. src/geekos/user.c Attach_User_Context() and src/geekos/kthread.c Reaper()•Begin_Int_Atomic() / End_Int_Atomic() - include/geekos/int.h•Oblivious way of saving and restoring interrupt


View Full Document

UMD CMSC 412 - Project 0/1

Documents in this Course
Security

Security

65 pages

Deadlocks

Deadlocks

22 pages

Set 2

Set 2

70 pages

Project 2

Project 2

21 pages

Load more
Download Project 0/1
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Project 0/1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Project 0/1 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?