Before we discuss how an operating system makes system calls available,
let's first use an example to illustrate how system calls are used: writing a
simple program to read data from one file and copy them to another file. The
first input that the program will need is the names of the two files: the input file
and the output file. These names can be specified in many ways, depending
on the operating-system design. One approach is for the program to ask the
user for the names of the two files. In an interactive system, this approach will
require a sequence of system calls, first to write a prompting message on the
screen and then to read from the keyboard the characters that define the two
files. On mouse-based and icon-based systems, a menu of file names is usually
displayed in a window. The user can then use the mouse to select the source
name, and a window can be opened for the destination name to be specified.
This sequence requires many I/0 system calls.