Project 1 Roadmap.

Slides:



Advertisements
Similar presentations
1 CS345 Operating Systems Φροντιστήριο Άσκησης 1.
Advertisements

CSCC69: Operating Systems
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Assistant Professor, University of Maryland Baltimore County.
4/14/2017 Discussed Earlier segmentation - the process address space is divided into logical pieces called segments. The following are the example of types.
Project 2 Roadmap. Segmentation Review Intel docs, fig. 3-1 and 3-5.
Processes Topics Process context switches Creating and destroying processes CS 105 “Tour of the Black Holes of Computing!”
1 Processes and Pipes COS 217 Professor Jennifer Rexford.
Processes CSCI 444/544 Operating Systems Fall 2008.
Project 2 Roadmap. Background – Context Switching One processor and multiple threads running concurrently – How?!! Give each thread a small time quantum.
Unix Processes.
Project 1 Roadmap. Address Space Protection in GeekOS User Process 1 Base 1 Size 1 User Process 2 Base 2 Size 2 User Process n Base n Size n Kernel User.
Project 1 Roadmap.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Process in Unix, Linux and Windows CS-3013 C-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
Unix & Windows Processes 1 CS502 Spring 2006 Unix/Windows Processes.
CMSC412 Fall’05 CMSC412 Project 0/1. CMSC412 Fall’05 The usual Info: csd.cmsc412 Recitation: CSI 2118; Mon.
CSE 451 Section 4 Project 2 Design Considerations.
Processes in Unix, Linux, and Windows CS-502 Fall Processes in Unix, Linux, and Windows CS502 Operating Systems (Slides include materials from Operating.
Process. Process Concept Process – a program in execution Textbook uses the terms job and process almost interchangeably A process includes: – program.
BINA RAMAMURTHY UNIVERSITY AT BUFFALO System Structure and Process Model 5/30/2013 Amrita-UB-MSES
Segmentation CS 537 – Introduction to Operating Systems.
The Programming Interface. Main Points Creating and managing processes – fork, exec, wait Performing I/O – open, read, write, close Communicating between.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Processes Tarek Abdelzaher Vikram Adve.
Process in Unix, Linux, and Windows CS-3013 A-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
Introduction to Processes CS Intoduction to Operating Systems.
Multiprogramming CSE451 Andrew Whitaker. Overview Multiprogramming: Running multiple programs “at the same time”  Requires multiplexing (sharing) the.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Shell (Part 2). Example r What if we want to support something like this: m ps –le | sort r One process should execute ps –le and another should execute.
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
Shell (Addendum). Example r What if we want to support something like this: m ps –le | sort r One process should execute ps –le and another should execute.
System calls for Process management
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
Operating Systems Process Creation
Process Management Azzam Mourad COEN 346.
Project 1 ELF, Program loading. elf.c Parameter – Char *exeFileData : executable file 을 read 한 버퍼 – struct elfHeader : GeekOS 의 ELF Header 구조체 – Struct.
CSCI 330 UNIX and Network Programming
 The MULTICS system solved problems of external fragmentation and lengthy search times by paging the segments  Solution differs from pure segmentation.
System calls for Process management Process creation, termination, waiting.
Memory Management Paging (continued) Segmentation
Section 8: Processes What is a process Creating processes Fork-Exec
Linux Processes & Threads
Processes in Unix, Linux, and Windows
Tarek Abdelzaher Vikram Adve Marco Caccamo
System Structure and Process Model
System Structure and Process Model
Processes in Unix, Linux, and Windows
System Structure B. Ramamurthy.
Memory Management Paging (continued) Segmentation
Processes in Unix, Linux, and Windows
System Structure and Process Model
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Operation System Program 1
CS 105 “Tour of the Black Holes of Computing!”
Processes Prof. Ikjun Yeom TA – Mugyo
Tutorial: The Programming Interface
CS 105 “Tour of the Black Holes of Computing!”
CS 105 “Tour of the Black Holes of Computing!”
Lecture 37 Syed Mansoor Sarwar
Still Chapter 2 (Based on Silberchatz’s text and Nachos Roadmap.)
CSE 451: Operating Systems Winter 2003 Lecture 4 Processes
Processes in Unix, Linux, and Windows
CSE 451: Operating Systems Winter 2007 Module 4 Processes
Processes in Unix and Windows
CS510 Operating System Foundations
CSE 451: Operating Systems Autumn 2004 Module 4 Processes
Memory Management Paging (continued) Segmentation
Processes David Ferry, Chris Gill, Brian Kocoloski
Presentation transcript:

Project 1 Roadmap

User Processes in GeekOS Kernel_Thread User Context Kernel_Thread User Context Kernel_Thread Kernel_Thread User Context Kernel_Thread User Processes

Address Space Protection in GeekOS User Processn Sizen Basen User Process2 Base2 Size2 User Process1 Base1 Size1 User processes’ address spaces don’t overlap Kernel “sees” all address spaces Kernel

Segmentation Principles Segment Descriptor size base privilegeLevel … User Process Kernel Address = User Address + Base Gives user processes the illusion they have their own world that starts at 0 Kernel

X86 Segmentation Intel docs, fig. 3-1 and 3-5

X86 Segmentation in GeekOS User Processn User Process2 User Process1 GDT=Global Descriptor Table: holds LDT descriptors for user processes LDT=Local Descriptor Table: holds segment descriptors for user processes LDT Desc1 GDT LDT Desc2 LDT Descn

X86 Segmentation in GeekOS (implementation) User_Context GDT Selector struct Segment_Descriptor ldt[0] LDT descriptor struct Segment_Descriptor ldt[1] Selector struct Segment_Descriptor *ldtDescriptor ushort_t ldtSelector ushort_t csSelector Selector ushort_t dsSelector int stackAddr int programSize char * program

Lifetime of an User Process Shell spawns user processes using Spawn_With_Path(see src/user/shell.c) User processes termination Normally - via Exit,called automatically when main() finishes Killed - via Sys_Kill which you will implement Parent processes can wait for their children using Wait

System Calls INT90 put args in registers on user side recover them on kernel side call Sys_xxx accordingly return result/error code Use g_CurrentThread to get info about current thread

Requirement #1:Background Processes Shell src/user/shell.c Scan for & If & detected, spawn in background, don’t Wait() If & not detected, Spawn normally, do Wait() Sys_Spawn() src/geekos/syscall.c need to consider ‘spawn in background argument’

Requirement #2:Killing Background Processes Kernel:Sys_Kill() src/geekos/syscall.c Get the PID of the victim process Lookup the victim’s kernel_thread (see Lookup_Thread in src/geekos/kthread.c) Dequeue thread from all queues, and ‘kill’ it User Add src/user/kill.c for testing Add kill.c to USER_C_SRCS in build/Makefile to create an user program

Requirement #3:Printing the process table Kernel:Sys_PS() src/geekos/syscall.c Prepare an struct Process_Info array in kernel space Walk all threads: s_allThreadList in src/geekos/kthread.c, fill out the above array Copy array into user space: Copy_To_User() User Add the ‘ps’ user program: src/user/ps.c , see req #2 Hit ‘ps’, ‘man ps’ in Linux to get an idea