CS计算机代考程序代写 file system gui interpreter COMP 3000 Operating Systems

COMP 3000 Operating Systems
Facilities for Users/Programmers
Lianying Zhao

Talking to the Computer
1. 2. 3.
4. 5. 6.
Connect to the computer • Terminal
Log in
• Authentication
Send commands (run programs) • Shell
Control programs
Feed data to programs Programs work with OS services
COMP 3000 (Winter 2021) 2

What is a Terminal?
• “An electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system”
• E.g., IBM 2741 (1960s)
• IBM 3270, VT102/100 (1970s-80s)
• Pseudo terminals
• /sbin/getty
COMP 3000 (Winter 2021)
3
Source: Wikipedia
Source: columbia.edu

Users and Access Control
• Largely coming down to file protection mechanisms
• Username -> UID, User group -> GID
• The login process: e.g., /usr/bin/login • To establish a session
• The password file:
• /etc/passwd -> $HOME, $SHELL, $PATH, … /etc/shadow
What about GUI?
COMP 3000 (Winter 2021)
4
And, remote (e.g., SSH)?

Permissions (File Modes)
• Very basic, mostly file-based access control
• The idea is: I am who/what I am (subject identity). So, what is your decision?
• Each object has an owner (e.g., user)
• — and is assigned security attributes (e.g., file modes)
• In the form of running processes
• Because the username is just a label
• UID, EUID (“effective” UID), FSUID (file system UID) • read, write, execute
• setuid, setgid, sticky bit
COMP 3000 (Winter 2021) 5

The Shell
• Command interpreter
• Technically not part of the OS
• Many shells exist (bash, dash, ksh, csh, tcsh, etc.)
The GUI is also like a shell, but in a
complex form
• Typical steps:
1. Initialize the environment (e.g., env variables)
2. Display a prompt
3. Parse user input, and perform the task in the case of internal commands
4. fork(), and wait in the parent process
5. Try to find the program (external command)
6. Manipulate fds as needed
7. exec()to attempt execution
8. Report errors (if any) and terminate child
COMP 3000 (Winter 2021) 6

COMP 3000 Operating Systems
Misc.
COMP 3000 (Winter 2021) 7

Make Good Use of the man Pages
• The operating system is too complex, so are all its related
utilities/commands/APIs…
• Such complexity is a result of evolution and advancement
• Memorize key concepts, as a rough direction and find references
COMP 3000 (Winter 2021) 8