KEMBAR78
Computer Science Software Notes CH 4-Updated | PDF | Computers
0% found this document useful (0 votes)
31 views41 pages

Computer Science Software Notes CH 4-Updated

Fragmentation occurs when files are saved, deleted, or modified on a hard drive without enough contiguous space. This causes files to be broken into pieces and stored in non-contiguous blocks across the drive. Defragmentation consolidates these fragmented files so that all pieces of each file are aligned together to improve performance. It also frees up contiguous space and optimizes file placement.

Uploaded by

Umer Jaseem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views41 pages

Computer Science Software Notes CH 4-Updated

Fragmentation occurs when files are saved, deleted, or modified on a hard drive without enough contiguous space. This causes files to be broken into pieces and stored in non-contiguous blocks across the drive. Defragmentation consolidates these fragmented files so that all pieces of each file are aligned together to improve performance. It also frees up contiguous space and optimizes file placement.

Uploaded by

Umer Jaseem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 41

Here's how fragmentation happens:

• Saving files: When you save a file, the computer tries to write it in one
contiguous block on the hard drive. However, if there isn't enough
space available, the file may be broken up into smaller pieces and
written in different locations.
• Deleting files: When you delete a file, the space it occupied becomes
free, but it may be fragmented, with empty gaps between existing
files.
• Modifying files: As you edit or update files, they may grow or
shrink, requiring them to be rewritten in different locations, potentially
causing further fragmentation.

Defragmentation helps by
• Consolidating file fragments: It gathers the scattered pieces of
files and puts them back together in a continuous block.
• Freeing up contiguous space: It organizes the free space on
the drive, making it easier to write new files in larger blocks.
• Optimizing file placement: It can place frequently accessed files
closer to the beginning of the drive for faster access.
Fragmentation and Defragmentation
• If there's not enough contiguous space to hold complete files on an
HDD, files can become fragmented and the storage algorithms on
the disk separate the data to fit it inside the available
space. Defragmentation consolidates these fragmented files so all the
related pieces are aligned together.

Key Differences b/w File History and Windows Back-up utility

Feature File History Windows Backup Utility

Creating a complete image of the


Focus Protecting personal files and folders
entire system

Incremental, saving multiple versions Full system image, capturing


Type of backup
of files everything at once

Usually less often, like weekly or


Backup frequency Typically hourly, more frequent
monthly

Restore the entire system to a previous


Restoration process Recover individual files or folders
state

External drives, DVDs, network


Storage location External drives, network locations
locations
Some common features of OS backup utilities:
•Scheduling: Set automatic backups to happen at regular
intervals, ensuring you always have a recent copy.

•Incremental backups: Only copy files that have changed since the
last backup, saving time and storage space.

•Image backups: Create a complete image of your entire drive,


including hidden files and system settings.

•System state backups: Focus on backing up only essential system


files and settings for quicker restoration.
•File selection: Choose specific folders or files to back up, instead of the entire
system.

•Storage options: Save backups to external drives, network storage, or even


cloud services.

Examples of OS backup utilities:


•Windows: System Image Backup, included in Windows 10 and 11.

•macOS: Time Machine, built-in backup tool for Mac computers.

•Linux: Various command-line tools like rsync and dd, as well as graphical
backup applications.

•Third-party options: Numerous paid and free backup software offers additional
features and flexibility.
Working of System Image Backup on Windows 10 and 11:

• Click on the Start menu and search for "Control Panel".


• Open Control Panel and navigate to "System and Security".
• Click on "Backup and Restore (Windows 7)".
• In the left-hand pane, click on "Create a system image".
• Choose the destination for your backup image. You can save it to an external hard drive, a
network drive, or DVDs.
• Select the drives you want to include in the backup image. You can typically choose to back up the
entire system drive (usually C:) or specific drives.
• Click on "Start backup".
• The backup process can take some time, depending on the size of your hard drive and the speed
of your storage device.
Security Utility Software
• Malware:
• Encompasses all software designed to harm your device or steal
your data. It's like a general category that includes:
viruses, worms, trojans, spyware, adware, and ransomware.
analogy to illustrate:
• Think of malware as a group of criminals.
• Examples: Viruses, worms, trojans, keyloggers, rootkits
• Spyware:
• Focuses on spying: Secretly collects your personal
information, browsing habits, keystrokes, and other data without your
knowledge or consent.
analogy to illustrate:
• Spyware is the sneaky thief who steals your wallet while you're
not looking.
• Examples: tracking cookies, hidden monitoring software.
• Adware:
• Bombards you with ads: Displays unwanted advertisements, pop-
ups, and banners while you're browsing the web, using software,
or playing games.
• analogy to illustrate:
Adware is the annoying street vendor who shoves flyers in your face.
• Examples: Pop-up adware, browser hijackers, bundled software
with hidden adware.
• Ransomware:
• Holds your data hostage: Encrypts your files and demands a
ransom payment to decrypt them and regain access.
analogy to illustrate:
Ransomware is the kidnapper who holds your loved ones hostage and
demands a ransom.
Examples: CryptoLocker, Petya, WannaCry.
Screen Savers
In the past, screen savers served a few important purposes:
• Preventing screen burn-in: Early computer monitors, like CRTs and
plasma displays, were susceptible to screen burn-in, which is a
permanent discoloration that could occur if an image was displayed on
the screen for too long. Screen savers helped to prevent this by displaying
constantly changing images or patterns.

• Saving energy: When a computer is idle, its display can use a significant
amount of energy. Screen savers helped to conserve energy by dimming
or turning off the display after a period of inactivity.
• Security: Some screen savers required a password to be entered before
the user could resume working. This helped to prevent unauthorized
access to the computer.

Phosphor burn, also known as screen burn-in or ghost image, is a
permanent discoloration or faint afterimage that can appear on certain
types of electronic displays. It's most commonly associated with older
technologies like cathode ray tubes (CRTs) and plasma displays, but
can also occur in some cases on OLED (organic light-emitting diode)
screens.

The good news is that phosphor burn is becoming less and less of a
problem in the modern era. Most modern displays, like LCDs and LED-
lit LCDs, are not susceptible to burn-in. And even with OLEDs, the risk
is significantly lower than it was with older technologies.
Device Drivers
• Device drivers are specialized software programs that serve as vital
translators between a computer's operating system and the various
hardware devices connected to it.
• They enable the OS and other applications to interact with and control
these devices effectively.
• In the world of computers, device drivers act as interpreters, relaying
messages between the operating system and connected hardware.
But how do these drivers understand specific devices and their
capabilities?
• That's where descriptors come in – crucial pieces of information
that paint a detailed picture of the hardware for the driver to work
its magic.
• Vendor and Product IDs: These unique identifiers pinpoint the
manufacturer and specific model of the hardware, allowing the
driver to recognize and configure it correctly.

Operating Systems
An operating system (OS) is the maestro of your computer, the invisible conductor
orchestrating all the hardware and software to work together seamlessly. It's the
essential layer between you and the raw machinery, making your computer usable
and responsive.
Examples :
• Windows: Developed by Microsoft, it's the most popular desktop OS for
personal computers.
Known for its user-friendly interface, compatibility with a wide range of
software, and gaming capabilities.

• macOS: Developed by Apple, it's known for its sleek design, intuitive
user experience, and integration with Apple devices.
• Linux:Open-source OS offering flexibility and customization.
• Available in various distributions (e.g., Ubuntu, Fedora, Mint), each with
its strengths and intended use cases.

Operating Systems
Mobile Operating Systems:
Android:
• Developed by Google, it's the most widely used mobile OS globally.
• Open-source, customizable, and runs on a vast range of devices.
• Offers a large selection of apps and services through the Google Play Store.
Mobile Operating Systems:
Android:
• Developed by Google, it's the most widely used mobile OS globally.
• Open-source, customizable, and runs on a vast range of devices.
• Offers a large selection of apps and services through the Google Play Store.
Operating Systems
• iOS: Developed by Apple, it's exclusively for Apple devices
like iPhones and iPads.
Known for its smoothness, security, and integration with Apple's
ecosystem of apps and services.
Common Functions of Operating Systems:
•Managing hardware resources:
Allocating memory, processing power, and storage for applications.
Controlling input and output devices (keyboard, mouse, printer, etc.).
•Providing a user interface:
Allowing users to interact with the computer and its software through
graphical interfaces (GUIs) or command-line interfaces (CLIs).
•Running applications:
Launching and managing programs, enabling users to perform tasks.
•Managing files and folders:
Organizing data and storing information on the computer's storage devices.
•Providing security:
Protecting the system from unauthorized access, viruses, and malware.
•Networking:
Enabling communication between computers and devices over networks.
Interrupts
• In the world of computers, interrupts are like urgent messages that devices or
programs send to the processor, saying, "Hey, pay attention to me right now,
something important has happened!"
• These messages temporarily halt the current task the processor is working on
and demand immediate attention. Let's delve deeper into how they work and
how the operating system handles them.
• What are interrupts?
• Imagine you're writing a report when suddenly the doorbell rings. You pause
your writing, answer the door, and then come back to finish your report.
That's kind of like what an interrupt does to the processor. It's a signal that
says, "Hold on, there's something more important that needs your attention
right away."

Continue……….
• Interrupts can come from two sources:
• Hardware interrupts: These are generated by devices like your
keyboard, network card, or disk drive when they need the processor's
attention. For example, when you press a key on the keyboard, it
sends an interrupt signal to the processor saying, "Hey, I have a new
keystroke for you!"
• Software interrupts: These are generated by the software
itself, usually by executing a special instruction. They're used for
things like requesting system calls from the operating system or
handling errors.
How does the operating system control interrupts?
• The operating system plays a crucial role in managing interrupts. Here's how
it does it:
• Interrupt Controller: The processor itself doesn't handle interrupts
directly. Instead, it relies on an interrupt controller, which is a separate chip that
manages all incoming interrupt requests. The interrupt controller receives signals
from various devices and software components and prioritizes them based on their
importance.

• Interrupt Service Routine (ISR): When the interrupt controller determines


that an interrupt needs to be serviced, it sends a specific signal to the processor
along with the interrupt source information. This signal triggers the execution of
a special piece of code called an Interrupt Service Routine (ISR). The ISR is
responsible for handling the specific event that caused the interrupt.

Continue………..
• Disabling and Enabling Interrupts: The operating system can
control how the processor responds to interrupts by enabling or
disabling interrupts. For example, when the operating system is
updating critical system files, it might disable interrupts to prevent
any external events from interfering with the process.
Exam Style Questions Ch#4
Q.3 Describe the purpose of an operating system
Ans. OS is a fundamental software that resides b/w the user and the computer.
1. Hardware Management:
The OS acts as a traffic controller, allocating resources like memory, CPU, and storage to different
programs efficiently.

It handles input and output devices like printers, keyboards, and networks, translating your actions into
signals the hardware understands.

2. User Interface:
The OS provides a user interface (UI) like a graphical desktop or command line for you to interact with the
computer. This lets you run programs, manage files, and access information easily.
3. Software Management:
The OS loads and runs other software programs you use, acting as a
platform for them to function.
It manages the installation, updates, and removal of software, making
sure everything is compatible and works together.
virtual memory
Imagine your computer's memory as a fancy restaurant with limited tables (RAM).
Virtual memory is like having a secret, much larger dining area in the back (hard
drive/SSD).

When the main dining area (RAM) fills up, the restaurant (operating
system) cleverly moves some plates (data) to the back to make space for new
customers (programs).

You (the user) don't even notice the switch, as you get your food (data) quickly
from either area.

But! Dishes (data) from the back take longer to retrieve, like waiting for a waiter to
fetch them.
Disk Thrashing
Disk thrashing, also known as virtual memory thrashing, occurs when
your computer's memory management system becomes overloaded
and constantly swaps data between your physical RAM (Random
Access Memory) and the much slower hard drive or SSD (Solid State
Drive). This creates a vicious cycle that significantly slows down your
entire system.
Analogy:
Multitasking/Interrupts
• In computer systems, multitasking refers to the ability to manage and
execute multiple tasks (processes or programs) at the same time. This
doesn't necessarily mean that tasks run simultaneously, but rather
interleave their execution in very rapid succession, giving the illusion
of parallel activity.

• An interrupt in a computer system acts like an urgent message sent from


a device or software program to the processor, demanding immediate
attention. It temporarily halts the currently running program and
redirects the processor's focus to handle the interrupting event.
GUI and CLI
GUI: Uses visual elements like icons, menus, buttons, and windows. Users interact with the
system by clicking, dragging, and typing within these elements.

GUI: Generally considered easier to learn for beginners due to its intuitive visual nature. Most
users are familiar with basic clicking and dragging gestures.

CLI: Relies on text-based commands typed by the user. Users need to know the specific
commands and syntax to perform tasks.

CLI: Requires memorizing commands and syntax, which can be challenging for new
users. However, experienced users can become very efficient with the CLI.
Advantages/Disadvantages
GUI:
Advantages:
Ease of Use: Intuitive for beginners, no need to memorize complex commands, readily
apparent actions through icons and menus.
Accessibility: Can be more accessible for users with visual impairments thanks to screen
readers and text-to-speech options.

Disadvantages:
Limited Flexibility: Actions and options are restricted to what's visually presented, can be
cumbersome for advanced tasks.
Slower Performance: Rendering graphics and handling user interactions adds
overhead, making it slightly slower than the CLI.

Advantages/Disadvantages
CLI:
Advantages:
High Flexibility: Direct access to the system through commands grants fine-grained control
and advanced functionalities.
Efficiency: Faster execution due to minimal processing and direct interaction with the
system.

Disadvantages:
Steeper Learning Curve: Requires memorizing commands and syntax, less intuitive for
beginners.
Accessibility Challenges: Less accessible for users with visual impairments unless
alternative input methods are available.

Q.5
A---c
B---b
C---c
D---d
E---a
F---c
G---c
H---d I---b J---d
Q.6 -a
Compiler: Translates the entire source code of a program into machine code (the language the
computer directly understands) before execution. It creates an independent executable file that
can run multiple times without retranslation.
Interpreter: Translates and executes the code line by line, on the fly, during runtime. It doesn't
create a separate executable file.
Execution Speed:
Compiler: Generally produces faster-running programs as the code is already translated into
machine code and ready for execution.
Interpreter: Can be slower as it needs to translate each line of code every time it's executed,
adding overhead.
Debugging:
Compiler: Debugging can be more challenging as errors are reported after full translation, making it
harder to pinpoint the exact line of code causing the issue.
Interpreter: Debugging can be easier as errors are reported as they occur during
execution, providing more immediate feedback.

Q.6-b
Compiler:
Advantage:
Faster execution: Compiled programs generally run faster because the machine
code is already optimized and directly understood by the computer, eliminating the
need for line-by-line translation during execution. This is especially beneficial for
performance-critical applications and large, complex software.
Disadvantage:
Less flexible: Compiled programs are typically platform-specific, meaning they
need to be recompiled for each different operating system or computer
architecture. This can be inconvenient and time-consuming for developers who need
to target multiple platforms.

Q.6-c
Interpreter:
Advantage:
More flexible: Interpreted programs can often run on various platforms
without any changes as long as the interpreter itself is available for that
platform. This makes them ideal for cross-platform development and rapid
prototyping.
Disadvantage:
Slower execution: Interpreters translate code line-by-line during
execution, adding an overhead compared to pre-compiled machine code. This
can lead to slower performance, especially for computationally intensive
tasks.

Q.7 Describe the difference b/w a compiler and an Interpreter
•Interpreters translate code line by line, which means that Pedro's friend can start using the
program immediately without having to wait for the entire program to be translated. This is important
because Pedro's friend needs to use the program right away.
•Interpreters do not create a separate executable file, so Pedro does not need to know what software
is available on his friend's laptop. This is important because Pedro does not have this information.
•Interpreters are generally slower than compilers, but this is not a major concern in this case
because the program is small and does not need to be very fast.
In addition to the reasons given in the image, there are a few other reasons why an interpreter might be a
good choice in this case:
•Interpreters are often easier to use than compilers, which can be helpful for Pedro if he is not a
very experienced programmer.
•Interpreters can be used to debug programs more easily than compilers, which can be helpful if Pedro's
friend finds any errors in the program.

You might also like