1 / 35

UNIX

UNIX. By Nick Gomez, Chris Rees, Brian Hernandez, Hector Rodriguez, Chris Sosa, and Joshua Burbridge. What Is UNIX?. An operating system originally created in 1969 Provided many ground-breaking features Completely self supporting Originally designed in assembly code

patsy
Download Presentation

UNIX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UNIX By Nick Gomez, Chris Rees, Brian Hernandez, Hector Rodriguez, Chris Sosa, and Joshua Burbridge

  2. What Is UNIX? • An operating system originally created in 1969 • Provided many ground-breaking features • Completely self supporting • Originally designed in assembly code • Rewritten in C in 1973 • The foundation of modern day Linux and BSD operating systems

  3. Why UNIX? UNIX incorporated many special features that were either new or uncommon to operating systems of the time. UNIX revolutionized operating system design, and many of it’s principles are used in modern operating systems, such as Windows, OS X, and Linux.

  4. Features • Hierarchical File System • Compatible File, Device, and Inter-Process I/O • Asynchronous Processes • System Command Language • Supports Multiple Users

  5. The File System Let’s see why the UNIX file system was so unique for its day!

  6. Three Types of Files 1. Ordinary Files • Binary (executable) files • Plain text files • Symbolic links

  7. Three Types of Files • Directories • Provides mapping between file names and files • Allows paths (e.g. /home/uname/Desktop) • The base directory called root (e.g. / ) • . and .. indicate current and parent directory respectively: /usr/local/.. same as /usr

  8. Three Types of Files Important Note Files do not exist inside directories. Rather, directories store file names and pointers to the information that describes the file.

  9. Three Types of Files • Special Files • Represents a particular device • Read from and write to like normal files • Unlike normal files, it interacts with associated devices • Stored in the /dev directory

  10. Why Special Files? • Provides little distinction between files and devices • Programs expecting files to read/write to can also accept devices without needing to differentiate the two • Devices are subject to the same protection mechanics that files have

  11. Removable File System Another unique feature of the UNIX file system is removable file systems. Using the system command mount, you can attach removable volumes to a leaf in the file structure. There is virtually no distinction between the removable volume and the permanent file system.

  12. Protection Another innovation of UNIX was access control on files. • Files created with owner name • 6 bits for read/write/execute permissions for owner and others • 7th bit can allow other users to temporarily become owner of the file

  13. Super-User • Regular users have limited access on a machine in some form or another • Super-user is the highest privileged user on the machine, able to perform any action • Usual constraints on the machine do not apply to super-user • Should only allow one person access

  14. Implementation Of File System • Directories contain file names and pointers • Pointer is called an i-number (index number) of the file • I-number references the information of the file in the system table

  15. File Information • Owner name • Protection bits • Physical address of location on disk • Size • Time of modification • Number of links to file • Directory bit • Special file bit • “Large” or “small” bit

  16. Efficiency of File System • File system provides satisfactory performance • 7621 line test program • Total time of 35.9 seconds, 212 lines per second • Time taken for each element: • 63.5% Assembler execution • 20.0% Disk wait time • 16.6% System overhead

  17. I/O Calls • Eliminate differences between different devices • open(name, flag) and Create • No user-visible automatic locks on files, unnecessary and insufficient • Sufficient internal interlocks • Files are sequential • read(filep, buffer, count), write(filep, buffer, count) • seek(filep, base, offset)

  18. Special Files • Unique feature of UNIX • Integral to I/O devices • Acts as ordinary file • Read/Write requests activate device • File and device I/O treated similar as possible • Same syntax and meaning • Same protection

  19. Processes and Images • Image – execution environment • Core Image • Register Values • Open Files • Curr. Directory • Curr. state

  20. Processes • Execution of image • Image resides in core • pID = fork(label) • Splits into two processes • Contain original image • Parent/child processes • Parent Process • Control returns from fork • Child Process • Control passed to label

  21. Pipes • filep = pipe() • Returns file descriptor • Creates interprocess channel • Passed from parent to child through fork • Read/Write • Read waits, data transferred • Setup by common ancestor of processes

  22. Execution of Programs • execute(file, arg1, arg2, …, arg-n) • arg1 usually same as file • Read in/execute • Creates process • Code in process replaced • Only returns on error • “jump” instead of subroutine

  23. Process Synchronization • processid = wait() • Suspend execution • Wait for child process • Error if no children • Can contain status from further descendants

  24. Termination • exit(status) • Terminates process • Destroys image • Closes open files • “Obliterates” • Returns to parent or higher

  25. The Shell • Aids in communication with UNIX • Command line interpreter • Command + args • Delimit to strings, search for command • Execute • Return to Shell • If command not found: • /bin/ and execute

  26. Standard I/O • Open file • Descriptor 1 – typewriter, write to 1 • Descriptor 0 – Read from 0 • Can use “>” and “<“ • “>” print/out to file after • “<“ read/in from file after • ls > there • ed < script • Interpreted directly by the Shell

  27. Filters • Commands can direct to each other • Use | • ls | pr -2| opr • Simplifies commands to the Shell • Makes commands look less “clumsy” • Filter – copies standard input to standard output with processing • Character transliteration, sorting of input, encryption/decryption

  28. Command Separators: Multitasking • Provided by the Shell • Commands separated by ; • ls ; ed • Commands followed by & do not wait for termination • as source > output & • Use parenthesis for order of operations • (date ; ls) > x &

  29. Shell as Command: Command Files • Shell is a command • Can be called recursively • File contains following lines: as source mv a.outtestprog testprog • Command sh< filename • Can also substitute parameters

  30. Implementation of the Shell • Shell mostly waits for user input • New-line character causes read to return • Read broken down into form capable of execute • fork() called • Child process attempts to execute with arguments • Parent waits for child to die • Command is finished. Shell waits for next command • Main loop of Shell never terminates • Except at EOF

  31. Initialization • Instances of Shell that user sees are child processes • UNIX creates process of init on startup • 1 for keyboard, 0 for printer file descriptions • Creates Shell when user logs in • When Shell executes, init waits

  32. Other Programs as Shell • User’s entry in password file can contain name of program • Programs can be executed at login • Can immediately begin working • User’s can be prevented from invoking programs • Limit users to ONLY single program • Ex: Chess • Log in as player, only play game

  33. Traps • Programs stuck in loop can be terminated • Interrupt signal • “delete” character • Cease execution, do not produce core image file • Quit signal • Force core image to be created • Shell ignores quits • Prevent user from being logged out by quit

  34. Perspective • UNIX was not created to meet any needs • Creators dissatisfied • Created more “hospitable” environment for PDP-7 • Written to easily write, test, run programs • System was able to maintain itself • Easily modified to fit new ideas/technology

  35. Influences • Success of UNIX comes from exploitation of specific ideas • Examples include • Fork operation from Berkely • I/O System calls from Multics • Shell name and function from Multics

More Related