




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Scheduling becomes slower as there are more
processes
Typically an operating system uses a full time
quantum as the initial estimated CPU burst
The book uses 10 ms in an example
Good question because it means you think about
border cases
There is also a linear moving average
Every data point has the same weigth
In the exponential version, older data points are
weighted less, newer data has a higher weight,
following a decaying exponential formula
Example:
Command: ls –al | grep me > file
ls -al
grep me
In:dflt Out:file1 Err:dflt
Command Table
Creates new process for each entry in the
command table.
It also creates pipes to communicate the output
of one process to the input of the next one.
Also it redirects the stdinput, stdoutput, and
stderr.
A | b | c | d > out < in
•All pipe entries share the same stderr
Read Command Line and print Command Table
Create Processes and communicate them with
pipes. Also do in/out/err redirection.
Wildcard, Envars, Subshells
separates the input into tokens and a parser that
parses the tokens according to a grammar.
regular expressions.
The grammar is described in a file shell.y using
syntax expressions.
Shell.l is processed with a program called lex that
generates a lexical analyzer.
Shell.y is processed with a program called yacc
that generates a parser program
You need to implement the following grammar in shell.l
and shell.y
_cmd [arg] [ | cmd [arg] ]* [ [> filename]_**
[< filename] [ >& filename] [>>
_filename] [>>& filename] ] [&]_*
Currently, the grammar implemented is very simple
Examples of commands accepted by the new grammar.
ls –al
ls –al > out
ls –al | sort >& out
awk –f x.awk | sort –u < infile > outfile &
>~/my_log.err 2>&
Dev/null is the “null device”
Everything written there is discarded
Used as input, it automatically ends it
with the “standard output” file descriptor (#1)
Shortcut: in some shells just “>& myfile” does both “>
myfile” and “2>&1”