CSE 466 – Fall 2000 - Introduction - 1 User / Kernel Space Physical Memory mem mapped I/O kernel code user pages user code GPLR virtual kernel C0000000.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

Slide 2-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 2 Using the Operating System 2.
Chorus Vs Unix Operating Systems Overview Introduction Design Principles Programmer Interface User Interface Process Management Memory Management File.
04/14/2008CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying the textbook.
1 Processes and Pipes COS 217 Professor Jennifer Rexford.
1 UNIX 1 History of UNIX 2 Overview of UNIX 3 Processes in UNIX 4 Memory management in UNIX 5 The UNIX file system 6 Input/output in UNIX.
Socket Programming.
Sockets Basics Conectionless Protocol. Today IPC Sockets Basic functions Handed code Q & A.
1 Case Study 1: UNIX and LINUX Chapter History of unix 10.2 Overview of unix 10.3 Processes in unix 10.4 Memory management in unix 10.5 Input/output.
Tutorial 8 Socket Programming
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
OPERATING SYSTEMS Introduction
CSE 466 – Fall Introduction - 1 Remainder of Syllabus  Lecture  RTOS  Maestro In Linux  Distributed Control Architecture – distributed state.
Processes CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Sockets and intro to IO multiplexing. Goals We are going to study sockets programming as means to introduce IO multiplexing problem. We will revisit socket.
UNIX System Administration OS Kernal Copyright 2002, Dr. Ken Hoganson All rights reserved. OS Kernel Concept Kernel or MicroKernel Concept: An OS architecture-design.
Inter-Process Communication Mechanisms CSE331 Operating Systems Design.
Threads, Thread management & Resource Management.
CSE 466 – Fall Introduction - 1 Reentrant Driver open() { if (count++) return(0); else return(grab_resources()); } release() { if (--count) return(0);
Group 1 Members: SMU CSE 8343 Wael Faheem Professor:Dr.M.KHALIL. Hazem Morsy Date: Poramate Ongsakorn Payal H Patel Samatha Devi Malka.
4P13 Week 1 Talking Points. Kernel Organization Basic kernel facilities: timer and system-clock handling, descriptor management, and process Management.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Page 1 Jan 5, 1998 CMPN 369 CPSC441 Sockets Module Sockets Application Programming Interface (API)
Queues, Pipes and Sockets. QUEUE A structure with a series of data elements with the first element waiting for an operation Used when an element is not.
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
CE Operating Systems Lecture 13 Linux/Unix interprocess communication.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
The Mach System Silberschatz et al Presented By Anjana Venkat.
Threads, Thread management & Resource Management.
Review: – Why layer architecture? – peer entities – Protocol and service interface – Connection-oriented/connectionless service – Reliable/unreliable service.
Goals for Today How do we provide multiprogramming? What are Processes? How are they related to Threads and Address Spaces? Note: Some slides and/or pictures.
Chapter 1 Introduction  What is an operating system  History of operating systems  The operating system zoo  Computer hardware review  Operating system.
Inter-Process Communication 9.1 Unix Sockets You may regard a socket as being a communication endpoint. –For two processes to communicate, both must create.
1 Spring Semester 2008, Dept. of Computer Science, Technion Internet Networking recitation #7 Socket Programming.
What is a Process ? A program in execution.
Concepts and Structures. Main difficulties with OS design synchronization ensure a program waiting for an I/O device receives the signal mutual exclusion.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
S ALVATORE DI G IROLAMO (TA) Networks and Operating Systems: Exercise Session 1.
Kernel Design & Implementation
Module 12: I/O Systems I/O hardware Application I/O Interface
Case Study 1: UNIX and LINUX
Protection of System Resources
CSE 466 – Fall Introduction - 1
Chapter 5: Threads Overview Multithreading Models Threading Issues
Operating Systems: A Modern Perspective, Chapter 6
Process Realization In OS
Socket Programming in C
10CS53 Operating Systems Unit VIII Engineered for Tomorrow
System Structure and Process Model
CSCI 315 Operating Systems Design
Chapter 2: The Linux System Part 2
System Structure and Process Model
10CS53 Operating Systems Unit VIII Engineered for Tomorrow
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
CS703 - Advanced Operating Systems
Lecture Topics: 11/1 General Operating System Concepts Processes
IPC Prof. Ikjun Yeom TA – Hoyoun
Jonathan Walpole Computer Science Portland State University
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
CS510 Operating System Foundations
Internet Networking recitation #8
CS Introduction to Operating Systems
Presentation transcript:

CSE 466 – Fall Introduction - 1 User / Kernel Space Physical Memory mem mapped I/O kernel code user pages user code GPLR virtual kernel C GPLR Addresses above C are protected in hw. System call changes The protection bits Addresses above Cxxxxxxx are always mapped to 0xxxxxxx by VM system copy_to_user copy_from_user are not really necessary…provde some protection? Virtual Memory driver module Virtual Register user code virtual kernel GPLR IPC?

CSE 466 – Fall Introduction - 2 Fork – Parent and child know about each other user code virtual kernel GPLR user code virtual kernel C GPLR Virtual Memory void main() { int pfds[2]; pipe(pfds); // create file desc. (int) if (fork()) producer(); else consumer(); } void producer() { int q = pfds[0]; while (1) {generate_data(buf); fwrite(q, buf, n); // blocking } void consumer() { int q = pfds[1]; while (1) {fread(q, buf, n); // blocking process_data(buf); }  Single Reader, Single Writer, private!  Kernel ensures mutual exclusion (Read/Write are system calls) Pid = 1Pid = 2 Duplicate! pfds[0]pfds[1]

CSE 466 – Fall Introduction - 3 FIFO’s, which are named pipes  Process 1 void main() { mknod(“/tmp/myfifo”, S_IFIFO, ); // create a FIFO file node f = open(“/tmp/myfifo”, O_WRONLY); while (1) {generate_data(buf); write(f, buf, n);} }  Process 2 void main() { f = open(“/tmp/myfifo”, O_RDONLY); while (1) {read(f, buf, n); process_data(buf);} }  Works for “unrelated” processes  Multiple writers, Multiple readers  Kernel ensures mutual exclusion  Kernel does not control interleaving of writers, readers  Works fine for process that share a file system! Where is the actual queue? On the disc? In Memory?

CSE 466 – Fall Introduction - 4 Implement a FIFO w/ a Device Driver  Open.. Returns a file descriptor  Read  Gets from a kernel space queue, blocks if empty  Write  Writes data into a kernel space queue, blocks if full  Close.. Releases the file descriptor

CSE 466 – Fall Introduction - 5 Sockets – Networking  IPC for processes running on different machines (no shared kernel space, no shared name space)  s = socket(int domain, int type, int protocol) -- protocol is usually associated with domain but not always  domain: internet, UNIX, apple-talk…etc. How to interpret that address.  bind(int s, sockaddr *addr, n)  s is the socket identifier  sockaddr is the address (june.cs.washington.edu)  n is the length of the address  Returns a file descriptor  Now it is like a pipe, you can do read/write, send/recv, listen/connect/accept.  Several types  stream  datagram  sequential  raw  The protocol stack  mapping from application level abstractions (open, read, socket) to HW and back  Deals with inter-operability issues between different kinds of system  Could use a named pipe if have access to a shared file system!

CSE 466 – Fall Introduction - 6 Stack Concept Physical layer Data-link layer Transport Physcal layer Data-link layer Transport frame packet message packet message packet Application Semantics pipe shared mem etc. pipe shared mem etc. Homework Design protocol that uses messages to implement a shared memory interface (shared variables) to processes running on separate processors Approach Think the transport layer interface to the application. Invent system calls (1) that the application should use, then determine what messages (2) need to be generated to implement the desired semantics. Be specific, give examples!! For example sockets support connect(), open(), read(), write(), close(). What do you need to implement shared variables? (1) (2)