GNU/Linux Basic Operating System – Chapter 1 Introduction
The Linux Command Line by William Shotts – Introduction
Please note most students not only have to read this required reading and the ciss100.com content several times but they have to continually return to previous readings and work with the reading material at their side. As introduced in LM1, most students do not catch the precise discrete terminology and its meaning and this understanding is critical to success. Also similar to the CISS 100 textbook content, you should be looking up any terms you do not understand.
Note when you open the links above you have access to the entire book (in pdf form). You may want to save it by printing it to PDF file so that you always have access without redownloading.
Lastly, note you will not be installing Ubuntu Linux on your machines as the text may instruct you to do.
Here are 2 great resources & tutorials for Linux terms and I recommend you bookmark them for future reference:
Lastly, here is comprehensive Linux documentation from the Linux Documentation Project: http://tldp.org
Please read, reread and understand this content as I cannot stress this preparation enough as students often plunge in without a proper foundational understanding(Prof Hurd calls it combat programming). As a result, students invariably end up having problems because they lack the proper foundational understanding. Let me ask you this, would you just open your car’s hood and start to fix things without getting the manuals and reading the manuals first… especially if you had never seen a car before? For some reason, this is what people do with computing as they just jump in and ask questions later when proper Information Systems Analysis an Design requires we research first. What makes this even worse is that without the preparatory research people can’t even formulate proper questions because they lack the necessary foundational understanding and terminology and therefore it becomes impossible to provide assistance.
The Operating System (OS) is the low-level or intermediary software (e.g. group of programs) that facilitates use of the computer’s hardware and software resources (this is known as abstraction, as the underlying computer hardware is represented by higher level conceptual constructs that are easier to use and more accessible to the user).
To illustrate this abstraction consider that you access your mp3 or video file by name rather the exact sectors on the hard drive where the file is stored.
The OS is also the computer’s resource manager and performs tasks for user’s/agent’s and the application processes in protected mode.
Why does the system need protection? Imagine if your word processor decided to write files over your MP3 collection… this would be bad so your word processor is not given this authority. What if your print jobs were interleaved with other user’s print jobs rather than printing in their entirety (e.g. print one page for you, print one page for them, print one page for you….). This would be bad or at least bothersome so some resources will require mutual exclusive access (i.e. one process has access to the resource at a time).
To prevent the above negative examples, the OS acts as the system’s policeman and protects and manages system resources. Put another way, every process must request the OS to access restricted/protected resources using a system call therefore it is the OS that actually accesses and manages the resources. To further illustrate this scenario please understand – a word processor does not open, write to, print or save a file. The word processor sends a request (system call) to the OS to open a file, get keyboard strokes from the keyboard, display the file on the screen, print the file and save the file to disk using System Calls.
Note my use of the word “agent” above as increasingly we have software that acts for us. As an example, your phone’s weather app could vibrate or make a tone if it were to receive notification of dangerous weather in your area. You did not ask the OS to make your phone vibrate… it was the weather app or software agent requesting the OS to use the vibrate resource.
System Resources can be categorized as either logical/virtual resources or as physical resources. Note this resource distinction can often be thought of in terms of logical software and physical hardware.
Logical or virtual resources include files (the actual digital information not the physical space the file takes up in storage) and logical Internet connections.
Physical resources include the CPU (CPU processing cycles are allocated in time slices by the OS Scheduler), memory, storage, physical network connections that include Wifi, Bluetooth, Ethernet network interface cards (NIC) and peripherals (e.g. I/O devices that include printers, keyboards, cameras, touch screens, etc.).
Now recall I stated at the course outset that Computing texts are often misread by the average person since every word looks familiar (i.e. you have seen every word on this page before). If so what is “mutual exclusive access”. Note that I used the word “process” above rather than “program”… do you know the distinction between process and program?
A process is an active or dynamic entity (active program) as it has been allocated logical and physical resources by the OS whereas a program is a static entity sitting somewhere on storage (and this could be somewhere on a network).
Think about this… you install a program by loading it on your hard drive and you may run a program by clicking or double clicking on its icon but once running; the program is used to create a running or dynamic process. Now I just used the term “dynamic”. In computing dynamic means during runtime.
Now having presented these very important concepts that would likely be missed by the layman, please reread the above 2 paragraphs. Do you understand everything? If your answer was yes, what is the difference between storage and memory? I used the term store above but did you catch this? If not you already made a mistake and if this happened then I have hopefully opened your eyes to the level of detail that you need to apply when studying Computing and Information Science.
Linux OS Elements
Ok, continuing on with OS basics, there are 2 main parts of an OS, the kernel and the system programs.
The Kernel – The Kernel is the fundamental core of the OS and allocates resources as introduced above. System programs and applications interact with the Kernel through system calls (this is the protection introduced above). The systems programs include device drivers, libraries, utility programs, shells (command interpreters) and various other application programs that perform system housekeeping (e.g. client/server relationships). Now, I recommend you read what Wikipedia has to say on the Operating System Kernel (or OS Kernel) as it is spot on: http://en.wikipedia.org/wiki/Kernel_(computing)
There are numerous System Programs in the form of utility commands and we will work with these extensively in the Linux Labs. A good list of Linux utilities is here: http://en.wikipedia.org/wiki/List_of_Unix_utilities
The Shell or Terminal Command Line Interface (CLI) – Some authors state the CLI or Shell or Terminal is a 3rd part of the OS and to this extent I include/reproduce Prof Stonebank’s presentation on the topic with permission under the Open Commons License. Note we will be working with Linux using the Terminal through either PuTTy if on Windows or via the built in Mac OS Terminal: (http://www.ee.surrey.ac.uk/Teaching/Unix/).
“The shell acts as an interface between the user and the kernel. When a user logs in, the login program checks the username and password, and then starts another program called the shell. The shell is a command line interpreter (CLI). It interprets the commands the user types in and arranges for them to be carried out. The commands are themselves programs: when they terminate, the shell gives the user another prompt ($ for our Ubuntu Linux OS however note that our prompt will have additional information before the $ set by the .profile or .login or another startup file). The adept user can customise his/her own shell, and users can use different shells on the same machine. The default Ubuntu Shell is bash.
The Terminal or Shell has certain features to help the user inputting commands.
Filename Completion – By typing part of the name of a command, filename or directory and pressing the [Tab] key, the shell will complete the rest of the name automatically. If the shell finds more than one name beginning with those letters you have typed (recall namespace ambiguity), it will beep, prompting you to type a few more letters before pressing the tab key again.
History – The shell keeps a list of the commands you have typed in. If you need to repeat a command, use the cursor keys to scroll up and down the list or type history for a list of previous commands.
To illustrate the shell’s functionality consider when a user types the following rm command with a “myfile” argument.
This has the effect of removing the file myfile using the rm system program. The shell searches the filestore for the file containing the program rm, and then requests the kernel, through system calls, to execute the program rm on myfile in the present working directory. When the process rm myfile has finished running, the shell then returns the Linux prompt $ to the user, indicating that it is waiting for further commands.Note something similar happens in a graphical user OS interface (e.g. Windows, Mac OSX) however few people are actually aware of what is happening under the hood. Note this will become clear in LL3.
Linux OS History and Perspective
Continuing on with our introduction, there is a wealth of information on the Web (again Wikipedia is correct) so I won’t repeat that information here. Please do not feel overwhelmed by all this new information – simply read it and try to understand noting a full understanding comes with time and you are going where few of your friends have dared or will dare to go but you will be employed because of this.
The Linux kernel was developed by Linus Torvalds and he made the source code available to the world resulting in a free operating system. Linux is now distributed under the GNU General Public License (GPL). This GPL means that software can be distributed freely (i.e. free to share). If and when you redistribute Linux and its source code, you must also distribute the same license providing the same democratic freedom to subsequent users and developers so that they may study and modify the program as they see fit. As a result, the Linux source code and its GPL are inseparable.
In contrast to MS Windows and Mac OSX, Linux was designed to be a portable operating system and interface (IEEE POSIX compliant interface) at the outset. When an OS or application is portable it can be run on many different platforms (e.g. computers, refrigerators, cars, mobile devices). Linux is mainly written in the C programming language (portable machine independent language) and it is this basis that allows it to be adapted on many different architectures serving a plethora of applications and and devices that include network attached storage (NAS), cell phones running Android OS and the explosion of Internet of Things (IoT) applications. To illustrate Linux’s present status consider that the Android OS uses a Linux Kernel.
So what are some of Linux’s attractive attributes?
Network OS (Mac OSX is also a Network OS whereas MS Windows is not)
Secure hierarchical file system based on directories
Allows links to file or directory permitting 2 or more names similar to Windows shortcuts
Shell is command interpreter as well as facilitating a programming language (Shell scripts are collection of shell commands in a file for subsequent execution, Windows called these batch files
Shell facilitates file name generation and wildcards where the asterisk (*) can replace several letters and the question mark (?) can replace a single letter
Device independent input and output were devices appear as files and supports redirection
Priority-based job control
Inter-process communication (IPC) pipes and filters
Now while we focus on Ubuntu, there are many other distributions or “distros” and it is important as IT professionals to recognize them: http://www.eweek.com/c/a/Linux-and-Open-Source/10-Linux-Distros-Every-IT-Manager-Should-Know-574208/?kc=EWKNLEDP11082011A
A complete listing of all the Linux distributions can be found at www.distrowatch.com.
For LL1 there is nothing to submit but please do not short change yourself by skipping or skimming through the reading and research. The reading and research is the important component but in education we must assess learning hence the subsequent assignment submissions.
Linus Torvalds’ Ted Talks
Thank you and here we go,