Foundation Course on Information Technology Outsourcing
2 CONTENTS UNIT - 1: Basics of Computer Science....................................................................... 1 UNIT - 2: Introduction to OS and Hardware Basics .................................................. 30 UNIT - 3: UNIX Basics.............................................................................................. 51 UNIT - 4: Server OS & Desktop OS Overview ......................................................... 60 UNIT - 5: Network Basics ......................................................................................... 72 UNIT - 6: Storage Basics.......................................................................................... 87 UNIT - 7: Virtualization Fundamentals...................................................................... 98 UNIT - 8: Database Fundamentals......................................................................... 112 UNIT - 9: Backup Fundamentals ............................................................................ 122 UNIT -10: Cloud Basics.......................................................................................... 132 UNIT -11: Introduction to Analytics......................................................................... 157
1 UNIT - 1: BASICS OF COMPUTER SCIENCE Structure 1.0 Learning Objectives 1.1 Introduction 1.2 computer History 1.3 Fundamentals of computers 1.3.1 Computer components 1.3.2 Memory types 1.3.3 Number system 1.4 Internet Basics 1.4.1 Intranet 1.4.2 Extranet 1.4.3 Websites 1.4.4 Email 1.5 Computer Security Basics 1.5.1 The CIA Triad 1.6 Summary 1.7 Glossary 1.8 References 1.0 Learning Objectives After studying this unit, you will be able to: • Explain computer hardware basics • State computer memory types • Explain the usage of the internet • Illustrate computer security
2 1.1 Introduction Computer Science is one of the disciplines of modern science under which, we study the various aspects of computer technologies, their development, and their applications in the present world. Likewise, Computer Science includes a wide range of topics such as the development of Computer Technology (hardware and software), application of Computer technology in today’s life, information technology, computer threat, computer security, etc. A computer is basically a programmable machine capable to perform arithmetic and logical operations automatically and sequentially. It is also known as a data processor, as it can store, process, and retrieve data as per the wish of the user. 1.2 Computer History The present Computer System has evolved after centuries of efforts from different intellectuals who contributed their works during different periods of time. Abacus is (most likely) considered as the earlier counting device. Let us now read about the innovators who contributed immensely in the development of a computer system. John Napier Napier was a Scottish mathematician who invented logarithms. Further, Napier also invented a computing device, which consisted of sticks with numbers imprinted on them. Napier named sticks ‘bones,’ as they were made up of bones. Blaise Pascal Pascal was a French mathematician who invented the machine based on gear wheels, which helped greatly in the calculation. Charles Babbage Babbage was an English Polymath, Mathematician, Mechanical Engineer, Philosopher, and Inventor. In 1822, he developed a machine capable to calculate the successive difference of expression and prepared a table that helped him in his calculations. Lady Ada Lovelace Lovelace was an English mathematician, who researched Babbage’s work. She has given the concept that ‘computers can be programmed’. Her work helped a great deal in the advancement of the computer system.
3 John Atanstoff With the assistance of Berry, John Atanstoff developed the Atanstoff Berry Computer (more popular as ABC) in 1937. It marked the beginning of the development of the electronic digital computer. John Mauchly and Eckart In 1947, John Mauchly and Eckart developed the first large-scale Electronic Digital Computer. It was called the Electronic Numerical Integrator and Calculator (ENIAC). Maurice V. Wilkes In 1949, Wilkes (at Cambridge University) designed Electronic Delay Storage Automatic Calculator (EDSAC). It was the first computer that started its operating system on the stored program concept. 1.3 Fundamentals of Computer System The computer is a device that transforms data into meaningful information. Data can be anything like marks obtained by you in various subjects. It can also be the name, age, sex, weight, height, etc. of all the students in a class. A computer can also be defined in terms of functions it can perform. A computer can i) accept data, ii) store data, iii) process data as desired, iv) retrieve the stored data as and when required and v) print the result in the desired format. The major characteristics of a computer are high speed, accuracy, diligence, versatility, and storage. Computer System
4 Data processing involves the following three activities – ➢ Input of data ➢ Processing of data ➢ Giving output (i.e., management of output result) ➢ In a computer system, data is arranged orderly and systematically. The term “computer” is derived from the Latin term “compute,” which means ‘to calculate.’ Initially, the computer system had been designed to calculate; it was intended to be a computing device. However, over a period of time, this device technically advanced; at present, it can perform a wide range of desirable works apart from data processing. The block diagram of the computer is shown in Fig. Computer Block Diagram The computer performs basically five major operations of functions irrespective of their size and make. These are 1) it accepts data or instruction by way of input, 2) it stores data, 3) it can process data as required by the user, 4) it gives results in the form of output, and 5) it controls all operations inside a computer. We discuss below each of these operations. Input: this is the process of entering data and programs into the computer system. Control Unit (CU): The process of input, output, processing, and storage is performed under the supervision of a unit called 'Control Unit'. It decides when to start receiving
5 data, stop it, store data, etc. It takes care of step-by-step processing of all operations inside the computer. Memory Unit: The computer is used to store data and instructions. Arithmetic Logic Unit (ALU): The major operations performed by the ALU are addition, subtraction, multiplication, division, logic, and comparison. Output: This is the process of producing results from the data for getting useful information. The ALU and the CU of a computer system are jointly known as the central processing unit (CPU). You may call the CPU the brain of any computer system. S.No. Operation Description 1 Take Input The process of entering data and instructions into the computer system. 2 Store Data Saving data and instructions so that they are available for processing as and when required. 3 Processing Performing arithmetic, and logical operations on data in Data order to convert them into useful information. 4 Output The process of producing useful information or results for Information the user, such as a printed report or visual display. 5 Control the Directs the manner and sequence in which all of the above workflow operations are performed. Major Functions of Computer System Following are the core functions of a computer system − • A computer accepts the command and/or data as the input given by the user. • A computer follows the instructions and stores the data given by the user. • A computer processes the data as per the instructions given by the user. • A computer gives the desired results in the form of output.
6 Salient Features of Computer System Following are the salient features of a Computer System − • Automation − The operating system of a computer system is automatic, as no human intervention is required; simply you need to give the command, and then it will do the work automatically. • Speed − Depending upon the power of the computer, it can perform, it can take Millions of instructions per second. • Storage − A computer system can store an enormous quantity of data in different formats. The storage capacity of a computer system is normally expressed in terms of Kilobytes (KB), Megabytes (MB), Gigabytes (GB), or Terabytes (TB). • Accuracy − The accuracy of a computer system is very high. • Versatility − A computer system is capable of performing a wide range of tasks. • Diligence − A computer neither gets tired nor loses concentration. • Reliability − As a computer system always gives accurate results; therefore, its reliability is very high. • Vast memory − A computer system can have a wide range of memory that can recall the desired data at any point in time. 1.4.1 Memory types Memory is a necessary part of the computer. It is a basic need to store and analyze data and accordingly give responses to the commands inferred on the computer by the users. Memory is the storage section of the computer’s functioning. The information for immediate use and for the computer hardware devices and their functioning is stored in the memory too. High-speed operations take place in the memory for the processing of information in the computer. Similar to the human brain, there are different types of memory storage available on the computer. With changing times and constant development in technology, memory is also upgraded. 1. Primary Memory This type of memory includes both the RAM (Random Access Memory) and the ROM (Read-Only Memory). It stores very small amounts of data and can be accessed very quickly when the computer is running on power mode. i. RAM (Random Access Memory) The data that is stored in the RAM memory can be accessed in a random manner. There is no particular order needed. It is the most expensive type of memory. It is very fast and quick but requires power to run and exchange data and share data that is stored in its memory. Whichever data is needed to be processed imminently is moved to the RAM where the modification and accessing of the data is done quickly so that there is no waiting period for the CPU to start functioning. It improves the speed of the
7 processing of the CPU and the different multiple commands given to it by the users. Whichever data becomes out of use is then moved to the secondary memory and the space in the RAM is freed for further processes. Two types of RAM are: a. DRAM Dynamic RAM is the commonly used RAM in the computers. Unlike earlier times when the computers used to use single data rate (SDR) RAM, now they use dual data rate (DDR) RAM which has faster processing ability. DDR2, DDR3, DDR4 are the available versions of the DRAM each efficient according to their number. The compatibility of the DRAM with the operating system needs to be checked before any installation. b. SRAM Static RAM is faster than Dynamic RAM and therefore it is more expensive. It has a total of six transistors in each of its cells. Therefore, it is commonly used as a data cache within the CPU and in high-end servers. The speed of computer increases drastically. ii. ROM (Read-Only Memory) Data can be only read and not written to it. It is a fast type of memory. It is a non- volatile type of memory. In case of no power, the data is stored in it and then accessed by the computer when power is turned on. It usually contains the Bootstrap code which is required for the computer to interact with the hardware systems and understand its operations and functions according to the commands given to it. In simpler devices used commonly, there is ROM in which the firmware data is stored to get them to function according to their need. 2. Secondary Memory It is physically placed or located inside a separate storage device which is then connected to the computer for access. HDD and SSD are the most commonly used secondary memory devices in a computer normally. They are not as expensive as the RAM and ROM and are reasonably priced. Their read and write speeds are also comparatively lower. Since it is a separate device altogether, it can preserve the data that is saved inside it without the need for power. The data exchanged and stored is first sent to the RAM and then to the CPU for further processing. They have the possibility of permanently storing the data and at the same time, you can easily use them anywhere and carry them along with you. Uses of Memory in a Computer
8 Computer memory is one of the basic needs of the CPU and its functioning to run the computer as it should. Computer Memory speeds up the data processing which is done by the CPU (Central Processing Unit). Storage of temporary and permanent data is necessary for the computer to run its processes and also respond to the user commands by communicating with all the hardware devices that support the computer and its running. The efficiency of the computer needs memory as a basic amenity in its system. Better memory will result in faster functioning of computer. Number systems The technique to represent and work with numbers is called the number system. The decimal number system is the most common number system. Other popular number systems include: 1. Decimal Number System 2. Octal Number System 3. Hexadecimal Number System ASCII Besides numerical data, the computer must be able to handle alphabets, punctuation marks, mathematical operators, special symbols, etc. that forms the complete character set of English language. The complete set of characters or symbols are called alphanumeric codes. The complete alphanumeric code typically includes − • 26 upper case letters • 26 lower case letters • 10 digits • 7 punctuation marks • 20 to 40 special characters Now a computer understands only numeric values, whatever the number system used. So, all characters must have a numeric equivalent called the alphanumeric code. The most widely used alphanumeric code is American Standard Code for Information Interchange (ASCII). ASCII is a 7-bit code that has 128 (27) possible codes.
9 ISCII-ISCII stands for Indian Script Code for Information Interchange. IISCII was developed to support Indian languages on computer. Language supported by IISCI include Devanagari, Tamil, Bangla, Gujarati, Gurmukhi, Tamil, Telugu, etc. IISCI is mostly used by government departments and before it could catch on, a new universal encoding standard called Unicode was introduced. Unicode-Unicode is an international coding system designed to be used with different language scripts. Each character or symbol is assigned a unique numeric value, largely within the framework of ASCII. Earlier, each script had its own encoding system, which could conflict with each other.
10 1.4 Internet Basics Internet is a system that interconnects the different computer systems across the world. It uses the Internet protocol suite to link devices located in different corners of the world. The Internet system carries an extensive range of information resources and services including World Wide Web (WWW), telephony, electronic mail, etc. It uses standard internet protocols, such as TCP/IP and HTTP, etc. An internal web comprises all Hypertext Transfer Protocol (HTTP) nodes on a private network; for example, an organization’s LAN or WAN. Internet Features of Internet The features are described below − Accessibility An Internet is a global service and access to all. Today, people located in a remote part of an island or interior of Africa can also use the Internet. Easy to Use The software, which is used to access the Internet (web browser), is designed very simple; therefore, it can be easily learned and used. It is easy to develop. Interaction with Other Media
11 Internet service has a high degree of interaction with other media. For example, News and other magazines, publishing houses have extended their business with the help of Internet services. Low Cost The development and maintenance cost of Internet service is comparatively low. Extension of Existing IT Technology This facilitates the sharing of IT technology by multiple users in organizations and even facilitates other trading partners to use. Flexibility of Communication Communication through Internet is flexible enough. It facilitates communication through text, voice, and video too. These services can be availed at both organizational and individual levels. Security Last but not the least, Internet facility has to a certain extent helped the security system both at the individual and national level with components such as CCTV camera, etc. Internet Software Internet Software comprises all the tools needed for networking through the computer. Following are a few important components of the Internet Software − • Transmission Control Protocol/ Internet Protocol (TCP/IP) • Dialer Software • Interment Browser • Internet Applications Internet applications are server-based applications. Following are a few applications of Internet ➢ World Wide Web (WWW) ➢ Electronic mail (e-mail) ➢ File Transfer Protocol (FTP) ➢ Telnet (i.e., log-in to the computer located remotely) ➢ Internet Relay Chat (IRC) (Real-time video chatting) How does the internet work? The internet works with the help of clients and servers. A device such as a laptop, which is connected to the internet is called a client, not a server as it is not directly connected to the internet. However, it is indirectly connected to the internet through an Internet Service Provider (ISP) and is identified by an IP address. Just like you have
12 an address for your home that uniquely identifies your home, an IP address acts as the shipping address of your device. The IP address is provided by your ISP. A server is a large computer that stores websites. It also has an IP address. A place where a large number of servers are stored is called a data center. The server accepts requests sent by the client through a browser over a network (internet) and responds accordingly. To access the internet, we need a domain name, which represents an IP address number, i.e., each IP address has been assigned a domain name. For example, youtube.com, facebook.com, paypal.com are used to represent the IP addresses. Domain names are created as it is difficult for a person to remember a long string of numbers. However, the internet does not understand the domain name, it understands the IP address, so when you enter the domain name in the browser search bar, the internet has to get the IP addresses of this domain name from a huge phone book, which is known as DNS (Domain Name Server). For example, if you have a person's name, you can find his phone number in a phone book by searching his name. The internet uses the DNS server in the same way to find the IP address of the domain name. DNS servers are managed by ISPs or similar organizations. Internet Working Once the server gets the request to provide information about a particular website, the data starts flowing. The data is transferred through the optical fiber cables in digital format or in the form of light pulses. As the servers are placed at distant places, the data may have to travel thousands of miles through optical fiber cable to reach your computer. The optical fiber is connected to a router, which converts the light signals into electrical signals. These electrical signals are transmitted to your laptop using an Ethernet cable. Thus, you receive the desired information through the internet, which
13 is actually a cable that connects you with the server. Furthermore, if you are using wireless internet using Wi-Fi or mobile data, the signals from the optical cable are first sent to a cell tower and from where it reaches your cell phone in the form of electromagnetic waves. The internet is managed by ICANN (Internet Corporation for Assigned Names and Numbers) located in the USA. It manages IP addresses assignment, domain name registration, etc. Data transfer is very fast on the internet. The moment you press enter you get the information from a server located thousands of miles away from you. The reason for this speed is that the data is sent in the binary form (0, 1), and these zeros and ones are divided into small pieces called packets, which can be sent at high speed. 1.4.1 Intranet An intranet is a computing network, based on the same techniques as the internet, but which can only be used by a specific group within an organization. In many companies, intranets have replaced the “blackboard” and allow access to data specific to the company, such as telephone lists, the list of absences, information about the company, etc. The objective of an intranet is to facilitate access to information for employees within the company. The intranet also starts automatically when you start the browser. The information published on the intranet is confidential and usually reserved for employees. Small companies with full knowledge of the facts use other channels of communication for employees. The intranet is, therefore, more common in companies that have more staff. The advantages of an intranet: • Information flows within the company are faster • The risk of error is reduced • Work is facilitated because all departments in the company have access to the common database and do not need to consult different lists or records • Some applications can even be automated
14 Intranet How the Intranet Works: Intranet basically comprises three components: a web server, an intranet platform, and applications. The web server is hardware that contains all the intranet software and data. It manages all requests for files hosted over the server and finds the requested files and then delivers it to the user's computer. Intranet Working The intranet platform, which is software, allows communication tools, collaboration apps, and databases to work seamlessly with each other. It is tailored to the specific needs of a business. The applications are required to enable users to work smoothly. They are the computing tools that allow users to do their work, communicate, coordinate with each other and retrieve and store information. Furthermore, the user
15 who wants to access the intranet is required to have a special network password and should be connected to the LAN. A user who is working remotely can gain access to the intranet through a virtual private network (VPN) that allows them to sign in to the intranet to access the information. Disadvantages of Intranet: • It may be costly to set up an Intranet due to hidden costs and complexity. • If the firewall does not work properly or is not installed, it can be hacked by someone • High-security passwords are required, which cannot be guessed by outside users • There is always a fear of losing control over the intranet • Sometimes document duplication may happen which can cause confusion among employees • You have to give access to multiple users, so you may find it hard to control this network. Examples of Intranet: Educational Intranet: It is generally found in a school, college, etc., For example, a school intranet is intended to allow teaching staff to communicate with each other and get information about upcoming updates such as exam dates, schools functions, holidays, etc. Real Estate Intranet: The intranet of a real estate company allows its sales team to have access to all important brochures, templates, forms that they may need to close a sale. Employees also remain up to date with important events like meetings, training, sessions, etc. It can also be used to share motivational messages with the team. Health Care Intranet: In the healthcare sector, in big hospitals, the Intranet helps health care professionals to work as a team to provide proper care and treatment to their patients. Doctors can share reports, treatment procedures, bills, and claims that can be settled easily without moving from one department to another department. IT Sector Intranet: In the IT sector three is always a lot of information that needs to be shared with all the employees in one go. It may be related to a project that needs to be completed within the given time frame, such as guidelines, terms and conditions, and rules that are to be followed while working on a project. Difference between Intranet and Internet:
16 Internet Intranet It is a medium such as optical fiber cable that It is a small, private network as it connects billions of computers with each other belongs to a specific to establish a worldwide network. organization. It has billions of users as it is a public network It has limited users. with a worldwide presence. It is not as safe as an intranet. It is a safer network than the internet. It can be assessed or used by anyone using Only authorized persons can use internet-enabled devices, such as laptops, this network. mobile phones, etc. It offers a wide range of information, such as It offers limited information news, blogs, websites, etc. related to its organization's work, policies, updates, etc. It is not owned by a single person or an It can be owned by a person or an organization. organization. 1.4.2 Website Website is a collection of related web pages that may contain text, images, audio, and video, etc. The first page of a website is called a home page. Each website has a specific internet address (URL) that you need to enter in your browser to access a website. A website is hosted on one or more servers and can be accessed by visiting its homepage using a computer network. A website is managed by its owner that can be an individual, company, or organization. The first website was introduced on 6 August 1991. It was developed by Tim Berners-Lee at CERN. As of January 2018, there were around 1.7 billion websites on the internet. What is the need for a website?
17 A popular website is another name of success in modern times as today we are living in a digital world where people are spending most of their spare time on internet browsing news, images, videos, and more. A website is the first thing that appears on the screen of your laptop when you search for a product or service, or any other information online. So, it is very important to have a website whether you are a businessman, organization, online store, etc. Let us understand how a website can help you grow your business! The benefits of having a website are as follows: 1. Cost-effective: The marketing of products and services through a website is less costly than print advertising, TV, and radio advertising. It also allows you to make changes related to your products and services such as you can edit products' specifications, features, discount offers, etc. 2. Broder demographic reach: A website can help your business reach people with diverse backgrounds throughout the world. 3. Business credibility: Having a website that is user-friendly and professional looking for your business makes people consider your business more credible than others who don't have a website to represent their businesses online. 4. 24/7 availability: You can keep your products available for sale around the clock through a website. Customers can buy anytime, and thus you can earn more profits than a traditional storefront. 5. Consumer convenience: It improves the shopping experience of your customers; they can buy your products from the comfort of their home. 6. Build customer rapport: Online presence helps you build and maintain a rapport among your customers. You can also introduce special offers or discounts for your loyal customers. 7. Improves productivity: It saves your time as you don't need to explain your products or services to each customer separately, as all the information is already available on the website. 8. Educate your customers: You can educate people about the benefits of your products and can show them how they are betters than the competitors' products. 9. Change location: You can move your business to another location without affecting your sales as customers still can find you through your website. 10. Grow manpower: You can post job openings for vacant positions and allow applicants to check job descriptions and apply online.
18 11: Personalized email address: It allows you to set up personalized email addresses for employees, companies, partners, etc. You can receive mails on these mail ids and reply accordingly. Furthermore, you can share offers, happy hours, updates, and can get feedback through email. 12. Improve customer service: It allows you to improve customer services such as you can share phone numbers to contact you, and display other relevant information such as order status, delivery status, refund or replacement procedure, etc. Types of Websites: A website can be of two types based on the type of webpages: • Static Website • Dynamic Website Static website A static website, as the name suggests, is a website in which pages do not change or remain the same. It is the basic type of website that is easy to create, maintain, and host. You don't need web programming and database design to create a static website. Its webpages are coded in HTML. The codes are fixed for each page, so the information contained on the page does not change, and it looks like a printed page. However, changes can be made by changing the codes if required. You can think of it as a brochure for a business that has the same information for every user. So, all users see the same information irrespective of their location, interests, etc., when they open a particular page of a static website. In the case of a static website, the content or webpage is taken directly from the file stored in the server without requiring any interpreter (application software) to interact with a database to fetch data from the database. So, database and server-site scripting are not required in static websites. Benefits of a Static Website: • It takes less time to create a static website. • It is less costly to develop this website. • The webpages are delivered at high speed by the servers. • Hosting through dedicated servers is available at a low price. • It is more secure than dynamic sites as it does not rely on CMS plugins and server-side scripting. Dynamic website A dynamic website is a collection of dynamic web pages whose content changes dynamically. It accesses content from a database or Content Management System (CMS). Therefore, when you alter or update the content of the database, the content of the website is also altered or updated. A dynamic website uses client-side scripting
19 or server-side scripting, or both to generate the dynamic content. For example, when a browser sends a request to the server, the server contacts the application server with further interacts with the database server to fetch the content, which is customized as per the user's requests and requirements. For example, a Facebook page may appear different to different users as per their friends' list, interests, location, etc. Benefits of a Dynamic Website: • It is very quick and easy to make changes in a dynamic website as it is integrated with high-end programming. • The web pages are easier to maintain despite being full of information and graphics. • E-commerce sites are dynamic as they need to be impressive and have easy navigation from one page to other pages. • It makes your site look professional. • The users can get customized information as per their interests, needs, and profile, etc. For example, facebook.com, flipkart.com, etc. Difference between Static Website and Dynamic Website: Static Website Dynamic Website As the name suggests, its web As the name suggests, the web pages page does not change in terms of keep changing as per users' design, content, etc. The requirements such as Facebook profile information or content remains the pages and an E-commerce site. So, the same. content does not remain the same. It mainly uses HTML and CSS and It requires server-side scripting, does not require server-side application server, and database to scripting, application server, and create and send dynamic webpages to database. the client. It has a limited number of pages. It may contain thousands of pages in the database. Its hosting cost is low, as HTML Its hosting cost is higher as dynamic files need less space on the server. pages need more space on the server.
20 It requires low maintenance. It requires high maintenance. It loads quickly as it involves the It takes more time to load due to the use of mark-up languages to create more processing time. a webpage. It lacks the Content management It makes use of the Content feature. Management Feature. The content of the webpage cannot The webpage content can be changed be changed during runtime. during runtime. It does not require interaction with Interaction with the database occurs. a database. It is more secure or has fewer It is less secure and may get hacked chances of it getting hacked as it easily as it uses many plugins and doesn't use plugins. content sources. It is more reliable, e.g., whenever It is less reliable, as it may go down for the server is down, it is redirected hours if the server breaks down to other nearby nodes. Types of Websites based on their purpose, target audience, etc. 1. Blog: It is a type of website that provides information or in which posts are added regularly in reverse chronological order, latest post or entries on top of the main page, and old ones towards the bottom. A blog is usually owned by a single person or a small group of people. The content in a blog is written in an informal or conversational style and can be focused on one subject or a wide range of related subjects. Furthermore, the posts are organized into categories if required, e.g., posts that provide similar information can be kept in a separate category. The content of a blog is generally referred to as a blog post, and it generally appears as posts on a streaming page. The information is regularly updated in a blog, e.g., articles, photos, and videos are added on a daily
21 basis to keep readers engaged and increase the traffic to the blog. It also allows readers to leave a comment about the posts. 2. E-commerce: These types of websites are like online shops where people can buy products through online payment from the comfort of their home, office, etc. Anyone who wants to sell products online can create an E-commerce site instead of investing in setting up a traditional brick-and-mortar shop. 3. Informational: These websites are created to provide free online information to users, e.g., tutorials, news, general knowledge-based sites. Today, you don't need to visit libraries to read a book, newspaper, novel, etc. owing to the presence of lots of informational sites. 4. Online Community: These sites offer a platform to interact and share ideas with others through the internet. You can find people with similar interests and backgrounds and interact with them to fulfill your objectives which may include promoting a product or service, taking feedback about your products, or asking questions related to a survey. 5. Social Media: These sites are created to provide users a platform where they can build their personal profiles with a lot of features such as creating a friend list, sending and accepting friend requests, sending messages, creating and joining groups, and sharing information with others users, comment on others' post, pictures, videos, etc. 6. Brochure: It is the simplest type of website which comprises a few pages. It is used by small businesses to have a simple online presence or to provide an overview of their business. Such websites are generally static where the content does not change, i.e., the same information is displayed to all users. 7. Non-profit: The sites are created to raise money for social causes such as to provide free medical treatment to the poor, free basic education to children, free food to children to prevent malnutrition, etc. 1.4.3 Email Email is a service that allows us to send message in electronic mode over the internet. It offers an efficient, inexpensive, and real-time means of distributing information among people. E-Mail Address Each user of email is assigned a unique name for his email account. This name is known as E-mail address. Different users can send and receive messages according to the e-mail address. E-mail is generally of the form username@domainname. For example, [email protected] is an e-mail address where webmaster is a username and tutorialspoint.com is a domain name.
22 • The username and the domain name are separated by @ (at) symbol. • E-mail addresses are not case-sensitive. • Spaces are not allowed in e-mail addresses. E-mail Message Components E-mail message comprises of different components: E-mail Header, Greeting, Text, and Signature. These components are described in the following diagram: Email component E-mail Header The first five lines of an E-mail message is called E-mail header. The header part comprises of following fields: • From • Date • To • Subject • CC • BCC
23 From The From field indicates the sender’s address i.e., who sent the e-mail. Date The Date field indicates the date when the e-mail was sent. To The To field indicates the recipient’s address i.e., to whom the e-mail is sent. Subject The Subject field indicates the purpose of e-mail. It should be precise and to the point. CC CC stands for Carbon copy. It includes those recipient addresses whom we want to keep informed but not exactly the intended recipient. BCC BCC stands for Black Carbon Copy. It is used when we do not want one or more of the recipients to know that someone else was copied on the message. Greeting The greeting is the opening of the actual message. E.g., Hi Sir or Hi Guys etc. Text It represents the actual content of the message. Signature This is the final part of an e-mail message. It includes the Name of the Sender, Address, and Contact Number. Advantages An E-mail has proved to be a powerful and reliable medium of communication. Here are the benefits of E-mail: ➢ Reliable ➢ Convenience ➢ Speed ➢ Inexpensive ➢ Printable ➢ Global ➢ Generality
24 Disadvantages Apart from several benefits of E-mail, there also exists some disadvantages as discussed below: ➢ Forgery ➢ Overload ➢ Misdirection ➢ Junk ➢ No response Forgery-E-mail doesn’t prevent forgery, that is, someone impersonating the sender, since the sender is usually not authenticated in any way. Overload-Convenience of E-mail may result in a flood of mail. Misdirection-It is possible that you may send an e-mail to an unintended recipient. Junk-Junk emails are undesirable and inappropriate emails. Junk emails are sometimes referred to as spam. No Response-It may be frustrating when the recipient does not read the e-mail and respond on a regular basis. 1.5 Computer Security Basics Computer security basically is the protection of computer systems and information from harm, theft, and unauthorized use. It is the process of preventing and detecting unauthorized use of your computer system. There are various types of computer security which is widely used to protect the valuable information of an organization. One way to ascertain the similarities and differences among Computer Security is by asking what is being secured. For example, • Information security is securing information from unauthorized access, modification & deletion • Application Security is securing an application by building security features to prevent Cyber Threats such as SQL injection, DoS attacks, data breaches and etc. • Computer Security means securing a standalone machine by keeping it updated and patched • Network Security is by securing both the software and hardware technologies • Cybersecurity is defined as protecting computer systems, which communicate over the computer networks
25 It’s important to understand the distinction between these words, though there isn’t necessarily a clear consensus on the meanings and the degree to which they overlap or are interchangeable. So, Computer security can be defined as controls that are put in place to provide confidentiality, integrity, and availability for all components of computer systems. Let’s elaborate on the definition. 1.6.1 The CIA Triad Computer security is mainly concerned with three main areas: The CIA Traid • Confidentiality is ensuring that information is available only to the intended audience • Integrity is protecting information from being modified by unauthorized parties • Availability is protecting information from being modified by unauthorized parties In simple language, computer security is making sure information and computer components are usable but still protected from people or software that shouldn’t access it or modify it. Computer security threats Computer security threats are possible dangers that can hamper the normal functioning of a computer. In the present age, cyber threats are constantly increasing as the world is going digital. The most harmful of computer security threats are: Viruses
26 Viruses A computer virus is a malicious program which is loaded into the user’s computer without user’s knowledge. It replicates itself and infects the files and programs on the user’s PC. The ultimate goal of a virus is to ensure that the victim’s computer will never be able to operate properly or even at all. Computer Worm Computer Worm A computer worm is a software program that can copy itself from one computer to another, without human interaction. The potential risk here is that it will use up your computer’s hard disk space because a worm can replicate in great volume and with great speed. Phishing Phishing Disguising as a trustworthy person or business, phishers attempt to steal sensitive financial or personal information through fraudulent email or instant messages. Phishing is unfortunately very easy to execute. You are deluded into thinking it’s legitimate mail and you may enter your personal information. Botnet
27 Botnet A botnet is a group of computers connected to the internet, that have been compromised by a hacker using a computer virus. An individual computer is called a ‘zombie computer’. The result of this threat is the victim’s computer, which is the bot that will be used for malicious activities and for a larger scale attack like DDoS. Rootkit Rootkit A rootkit is a computer program designed to provide continued privileged access to a computer while actively hiding its presence. Once a rootkit has been installed, the controller of the rootkit will be able to remotely execute files and change system configurations on the host machine. Keylogger Keylogger Also known as a keystroke logger, keyloggers can track the real-time activity of a user on his computer. It keeps a record of all the keystrokes made by the user keyboard. Keylogger is also a very powerful threat to steal people’s login credentials such as username and password.
28 These are perhaps the most common security threats that you’ll come across. Apart from these, there are others like spyware, wabbits, scareware, bluesnarfing, and many more. Fortunately, there are ways to protect yourself against these attacks. Why is Computer Security Important? In this digital era, we all want to keep our computers and our personal information secure and hence computer security is important to keep our personal information protected. It is also important to maintain our computer security and its overall health by preventing viruses and malware which would impact the system performance. Computer Security Practices Computer security threats are becoming relentlessly inventive these days. There is much need for one to arm oneself with information and resources to safeguard against these complex and growing computer security threats and stay safe online. Some preventive steps you can take include: ➢ Secure your computer physically by: ➢ Installing reliable, reputable security and anti-virus software ➢ Activating your firewall, because a firewall acts as a security guard between the internet and your local area network ➢ Stay up-to-date on the latest software and news surrounding your devices and perform software updates as soon as they become available ➢ Avoid clicking on email attachments unless you know the source ➢ Change passwords regularly, using a unique combination of numbers, letters, and case types ➢ Use the internet with caution and ignore pop-ups, drive-by downloads while surfing ➢ Taking the time to research the basic aspects of computer security and educate yourself on evolving cyber-threats Perform daily full system scans and create a periodic system backup schedule to ensure your data is retrievable should something happen to your computer. Apart from these, there are many ways you can protect your computer system. Aspects such as encryption and computer cleaners can assist in protecting your computers and their files. Unfortunately, the number of cyber threats is increasing at a rapid pace and more sophisticated attacks are emerging. So, having a good foundation in cybersecurity concepts will allow you to protect your computer against ever-evolving cyber threats.
29 1.6 Summary • Computer Science is one of the disciplines of modern science about the various aspects of computer technologies, their development, and their applications in the present world. • Computer Science includes a wide range of topics such as the development of Computer Technology (hardware and software), application of Computer technology • Computers can connect to different locations using the Internet. • Computer software that performs a task or set of tasks, such as word processing or drawing. Applications are also referred to as programs. • Computer uses Internet Software comprises of all the tools needed for networking. • Computer security is required for preventing damage to the hardware. 1.7 Glossary • Application: Computer software that performs a task or set of tasks, such as word processing or drawing. Applications are also referred to as programs. • ASCII: American Standard Code for Information Interchange, an encoding system for converting keyboard characters and instructions into the binary number code that the computer understands. • Bandwidth: The capacity of a networked connection. Bandwidth determines how much data can be sent along the networked wires. Bandwidth is particularly important for Internet connections since greater bandwidth also means faster downloads. • Binary code: The most basic language a computer understands, it is composed of a series of 0s and 1s. The computer interprets the code to form numbers, letters, punctuation marks, and symbols. 1.8 References • https://edu.gcfglobal.org/en/computerbasics/ • https://www.uc.edu/webapps/af/hr/CUSTOMGUIDE/content/content/computerba sics.pdf • https://teamtreehouse.com/library/computer-basics • https://www.nist.gov/itl/smallbusinesscyber/cybersecurity-basics
30 UNIT - 2: INTRODUCTION TO OS AND HARDWARE BASICS Structure 2.0 Learning Objectives 2.1 Introduction 2.2 Hardware Basics 2.2.1 Components of a Computer System 2.2.2 Memory Subsystem 2.2.3 Input-Output Subsystem 2.3 Operating System 2.3.1 Memory Management 2.3.2 Process Management 2.3.3 File Management 2.4 Summary 2.5 Glossary 2.6 References 2.0 Learning Objectives After studying this unit, you will be able to: • Explain hardware basics of computer system • Explain operating system 2.1 Introduction An Operating System (OS) is software that acts as an interface between computer hardware components and the user. Every computer system must have at least one operating system to run other programs. Applications like Browsers, MS Office, Notepad Games, etc., need some environment to run and perform its tasks. The OS
31 helps you to communicate with the computer without knowing how to speak the computer’s language. It is not possible for the user to use any computer or mobile device without having an operating system. An operating system acts as an intermediary between the user of a computer and computer hardware. The purpose of an operating system is to provide an environment in which a user can execute programs conveniently and efficiently. An operating system is a software that manages computer hardware. The hardware must provide appropriate mechanisms to ensure the correct operation of the computer system and to prevent user programs from interfering with the proper operation of the system. Hardware Basics of Computer System Functions of Operating system -Operating system performs three functions: • Convenience: An OS makes a computer more convenient to use. • Efficiency: An OS allows the computer system resources to be used efficiently. • Ability to Evolve: An OS should be constructed in such a way as to permit the effective development, testing, and introduction of new system functions at the same time without interfering with service. • Throughput: An OS should be constructed so that it can give maximum throughput (Number of tasks per unit time). Major Functionalities of Operating System: ➢ Resource Management: When parallel accessing happens in the OS means when multiple users are accessing the system the OS works as Resource Manager, its responsibility is to provide hardware to the user. It decreases the load in the system.
32 ➢ Process Management: It includes various tasks like scheduling, termination of the process. OS manages various tasks at a time. Here CPU Scheduling happens means all the tasks would be done by the many algorithms that use for scheduling. ➢ Storage Management: The file system mechanism used for the management of the storage. NIFS, CFS, CIFS, NFS, etc. are some file systems. All the data stored in various tracks of Hard disks that are all managed by the storage manager. It included Hard Disk. ➢ Memory Management: Refers to the management of primary memory. The operating system has to keep track, how much memory has been used and by whom. It has to decide which process needs memory space and how much. OS also has to allocate and deallocate the memory space. ➢ Security/Privacy Management: Privacy is also provided by the Operating system by means of passwords so that unauthorized applications can’t access programs or data. For example, Windows uses Kerberos authentication to prevent unauthorized access to data. 2.2 Hardware Basics An operating system has to work closely with the hardware system that acts as its foundations. The operating system needs certain services that can only be provided by the hardware. In order to fully understand the Linux operating system, you need to understand the basics of the underlying hardware. This chapter gives a brief introduction to that hardware: the modern PC. When the ``Popular Electronics'' magazine for January 1975 was printed with an illustration of the Altair 8080 on its front cover, a revolution started. The Altair 8080, named after the destination of an early Star Trek episode, could be assembled by home electronics enthusiasts for a mere $397. With its Intel 8080 processor and 256 bytes of memory but no screen or keyboard, it was puny by today's standards. Its inventor, Ed Roberts, coined the term `the `personal computer'' to describe his new invention, but the term PC is now used to refer to almost any the computer that you can pick up without needing help. By this definition, even some of the very powerful Alpha AXP systems are PCs. Enthusiastic hackers saw the Altair's potential and started to write software and build hardware for it. To these early pioneers, it represented freedom; the freedom from huge batch processing mainframe systems run and guarded by an elite priesthood. Overnight fortunes were made by college dropouts fascinated by this new phenomenon, a computer that you could have at home on your kitchen table. A lot of hardware appeared, all different to some degree, and software hackers were happy to write software for these new machines. Paradoxically it was IBM who firmly cast the mould of the modern PC by announcing the IBM PC in 1981 and shipping it to customers early in 1982. With its Intel 8088 processor, 64K of memory (expandable to 256K), two
33 floppy disks, and an 80 character by 25 lines Colour Graphics Adapter (CGA) it was not very powerful by today's standards but it sold well. It was followed, in 1983, by the IBM PC-XT which had the luxury of a 10Mbyte hard drive. It was not long before IBM PC clones were being produced by a host of companies such as Compaq and the architecture of the PC became a de-facto standard. This de-facto standard helped a multitude of hardware companies to compete together in a growing market which, happily for consumers, kept prices low. Many of the system architectural features of these early PCs have carried over into the modern PC. For example, even the most powerful Intel Pentium Pro based system starts running in the Intel 8086's addressing mode. When Linus Torvalds started writing what was to become Linux, he picked the most plentiful and reasonably priced hardware, an Intel 80386 PC. 2.2.1 Components of computer system Component of Computer System Looking at a PC from the outside, the most obvious components are a system box, a keyboard, a mouse and a video monitor. On the front of the system box are some buttons, a little display showing some numbers and a floppy drive. Most systems these
34 days have a CD ROM and if you feel that you have to protect your data, then there will also be a tape drive for backups. These devices are collectively known as the peripherals. The CPU The CPU, or rather microprocessor, is the heart of any computer system. The microprocessor calculates, performs logical operations, and manages data flows by reading instructions from memory and then executing them. In the early days of computing, the functional components of the microprocessor were separate (and physically large) units. This is when the term Central Processing Unit was coined. The modern microprocessor combines these components onto an integrated circuit etched onto a very small piece of silicon. The terms CPU, microprocessor and processor are all used interchangeably in this book. Microprocessors operate on binary data; that is data composed of ones and zeros. These ones and zeros correspond to electrical switches being either on or off. Just as 42 is a decimal number meaning ``4 10s and 2 units'', a binary number is a series of binary digits each one representing a power of 2. In this context, a power means the number of times that a number is multiplied by itself. 10 to the power 1 (101) is 10, 10 to the power 2 (102) is 10x10, 103 is 10x10x10 and so on. Binary 0001 is decimal 1, binary 0010 is decimal 2, binary 0011 is 3, binary 0100 is 4, and so on. So, 42 decimals are 101010 binary or (2 + 8 + 32 or 21 + 23 + 25). Rather than using binary to represent numbers in computer programs, another base, hexadecimal is usually used. In this base, each digital represents a power of 16. As decimal numbers only go from 0 to 9 the numbers 10 to 15 are represented as a single digit by the letters A, B, C, D, E, and F. For example, hexadecimal E is decimal 14 and hexadecimal 2A is decimal 42 (two 16s) + 10). Using the C programming language notation (as I do throughout this book) hexadecimal numbers are prefaced by ``0x''; hexadecimal 2A is written as 0x2A. Microprocessors can perform arithmetic operations such as add, multiply and divide and logical operations such as ``is X greater than Y?'' The processor's execution is governed by an external clock. This clock, the system clock, generates regular clock pulses to the processor and, at each clock pulse, the processor does some work. For example, a processor could execute an instruction for every clock pulse. A processor's speed is described in terms of the rate at which the system clock ticks. A 100Mhz processor will receive 100,000,000 clock ticks every second. It is misleading to describe the power of a CPU by its clock rate as different processors perform different amounts of work per clock tick. However, all things being equal, a faster clock speed means a more powerful processor. The instructions executed by the processor are very simple; for example, ``read the contents of memory at location X into register Y''. Registers are the microprocessor's
35 internal storage, used for storing data and performing operations on it. The operations performed may cause the processor to stop what it is doing and jump to another instruction somewhere else in memory. These tiny building blocks give the modern microprocessor almost limitless power as it can execute millions or even billions of instructions a second. The instructions have to be fetched from memory as they are executed. Instructions may themselves reference data within memory and that data must be fetched from memory and saved there when appropriate. The size, number and type of register within a microprocessor is entirely dependent on its type. An Intel 4086 processor has a different register set to an Alpha AXP processor; for a start, the Intel's are 32 bits wide and the Alpha AXP's are 64 bits wide. In general, though, any given processor will have a number of general-purpose registers and a smaller number of dedicated registers. Most processors have the following special purpose, dedicated, registers: Program Counter (PC) This register contains the address of the next instruction to be executed. The contents of the PC are automatically incremented each time an instruction is fetched. Stack Pointer (SP) Processors have to have access to large amounts of external read/write random access memory (RAM) which facilitates temporary storage of data. The stack is a way of easily saving and restoring temporary values in external memory. Usually, processors have special instructions which allow you to push values onto the stack and to pop them off again later. The stack works on a last in first out (LIFO) basis. In other words, if you push two values, x, and y, onto a stack and then pop a value off of the stack then you will get back the value of y. Some processors’ stacks grow upwards towards the top of memory whilst others grow downwards towards the bottom, or base, of memory. Some processors support both types, for example, ARM. Processor Status (PS) Instructions may yield results; for example, ``is the content of register X greater than the content of register Y?'' will yield true or false as a result. The PS register holds this and other information about the current state of the processor. For example, most processors have at least two modes of operation, kernel (or supervisor) and user. The PS register would hold information identifying the current mode. Memory All systems have a memory hierarchy with memory at different speeds and sizes at different points in the hierarchy. The fastest memory is known as cache memory and is what it sounds like - memory that is used to temporarily hold, or cache, contents of the main memory. This sort of memory is very fast but expensive, therefore most
36 processors have a small amount of on-chip cache memory and more system-based (on-board) cache memory. Some processors have one cache to contain both instructions and data, but others have two, one for instructions and the other for data. The Alpha AXP processor has two internal memory caches; one for data (the D- Cache) and one for instructions (the I-Cache). The external cache (or B-Cache) mixes the two together. Finally, there is the main memory which relative to the external cache memory is very slow. Relative to the on-CPU cache, the main memory is positively crawling. The cache and main memories must be kept in step (coherent). In other words, if a word of main memory is held in one or more locations in the cache, then the system must make sure that the contents of cache and memory are the same. The job of cache coherency is done partially by the hardware and partially by the operating system. This is also true for a number of major system tasks where the hardware and software must cooperate closely to achieve their aims. Buses The individual components of the system board are interconnected by multiple connection systems known as buses. The system bus is divided into three logical functions; the address bus, the data bus and the control bus. The address bus specifies the memory locations (addresses) for the data transfers. The data bus holds the data transferred. The data bus is bidirectional; it allows data to be read into the CPU and written from the CPU. The control bus contains various lines used to route timing and control signals throughout the system. Many flavours of bus exist, for example ISA and PCI buses are popular ways of connecting peripherals to the system. Controllers and Peripherals Peripherals are real devices, such as graphics cards or disks controlled by controller chips on the system board or on cards plugged into it. The IDE disks are controlled by the IDE controller chip and the SCSI disks by the SCSI disk controller chips and so on. These controllers are connected to the CPU and to each other by a variety of buses. Most systems built now use PCI and ISA buses to connect together the main system components. The controllers are processors like the CPU itself, they can be viewed as intelligent helpers to the CPU. The CPU is in overall control of the system. All controllers are different, but they usually have registers that control them. Software running on the CPU must be able to read and write those controlling registers. One register might contain a status describing an error. Another might be used for control purposes; changing the mode of the controller. Each controller on a bus can be individually addressed by the CPU, this is so that the software device driver can write to its registers and thus control it. The IDE ribbon is a good example, as it gives you the ability to access each drive on the bus separately. Another good example is the
37 PCI bus which allows each device (for example a graphics card) to be accessed independently. Address Spaces The system bus connects the CPU with the main memory and is separate from the buses connecting the CPU with the system's hardware peripherals. Collectively the memory space that the hardware peripherals exist in is known as I/O space. I/O space may itself be further subdivided, but we will not worry too much about that for the moment. The CPU can access both the system space memory and the I/O space memory, whereas the controllers themselves can only access system memory indirectly and then only with the help of the CPU. From the point of view of the device, say the floppy disk controller, it will see only the address space that its control registers are in (ISA), and not the system memory. Typically, a CPU will have separate instructions for accessing the memory and I/O space. For example, there might be an instruction that means ``read a byte from I/O address 0x3f0 into register X''. This is exactly how the CPU controls the system's hardware peripherals, by reading and writing to their registers in I/O space. Wherein I/O space the common peripherals (IDE controller, serial port, floppy disk controller and so on) have their registers has been set by convention over the years as the PC architecture has developed. The I/O space address 0x3f0 just happens to be the address of one of the serial port's (COM1) control registers. There are times when controllers need to read or write large amounts of data directly to or from system memory. For example, when user data is being written to the hard disk. In this case, Direct Memory Access (DMA) controllers are used to allow hardware peripherals to directly access system memory but this access is under strict control and supervision of the CPU. Timers All operating systems need to know the time and so the modern PC includes a special peripheral called the Real Time Clock (RTC). This provides two things: a reliable time of day and an accurate timing interval. The RTC has its own battery so that it continues to run even when the PC is not powered on, this is how your PC always ``knows'' the correct date and time. The interval timer allows the operating system to accurately schedule essential work. 2.2.2 Memory Subsystem The memory subsystem is made up of hardware and software components. The following figure shows a conceptual layout of the hardware components of a memory subsystem.
38 Memory Subsystem Main memory is the primary storage area of the computer system. It is in main memory that programs and the data they use are stored while the programs are executing. Data are also stored on slower peripheral devices such as disks and magnetic tape; programs are stored here as well when they are not executing. The input/output processor (IOP) regulates the flow of data between main memory and peripheral devices. The actual transfer of data between the main memory and the CPU or the peripheral devices is handled by the memory controller. Memory Structure and Access Program SegmeProgram compilation converts the symbolic form of a program into object code. The object code is placed into a code file, in the form of code segments. This process of code segmentation is performed by the compilers. For each code segment, the compiler generates a sequence of 52 bits called a code segment descriptor (descriptors are discussed next, under “Descriptors”). The segment descriptors are maintained in a dictionary and kept in the code file. Thus, a code file contains both code segments and a segment dictionary. When a program is executed, the segment dictionary is read into memory and placed in a segment dictionary stack. This stack is never executed; it is used only to hold segment descriptors. Data items from the program are also maintained as separate areas in memory. For example, an array in ALGOL or an item at the 01 level in COBOL is managed as a data segment.
39 Each data segment is “pointed” to by a data descriptor. Data descriptors are maintained in the program's stack (the process stack). These data descriptors are built as the program executes stack-building code that was generated by the compiler as it scanned the declarations of a program (such as the Data Division in COBOL). Descriptors Descriptors contain all the information needed by the processor and the operating system to access memory for the process, and are said to “point” to the segments they define. Two types of descriptors are available: data descriptors and code descriptors. Both data and code descriptors are composed of 52 bits, broken into several fields of varying length. Accessing Memory for any process or program, the processor accesses data arrays or code through the descriptors. If the descriptor indicates that the information you want is present in main memory, the processor can obtain the information and continue processing. If the descriptor indicates that the information you want is not present in main memory, the processor generates an interrupt for system service. 2.2.3 Input-Output Subsystem The I/O subsystem of a computer provides an efficient mode of communication between the central system and the outside environment. It handles all the input output operations of the computer system. Peripheral Devices- Input or output devices that are connected to computer are called peripheral devices. These devices are designed to read information into or out of the memory unit upon command from the CPU and are considered to be the part of computer system. These devices are also called peripherals. For example: Keyboards, display units and printers are common peripheral devices. There are three types of peripherals: 1. Input peripherals: Allows user input, from the outside world to the computer. Example: Keyboard, Mouse etc. 2. Output peripherals: Allows information output, from the computer to the outside world. Example: Printer, Monitor etc 3. Input-Output peripherals: Allows both input (from outside world to computer) as well as, output (from computer to the outside world). Example: Touch screen etc. Interfaces- Interface is a shared boundary between two separate components of the computer system which can be used to attach two or more components to the system for communication purposes. There are two types of interfaces: • CPU Interface • I/O Interface
40 Input-Output Interface -Peripherals connected to a computer need special communication links for interfacing with CPU. In computer system, there are special hardware components between the CPU and peripherals to control or manage the input-output transfers. These components are called input-output interface units because they provide communication links between processor bus and peripherals. They provide a method for transferring information between internal system and input- output devices. I/O Interface The Input/output Interface is required because there are exists many differences between the central computer and each peripheral while transferring information. Some major differences are: 1. Peripherals are electromechanical and electromagnetic devices and their manner of operation is different from the operation of CPU and memory, which are electronic device. Therefore, a conversion of signal values may be required. 2. The data transfer rate of peripherals is usually slower than the transfer rate of CPU, and consequently a synchronisation mechanism is needed. 3. Data codes and formats in peripherals differ from the word format in the CPU and Memory. 4. The operating modes of peripherals are differing from each other and each must be controlled so as not to disturb the operation of other peripherals connected to CPU. These differences are resolved through an input-output interface. As input-output interface (Interface Unit) contains various components, each of which performs one or
41 more vital functions for the smooth transforming of information between CPU and Peripherals. Input/Output Channels- A channel is an independent hardware component that coordinates all I/O to a set of controllers. Computer systems that use I/O channel have special hardware components that handle all I/O operations. Channels use separate, independent and low-cost processors for its functioning which are called Channel Processors. Channel processors are simple but contain sufficient memory to handle all I/O tasks. When I/O transfer is complete or an error is detected, the channel controller communicates with the CPU using an interrupt and informs the CPU about the error or the task completion. Each channel supports one or more controllers or devices. Channel programs contain a list of commands to the channel itself and for various connected controllers or devices. Once the operating system has prepared a list of I/O commands, it executes a single I/O machine instruction to initiate the channel program, the channel then assumes control of the I/O operations until they are completed. 2.3 Operating System An operating system acts as an intermediary between the user of a computer and computer hardware. The purpose of an operating system is to provide an environment in which a user can execute programs conveniently and efficiently. An operating system is software that manages computer hardware. The hardware must provide appropriate mechanisms to ensure the correct operation of the computer system and to prevent user programs from interfering with the proper operation of the system. 2.3.1 Memory management The main memory is central to the operation of a modern computer. Main Memory is a large array of words or bytes, ranging in size from hundreds of thousands to billions. Main memory is a repository of rapidly available information shared by the CPU and I/O devices. Main memory is the place where programs and information are kept when the processor is effectively utilizing them. Main memory is associated with the processor, so moving instructions and information into and out of the processor is extremely fast. Main memory is also known as RAM (Random Access Memory). This memory is a volatile memory. RAM lost its data when a power interruption occurs. In a multiprogramming computer, the operating system resides in a part of memory and the rest is used by multiple processes. The task of subdividing the memory among different processes is called memory management. Memory management is a method in the operating system to manage operations between main memory and disk during
42 process execution. The main aim of memory management is to achieve efficient utilization of memory. Memory Management is required for: • Allocate and de-allocate memory before and after process execution. • To keep track of used memory space by processes. • To minimize fragmentation issues. • To proper utilization of main memory. • To maintain data integrity while executing of process. Memory Management Logical and Physical Address Space Logical Address space: An address generated by the CPU is known as “Logical Address”. It is also known as a Virtual address. Logical address space can be defined as the size of the process. A logical address can be changed. Physical Address space: An address seen by the memory unit (i.e., the one loaded into the memory address register of the memory) is commonly known as a “Physical Address”. A Physical address is also known as a Real address. The set of all physical addresses corresponding to these logical addresses is known as Physical address space. A physical address is computed by MMU. The run-time mapping from virtual to
43 physical addresses is done by a hardware device Memory Management Unit (MMU). The physical address always remains constant. Static and Dynamic Loading: To load a process into the main memory is done by a loader. There are two different types of loading: Static loading: - loading the entire program into a fixed address. It requires more memory space. Dynamic loading: - The entire program and all data of a process must be in physical memory for the process to execute. So, the size of a process is limited to the size of physical memory. To gain proper memory utilization, dynamic loading is used. In dynamic loading, a routine is not loaded until it is called. All routines are residing on disk in a relocatable load format. One of the advantages of dynamic loading is that unused routine is never loaded. This loading is useful when a large amount of code is needed to handle it efficiently. Static and Dynamic linking: To perform a linking task a linker is used. A linker is a program that takes one or more object files generated by a compiler and combines them into a single executable file. Static linking: In static linking, the linker combines all necessary program modules into a single executable program. So, there is no runtime dependency. Some operating systems support only static linking, in which system language libraries are treated like any other object module. Dynamic linking: The basic concept of dynamic linking is similar to dynamic loading. In dynamic linking, “Stub” is included for each appropriate library routine reference. A stub is a small piece of code. When the stub is executed, it checks whether the needed routine is already in memory or not. If not available, then the program loads the routine into memory. Swapping: When a process is executed it must have resided in memory. Swapping is a process of swapping a process temporarily into a secondary memory from the main memory, which is fast as compared to secondary memory. A swapping allows more processes to be run and can be fit into memory at one time. The main part of swapping is transferred time and the total time is directly proportional to the amount of memory swapped. Swapping is also known as roll-out, roll in, because if a higher priority process arrives and wants service, the memory manager can swap out the lower priority process and then load and execute the higher priority process. After finishing higher priority work, the lower priority process swapped back in memory and continued to the execution process.
44 Swapping Contiguous Memory Allocation: The main memory should oblige both the operating system and the different client processes. Therefore, the allocation of memory becomes an important task in the operating system. The memory is usually divided into two partitions: one for the resident operating system and one for the user processes. We normally need several user processes to reside in memory simultaneously. Therefore, we need to consider how to allocate available memory to the processes that are in the input queue waiting to be brought into memory. In adjacent memory allotment, each process is contained in a single contiguous segment of memory. Contagious Memory Allocation
45 Memory allocation: To gain proper memory utilization, memory allocation must be allocated efficient manner. One of the simplest methods for allocating memory is to divide memory into several fixed-sized partitions and each partition contains exactly one process. Thus, the degree of multiprogramming is obtained by the number of partitions. Multiple partition allocation: In this method, a process is selected from the input queue and loaded into the free partition. When the process terminates, the partition becomes available for other processes. Fixed partition allocation: In this method, the operating system maintains a table that indicates which parts of memory are available and which are occupied by processes. Initially, all memory is available for user processes and is considered one large block of available memory. This available memory is known as “Hole”. When the process arrives and needs memory, we search for a hole that is large enough to store this process. If the requirement is fulfilling then we allocate memory to process, otherwise keeping the rest available to satisfy future requests. While allocating a memory sometimes dynamic storage allocation problems occur, which concerns how to satisfy a request of size n from a list of free holes. There are some solutions to this problem: First fit: - In the first fit, the first available free hole fulfils the requirement of the process allocated. First Fit Here, in this diagram 40 KB memory block is the first available free hole that can store process A (size of 25 KB), because the first two blocks did not have sufficient memory space.
46 Best fit: In the best fit, allocate the smallest hole that is big enough to process requirements. For this, we search the entire list, unless the list is ordered by size. Best Fit Here in this example, first, we traverse the complete list and find the last hole 25KB is the best suitable hole for Process A (size 25KB). In this method memory utilization is maximum as compared to other memory allocation techniques. Worst fit: In the worst fit, allocate the largest available hole to process. This method produces the largest leftover hole. Fragmentation: A Fragmentation is defined as when the process is loaded and removed after execution from memory, it creates a small free space. These spaces cannot be assigned to new processes because spaces are not combined or do not fulfil the memory requirement of the process. To achieve a degree of multiprogramming, we must reduce the waste of memory or fragmentation problem. In operating system two types of fragmentation: Internal fragmentation: Internal fragmentation occurs when memory blocks are allocated to the process more than their requested size. Due to this some unused space is leftover and creates an internal fragmentation problem. Example: Suppose there is a fixed partitioning is used for memory allocation and the different size of block 3MB, 6MB, and 7MB space in memory. Now a new process p4 of size 2MB comes and demand for the block of memory. It gets a memory block of 3MB but 1MB block memory is a waste, and it cannot be allocated to other processes too. This is called internal fragmentation. External fragmentation: In external fragmentation, we have a free memory block, but we cannot assign it to process because blocks are not contiguous. Example: Suppose (consider above example) three processes p1, p2, p3 comes with sizes 2MB, 4MB, and 7MB respectively. Now they get memory blocks of size 3MB, 6MB, and 7MB
47 allocated respectively. After allocating process p1 process and p2 process left 1MB and 2MB. Suppose a new process p4 comes and demands a 3MB block of memory, which is available, but we cannot assign it because free memory space is not contiguous. This is called external fragmentation. Both the first fit and best-fit systems for memory allocation are affected by external fragmentation. To overcome the external fragmentation problem Compaction is used. In the compaction technique, all free memory space combines and makes one large block. So, this space can be used by other processes effectively. Another possible solution to the external fragmentation is to allow the logical address space of the processes to be non-contiguous, thus permitting a process to be allocated physical memory where ever the latter is available. Paging: • Paging is a memory management scheme that eliminates the need for contiguous allocation of physical memory. This scheme permits the physical address space of a process to be non-contiguous. • Logical Address or Virtual Address (represented in bits): An address generated by the CPU • Logical Address Space or Virtual Address Space (represented in words or bytes): The set of all logical addresses generated by a program • Physical Address (represented in bits): An address actually available on a memory unit • Physical Address Space (represented in words or bytes): The set of all physical addresses corresponding to the logical addresses Paging
48 Here in this example, Process A (Size 25 KB) is allocated to the largest available memory block which is 60KB. Inefficient memory utilization is a major issue in the worst fit. 2.3.2 Process Management A Program does nothing unless its instructions are executed by a CPU. A program in execution is called a process. In order to accomplish its task, the process needs computer resources. There may exist more than one process in the system which may require the same resource at the same time. Therefore, the operating system has to manage all the processes and resources in a convenient and efficient way. Some resources may need to be executed by one process at one time to maintain consistency otherwise the system can become inconsistent and deadlock may occur. The operating system is responsible for the following activities in connection with Process Management 1. Scheduling processes and threads on the CPUs. 2. Creating and deleting both user and system processes. 3. Suspending and resuming processes. 4. Providing mechanisms for process synchronization. 5. Providing mechanisms for process communication. 2.3.3 File Management File management is one of the basic and important features of operating systems. The operating system is used to manage files of the computer system. All the files with different extensions are managed by the operating system. A file is a collection of specific information stored in the memory of a computer system. File management is defined as the process of manipulating files in the computer system, its management includes the process of creating, modifying, and deleting the files. The following are some of the tasks performed by file management of operating system of any computer system: 1. It helps to create new files in the computer system and place them at specific locations. 2. It helps in easily and quickly locating these files in the computer system. 3. It makes the process of sharing of files among different users very easy and user- friendly. 4. It helps to stores the files in separate folders known as directories. These directories help users to search files quickly or to manage the files according to their types or uses. 5. It helps the user to modify the data of files or to modify the name of the file in the directories.
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164