Skip to content
Home Tutorials Roadmaps Courses Classroom Training Blog
Log in Join free
Computer Science Beginner Free

OS Fundamentals

Lesson 10 of 17 · Operating Systems 59%
1. Introduction to CS
What is Computer Science?
6. Operating Systems
OS Fundamentals
7. Cybersecurity Basics
Security Fundamentals
8. Software Engineering
Software Development Life Cycle
9. Cloud Computing
Cloud Computing Basics
10. Dynamic Programming
Dynamic Programming Introduction
11. AI & Machine Learning
Introduction to AI & ML
12. Internet of Things
IoT Fundamentals
13. Blockchain Basics
How Blockchain Works

An operating system manages hardware resources and provides services for programs.

Key Functions

  • Process Management — scheduling, multitasking
  • Memory Management — allocation, virtual memory
  • File System — organizing storage
  • Security — access control

Syntax

COMPUTER-SCIENCE
# Process states
New → Ready → Running → Terminated
                ↓
              Waiting → Ready
Process Scheduling Concept
PYTHON
# Round Robin scheduling
def round_robin(processes, quantum):
    n = len(processes)
    remaining = [p[1] for p in processes]
    time = 0

    while True:
        done = True
        for i in range(n):
            if remaining[i] > 0:
                done = False
                if remaining[i] > quantum:
                    time += quantum
                    remaining[i] -= quantum
                else:
                    time += remaining[i]
                    remaining[i] = 0
                    print(f"{processes[i][0]} completed at t={time}")
        if done:
            break

processes = [("P1", 10), ("P2", 4), ("P3", 6)]
round_robin(processes, quantum=3)

Practice

1
Exercise

What are the main functions of an OS?

Answer
Process management, memory management, file system management, security, and I/O management.

Quick Quiz

1

What is multitasking?

Multitasking allows multiple processes to share CPU time.

Choose an answer to continue.

Interview Questions

A process is an independent program with its own memory. A thread shares memory with other threads in the same process. Threads are lightweight.

Up next

Security Fundamentals

Lesson 11 of 17 · Cybersecurity Basics