BASICS OF OPERATING SYSTEM
INTRODUCTION
Definition of an Operating System:
As we know ,Operating system is used in mobiles, laptops etc., so if we think generally we get to know that operating system is the software and with the help of the OS we can communicate with the hardware. As of now we got the practical view of an operating system.. practical view in the sense, where we generally use the operating system in the real-life applications. So, now we just go into deeper and define what exactly the Operating System is , An Operating System is an interface between a computer user (or) user and the computer hardware.
Examples of Operating System:
Windows, Linux, Mac etc.
Tasks performed by Operating System are:
- File Management
>Keeps track of information, location, uses, status etc. The collective facilities are often known as file system
>Allocation and De-allocation of the resources.
- Memory Management
>Memory management refers to the management of the memory such that primary memory or main memory .Main memory is a large array of words or bytes where each word or byte has its own address.
>Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are not in use.
>Allocates and De-allocates the memory as per the process requests.
- Process Management
>OS decides which process gets the processor when and for how much time. This function is called process scheduling.
>Keeps tracks of processor and status of process. The program responsible for this task is known as traffic controller.
>Allocates and De-allocates the processor as per the process requirement.
- Device Management
>An Operating System manages device communication via their respective drivers.
>Keeps tracks of all devices. Program responsible for this task is known as the I/O controller.
>Decides which process gets the device when and for how much time.
- Handling Input and Output
- Controlling Peripheral Devices such as Disk drivers, Printers.
Types of OS
- Simple Batch System
- Multiprogramming Batch System
- Multiprocessor System
- Desktop System
- Distributed Operating System
- Clustered System
- Realtime Operating System
- Handheld System
Process
In simple terms, Process is nothing but program under execution. Technically the word Process can be defined it is the instance of a computer that is being executed by one or many threads.
In order to execute the program the process memory is divided into four sections :
- Text
- Data Section
- Heap
- Stack
As process executes it changes its states:
Memory
Memory can be defined as a collection of some data represented in the binary format. On the basis of various functions like manages memory allocation, memory management, swapping, paging .
Basically, memory is of two types. Primary memory and secondary memory. Basic levels of memory consist of CPU, cache memory, primary and secondary memory.
Capable to store any information or data temporally or permanently.
Machine understands only binary language that is 0 or 1. Computer converts every data into binary language first and then stores it into the memory.
That means if we have a program line written as int a= 10 then the computer converts it into the binary language and then store it into the memory blocks.
File Systems
A file is a collection of related information that is recorded on secondary storage. Or file is a collection of logically related entities.
File Structure
3 Types of File Structure:
- A text file: It is a series of characters that is organized in lines.
- An object file: It is a series of bytes that is organized into blocks.
- A source file: It is a series of functions and processes.
File Attributes
A file has a name and data. It also stores meta information like file creation date and time, current size, last modified date, etc. All this information is called the attributes of a file system.
Name, Identifier, Location, Type, Size, Protection, Time, date and security.
File Type
Files are classified as follows:
Ordinary Files
Directory Files
Special Files
Functions of File
- Create file, find space on disk, and make an entry in the directory.
- Write to file, requires positioning within the file
- Read from file involves positioning within the file
- Delete directory entry, regain disk space.
- Reposition: move read/write position.
Basic Linux Commands
What is Linux?
Before learning the Linux Commands ,lets have a basic knowledge about Linux and what exactly the Linux is ,basically the Linux is an operating system’s kernel.
Linux command line is a text interface toyour computer.
Linux Commands:
- pwd — When you first open the terminal, you are in the home directory of your user. To know which directory you are in, you can use the “pwd” command.
2. ls — Use the “ls” command to know what files are in the directory you are in. You can see all the hidden files by using the command “ls -a”.
3. cd — Use the “cd” command to go to a directory. For example, if you are in the home folder, and you want to go to the downloads folder, then you can type in “cd Downloads”.
4. mkdir & rmdir — Use the mkdir command when you need to create a folder or a directory. For example, if you want to make a directory called “DIY”, then you can type “mkdir DIY”.rmdir can only be used to delete an empty directory. To delete a directory containing files, use rm.
5. rm — Use the rm command to delete files and directories. Use “rm -r” to delete just the directory. It deletes both the folder and the files it contains when using only the rm command.
6. touch — The touch command is used to create a file. It can be anything, from an empty txt file to an empty zip file. For example, “touch new.txt”.
Block Storage
Block storage chops data into blocks — get it? — and stores them as separate pieces. Each block of data is given a unique identifier, which allows a storage system to place the smaller pieces of data wherever is most convenient. That means that some data can be stored in a Linux® environment and some can be stored in a Windows unit.
Object Storage
Object storage, also known as object-based storage, is a flat structure in which files are broken into pieces and spread out among hardware. In object storage, the data is broken into discrete units called objects and is kept in a single repository, instead of being kept as files in folders or as blocks on servers.
Thank you !