Date post: | 24-Dec-2015 |
Category: |
Documents |
Upload: | madison-jefferson |
View: | 218 times |
Download: | 3 times |
20 March 2003 Operating Systems: User Interfaces 2
Overview
System calls Required to interact with hardware
Command language Enter commands through terminal or shell Can be used to create batch files or shell scripts
Job Control Language (JCL) Submitting batches to mainframe
Graphical User Interface (GUI) windows, menus, icons, pointing device
20 March 2003 Operating Systems: User Interfaces 3
System Calls
Similar to ordinary library function calls Target of function call is system code
part of OS rather than part of calling program
Higher level calls are APIs call lower level system functions used to develop programs for the target OS Windows NT has high security; only offers APIs
20 March 2003 Operating Systems: User Interfaces 4
UNIX system calls: file I/O
Creat: creates a file Open: opens a file for read/write etc. Read: reads bytes from file into buffer Write: writes bytes to file into buffer Close: frees file from use by the process Lseek: moves to file position Link: creates another name for the file
20 March 2003 Operating Systems: User Interfaces 5
UNIX system calls: processes
Fork: creates copy of current process Exec: replaces current process with new one Exit: terminates process, returns to parent Kill: sends software signal to terminate process Pause: suspends execution of a process Signal: control signals using specified function
20 March 2003 Operating Systems: User Interfaces 6
DOS Software Interrupts
Interrupt vector table in first 1K of memory Interrupts processor like hardware interrupts Each vector has some system functions Interrupt 21H has many functions for:
Character I/O, file/directory, process and memory management, date/time, etc.
20 March 2003 Operating Systems: User Interfaces 7
Command Languages
Used for on-line but also batch processing Used to start programs Also used to modify user environment
prompt, path, working directory, etc.
20 March 2003 Operating Systems: User Interfaces 8
UNIX commands
command-name options arguments #comment 0 or more options beginning with dashes (-) 0 or more arguments are often file names Comment is ignored, used for documenting
scripts
20 March 2003 Operating Systems: User Interfaces 9
UNIX shell scripting
shell script commands saved in a file and run as a program
programming-language features variables, functions, if, case, for/while loops, etc.
different shell languages have differing features sh, csh, ksh, bash, etc.
20 March 2003 Operating Systems: User Interfaces 10
UNIX file/folder commands
pwd show current directory ls lists files in current directory cd change to a different directory cat display file contents cp copy file mv move or rename file rm delete file
20 March 2003 Operating Systems: User Interfaces 11
Other UNIX commands
wc count characters, words, lines sort sort lines of a file grep search for a pattern in file lines find search for files with a given name/pattern date show date and time echo repeat a line of text who display users logged on the system man display documentation about a command exit close the shell (logout if the only shell)
20 March 2003 Operating Systems: User Interfaces 12
Perl
Text processing language Combines features of C, UNIX shells, etc. Often used to make programmed Web pages Can be used for system administration tasks
20 March 2003 Operating Systems: User Interfaces 13
MS-DOS
Similar to UNIX but simpler (e.g. only one user) UNIX-like directory structure Batch files (.bat extension) command-name options arguments
Options begin with forward slashes (/) Command.com
Interprets “internal” DOS commands like UNIX shell
External DOS commands are separate programs stored in folder c:\windows\command in Windows 98
20 March 2003 Operating Systems: User Interfaces 14
Internal DOS commands
CD change or display the working folder DIR display contents of folder TYPEdisplay contents of file DEL delete file COPY copy file TIME display and change time DATE display and change date CLS clear the screen SET set or display environment variables
20 March 2003 Operating Systems: User Interfaces 15
External DOS commands
FDISK partition a disk FORMAT add a file system to a disk CHKDSK examine and repair a disk XCOPY powerful version of COPY MEM display DOS memory usage MORE display file one screen at a time HELP display command documentation
20 March 2003 Operating Systems: User Interfaces 16
DOS Options
dir displays contents of current folder filename, ext, size, date, time, windows filename
dir/p pauses after each screen dir/w uses wide list format (brief) dir/s displays all subdirectories
20 March 2003 Operating Systems: User Interfaces 17
More DOS Options
dir/od displays files in order of date dir/o-d same but most recent date first dir/a displays file attributes
directories, hidden, system, read-only, archive
dir/ah displays hidden files only dir/? displays help with the dir command
20 March 2003 Operating Systems: User Interfaces 18
DOS Path
Fully specifies the location of a file disk, folder(s), filename, extension e.g. c:\windows\command\fdisk.exe shared computer, shared folder, filename, ext. e.g. \\xpacer\SharedDocs\OS\index.htm
OS uses search path to look for commands type PATH at DOS prompt put SET PATH command in autoexec.bat file
20 March 2003 Operating Systems: User Interfaces 19
DOS Batch Files
text file, .bat extension, contains commands useful for multiple file move/copy/delete can also run other programs and batch files useful for repeating tasks on many computers can keep networked client PCs identical
20 March 2003 Operating Systems: User Interfaces 20
Using DOS Batch Files
To create, edit or view a batch file use text editor (DOS Edit, Notepad or WordPad)
To run a batch file double-click in Explorer, or type its name at the DOS prompt or Run dialog
To get information on any DOS command type the command followed by /?
20 March 2003 Operating Systems: User Interfaces 21
Useful DOS batch file commands
xcopypowerful version of copy deltree delete directory and all subdirectories call calls another batch program goto go to labelled line in a batch file for runs command on each file in a set if conditional net Windows networking functions echo displays messages or command echoing rem remark (documentation line)
20 March 2003 Operating Systems: User Interfaces 22
Job Control Languages
Used on large computers for batch jobs: No human interaction/delays/interruptions Routine jobs e.g. payroll, financial reports Used resources are predictable, scheduled Must manage errors without intervention
Jobs are given rank/priority Jobs are allocated memory, processor time
20 March 2003 Operating Systems: User Interfaces 23
Graphical User Interfaces
Usually an addition to command interfaces e.g. Windows (DOS), X Windows (UNIX)
Features include: overlapping windows screen cursor moved by pointing device desktop, icons, taskbar, menus, dialog boxes buttons, scroll bars, lists