© 2026 schoolict.net (Ruwan Mangala Suraweera)
5.4 Memory Management, Paging, Device Drivers and Spoolingමතක කළමනාකරණය, පිටුගත කිරීම, උපාංග ධාවක සහ Spooling
Grade 12 A/L ICT · Lesson 512 ශ්රේණිය A/L ICT · පාඩම 5
In this videoමේ වීඩියෝවේ
- The MMU translates and protects memory addresses.MMU මතක ලිපින පරිවර්තනය කර ආරක්ෂා කරයි.
- Virtual memory + paging map pages to frames via a page table.අතථ්ය මතකය + පිටුගත කිරීම පිටු වගුවකින් පිටු රාමු වලට සිතියම්ගත කරයි.
- Logical address = page × size + offset; physical uses frame × size + offset.තාර්කික = පිටුව × ප්රමාණය + offset; භෞතික = රාමුව × ප්රමාණය + offset.
- Device drivers let the OS control varied hardware.උපාංග ධාවක OS ට විවිධ දෘඩාංග පාලනය කිරීමට ඉඩ දෙයි.
- Spooling queues slow-device output (e.g. printing) on disk.Spooling මන්දගාමී උපාංග ප්රතිදානය තැටියේ පෝලිම්ගත කරයි.
Notesසටහන්
Syllabus 5.4. The OS manages memory with help from the MMU, supports virtual memory and paging, and controls I/O devices through device drivers. Spooling queues output (for example to a printer). In this part you practise address calculations: page number, offset and physical address.විෂය නිර්දේශය 5.4. OS MMU උදව්වෙන් මතකය කළමනාකරණය කරයි, අතථ්ය මතකය සහ පිටුගත කිරීම සහය දක්වයි, උපාංග ධාවක හරහා I/O උපාංග පාලනය කරයි. Spooling ප්රතිදාන පෝලිම්ගත කරයි. මෙම කොටසින් ලිපින ගණනය: පිටු අංකය, offset සහ භෞතික ලිපිනය පුහුණු වේ.
1. Why manage memory?1. මතකය කළමනාකරණය කරන්නේ ඇයි?
Many programs share limited RAM. The OS must allocate, protect and map memory so each process sees a private address space and cannot overwrite another. The Memory Management Unit (MMU) is hardware that translates addresses and checks permissions.වැඩසටහන් බොහෝ දෙනෙක් සීමිත RAM බෙදා ගනී. OS මතකය වෙන් කර, ආරක්ෂා කර, සිතියම්ගත කළ යුතුය. MMU ලිපින පරිවර්තනය කර අවසර පරීක්ෂා කරන දෘඩාංගයයි.
2. Virtual memory and paging2. අතථ්ය මතකය සහ පිටුගත කිරීම
Virtual memory lets a process use a large logical address space. Parts that do not fit in RAM live on disk (swap/page file). Paging splits memory into fixed-size pages (logical) and frames (physical). A page table maps page → frame.අතථ්ය මතකය මගින් ක්රියාවලියකට විශාල තාර්කික ලිපින අවකාශයක් භාවිත කළ හැක. පිටුගත කිරීම මතකය නිශ්චිත ප්රමාණයේ පිටු සහ රාමු වලට බෙදයි. පිටු වගුව පිටුව → රාමුව සිතියම්ගත කරයි.
Logical address = page number × page size + offset. Physical address = frame number × page size + offset (same offset).තාර්කික ලිපිනය = පිටු අංකය × පිටු ප්රමාණය + offset. භෞතික ලිපිනය = රාමු අංකය × පිටු ප්රමාණය + offset.
page = 3500 ÷ 1024 = 3; offset = 3500 mod 1024 = 428.පිටුව = 3500 ÷ 1024 = 3; offset = 3500 mod 1024 = 428.
PA = 5 × 1024 + 428 = 5548.PA = 5 × 1024 + 428 = 5548.
10240 ÷ 1024 = 10 pages.10240 ÷ 1024 = පිටු 10.
Offset bits = log₂(1024) = 10; page bits = 16 − 10 = 6; max pages = 2·6 = 64.Offset බිටු = log₂(1024) = 10; පිටු බිටු = 6; උපරිම පිටු = 64.
3. I/O device management3. I/O උපාංග කළමනාකරණය
Keyboards, disks, printers and USB devices differ. The OS talks to them through device drivers – software modules that hide hardware details and present a uniform interface (read, write, control).යතුරුපුවරු, තැටි, මුද්රක සහ USB වෙනස්ය. OS උපාංග ධාවක හරහා ඒවා සමඟ කතා කරයි – දෘඩාංග විස්තර සඟවන මෘදුකාංග.
- Need for drivers: each device has its own registers and protocols.ධාවක අවශ්යතාව: සෑම උපාංගයකටම තම රෙජිස්තර සහ ප්රොටොකෝල ඇත.
- When you plug in a printer or USB stick, the OS loads the matching driver (or asks you to install one).මුද්රකයක් හෝ USB යොදන විට OS ගැළපෙන ධාවකය පූරණය කරයි.
- Without the right driver the device is invisible or limited.නිවැරදි ධාවකය නැතිව උපාංගය නොපෙනේ හෝ සීමිතයි.
4. Spooling4. Spooling
Spooling (Simultaneous Peripheral Operations On-Line) stores data destined for a slow device (classically a printer) on disk first, then feeds the device in the background. Many users can “print” at once without waiting for the paper.Spooling මන්දගාමී උපාංගයකට (සම්භාව්ය මුද්රකය) යන දත්ත මුලින් තැටියේ තබා පසුබිමේ උපාංගයට යවයි. පරිශීලකයින් බොහෝ දෙනෙකුට එකවර “මුද්රණය” කළ හැක.
Many students send jobs; the spooler queues them on disk so each PC can continue working while the shared printer prints one job after another.ශිෂ්යයින් බොහෝ දෙනෙක් රැකියා යවති; spooler තැටියේ පෝලිම්ගත කරන අතර බෙදාගත් මුද්රකය එකින් එක මුද්රණය කරයි.
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1What does the MMU do?MMU කරන්නේ කුමක්ද?
2What is virtual memory?අතථ්ය මතකය යනු කුමක්ද?
3Define page and frame.පිටුව සහ රාමුව අර්ථ දක්වන්න.
4Why are device drivers needed?උපාංග ධාවක අවශ්ය වන්නේ ඇයි?
5What is spooling?Spooling යනු කුමක්ද?
6For LA=3500 and page size 1024, what are page and offset?LA=3500 සහ පිටු ප්රමාණය 1024 සඳහා පිටුව සහ offset කුමක්ද?
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1The MMU mainlyMMU ප්රධාන වශයෙන්
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Address translation hardware.ලිපින පරිවර්තන දෘඩාංග.
2Virtual memory allowsඅතථ්ය මතකය ඉඩ දෙන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
RAM + disk backing.RAM + තැටි ආධාරකය.
3In paging, a frame isපිටුගත කිරීමේදී රාමුවක් යනු
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Physical page-sized block.භෞතික පිටු-ප්රමාණ කොටස.
4Logical address =තාර්කික ලිපිනය =
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Page and offset.පිටුව සහ offset.
5For LA 3500 and 1 KB pages, the page number isLA 3500 සහ 1 KB පිටු සඳහා පිටු අංකය
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
3500//1024=3.3500//1024=3.
6With page 3 in frame 5 and offset 428, PA isපිටුව 3 රාමුව 5, offset 428 නම් PA
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
5*1024+428.5*1024+428.
7A 10 KB process with 1 KB pages needs1 KB පිටු සහිත 10 KB ක්රියාවලියකට අවශ්ය
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
10.10.
8A device driver isඋපාංග ධාවකයක් යනු
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Per-device software.උපාංගයකට මෘදුකාංග.
9Spooling is often used forSpooling බොහෝ විට භාවිත වන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Classic printer spool.සම්භාව්ය මුද්රක spool.
10Offset bits for a 1024-byte page areබයිට් 1024 පිටුවක offset බිටු
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
log2(1024)=10.log2(1024)=10.
11With 16-bit logical addresses and 10 offset bits, page bits =තාර්කික බිටු 16 සහ offset බිටු 10 නම් පිටු බිටු =
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
16−10=6.16−10=6.
12Mapping in this lesson meansමෙම පාඩමේ සිතියම්ගත කිරීම යනු
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Page-table translation.පිටු-වගු පරිවර්තනය.
13Which term means: “Memory Management Unit – hardware address translation and protection”?“Memory Management Unit – දෘඩාංග ලිපින පරිවර්තනය සහ ආරක්ෂාව” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
MMU – Memory Management Unit – hardware address translation and protection.MMU – Memory Management Unit – දෘඩාංග ලිපින පරිවර්තනය සහ ආරක්ෂාව.
14Which term means: “The real RAM chips and their addresses”?“සැබෑ RAM චිප සහ ඒවායේ ලිපින” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Physical memory – The real RAM chips and their addresses.භෞතික මතකය – සැබෑ RAM චිප සහ ඒවායේ ලිපින.
15Which term means: “Large logical space backed by RAM + disk”?“RAM + තැටියෙන් ආධාරක විශාල තාර්කික අවකාශය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Virtual memory – Large logical space backed by RAM + disk.අතථ්ය මතකය – RAM + තැටියෙන් ආධාරක විශාල තාර්කික අවකාශය.
16Which term means: “Fixed-size pages mapped to frames”?“රාමු වලට සිතියම්ගත නිශ්චිත ප්රමාණයේ පිටු” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Paging – Fixed-size pages mapped to frames.පිටුගත කිරීම – රාමු වලට සිතියම්ගත නිශ්චිත ප්රමාණයේ පිටු.
17Which term means: “Fixed-size block of a process’s logical address space”?“ක්රියාවලියක තාර්කික ලිපින අවකාශයේ නිශ්චිත කොටසකි” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Page – Fixed-size block of a process’s logical address space.පිටුව – ක්රියාවලියක තාර්කික ලිපින අවකාශයේ නිශ්චිත කොටසකි.
18Which term means: “Fixed-size block of physical RAM”?“භෞතික RAM හි නිශ්චිත කොටසකි” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Frame – Fixed-size block of physical RAM.රාමුව – භෞතික RAM හි නිශ්චිත කොටසකි.
19Which term means: “Maps page numbers to frame numbers”?“පිටු අංක රාමු අංක වලට සිතියම්ගත කරයි” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Page table – Maps page numbers to frame numbers.පිටු වගුව – පිටු අංක රාමු අංක වලට සිතියම්ගත කරයි.
20Which term means: “Displacement within a page/frame”?“පිටුව/රාමුව තුළ විස්ථාපනය” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Offset – Displacement within a page/frame.Offset – පිටුව/රාමුව තුළ විස්ථාපනය.
MCQ answer keyMCQ පිළිතුරු
- C – Address translation hardware.ලිපින පරිවර්තන දෘඩාංග.
- A – RAM + disk backing.RAM + තැටි ආධාරකය.
- E – Physical page-sized block.භෞතික පිටු-ප්රමාණ කොටස.
- B – Page and offset.පිටුව සහ offset.
- C – 3500//1024=3.3500//1024=3.
- D – 5*1024+428.5*1024+428.
- D – 10.10.
- B – Per-device software.උපාංගයකට මෘදුකාංග.
- E – Classic printer spool.සම්භාව්ය මුද්රක spool.
- A – log2(1024)=10.log2(1024)=10.
- B – 16−10=6.16−10=6.
- C – Page-table translation.පිටු-වගු පරිවර්තනය.
- E – MMU – Memory Management Unit – hardware address translation and protection.MMU – Memory Management Unit – දෘඩාංග ලිපින පරිවර්තනය සහ ආරක්ෂාව.
- A – Physical memory – The real RAM chips and their addresses.භෞතික මතකය – සැබෑ RAM චිප සහ ඒවායේ ලිපින.
- D – Virtual memory – Large logical space backed by RAM + disk.අතථ්ය මතකය – RAM + තැටියෙන් ආධාරක විශාල තාර්කික අවකාශය.
- D – Paging – Fixed-size pages mapped to frames.පිටුගත කිරීම – රාමු වලට සිතියම්ගත නිශ්චිත ප්රමාණයේ පිටු.
- E – Page – Fixed-size block of a process’s logical address space.පිටුව – ක්රියාවලියක තාර්කික ලිපින අවකාශයේ නිශ්චිත කොටසකි.
- B – Frame – Fixed-size block of physical RAM.රාමුව – භෞතික RAM හි නිශ්චිත කොටසකි.
- C – Page table – Maps page numbers to frame numbers.පිටු වගුව – පිටු අංක රාමු අංක වලට සිතියම්ගත කරයි.
- A – Offset – Displacement within a page/frame.Offset – පිටුව/රාමුව තුළ විස්ථාපනය.
Structured Questionsව්යුහගත ප්රශ්න
1Explain why memory management and the MMU are needed.මතක කළමනාකරණය සහ MMU අවශ්ය වන්නේ ඇයිදැයි පැහැදිලි කරන්න. (2 marksලකුණු 2)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
2Describe virtual memory and paging in three clear points.අතථ්ය මතකය සහ පිටුගත කිරීම කරුණු තුනකින් විස්තර කරන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3For LA=3500, page size 1 KB, frame 5: find page, offset, PA.LA=3500, පිටු 1 KB, රාමුව 5: පිටුව, offset, PA සොයන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4Explain device drivers and why installing them matters.උපාංග ධාවක පැහැදිලි කර ස්ථාපනය වැදගත් වන්නේ ඇයිදැයි කියන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5Define spooling and give a school-lab printer example.Spooling අර්ථ දක්වා පාසල් රසායනාගාර මුද්රක උදාහරණයක් දෙන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- The MMU translates and protects memory addresses.MMU මතක ලිපින පරිවර්තනය කර ආරක්ෂා කරයි.
- Virtual memory + paging map pages to frames via a page table.අතථ්ය මතකය + පිටුගත කිරීම පිටු වගුවකින් පිටු රාමු වලට සිතියම්ගත කරයි.
- Logical address = page × size + offset; physical uses frame × size + offset.තාර්කික = පිටුව × ප්රමාණය + offset; භෞතික = රාමුව × ප්රමාණය + offset.
- Device drivers let the OS control varied hardware.උපාංග ධාවක OS ට විවිධ දෘඩාංග පාලනය කිරීමට ඉඩ දෙයි.
- Spooling queues slow-device output (e.g. printing) on disk.Spooling මන්දගාමී උපාංග ප්රතිදානය තැටියේ පෝලිම්ගත කරයි.
Downloadsබාගත කිරීම්
Full Lesson 5 PDFසම්පූර්ණ පාඩම 5 PDF: English · සිංහල
Next: Lesson 5 A/L Exam Practiceඊළඟට: පාඩම 5 A/L විභාග පුහුණුව →
