程序代写代做代考 file system gui algorithm CO2017 — Week 1L3 — Linux OS and the Linux user interface

CO2017 — Week 1L3 — Linux OS and the Linux user interface

CO2017 — Week 1L3 — Linux OS and the Linux

user interface

Dr Gilbert Laycock (gtl1)

2017–01–24

gtl1–R873 W1L3 — Linux user interface 2017–01–24 1 / 10

Recap

Recap and Lecture Review

Recap

Overview of OSs:

Managing resources and extending the machine

Two key concepts of OSs:

Processes & interrupt

Multitasking and scheduling algorithms

gtl1–R873 W1L3 — Linux user interface 2017–01–24 2 / 10

Relationship of user interface and the OS

User interface is built on top of an OS

The user’s gateway into the computer.

Enables the user to interact with the computer via the capabilities
provided by the OS.

Human-computer interaction (HCI) is now a hot topic

Inconsistency and lack of forethought in the design of user interface have
made much trouble in many systems.
User-friendliness has become a key factor in computer system design.

gtl1–R873 W1L3 — Linux user interface 2017–01–24 3 / 10

Relationship of user interface and the OS Exploring OS features using linux command line

Tour of linux command line looking at OS features

Status of processes

Memory usage

Filesystem

Devices

gtl1–R873 W1L3 — Linux user interface 2017–01–24 4 / 10

Relationship of user interface and the OS System calls

System Calls

A layer of services/procedures just on top of the hardware an OS
provides for user programs to implement some activities, usually
sensitive or privileged

Different OSs have different set of system calls

An OS has only limited system calls, but may provide additional
subroutines, APIs, between the programmer and system call interface

Invoking a system call is similar to calling a general function. But the
general function code is part of the calling program, while the system
call code is in the OS

gtl1–R873 W1L3 — Linux user interface 2017–01–24 5 / 10

Relationship of user interface and the OS System calls

Example System Calls of UNIX OS

System V UNIX provides about 64 system calls, concerning file, I/O, and
processes.

System Call Description

Process
pid = fork() Create a child process identical to the parent
exit(status) Terminate process execution and return status
File management
read(fd,buf,size) Read data from a file into a buffer
link(fd1,fd2) Create a new entry fd2 pointing to fd1
Miscellaneous
time(&secs) Get the elapsed time since Jan 1, 1970 GMT
stime(secs) Set the system time and date

gtl1–R873 W1L3 — Linux user interface 2017–01–24 6 / 10

Relationship of user interface and the OS Kernel vs User mode

Kernel vs User mode

User Mode
Applications

Standard Libraries

Kernel Mode

system-call interface to the kernel

CPU scheduling file system virtual memory

kernel interface to the hardware

Hardware Physical memory device controllers terminals

gtl1–R873 W1L3 — Linux user interface 2017–01–24 7 / 10

Relationship of user interface and the OS Command line

Command Language

Allow users to interact directly with an OS via a terminal

The main aim is to initiate the execution of programs

They are of most value to operational users

In UNIX and similar systems, they are sufficiently powerful for
application programming

UNIX command language, shell, has the format like

commandname options arguments #comment

e.g., “ls -l” lists all file information in the directory

A series of commands can be assembled in a text file — shell program
or script

gtl1–R873 W1L3 — Linux user interface 2017–01–24 8 / 10

Relationship of user interface and the OS GUI/WIMP interface

Graphical User Interface (GUI)

GUIs are a common, significant feature in modern computing

GUIs are usually layered on top of an existing command based interface, e.g, X
Windows for UNIX and Windows for MS-DOS

Common features of GUI systems

On-screen overlapping windows
Pointing devices, usually a mouse
Various graphical features: buttons, icons, scroll bars
Higher level components: menus, selection lists, dialogue boxes

A GUI system is a desktop metaphor: the screen display represents a working
desk with documents the user can switch

gtl1–R873 W1L3 — Linux user interface 2017–01–24 9 / 10

Summary

Summary

User interface enables the user computer interaction

System calls are the ultimate user interface to computer

Different users may prefer different user interfaces

System calls may be directly used by programmers
Command languages are efficient for operational users
GUIs are most common, esp. for end-users

gtl1–R873 W1L3 — Linux user interface 2017–01–24 10 / 10

Recap
Relationship of user interface and the OS
Exploring OS features using linux command line
System calls
Kernel vs User mode
Command line
GUI/WIMP interface

Summary