tutorial4 - CSCC69 Tutorial 4 Dan Zingaro May 31, 2010...

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

View Full Document Right Arrow Icon
CSCC69 Tutorial 4 Dan Zingaro May 31, 2010
Background image of page 1

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

View Full DocumentRight Arrow Icon
System Calls I We use system calls in our user-level programs to ask for an OS service I So, to test system calls, you require user-level programs that call them! I In Exercise 2, you will implement several system calls I OS/161 has one system call ( reboot ) already implemented
Background image of page 2
Executing User Programs I The p command runs user-level programs I cmd_dispatch : use strtok to tokenize the user input into words, and match the first word against a table of function pointers I The function pointer in the table for p is cmd_prog for (i=0; cmdtable[i].name; i++) { !strcmp(args[0], cmdtable[i].name)) { .... result = cmdtable[i].func(nargs, args); ... return result; } }
Background image of page 3

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

View Full DocumentRight Arrow Icon
Executing User Programs I cmd_prog drops the leading p and calls common_prog I common_prog calls thread_fork , and sets up the new thread to run cmd_progthread I cmd_progthread then calls runprogram to run the requested program strcpy(progname, args[0]); result = runprogram(progname); Check kern/main/main.c for more details
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/05/2011 for the course CS 69 taught by Professor Cathy during the Summer '10 term at University of Toronto- Toronto.

Page1 / 8

tutorial4 - CSCC69 Tutorial 4 Dan Zingaro May 31, 2010...

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

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