0% found this document useful (0 votes)
2 views

Lec 7_8Intro.toOS

The document provides an introduction to operating systems (OS), defining it as software that acts as an intermediary between users and computer hardware, facilitating program execution and resource management. It outlines the importance of OS in managing software and hardware, including resource allocation, process management, and security. Additionally, it covers booting processes, dual booting, virtualization with VirtualBox, and various command-line operations related to file management and permissions.

Uploaded by

bscs23091
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lec 7_8Intro.toOS

The document provides an introduction to operating systems (OS), defining it as software that acts as an intermediary between users and computer hardware, facilitating program execution and resource management. It outlines the importance of OS in managing software and hardware, including resource allocation, process management, and security. Additionally, it covers booting processes, dual booting, virtualization with VirtualBox, and various command-line operations related to file management and permissions.

Uploaded by

bscs23091
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Lecture-07,08: Intro.

to OS
Instructor: Mehwish Ghafoor
[email protected]
Definition of Operating System (OS)
• Definition of an Operating System (OS):
• An operating system is a software that acts as an
intermediary between users and the computer
hardware.
• It provides a user-friendly environment for
executing programs, managing hardware
resources, and interacting with various system
components.
2
Importance of OS

• The operating system serves as a


fundamental layer that enables efficient
and secure utilization of computer
hardware and software.
• It provides an abstraction layer, hiding
complex hardware details from
applications and users.
3
Role of OS in managing Software and
Hardware

RESOURCE ALLOCATION PROCESS MANAGEMENT MEMORY MANAGEMENT

4
Role of OS in managing Software and
Hardware

File System Management Device Management

Security and Access Control User Interface

5
How to boot OS

Power-On Self Test (POST):


• When the computer is powered on, the hardware runs a self-
test to check if essential components are working correctly.
• The BIOS (Basic Input/Output System) or UEFI (Unified
Extensible Firmware Interface) firmware is responsible for
initializing hardware components and identifying boot
devices.
6
How to boot OS

Bootloader Stage:
• After POST, the computer looks for a bootloader,
which is a small program that helps load the
operating system.
• The bootloader is typically stored in the Master
Boot Record (MBR) of the bootable storage
device (like a hard drive).
7
How to boot OS

Loading the Kernel:


• The bootloader loads the kernel, the core
part of the operating system, into memory.
• The kernel manages hardware resources
and provides essential services to
processes.
8
How to boot OS

Init Process:
• Once the kernel is loaded, the init process
(or its modern equivalents) is started. Init
is the first user-level process and serves
as the parent process for all other
processes.
9
How to boot OS

Running User Processes:


• As the init process starts, it initializes the
system and launches various services.
• User processes and applications are then
executed, allowing users to interact with the
system.
10
How to boot OS

User Login & Running Apps:


• User authentication
• User can access the system's resources and run
applications.
• The OS now manages user processes and
applications, ensuring fair allocation of resources
and providing necessary services.
11
Dual Boot- OS

● Dual boot allows users to have


multiple operating systems on the
same computer, each in its own
partition.
● It provides the flexibility to choose
between different OS
environments during startup.

12
VirtualBox

● VirtualBox is a
virtualization software
that allows running
multiple operating
systems as virtual
machines within a host
OS.
● It's used for creating isolated environments without the need for separate
partitions.
13
Windows OS

● Windows is a widely used family of operating systems developed by


Microsoft.
● It offers a user-friendly interface and a range of features for various
computing needs.
14
Windows OS : Features

Graphical User File


Multitasking
Interface (GUI) Management

Software
Security Updates
Compatibility

15
Graphical User Interface

Visual
User-Friendly
Representation

WYSIWYG
Point-and-Click (What You See
Interaction Is What You
Get)

16
● User-Friendly: GUIs are intuitive and easy to learn, making them
accessible to a wide range of users.
Graphical User ● Visual Representation: Icons and images help users identify and
understand functions.
Interface ● Point-and-Click Interaction: Users can perform actions by clicking
on icons and buttons.
● WYSIWYG (What You See Is What You Get): GUIs provide a direct
preview of how content will appear.

17
Graphical User Interface:
Key Components
● Windows: Separate areas where applications
and content are displayed.
● Icons: Pictorial representations of files, folders,
or applications.
● Menus: Dropdown lists of commands and
options.
● Buttons: Interactive elements that initiate
actions.
● Dialog Boxes: Windows that prompt users for
input or confirmations.
● Scrollbars: Allow users to navigate through
content that doesn't fit on the screen.

18
Graphical User Interface: Examples

WINDOWS OS: KNOWN FOR ITS START MACOS: FEATURES A DOCK, MENU BAR, LINUX GUIS: VARIOUS DESKTOP
MENU, TASKBAR, AND WINDOW-BASED AND FINDER FOR FILE MANAGEMENT. ENVIRONMENTS LIKE GNOME, KDE,
INTERFACE. AND XFCE.

19
Graphical User Interface: Ubuntu

20
Command Line Interface: CLI
• An interface to get work done by commands
• NO GUI ALLOWED
• More flexibility and greater number of options
• Lesser Resources, Higher Speed
• Scripting

21
Directory Structure

22
Current
directory, ~
Hostname shows home
User Name
dir.

Terminal
23
Command: PWD
• Pwd: present working directory

/ shows root dir.

24
Directory/Folder
Image file
Executable File
Command: ls

Directory/Folder

Files with different


extensions

25
Size Count of files and directory
Command: ls -l

Size

26
Command: Man [cmd_name]used to display the user
manual of any command that we can run on the terminal
man ls

27
Command mkdir [dir_name]

28
Command cd [path]

Move one step


back

29
Hidden Folder . And ..

30
Command Clear

31
Create Files and Edit: Vim [file_name]
1

• To Write press i 2
• To Quit: press ESC then :q!
• To save and quit: press ESC then :wq!

32
Command: cat [file_name]: Display content of file

33
Command Vim – f2.txt

34
Command: Less [file_name], More [file_name]
• The cat command is all well and good for small files. But, if the file is large, the
contents will zoom past and we’ll only see the last screen worth of content.

• Less command is a Linux utility that can be used to read the contents of a text file
one page (one screen) at a time.

• The more command displays the contents of the file one screen at a time for
large files. If the contents of the file fit a single screen, the output will be the
same as the cat command.

• The less command is similar to the more command but provides extensive
features. One important one is that it allows backward as well as forward
movement in the file

35
Less:

36
More:

37
Change Dir: cd

38
Remove Dir or File: rm [file_name]

39
Remove Multiple File or Dir: rm [file_name]
Remove
file/s with
same
extension, *
shows
filename
starts with
any number
of
characters, it
should end
with .txt

40
Remove Multiple File or Dir: rm [file_name]

It will delete file starts with ‘f’


then one character followed
by .txt

It will delete file starts with ‘f’


followed by one character
then ‘.’ and ends with any no.
of character

41
Command copy: cp [ source ] [destination]
• Copy content of file1.txt to file2.txt
• cp file1.txt file2.txt ; this command copy contents of file1.txt to file2.txt, if file2.txt
doesn’t exist, it will create file then copy content else re-write file2.txt

42
Absolute Path and Relative Path

•Absolute paths always start with the


root directory and provide the full path
to the file or directory.
•Relative path is a path to a file or
directory that is relative to the current
directory
43
Relative Path using cp command (copy)

44
Absolute Path using cp command

45
Move Command: mv [file_name]

46
Change File or Dir. Permission for types of
Users: chmod
• Chmod
• Two modes to set permission
• Symbolic mode
• Octal mode

47
Chmod: Symbolic Mode
Operators Function

`+` Add permissions

`-` Remove permissions

Set the permissions to the specified


`=`
values

48
Chmod: Symbolic Mode
Operators Function

`+` Add permissions

`-` Remove permissions

Set the permissions to the specified


`=`
values

Letters Function

`r` Read permission

`w` Write permission

`x` Execute permission


49
Chmod: Symbolic Mode
Operators Function

`+` Add permissions Reference Class

u Owner
`-` Remove permissions
g Group
Set the permissions to the specified
`=` o Others
values

All
a
Letters Function (owner,groups,others)

`r` Read permission

`w` Write permission

`x` Execute permission


50
Chmod: Symbolic Mode

• Read, write and execute permissions to the file owner:


chmod u+rwx [file_name]
•Remove write permission for the group and others:
chmod go-w [file_name]
•Read and write for Owner, and Read-only for the group
and other:
chmod u+rw,go+r [file_name]
51
Chmod: Symbolic Mode
Execute permissions to the file owner:
chmod u+x [file_name]

52
Chmod: Symbolic Mode
Remove read permissions to group and others:
chmod go-r [file_name]

53
Chmod: Symbolic Mode
Add read,write for owner and add execute-only for group and others:
chmod u+rw, go+x [file_name]

54
Chmod: Symbolic Mode
Add read,write for group for dir:
chmod g+rw [dir_name]

55
Chmod: Octal Mode
• First digit specify the permission for Owner.
• Second digit specify the permission for Group.
• Third digit specify the permission for Others. The digits

Value Permission

4 Read Permission

2 Write Permission

1 Execute Permission

56
Chmod: Octal Mode
• First digit specify the permission for Owner.
• Second digit specify the permission for Group.
• Third digit specify the permission for Others. The digits

Value Permission Example:


4 Read Permission chmod 672 [file_name]
Here.
2 Write Permission •6 represent permission of file Owner which are (rw).
•7 represent permission of Group which are (rwx).
1 Execute Permission •2 represent permission of Other which is (w).

57
Chmod: Octal Mode
Add no permission for owner,[read,write,execute] for group and read for others:
chmod 074 [file_name]

58
Chmod: Octal Mode
Add all permission for owner and group, Read for others:
chmod 774 [dir_name]

59
Class Task
• What is chmod 777, chmod 755, and chmod a+x?
• What is chmod 671, chmod 515, and chmod a-x?

60

You might also like