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

Assignment 1

this is assignment

Uploaded by

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

Assignment 1

this is assignment

Uploaded by

John Xerxes
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

ASSIGNMENT 1

PRINCIPLES OF OPERATING
SYSTEMS

Submitted To:
Mam Memoona Malik
Submitted By:
Shoaib Hasan SP22-BAI-045
Shugufta Zehra SP22-BAI-046
Easha Altaf SP22-BAI-010
Semester:
5th
Program:
BAI
COMSATS UNIVERSITY ISLAMABAD

Q1: What does free and open-source software mean?

Ans.

Free and open-source software (FOSS) refers to software that meets two essential criteria:

1. Free to Use: You can use the software for any purpose, personal, commercial, or
educational, without paying any licensing fees.
2. Open Source: The source code, the underlying code that makes the software function, is
freely available for anyone to inspect, modify, and distribute.

Key characteristics of free and open-source software include:

 Freedom to Use: Users are free to run the software for any purpose.
 Freedom to Modify: You can change the source code and create your own modified versions
of the software.
 Freedom to Share: You can share the software and your modifications with others, freely
redistributing it.
 Freedom to Contribute: You can contribute to the improvement of the software by fixing
bugs, adding new features, and submitting your changes back to the project.

Q2: Explain the concept of Linux distributions.

Ans. A Linux distribution, often abbreviated as distro, is a complete operating system built around
the Linux kernel. It's like a pre-packaged box containing the essential ingredients (kernel) and a
variety of tools, applications, and libraries needed to run a functional computer system.

Here's a breakdown of the concept:

 Linux Kernel: The core component, responsible for managing hardware resources like
memory, CPU, and device drivers. It acts as the bridge between the hardware and software.
 Distributions: Different organizations or individuals package the Linux kernel with additional
software to cater to specific needs or user preferences. These additional components can
include:
o Package Managers: Tools to easily install, update, and remove software
applications.
o Desktop Environments: Graphical user interfaces (GUIs) that provide a user-friendly
way to interact with the system. Popular options include GNOME, KDE Plasma
o Applications: A wide range of software programs for various tasks, like web
browsing, office productivity, multimedia, and development tools.
o Configuration Tools: Utilities to manage system settings, network configuration, and
user accounts.
Q3: Compare

a) Desktop and mobile operating systems


Ans.

Feature Desktop OS Mobile OS


Primary Use Designed for productivity tasks, Designed for on-the-go use, basic tasks,
multitasking, content creation, and entertainment, and communication.
entertainment.
More powerful processors, larger
Hardware displays, and more diverse hardware Less powerful processors, smaller touchscreens,
configurations limited hardware variations

User Interface Primarily mouse and keyboard-driven, Primarily touch-based interface, with optional
(UI) with optional touch support. stylus support on some devices.
Processing More processing power for demanding Lower processing power for battery efficiency.
Power tasks.
Multitasking More efficient multitasking capabilities. Limited multitasking capabilities
Connectivity Wired and wireless connectivity options. Primarily wireless connectivity (Wi-Fi, Cellular)
Examples Windows, macOS, Linux Android, iOS, iPadOS

b) Windows operating system and Linux


Ans.

Feature Windows Linux


Cost Free and open-source software (FOSS)
A paid license is required for most
versions
Applications
Vast library of commercial and Large collection of open-source software, with some
open-source applications commercial options available.
Generally considered less secure
Security due to a larger user base and being Generally considered more secure due to its open-
a target for malware source nature but requires user awareness and
knowledge for optimal security
Updates are frequent and often managed by the
Updates can be automatic or package manager, with minimal disruption.
Updates manual, sometimes requiring
restarts.
Steeper learning curve, especially for users unfamiliar
Learning Generally easier to learn and use with command lines.
Curve for new users due to a familiar
interface
Limited customization options for Highly customizable, allowing users to modify the
Customization the core system system and desktop environment to their
preferences.
c) Android operating system and iOS
Ans.

Feature Android iOS


Manufacturer Developed and owned by Apple.
Open source, used by various phone
manufacturers
Cost Generally, less expensive devices Generally, more expensive devices
User Interface More customizable UI with various Consistent and user-friendly UI across all
(UI) launcher options devices
Store Google Play Store Apple App Store
Security
More susceptible to malware due to the Generally considered more secure due to the
open ecosystem. closed ecosystem
Integration Integrates well with other Google
services. Tight integration with other Apple devices and
services.

d) Win32 and POSIX


Ans.

Feature Win32 POSIX


OS Windows Various (Linux, macOS, Unix-like)
Functionality Windows-specific features (GUI, etc.) Core functionalities (file, process, I/O etc.)
Languages C, C++ (with Windows extensions) C, C++, scripting languages (with bindings)
Learning Curve Steeper Easier

e) Device driver and controller


Ans.

Feature Device Controller Device Driver


Type Hardware Component Software Component
Location Motherboard or within the device Installed on the operating system
Function Bridges device and system bus Acts as an intermediary between OS and
communication controller
Understands device protocol, and
Responsibility translates signals for the bus Provides a standardized interface for OS,
translates OS commands and data for the
controller
Analogy Role Bilingual translator for the device Software program giving instructions to
translator
f) Multicore and multiprocessor systems
Ans.

Feature Multicore System Multiprocessor System


CPU Architecture Single CPU with multiple cores Multiple separate CPUs
Resource Sharing Cores share cache, internal bus Each CPU has its cache, bus connection
Scalability Easier to add cores, limited by chip More scalable by adding CPUs, complex design
Cost Less expensive More expensive
Performance Good for multithreaded workloads Excellent for highly demanding tasks
Memory Shared physical memory. Can have local or complex shared memory
Management systems

g) Interrupts and system calls

Ans.

Feature Interrupt System Call


Initiation Asynchronous (triggered by events) Synchronous (initiated by program)
Control Flow Takes control of the program abruptly. The program relinquishes control willingly.

Purpose Handle time-sensitive events, exceptions Request services from the kernel
Examples Timer ticks, device I/O completion, errors File access, memory allocation, process
creation.

Q4: What is meant by hybrid kernels, microkernels, and modular kernels?

Ans.

Hybrid kernels, micro kernels, and modular kernels are different design approaches in operating
system (OS) kernel architecture. Each approach has its own advantages and trade-offs.
Hybrid Kernel:

 Combines Aspects: Attempts to balance the benefits of both microkernels and monolithic
kernels. It has a smaller kernel than a monolithic kernel but includes some essential device
drivers and functionalities within the kernel space for performance reasons.
 Security: Offers a balance between security (smaller kernel) and performance (essential
drivers in kernel space).
 Complexity: More complex than a microkernel but potentially simpler than a monolithic
kernel depending on the design.
 Examples: Windows NT, NetWare, BeOS

Micro kernel:

 Design Philosophy: Minimalist approach. The microkernel itself only provides the most
essential functionalities like memory management, process management, and inter-process
communication (IPC).
 Security: Considered more secure because a smaller kernel attack surface reduces potential
vulnerabilities.
 Performance: This may have slightly lower performance compared to monolithic or hybrid
kernels due to the overhead of message passing between the microkernel and device drivers
or services running in user space.
 Flexibility: Highly modular. Device drivers and other services run in separate user-space
processes, allowing for easier updates and customization without affecting the core kernel.
 Examples: Mach (used in early versions of macOS), QNX

Modular Kernel:

 Focus on Modularity: A modular kernel shares some characteristics with microkernels but
emphasizes the concept of modules. The core kernel provides essential functionalities, while
device drivers and other services can be loaded as modules at runtime.
 Flexibility: Like microkernels, modular kernels offer flexibility and easier updates by adding
or removing modules as needed.
 Performance: This can offer good performance due to the ability to load only required
modules, reducing kernel size and context switching.
 Examples: Linux kernel (with modules)

Choosing the Right Kernel Architecture:

The choice of kernel architecture depends on factors like performance requirements, security needs,
and desired level of flexibility.

 Microkernels: Ideal for security-critical systems where a smaller attack surface is paramount.
 Monolithic Kernels: Traditionally favoured for performance-oriented systems where raw
speed is a priority.
 Hybrid Kernels: Offer a compromise between security and performance for general-purpose
systems.
 Modular Kernels: Provide a balance between flexibility, performance, and security, making
them popular choices for modern operating systems like Linux.

Q5: Suppose you need to design a complete operating system for an Intel computer system
which behaves as a client in a client-server architecture. The client computer system uses
a single Intel microprocessor, 8 GB RAM, 256 GB solid state drive and standard
input/output devices. Clearly state the functions that your operating system will provide
if you would select the micro-kernel OS structure. Provide appropriate diagrams to
support your answer.

Ans.

Here are the main functions the operating system would provide:

Memory Management: The microkernel manages the allocation and deallocation of physical
memory for processes running in user space. It ensures no process can directly access memory used
by another process or the kernel itself.

Device Management (Basic): The microkernel might handle basic device initialization and interrupt
handling. However, complex device drivers would likely run in user space for increased flexibility and
security.

Process Management: This includes creating, scheduling, and managing processes. Since we're
aiming for a micro-kernel architecture, most of the operating system services will be implemented as
user-space servers, including device drivers and file systems.

Inter-Process Communication (IPC): Facilitating communication between client processes and server
processes. This would include message-passing mechanisms and possibly shared memory for
efficient data exchange.

File System Management: Managing access to files stored on the 256 GB solid-state drive, including
file permissions, directory structure, and file caching.

Security: Implementing security measures such as access control mechanisms to ensure that client
processes can only access resources they're authorized to use.

Diagram

___________________________

| User Processes |

|___________________________|
|

___________|___________

| Micro-Kernel OS |

|_________________________|

| Process Management |

| Memory Management |

| Inter-Process Comm. |

| Device Management |

| File System Management|

| Security |

|_________________________|

______ ____|_______ ___________

|Device Drivers Server| File System Server |

|____________________|___________________|

| Device Management | File System |

| (Keyboard, Mouse, | Operations |

| Display, Network) | (Read, Write, |

|____________________| Permissions) |

| Hardware |

In this diagram:

User processes interact with the micro-kernel, which provides essential OS services like process
management, memory management, IPC, device management, file system management, and
security.

Device drivers and the file system are implemented as separate user-space server processes,
interacting with the micro-kernel through well-defined interfaces.

This architecture keeps the kernel minimal, improving system stability, scalability, and security, while
allowing for easy extensibility and maintenance.

You might also like