1 / 104

The UNIX OS

Peter J. Vasquez Sr. CSCI 6303.01. The UNIX OS. The UNIX OS. What is UNIX? OpenBSD Installation Introduction to VI OpenBSD Configuration Introduction to ksh ksh Scripting. What is UNIX?. Design Architecture Filesystems Brief History. UNIX Design. Modular Programming

indra
Télécharger la présentation

The UNIX OS

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. Peter J. Vasquez Sr. CSCI 6303.01 The UNIX OS

  2. The UNIX OS • What is UNIX? • OpenBSD Installation • Introduction to VI • OpenBSD Configuration • Introduction to ksh • ksh Scripting

  3. What is UNIX? • Design • Architecture • Filesystems • Brief History

  4. UNIX Design • Modular Programming • software design technique that increases the extent to which software is composed from separate parts, called modules.http://en.wikipedia.org/wiki/Modularity_(programming)‏ • Re-Usable Code • the likelihood a segment of source code can be used again to add new functionalities with slight or no modification. http://en.wikipedia.org/wiki/Reusability

  5. UNIX Architecture • Kernel – manages the computer's resources and controls their use by programs. • Consists of: • CPU – responsible for running or executing programs. The kernel decides which processes are allocated to the processor. • Memory – used to store instructions and data. The kernel decides what memory is available to a process, and whether nor not enough is available. • I/O – input and output devices (keyboards, mice, disk drives, etc). The kernel allocates requests to these devices from applications to perform I/O.

  6. UNIX Architecture (cont.) • Shell - user interface to the kernel, where commands are input (whether on the command line interface or in a GUI) • Shell Examples: • Bourne Shell (and variants) • C Shell (and variants) • Blackbox, fluxbox, fvwm, GNOME, KDE, XFCE, CDE

  7. UNIX Architecture (cont.) • System Processes (Daemons) – programs that assist the kernel with specific system tasks. • Refers to background processes • Handles tasks in the background that the user cannot be bothered with • Most daemons are child processes of another running process (usually the init process, which is the initialization shell script responsible for starting up most processes after the kernel has loaded)

  8. UNIX Architecture (cont.) • Parent/Child Processes • Relationship of running process to other running processes. If one process initiates a new process, it is called the parent, while the new process is known as a child • New processes are spawned through a procedure called 'fork', which creates a copy of the parent along with the needed memory space and parameters to run with a task/set of instructions • Common example is the execution of shell commands, which remain interactive while child processes can be sent to the background to run

  9. UNIX Filesystems • UFS – UNIX File System (4.2/4.4BSD)‏ • a few block at the beginning reserved for boot blocks • a superblock containing a magic number identifying as UFS filesystem • a collection of cylinder groups, each containing the following: • backup copy of the superblock • cylinder group header with statistics • number of inodes • number of data blocks

  10. UNIX Filesystems (cont)‏ • <swap> - • form of virtual memory used to extend available main memory • dedicated partition, which should be at least the size of main memory • not required, but highly recommended

  11. UNIX Brief History

  12. A Brief Overview of OpenBSD • UNICS -> UNIX TSS -> BSD -> NetBSD -> OpenBSD • Designed with Security and Simplicity as primary goals (only 2 remote holes in the default install in the past 10 years)‏ • Major contributions to other UNIX/Linux Operating Systems include • OpenSSH : free implementation of SSH (secure shell) which provides for encrypted remote administration of UNIX/Linux systems (85% of installed systems world-wide)‏ • pf : or packet filter (firewall) has been used in a wide range of embedded systems (for example, the syswall security appliance)‏

  13. OpenBSD Installation • Obtain CD (can be purchased at openbsd.org, or ISO download from ftp.openbsd.org)‏ • Boot up using correct version (i386 in this example)‏ • Set up partition sizes, choose filesystem type • Set up basic system and package configuration

  14. OpenBSD Installation (cont.) • Boot from CD

  15. OpenBSD Installation (cont.) • Press 'i' for install

  16. OpenBSD Installation (cont.) • Press <enter>

  17. OpenBSD Installation (cont.) • Press <enter>

  18. OpenBSD Installation (cont.) • Press <enter>

  19. OpenBSD Installation (cont.) • Type 'yes' to proceed with install

  20. OpenBSD Installation (cont.) • Press <enter>

  21. OpenBSD Installation (cont.) • Press <enter> for default disk, or specify disk

  22. OpenBSD Installation (cont.) • Type 'yes' to use the entire disk for OpenBSD

  23. OpenBSD Installation (cont.) • Press <enter>

  24. OpenBSD Installation (cont.) • Now, type '?' for help, then press <enter>

  25. OpenBSD Installation (cont.) • Now type 'p' to see current partition map

  26. OpenBSD Installation (cont.) • Press <enter>

  27. OpenBSD Installation (cont.) • Create (/) root, <swap>, /tmp and /var partitions

  28. OpenBSD Installation (cont.) • Create /usr and /home partitions

  29. OpenBSD Installation (cont.) • Type 'p' and press <enter> to see partitions

  30. OpenBSD Installation (cont.) • Type 'w', <enter>, 'q', <enter>, to write and exit

  31. OpenBSD Installation (cont.) • Now begin basic system, package configuration

  32. OpenBSD Installation (cont.) • Type hostname, networking info, press <enter>

  33. OpenBSD Installation (cont.) • Type in root password, press <enter> for CD

  34. OpenBSD Installation (cont.) • Type in 'all' to select all packages

  35. OpenBSD Installation (cont.) • Press <enter>, type 'done', and press <enter>

  36. OpenBSD Installation (cont.) • Packages begin unpacking/installing to disk

  37. OpenBSD Installation (cont.) • Type timezone 'US/Central', type 'halt' to reboot

  38. OpenBSD Installation (cont.) • Press <enter>, the system will now reboot

  39. Introduction to VI • Two modes of operation • Insert mode : type in a character to modify the contents under the cursor directly • Command mode : type in a “:” followed by the command string for more advanced options • We can create files, modify their contents, and write the changes back to the disk • We can search within files for common strings • Useful in modification of the OS configuration files

  40. Introduction to VI (cont.) • Login as new user, list contents of directory

  41. Introduction to VI (cont.) • Type 'vi sample' for a new file named 'sample'

  42. Introduction to VI (cont.) • Type 'I' for insert mode, type, press <esc> ': wq'

  43. Introduction to VI (cont.) • We can open the same file to make changes

  44. Introduction to VI (cont.) • Type 'yy' and then 'p' to copy and paste the line

  45. Introduction to VI (cont.) • You can type 'dd' to delete the current line

  46. Introduction to VI (cont.) • We can search/replace a word, ':%s/new/old/g'

  47. Introduction to VI (cont.) • Now our file reads the following:

  48. Introduction to VI (cont.) • We can undo the change by typing 'u'

  49. Introduction to VI (cont.) • A lot of changes are available, for a complete reference you can type in 'vi reference' into a search browser, which will provide many results • The most common uses of vi are for the modification of system configuration files, and in shell programming (scripting)

  50. OpenBSD Configuration • Default configuration is listed in /etc/rc.conf

More Related