usingOS - Using an Operating System (CSE 422S) Dante...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Using an Operating System (CSE 422S) Dante Cannarozzi Washington University djc2@cse.wustl.edu www.cse.wustl.edu/~djc2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 -Ken Wong, Sep 2008 User‘s View of an OS An OS is a collection of system programs » Allows user to build, run and debug programs (tools) » Provides the user with an abstract machine Tools » Compilers, Linker, Loader, Shell » Debuggers, System Administration (e.g., file stats) Abstractions » Isolated, linear address space for each process » Almost unlimited main memory (e.g., 32-bit addressing) » Large, persistent, linear storage facilities » Process control (start/stop/resume) and scheduling » Controlled resource sharing
Background image of page 2
3 -Ken Wong, Sep 2008 UNIX Interfaces Users Application Programs Standard Library Operating System Hardware User Interface Library Interface System Call Interface (shell, gcc, vi, make, GUI) (open,close,read,write,fork) (process, memory, I/O) (CPU, memory, disk, terminals) Man Section (1) (2) (3)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 -Ken Wong, Sep 2008 Unix Man Pages Linux : man 2 open Solaris : man s 2 open Name open open or create a file SYNOPSIS #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int open(const char *path, int flags); int open(const char *path, int flags, mode_t mode); DESCRIPTION RETURN VALUE open returns the new file descriptor, or -1 if . .. SEE ALSO chmod(2), close(2), dup(2), lseek(2) . ..
Background image of page 4
5 -Ken Wong, Sep 2008 BSD init And getty Processes login getty init init PID 1 fork One per terminal Open stdin, stdout, stderr Prompt for login name execve execve execve some shell Read .login and then .cshrc (or .bashrc) Start at end of bootstrap procedure BSD: Berkeley Software Distribution
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 -Ken Wong, Sep 2008 The UNIX Process Concept (1) A process is a program in execution » Needs system resources (e.g., CPU) to execute Every process has a unique process ID (PID) » PID 0: Scheduler sched - swapper , a kernel process » PID 1: /sbin/init started at the end of the bootstrap process and never dies All other processes are descendants of init » PID 2: Page Daemon pageout or pagedaemon Memory Layout (‗ nm –ng a.out’ ) » Text (Instructions) » Heap (Global Variables) » Stack (Local Variables) » Command-line args, environment variables text heap stack Lo Hi
Background image of page 6
7 -Ken Wong, Sep 2008 The UNIX Process Concept (2) The execution environment is multiprogrammed » Each process has a set of register values » CPU only has one set of registers which is shared by all processes OS kernel loads hardware registers with the register values of the currently running process » Processes contend for system resources (CPU, memory, I/O devices)
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 -Ken Wong, Sep 2008 Process Creation Events System initialization (created during bootup) » Background Processes : Daemons (email, printer) » Foreground Processes : Interact with user (login- shell) Process creation system call (e.g., fork) » Ex. 1: Concurrent server application forks child to handle request » Ex. 2: Run make utility in parallel mode (make
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 53

usingOS - Using an Operating System (CSE 422S) Dante...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online