notes8

notes8 - 2/8/04 System Calls - the way a user program gets...

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

View Full Document Right Arrow Icon
2/8/04 System Calls - the way a user program gets services from the operating system - system calls use software interrupts. These are interrupts generated by the program itself - during the system call the OS: + checks argument validity + enforces policy and security + performs the service requested main() printf -> libc.printf -> write (wrapper( -> syscall(sys_write) -> kernel sys_write, check args, perform write function ways of printing "hello world" 1. printf("hello world\n"); 2. write(1,"hello world\n",12); 3. syscall(sys_write, "hello world\n",12); Truss command - traces system calls of a process. It lists all the system calls that a process makes. truss truss [-o outfile] [-f] -f traces also children truss in solaris, gtrace in linux A process is a program in execution a program may have multiple processes running the same program. each process will be a different instance of the same program ps -e (lists all processes) top (monitors processes states of a process new->ready<->running->terminated ^waiting<-| new - process is being initialized ready - the process is a candidate to run in the CPU but there is another process currently running running - the process is currently using the CPU #running processes <= #processors waiting - process is waiting for an event (keyboard, mouse, network, disk, etc) terminated - process is exiting most of the time processes are in the _waiting state_
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

notes8 - 2/8/04 System Calls - the way a user program gets...

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

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