1 / 23

UNIX & Windows NT

UNIX & Windows NT. Unix History. First developed in 1969 by Ken Thompson and Dennis Ritchie of the Research Group at Bell Laboratories; incorporated features of other operating systems, especially MULTICS.

Download Presentation

UNIX & Windows NT

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&Windows NT

  2. Unix History • First developed in 1969 by Ken Thompson and Dennis Ritchie of the Research Group at Bell Laboratories; incorporated features of other operating systems, especially MULTICS. • The third version was written in C, which was developed at Bell Labs specifically to support UNIX. • The most influential of the non-Bell Labs and non-AT&T UNIX development groups — University of California at Berkeley (Berkeley Software Distributions). • 4BSD UNIX resulted from DARPA funding to develop a standard UNIX system for government use. • Developed for the VAX, 4.3BSD is one of the most influential versions, and has been ported to many other platforms. • Several standardization projects seek to consolidate the variant flavors of UNIX leading to one programming interface to UNIX.

  3. Design Principle • Designed to be a time-sharing system. • Has a simple standard user interface (shell) that can be replaced. • File system with multilevel tree-structured directories. • Files are supported by the kernel as unstructured sequences of bytes. • Supports multiple processes; a process can easily create new processes. • High priority given to making system interactive, and providing facilities for program development.

  4. Programmer Interface • Kernel: everything below the system-call interface and above the physical hardware. • Provides file system, CPU scheduling, memory management, and other OS functions through system calls. • Systems programs: use the kernel-supported system calls to provide useful functions, such as compilation and file manipulation.

  5. Architecture

  6. System Call • System calls define the programmer interface to UNIX • The set of systems programs commonly available defines the user interface. • The programmer and user interface define the context that the kernel must support. • Roughly three categories of system calls in UNIX. • File manipulation (same system calls also support device manipulation) • Process control • Information manipulation

  7. File Manipulation • A file is a sequence of bytes; the kernel does not impose a structure on files. • Files are organized in tree-structured directories. • Directories are files that contain information on how to find other files. • Path name: identifies a file by specifying a path through the directory structure to the file. • Absolute path names start at root of file system • Relative path names start at the current directory • System calls for basic file manipulation: create, open, read, write, close, unlink, trunc.

  8. Unix Directory Structure

  9. Process Control • A process is a program in execution. • Processes are identified by their process identifier, an integer. • Process control system calls • fork creates a new process • execve is used after a fork to replace on of the two processes’s virtual memory space with a new program • exit terminates a process • A parent may wait for a child process to terminate; wait provides the process id of a terminated child so that the parent can tell which child terminated. • wait3 allows the parent to collect performance statistics about the child • A zombie process results when the parent of a defunct child process exits before the terminated child.

  10. Process Control Calls

  11. Process Control • Processes communicate via pipes; queues of bytes between two processes that are accessed by a file descriptor. • All user processes are descendants of one original process, init. • init forks a getty process: initializes terminal line parameters and passes the user’s login name to login. • login sets the numeric user identifier of the process to that of the user • executes a shell which forks subprocesses for user commands. • setuid bit sets the effective user identifier of the process to the user identifier of the owner of the file, and leaves the real user identifier as it was. • setuid scheme allows certain processes to have more than ordinary privileges while still being executable by ordinary users.

  12. Signals • Facility for handling exceptional conditions similar to software interrupts. • The interrupt signal, SIGINT, is used to stop a command before that command completes (usually produced by ^C). • Signal use has expanded beyond dealing with exceptional events. • Start and stop subprocesses on demand • SIGWINCH informs a process that the window in which output is being displayed has changed size. • Deliver urgent data from network connections.

  13. Process Groups • Set of related processes that cooperate to accomplish a common task. • Only one process group may use a terminal device for I/O at any time. • The foreground job has the attention of the user on the terminal. • Background jobs – nonattached jobs that perform their function without user interaction. • Access to the terminal is controlled by process group signals. • Each job inherits a controlling terminal from its parent. • If the process group of the controlling terminal matches the group of a process, that process is in the foreground. • SIGTTIN or SIGTTOU freezes a background process that attempts to perform I/O; if the user foregrounds that process, SIGCONT indicates that the process can now perform I/O. • SIGSTOP freezes a foreground process.

  14. Shell and Command • Shell – the user process which executes programs (also called command interpreter). • Called a shell, because it surrounds the kernel. • The shell indicates its readiness to accept another command by typing a prompt, and the user types a command on a single line. • A typical command is an executable binary object file. • The shell travels through the search path to find the command file, which is then loaded and executed. • The directories /bin and /usr/bin are almost always in the search path. • Typical search path on a BSD system: ( ./home/prof/avi/bin /usr/local/bin /usr/ucb/bin/usr/bin ) • The shell usually suspends its own execution until the command completes.

  15. Windows NT • 32-bit preemptive multitasking operating system for modern microprocessors. • Key goals for the system: • portability • security • POSIX compliance • multiprocessor support • extensibility • international support • compatibility with MS-DOS and MS-Windows applications. • Uses a micro-kernel architecture. • Available in two versions, Windows NT Workstation and Windows NT Server. • In 1996, more NT server licenses were sold than UNIX licenses

  16. Architecture • Layered system of modules. • Protected mode — HAL, kernel, executive. • User mode — collection of subsystems • Environmental subsystems emulate different operating systems. • Protection subsystems provide security functions.

  17. Architecture

  18. Foundation for the executive and the subsystems. • Never paged out of memory; execution is never preempted. • Four main responsibilities: • thread scheduling • interrupt and exception handling • low-level processor synchronization • recovery after a power failure • Kernel is object-oriented, uses two sets of objects. • dispatcher objects control dispatching and synchronization (events, mutants, mutexes, semaphores, threads and timers). • control objects (asynchronous procedure calls, interrupts, power notify, power status, process and profile objects.)

  19. The process has a virtual memory address space, information (such as a base priority), and an affinity for one or more processors. • Threads are the unit of execution scheduled by the kernel’s dispatcher. • Each thread has its own state, including a priority, processor affinity, and accounting information. • A thread can be one of six states: ready, standby, running, waiting, transition, and terminated.

  20. File System • The fundamental structure of the NT file system (NTFS) is a volume. • Created by the NT disk administrator utility. • Based on a logical disk partition. • May occupy a portions of a disk, an entire disk, or span across several disks. • All metadata, such as information about the volume, is stored in a regular file. • NTFS uses clusters as the underlying unit of disk allocation. • A cluster is a number of disk sectors that is a power of tow. • Because the cluster size is smaller than for the 16-bit FAT file system, the amount of internal fragmentation is reduced.

  21. File System: Internal Layout • NTFS uses logical clusternumbers (LCNs) as disk addresses. • A file in NTFS is not a simple byte stream, as in MS-DOS or UNIX, rather, it is a structured object consisting of attributes. • Every file in NTFS is described by one or more records in an array stored in a special file called the Master File Table (MFT). • Each file on an NTFS voluem has a unique ID called a file reference. • 64-bit quantity that consists of a 16-bit file number and a 48-bit sequence number. • Can be used to perform internal consistency checks. • The NTFS name space is organized by a hierarchy of directories; the indexroot contains the top level of the B+ tree.

  22. File System: Recovery • All file system data structure updates are performed inside transactions. • Before a data structure is altered, the transaction writes a log record that contains redo and undo information. • After the data structure has been changed, a commit record is written to the log to signify that the transaction succeeded. • After a crash, the file system data structures can be restored to a consistent state by processing the log records. • This scheme does not guarantee that all the user file data can be recovered after a crash, just that the file system data structures (the metadata files) are undamaged and reflect some consistent state prior to the crash.. • The log is stored in the third metadata file at the beginning of the volume. • The logging functionality is provided by the NT log file service.

  23. File System: Security • Security of an NTFS volume is derived from the NT object model. • Each file object has a security descriptor attribute stored in tis MFT record. • This attribute contains the access token of the owner of the file, and an access control list that states the access privileges that are granted to each user that has access to the file.

More Related