Purpose and significance of Operating System

Operating system એ master system software છે જે CPU, memory, files અને devices, બધું જ manage કરે છે અને user ને આ complicated hardware ઉપર એક simple interface આપી દે છે.

10 min read · 9 cards · 2 checks

Read in: English · हिन्दी · ગુજરાતી


Theory

એ 8 seconds જેના વિશે તમે ક્યારેય વિચારતા નથી

એક customer નું laptop screen પર ફક્ત black screen બતાવે છે, જેમાં એક cursor blink થયા કરે છે. એ કહે છે, "કાલ સુધી તો બધું બરાબર હતું."

Chirag ને એક જ નજરમાં ખબર પડી જાય છે: "Machine તો સાવ સારી છે, Windows load નથી થતું."

જરા વિચારો: hardware perfect છે, છતાં desktop નહીં, icons નહીં, click નહીં, કંઈ જ નહીં. Power button દબાવ્યા પછી અને એક કામ કરવા લાયક computer મળે એની વચ્ચેની જે ખાલી જગ્યા છે એ ભરે છે operating system, અને આજે આપણે એ જ સમજવાના છીએ કે એ 8 seconds માં અને એ પછી OS ખરેખર કરે છે શું.

Theory

Hotel નો general manager

ગયા topic માં આપણે hotel નું example લીધું હતું: hardware એટલે building, apps એટલે guests. હવે OS એ general manager છે. Guests પોતે ક્યારેય વીજળીના wire નથી જોડતા કે પોતાની room પોતે assign નથી કરતા; એ તો ફક્ત માંગે છે, અને manager rooms allocate કરે (એટલે memory), એક જ lift ને બધા વચ્ચે fairly schedule કરે (એટલે CPU), શું ક્યાં stored છે એના registers રાખે (એટલે files), staff ને order આપે (એટલે drivers દ્વારા devices), અને guests એકબીજાની room માં ઘૂસી ન જાય એનું ધ્યાન રાખે (એટલે protection).

Theory

OS છે શું

Operating system એક એવું system software છે જે:

  • દરેક hardware resource ને manage કરે છે, અને
  • users તથા applications ને કામ કરવા માટે એક simple platform આપે છે.

Startup વખતે load થતો સૌથી પહેલો મોટો program આ જ છે (એને booting કહે છે: ROM માંનું firmware જાગે, storage પરથી OS શોધે, અને એને RAM માં load કરે), અને shutdown થાય ત્યાં સુધી બધું એના જ હાથમાં રહે છે. Computer પર Windows, Linux, macOS; phone પર Android અને iOS, હા, તમારો phone પણ એક આખો OS જ ચલાવે છે.

At a glance

Exam માં પુછાતા functions

Functionએનો મતલબતમને ક્યારે દેખાય
Process managementCPU નો time બધા running programs વચ્ચે વહેંચે4 cores પર 30 apps એકસાથે ચાલતી લાગે
Memory managementદરેક program ને RAM આપે અને protect કરેએક app crash થાય તોય બીજી બંધ ન થાય
File managementRaw disk ઉપર names, folders, permissions આપેતમે folders જુઓ છો, disk sectors નહીં
Device managementDrivers દ્વારા hardware સાથે વાત કરેકોઈ પણ printer setup પછી ચાલી જાય
SecurityLogins, locks, permissionsતમારો ભાઈ-બહેન તમારું account ન ખોલી શકે
User interfaceGUI (icons) કે CLI (typed commands)Desktop પોતે જ

Quiz

તમારા laptop માં 4 CPU cores છે, છતાં એ આરામથી 30 programs "એકસાથે" ચલાવે છે. OS નું કયું function આ illusion ને શક્ય બનાવે છે?

  1. Process management, જે CPU ને programs વચ્ચે ખૂબ ઝડપથી switch કરે છે
  2. File management, જે 30 programs ને folders માં store કરે છે
  3. Device management, જે extra virtual cores ઉમેરી દે છે
  4. GUI, જે એકસાથે 30 windows બતાવે છે
Show the answer

Process management, જે CPU ને programs વચ્ચે ખૂબ ઝડપથી switch કરે છે

OS નો scheduler દરેક program ને CPU time નો એક નાનકડો slice આપે છે, અને એક second માં હજારો વાર switch કરે છે; આ gaps માણસને દેખાતા જ નથી, એટલે બધું parallel ચાલતું લાગે. Folders અને windows ને CPU sharing સાથે કંઈ લેવાદેવા નથી, અને કોઈ software real cores ઉમેરી ન શકે. આ "illusion of simultaneity" exam નું classic explanation છે.

Think first

જરા વિચારો

Chrome અને એક game બંને ચાલી રહ્યાં છે. કોઈ bug ને લીધે game એવી memory માં લખવા જાય છે જે એને assign જ નહોતી થઈ. તો Chrome નો data corrupt કેમ નથી થતો? કયું function એને બચાવે છે, અને game નું શું થાય છે?

Show the answer

Memory management. OS એ દરેક program ને RAM નો પોતાનો protected વિસ્તાર આપ્યો છે; game જેવી પોતાની allocation બહારની address ને touch કરે એ જ ક્ષણે OS એ access block કરી દે અને સામાન્ય રીતે game ને બંધ કરી નાખે (એ જ જાણીતું "app has stopped working"). Chrome ને તો કંઈ ખબર જ ન પડે. એક program crash થાય પણ આખી machine ન બેસી જાય, એ જ memory protection નું કામ છે.

Watch out

અહીં marks કપાય છે

OS ને application કહી દેવું: એ તો system software નું flagship છે. "OS is stored in RAM" એવું લખવું: એ disk પર stored થાય છે અને boot વખતે RAM માં loaded થાય છે (power-on વખતે RAM ખાલી હોય છે, ROM વાળો lesson યાદ કરો). અને "explain functions of OS" જેવા question માં ફક્ત નામ ગણાવી દેવાથી અડધા જ marks મળે; દરેક function ની સાથે એ શું કરે છે એની એક line લખવી જ પડે.

Theory

આગળ આ ક્યાં લઈ જાય છે

આના પર તો આખો એક subject આવવાનો છે next semester માં (BCA203 Operating System): scheduling algorithms, memory policies જેમ કે 2 topic પહેલાં જોયેલી virtual memory, deadlocks. આજે જોયેલો 6 functions વાળો map એ subject નું table of contents જ છે. અને તમે C, Python કે Java માં જે પણ app લખશો એ કોઈક ને કોઈક OS ના guest તરીકે જ ચાલશે, બરાબર આ જ રીતે resources માંગતી.

Summary

Key takeaways

  • OS એ hardware અને applications વચ્ચેનું master system software છે.
  • Boot વખતે load થાય: ROM નું firmware એને storage પરથી શોધીને RAM માં load કરે.
  • Exam ના 6 functions: process, memory, file, device management, security, user interface.
  • Programs ક્યારેય hardware ને સીધા touch નથી કરતા; એ OS દ્વારા request કરે છે.
  • Examples: Windows, Linux, macOS, Android, iOS.
  • યાદ રાખવાની trick: hotel નો general manager.

Study this properly

This page is the lesson to read. In Gri-Learn the same topic is a graded deck: the self-checks are scored and your weak topics are tracked. Free to start.

Start this topic

Already have an account? Sign in

More from Basic Computer Architecture

Gri-Learn · syllabus-mapped B.C.A. lessons in English, Hindi and Gujarati

Purpose and significance of Operating System · Introduction to Computers · Gri-Learn