File size: 84,423 Bytes
e932b30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Operating Systems Exam Revision Guide</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3b82f6',
                        secondary: '#1e40af',
                        accent: '#0ea5e9',
                        light: '#f0f9ff',
                        dark: '#0c4a6e'
                    }
                }
            }
        }
    </script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            background-attachment: fixed;
        }
        .unit-card {
            transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
        }
        .unit-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .choice-chip {
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .choice-chip:hover {
            transform: scale(1.05);
        }
        .question-card {
            overflow: hidden;
            transition: all 0.3s ease;
        }
        .highlighted {
            background: linear-gradient(90deg, #dbeafe 0%, transparent 100%);
            border-left: 4px solid #3b82f6;
        }
        .exam-tip {
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
            70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
            100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
        }
        mark {
            background-color: #fef3c7;
            padding: 0 2px;
        }
        pre {
            font-size: 0.9rem !important;
            line-height: 1.5;
        }
        .answer {
            border-left: 4px solid #3b82f6;
            background-color: #f8fafc;
            padding: 1rem;
            margin-top: 1rem;
            border-radius: 0 0.5rem 0.5rem 0;
        }
        .answer-title {
            font-weight: 600;
            color: #1e40af;
            margin-bottom: 0.5rem;
        }
    </style>
</head>
<body>
    <!-- Header -->
    <header class="bg-secondary text-white py-8 shadow-xl">
        <div class="container mx-auto px-4">
            <div class="flex flex-col md:flex-row justify-between items-center gap-6">
                <div>
                    <h1 class="text-3xl md:text-4xl font-bold flex items-center gap-3">
                        <i class="fas fa-server"></i> 
                        Operating Systems Exam Revision Guide
                    </h1>
                    <p class="mt-2 text-blue-200">
                        Comprehensive preparation material for Operating Systems exam
                    </p>
                </div>
                <div class="inline-flex gap-2">
                    <button class="bg-accent hover:bg-blue-500 text-white px-4 py-2 rounded-full flex items-center">
                        <i class="fas fa-book mr-2"></i> Study Notes
                    </button>
                    <button onclick="window.print()" class="bg-primary hover:bg-blue-600 text-white px-4 py-2 rounded-full flex items-center">
                        <i class="fas fa-print mr-2"></i> Print Summary
                    </button>
                </div>
            </div>
        </div>
    </header>
    <!-- Exam Tips -->
    <section class="py-6 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-blue-100">
        <div class="container mx-auto px-4">
            <div class="exam-tip bg-white rounded-xl p-4 shadow-md flex items-start">
                <div class="bg-accent text-white rounded-full p-3 mr-4">
                    <i class="fas fa-lightbulb text-lg"></i>
                </div>
                <div>
                    <h3 class="font-bold text-lg text-secondary mb-1">Quick Tips for Your Exam</h3>
                    <ul class="list-disc pl-5 space-y-1 text-gray-700">
                        <li>Write neatly, underline keywords: <mark>process</mark>, <mark>deadlock</mark>, <mark>virtual memory</mark>, <mark>FCFS</mark></li>
                        <li><strong>Draw diagrams</strong> for process states, scheduling algorithms, and memory management</li>
                        <li>Write small code snippets — even 4 lines with comments can get full marks</li>
                        <li>Spend ~1 minute per 2 marks — don't over-write answers</li>
                        <li>If you're unsure, write something — definition, diagram, or an example</li>
                    </ul>
                </div>
            </div>
        </div>
    </section>
    <main class="container mx-auto px-4 py-8">
        <!-- Unit Navigation -->
        <section class="mb-12">
            <h2 class="text-2xl font-bold text-center text-secondary mb-8">Exam Units</h2>
            <div class="grid grid-cols-1 md:grid-cols-4 gap-6">
                <div class="unit-card bg-gradient-to-br from-blue-100 to-blue-200 border border-blue-300 rounded-2xl p-6 text-center shadow-md">
                    <h3 class="text-xl font-bold text-secondary flex justify-center items-center">
                        <i class="fas fa-microchip mr-2 text-accent"></i>
                        UNIT-1
                    </h3>
                    <p class="text-gray-700 font-medium mt-2">Introduction to OS</p>
                    <div class="bg-primary/10 text-xs inline-block px-3 py-1 rounded-full mt-3 text-primary font-medium">
                        6 Questions
                    </div>
                </div>
                <div class="unit-card bg-gradient-to-br from-indigo-100 to-indigo-200 border border-indigo-300 rounded-2xl p-6 text-center shadow-md">
                    <h3 class="text-xl font-bold text-secondary flex justify-center items-center">
                        <i class="fas fa-tasks mr-2 text-indigo-500"></i>
                        UNIT-2
                    </h3>
                    <p class="text-gray-700 font-medium mt-2">Process Management</p>
                    <div class="bg-indigo-500/10 text-xs inline-block px-3 py-1 rounded-full mt-3 text-indigo-700 font-medium">
                        4 Questions
                    </div>
                </div>
                <div class="unit-card bg-gradient-to-br from-cyan-100 to-cyan-200 border border-cyan-300 rounded-2xl p-6 text-center shadow-md">
                    <h3 class="text-xl font-bold text-secondary flex justify-center items-center">
                        <i class="fas fa-memory mr-2 text-cyan-500"></i>
                        UNIT-3
                    </h3>
                    <p class="text-gray-700 font-medium mt-2">Memory Management</p>
                    <div class="bg-cyan-500/10 text-xs inline-block px-3 py-1 rounded-full mt-3 text-cyan-700 font-medium">
                        4 Questions
                    </div>
                </div>
                <div class="unit-card bg-gradient-to-br from-purple-100 to-purple-200 border border-purple-300 rounded-2xl p-6 text-center shadow-md">
                    <h3 class="text-xl font-bold text-secondary flex justify-center items-center">
                        <i class="fas fa-database mr-2 text-purple-500"></i>
                        UNIT-4
                    </h3>
                    <p class="text-gray-700 font-medium mt-2">File Systems & I/O</p>
                    <div class="bg-purple-500/10 text-xs inline-block px-3 py-1 rounded-full mt-3 text-purple-700 font-medium">
                        1 Question
                    </div>
                </div>
            </div>
        </section>
        <!-- Comparison Tables -->
        <section class="mb-12">
            <h2 class="text-2xl font-bold text-secondary mb-6 flex items-center gap-2">
                <i class="fas fa-table text-accent"></i> Important Comparison Tables
            </h2>
            <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
                <!-- OS Types Table -->
                <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                    <div class="bg-primary text-white py-3 px-4">
                        <h3 class="font-bold text-lg flex items-center gap-2">
                            <i class="fas fa-server"></i> Types of Operating Systems
                        </h3>
                    </div>
                    <div class="overflow-x-auto">
                        <table class="min-w-full">
                            <thead class="bg-blue-50">
                                <tr>
                                    <th class="py-3 px-4 text-left">Type</th>
                                    <th class="py-3 px-4 text-left">Key Features</th>
                                    <th class="py-3 px-4 text-left">Use Cases</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr class="border-b">
                                    <td class="py-3 px-4 font-medium">Batch OS</td>
                                    <td class="py-3 px-4">Processes jobs in groups, minimal manual intervention</td>
                                    <td class="py-3 px-4">Large-scale data processing</td>
                                </tr>
                                <tr class="border-b bg-blue-50">
                                    <td class="py-3 px-4 font-medium">Multitasking OS</td>
                                    <td class="py-3 px-4">Multiple tasks run seemingly simultaneously</td>
                                    <td class="py-3 px-4">Desktop environments (Windows, macOS)</td>
                                </tr>
                                <tr class="border-b">
                                    <td class="py-3 px-4 font-medium">Time Sharing OS</td>
                                    <td class="py-3 px-4">CPU time shared among multiple users</td>
                                    <td class="py-3 px-4">Interactive computing, multi-user systems</td>
                                </tr>
                                <tr class="border-b bg-blue-50">
                                    <td class="py-3 px-4 font-medium">Multiprocessing OS</td>
                                    <td class="py-3 px-4">Utilizes multiple CPUs/cores</td>
                                    <td class="py-3 px-4">High-performance computing</td>
                                </tr>
                                <tr class="border-b">
                                    <td class="py-3 px-4 font-medium">Real Time OS</td>
                                    <td class="py-3 px-4">Guaranteed response within time constraints</td>
                                    <td class="py-3 px-4">Critical applications (medical, aerospace)</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- Memory Management Table -->
                <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                    <div class="bg-indigo-500 text-white py-3 px-4">
                        <h3 class="font-bold text-lg flex items-center gap-2">
                            <i class="fas fa-memory"></i> Memory Management Techniques
                        </h3>
                    </div>
                    <div class="overflow-x-auto">
                        <table class="min-w-full">
                            <thead class="bg-indigo-50">
                                <tr>
                                    <th class="py-3 px-4 text-left">Technique</th>
                                    <th class="py-3 px-4 text-left">Advantages</th>
                                    <th class="py-3 px-4 text-left">Disadvantages</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr class="border-b">
                                    <td class="py-3 px-4 font-medium">Paging</td>
                                    <td class="py-3 px-4">No external fragmentation, simple allocation</td>
                                    <td class="py-3 px-4">Internal fragmentation, page table overhead</td>
                                </tr>
                                <tr class="border-b bg-indigo-50">
                                    <td class="py-3 px-4 font-medium">Segmentation</td>
                                    <td class="py-3 px-4">Logical modularization, no internal fragmentation</td>
                                    <td class="py-3 px-4">External fragmentation, complex swapping</td>
                                </tr>
                                <tr class="border-b">
                                    <td class="py-3 px-4 font-medium">Swapping</td>
                                    <td class="py-3 px-4">Enables larger processes than physical memory</td>
                                    <td class="py-3 px-4">Slower performance due to disk I/O</td>
                                </tr>
                                <tr class="border-b bg-indigo-50">
                                    <td class="py-3 px-4 font-medium">Virtual Memory</td>
                                    <td class="py-3 px-4">Processes larger than RAM, higher multiprogramming</td>
                                    <td class="py-3 px-4">Slower due to page faults, potential thrashing</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </section>
        <!-- Unit Content -->
        <div>
            <!-- Unit 1 -->
            <section id="unit-1" class="mb-12">
                <div class="flex items-center gap-3 mb-6">
                    <div class="w-2 h-10 bg-primary rounded-lg"></div>
                    <h2 class="text-2xl font-bold text-secondary flex items-center gap-2">
                        <i class="fas fa-microchip text-accent"></i> UNIT-1: Introduction to Operating Systems
                    </h2>
                </div>
                <div class="grid grid-cols-1 gap-4">
                    <!-- Question 1 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q1.</span>
                                <span class="text-gray-800 font-medium">Define Operating System.</span>
                                <span class="text-sm bg-blue-100 text-primary px-2 py-0.5 rounded-full">2 MARKS</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p>An Operating System is a software program that connects end users to computer hardware, functioning as a translator between high-level and low-level languages. It acts as an intermediary between the user and computer hardware, providing a user-friendly interface. The OS manages computer hardware and software resources, enabling users to execute applications without needing detailed knowledge of the underlying hardware operations. It serves as both a resource manager and an extended machine, making complex hardware operations transparent to users.</p>
                        </div>
                    </div>
                    <!-- Question 2 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q2.</span>
                                <span class="text-gray-800 font-medium">What are the Goals of an OS?</span>
                                <span class="text-sm bg-blue-100 text-primary px-2 py-0.5 rounded-full">2 MARKS</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p>The fundamental goals of an Operating System are:</p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li>To execute user programs and make tasks easier for users</li>
                                <li>To manage and control the entire set of computer resources effectively</li>
                                <li>To provide convenience for clients through a user-friendly interface</li>
                                <li>To ensure efficient operation of the computer system by optimizing resource utilization</li>
                            </ol>
                            <p class="mt-3">These goals enable the OS to act as both a resource manager (allocating CPU, memory, I/O devices) and an extended machine (hiding hardware complexities from users), ensuring smooth operation and maximizing system efficiency.</p>
                        </div>
                    </div>
                    <!-- Question 3 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q3.</span>
                                <span class="text-gray-800 font-medium">List the different types of Operating Systems.</span>
                                <span class="text-sm bg-blue-100 text-primary px-2 py-0.5 rounded-full">2 MARKS</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p>The different types of Operating Systems are:</p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Batch Operating System</strong> - Processes jobs in groups with minimal manual intervention</li>
                                <li><strong>Multitasking Operating System</strong> - Allows multiple tasks to run seemingly simultaneously</li>
                                <li><strong>Time Sharing OS</strong> - Shares CPU time among multiple users for interactive computing</li>
                                <li><strong>Multiprocessing OS</strong> - Utilizes multiple CPUs or processor cores for improved performance</li>
                                <li><strong>Real Time OS</strong> - Processes data within guaranteed time constraints for critical applications</li>
                            </ol>
                            <p class="mt-3">Each type serves specific computing needs, from large-scale data processing (Batch) to interactive user environments (Time Sharing) and mission-critical systems (Real Time).</p>
                        </div>
                    </div>
                    <!-- Question 4 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q4.</span>
                                <span class="text-gray-800 font-medium">Define: a) Program, b) Process.</span>
                                <span class="text-sm bg-blue-100 text-primary px-2 py-0.5 rounded-full">2 MARKS</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p>a) <strong>Program</strong>: A program is a well-organized set of instructions written in a programming language, stored on secondary storage devices like hard drives. It is a passive entity containing the code that directs the computer to perform specific tasks.</p>
                            <p class="mt-2">b) <strong>Process</strong>: A process is the active execution of a program. It represents a program that is currently running, including its code, data, current activity, and the state of processor and memory allocated to it. The OS manages processes, allocating resources for their execution.</p>
                        </div>
                    </div>
                    <!-- Question 5 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q5.</span>
                                <span class="text-gray-800 font-medium">What is Demand Paging?</span>
                                <span class="text-sm bg-blue-100 text-primary px-2 py-0.5 rounded-full">2 MARKS</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p>Demand Paging is a common Virtual Memory Management technique where pages of a process that are used the least are stored in secondary memory. Pages are only loaded into main memory when they are requested by the CPU or when a page fault occurs. Various page replacement algorithms determine which pages should be swapped in or out. This technique allows systems to run processes larger than physical memory by loading only necessary parts, improving memory utilization and enabling higher multiprogramming.</p>
                        </div>
                    </div>
                    <!-- Question 6 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q6.</span>
                                <span class="text-gray-800 font-medium">List out File Access methods.</span>
                                <span class="text-sm bg-blue-100 text-primary px-2 py-0.5 rounded-full">2 MARKS</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p>The three primary File Access methods are:</p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Sequential Access</strong>: Records are accessed in a pre-defined order, one after another. Information is processed sequentially from the beginning of the file. This is the most common method for accessing files like text files or compiler input.</li>
                                <li><strong>Random Access (Direct Access)</strong>: Records can be accessed directly using a unique address or key, without going through preceding records. This allows reading or writing any record immediately.</li>
                                <li><strong>Index Sequential Access</strong>: Combines features of sequential and random access. An index is created for the file containing pointers to record locations. The index is searched (often sequentially) to find the pointer, which then allows direct access to the desired record.</li>
                            </ol>
                        </div>
                    </div>
                </div>
            </section>
            <!-- Unit 2 -->
            <section id="unit-2" class="mb-12">
                <div class="flex items-center gap-3 mb-6">
                    <div class="w-2 h-10 bg-indigo-500 rounded-lg"></div>
                    <h2 class="text-2xl font-bold text-secondary flex items-center gap-2">
                        <i class="fas fa-tasks text-indigo-500"></i> UNIT-2: Process Management
                    </h2>
                </div>
                <div class="grid grid-cols-1 gap-4">
                    <!-- Question 1 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q1.</span>
                                <span class="text-gray-800 font-medium">Explain the components of a computer system. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>A computer system consists of five integrated components working together to process and manage information. Understanding these components is essential for grasping how an Operating System functions as a resource manager.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Hardware</strong>: Provides basic computing resources including CPU, memory (RAM), and I/O devices (keyboard, monitor, disk drives). The hardware forms the physical foundation of the system.</li>
                                <li><strong>Operating System</strong>: Acts as both a resource manager (managing hardware and software resources) and an extended machine (providing a user-friendly interface that hides hardware complexities).</li>
                                <li><strong>Utilities</strong>: Helper programs that supplement OS capabilities, handling critical tasks like disk optimization and anti-virus protection.</li>
                                <li><strong>Application Programs</strong>: Software designed to perform specific user tasks, such as word processors, web browsers, or games.</li>
                                <li><strong>End Users</strong>: People who interact with the computer system to achieve specific goals, either directly with applications or through the OS.</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>When a user (End User) types a document in Microsoft Word (Application Program), the OS manages loading the program into RAM (Hardware), handles keystrokes from the keyboard (Hardware), stores the document on the hard disk (Hardware), and uses utility programs for tasks like spell-checking (Utilities).</p>
                            <p class="mt-3"><strong>Conclusion:</strong></p>
                            <p>These five components work in harmony to form a complete computer system. The hardware provides the foundation, the OS manages resources and provides an interface, utilities offer supplementary services, application programs fulfill user needs, and end users drive the system's purpose.</p>
                        </div>
                    </div>
                    <!-- Question 1 Alternative -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4 highlighted">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q1.</span>
                                <span class="text-gray-800 font-medium">Explain Basic characteristics of an Operating System. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>The basic characteristics of an Operating System define its core functionalities and essential services for managing computer resources and facilitating user interaction. These characteristics ensure efficient and convenient system operation.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Memory Management</strong>: Tracks primary memory usage, allocating space to processes when requested and deallocating it when no longer needed.</li>
                                <li><strong>Processor Management (CPU Scheduling)</strong>: Allocates the CPU to processes when needed and deallocates it when no longer required, ensuring efficient CPU utilization.</li>
                                <li><strong>Device Management (I/O Management)</strong>: Controls all input and output devices, determining which process receives a device, when, and for how long.</li>
                                <li><strong>File Management</strong>: Handles allocation and deallocation of file storage space, organizing files and managing access permissions.</li>
                                <li><strong>Security</strong>: Protects programs and data from unauthorized access using mechanisms like passwords.</li>
                                <li><strong>Job Accounting</strong>: Monitors and records time and resources consumed by different jobs and users.</li>
                                <li><strong>Control over System Performance</strong>: Tracks system performance metrics, including response times to service requests.</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>When opening a document (File Management), typing on the keyboard (Device Management), the OS schedules the typing process on the CPU (Processor Management) while storing document data in RAM (Memory Management). It ensures only authorized users access private files (Security) and logs application usage time (Job Accounting).</p>
                            <p class="mt-3"><strong>Conclusion:</strong></p>
                            <p>These characteristics collectively enable the OS to function as both a resource manager, efficiently allocating hardware and software resources, and an extended machine, providing a user-friendly environment. They form the foundation for stable, secure, and efficient computer system operation.</p>
                        </div>
                    </div>
                    <!-- Question 2 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q2.</span>
                                <span class="text-gray-800 font-medium">Explain Multiprogramming Operating System. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>A Multiprogramming Operating System is an approach where multiple programs (jobs) reside in main memory simultaneously, and the CPU executes them concurrently. It is designed to maximize CPU utilization by ensuring the processor remains busy.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Multiple Programs in Memory</strong>: More than one program or job is kept in the main memory at any given time.</li>
                                <li><strong>CPU Utilization Focus</strong>: When one job requires I/O operations (during which the CPU would otherwise be idle), the OS switches to another job that needs CPU processing.</li>
                                <li><strong>Mechanism</strong>: The OS selects a job from memory and starts its execution. If that job needs I/O, the OS switches to another ready job, continuing this process to keep the CPU active.</li>
                                <li><strong>Resource Management</strong>: Requires memory management to hold multiple jobs and CPU scheduling to determine execution order.</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>Consider a system where a user program (Job P1) is performing calculations and then needs to read data from a disk. Instead of letting the CPU sit idle during the disk read, the multiprogramming OS switches to execute another user program (Job P2) that is ready for CPU processing. Once the disk read for P1 completes, P1 might regain the CPU.</p>
                            <p class="mt-3"><strong>Advantages and Disadvantages:</strong></p>
                            <p><em>Advantages</em>: High CPU utilization (CPU rarely idle), efficient memory utilization, high CPU throughput.</p>
                            <p><em>Disadvantages</em>: CPU scheduling becomes mandatory (many jobs compete for CPU), users cannot interact directly with executing jobs, and programmers cannot modify a program while it's running.</p>
                        </div>
                    </div>
                    <!-- Question 2 Alternative -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4 highlighted">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q2.</span>
                                <span class="text-gray-800 font-medium">Explain Multitasking Operating System. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>A Multitasking Operating System allows multiple tasks or processes to be executed seemingly simultaneously by rapidly switching the CPU between them. This creates the illusion of concurrent execution, enabling user interaction with multiple applications.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Concurrent Execution</strong>: Creates the appearance of executing multiple jobs simultaneously through rapid CPU switching.</li>
                                <li><strong>User Interaction</strong>: Unlike batch systems, users can interact directly with programs while they're running.</li>
                                <li><strong>Mechanism</strong>: When a process needs I/O (which is slow), the OS switches to another ready process, preventing CPU idle time.</li>
                                <li><strong>Time-Sharing</strong>: Multitasking OS is often called a Time-Sharing system as CPU time is divided among multiple users or processes.</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>Modern desktop OS like Windows, macOS, and Linux are multitasking systems. A user can simultaneously run a web browser, music player, and word processor, switching between them seamlessly while the CPU rapidly switches execution contexts.</p>
                            <p class="mt-3"><strong>Advantages and Disadvantages:</strong></p>
                            <p><em>Advantages</em>: Supports multiple interactive users/applications smoothly; provides flexibility; prevents single programs from monopolizing CPU; manages resources effectively.</p>
                            <p><em>Disadvantages</em>: May run slowly with inadequate processor speed; multiple processors generate more heat; requires complex scheduling algorithms.</p>
                        </div>
                    </div>
                    <!-- Question 3 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q3.</span>
                                <span class="text-gray-800 font-medium">Explain Process life cycle with diagram. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>The Process Life Cycle describes the various states a process transitions through from creation to termination within an Operating System. Understanding these states is fundamental to process management.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>New</strong>: The process is created by the OS but not yet admitted to the ready queue for execution.</li>
                                <li><strong>Ready</strong>: The process is loaded into main memory and waiting to be assigned to a CPU for execution.</li>
                                <li><strong>Running</strong>: The process is currently being executed by the CPU (only one process can be in this state per CPU).</li>
                                <li><strong>Blocked (Waiting)</strong>: The process cannot execute further because it's waiting for an event (e.g., I/O completion).</li>
                                <li><strong>Exit (Terminated)</strong>: The process has finished execution or was terminated; OS releases its resources.</li>
                            </ol>
                            <p class="mt-3"><strong>Diagram Description:</strong></p>
                            <p>The cycle begins with the <strong>New</strong> state. The process moves to <strong>Ready</strong> state, then to <strong>Running</strong> when scheduled. While Running, it can transition to <strong>Blocked</strong> if waiting for an event, or directly to <strong>Exit</strong> if completed. A Blocked process returns to <strong>Ready</strong> once the awaited event occurs. Finally, all processes reach the <strong>Exit</strong> state.</p>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>When you open a web browser (New → Ready → Running), it pauses while waiting for a webpage (Blocked), resumes once loaded (Ready → Running), and closes when you exit (Exit). This demonstrates the complete life cycle in action.</p>
                        </div>
                    </div>
                    <!-- Question 3 Alternative -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4 highlighted">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q3.</span>
                                <span class="text-gray-800 font-medium">Explain Process Control Block (PCB). (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>A Process Control Block (PCB) is a fundamental data structure maintained by the Operating System for every active process. It serves as the process's unique identifier and repository of all essential information needed for management.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <p>The PCB contains critical information including:</p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Process ID (PID)</strong>: Unique integer identifier for each process</li>
                                <li><strong>Process State</strong>: Current state (New, Ready, Running, Blocked, Exit)</li>
                                <li><strong>Process Privileges</strong>: Access rights and permissions for system resources</li>
                                <li><strong>Pointers</strong>: Memory addresses for code, data, and stack regions</li>
                                <li><strong>Program Counter (PC)</strong>: Address of next instruction to execute</li>
                                <li><strong>CPU Registers</strong>: Values of various CPU registers</li>
                                <li><strong>CPU Scheduling Info</strong>: Priority and scheduling details</li>
                                <li><strong>Memory Management Info</strong>: Page/segment tables for memory allocation</li>
                                <li><strong>Accounting Information</strong>: Resource usage statistics</li>
                                <li><strong>I/O Status Information</strong>: Allocated devices and pending operations</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>When a web browser (Process A) is running, its PCB stores current state (Running), next instruction address (PC), CPU register values, CPU time consumed, and open files. If the OS switches to another process (like a music player), it saves the browser's state into its PCB and loads the music player's state from its PCB.</p>
                            <p class="mt-3"><strong>Conclusion:</strong></p>
                            <p>The PCB is indispensable for process management. It enables context switching, resource tracking, scheduling, and lifecycle management. Without PCBs, the OS could not effectively manage multiple processes or maintain system stability during execution.</p>
                        </div>
                    </div>
                    <!-- Question 4 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q4.</span>
                                <span class="text-gray-800 font-medium">Find average waiting time and average turnaround time using FCFS scheduling algorithm. (4 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>First-Come, First-Served (FCFS) is a non-preemptive CPU scheduling algorithm where processes execute in the order they arrive in the ready queue, following a FIFO (First In, First Out) approach.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ul class="list-disc pl-5">
                                <li><strong>Principle</strong>: Jobs execute on a first-come, first-served basis</li>
                                <li><strong>Nature</strong>: Non-preemptive scheduling algorithm</li>
                                <li><strong>Mechanism</strong>: Processes enter the ready queue upon arrival; CPU executes the head process until completion</li>
                                <li><strong>Gantt Chart Representation</strong>:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li>P1 arrives at time 0, runs for 15ms (finishes at time 15)</li>
                                        <li>P2 arrived at time 2, runs from time 15 for 10ms (finishes at time 25)</li>
                                        <li>P3 arrived at time 4, runs from time 25 for 5ms (finishes at time 30)</li>
                                        <li>P4 arrived at time 8, runs from time 30 for 8ms (finishes at time 38)</li>
                                    </ul>
                                </li>
                            </ul>
                            <p class="mt-3"><strong>Calculation Table:</strong></p>
                            <table class="min-w-full mt-3 border border-gray-300">
                                <thead class="bg-gray-100">
                                    <tr>
                                        <th class="py-2 px-3 border-b">Process</th>
                                        <th class="py-2 px-3 border-b">Arrival Time (AT)</th>
                                        <th class="py-2 px-3 border-b">Burst Time (BT)</th>
                                        <th class="py-2 px-3 border-b">Completion Time (CT)</th>
                                        <th class="py-2 px-3 border-b">Turnaround Time (TAT = CT - AT)</th>
                                        <th class="py-2 px-3 border-b">Waiting Time (WT = TAT - BT)</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td class="py-2 px-3 border-b">P1</td>
                                        <td class="py-2 px-3 border-b">0</td>
                                        <td class="py-2 px-3 border-b">15</td>
                                        <td class="py-2 px-3 border-b">15</td>
                                        <td class="py-2 px-3 border-b">15 - 0 = 15</td>
                                        <td class="py-2 px-3 border-b">15 - 15 = 0</td>
                                    </tr>
                                    <tr>
                                        <td class="py-2 px-3 border-b">P2</td>
                                        <td class="py-2 px-3 border-b">2</td>
                                        <td class="py-2 px-3 border-b">10</td>
                                        <td class="py-2 px-3 border-b">25</td>
                                        <td class="py-2 px-3 border-b">25 - 2 = 23</td>
                                        <td class="py-2 px-3 border-b">23 - 10 = 13</td>
                                    </tr>
                                    <tr>
                                        <td class="py-2 px-3 border-b">P3</td>
                                        <td class="py-2 px-3 border-b">4</td>
                                        <td class="py-2 px-3 border-b">5</td>
                                        <td class="py-2 px-3 border-b">30</td>
                                        <td class="py-2 px-3 border-b">30 - 4 = 26</td>
                                        <td class="py-2 px-3 border-b">26 - 5 = 21</td>
                                    </tr>
                                    <tr>
                                        <td class="py-2 px-3 border-b">P4</td>
                                        <td class="py-2 px-3 border-b">8</td>
                                        <td class="py-2 px-3 border-b">8</td>
                                        <td class="py-2 px-3 border-b">38</td>
                                        <td class="py-2 px-3 border-b">38 - 8 = 30</td>
                                        <td class="py-2 px-3 border-b">30 - 8 = 22</td>
                                    </tr>
                                </tbody>
                            </table>
                            <p class="mt-3"><strong>Conclusion / Evaluation:</strong></p>
                            <ul class="list-disc pl-5 mt-2">
                                <li><strong>Average Turnaround Time</strong>: (15 + 23 + 26 + 30) / 4 = 94 / 4 = <strong>23.5 ms</strong></li>
                                <li><strong>Average Waiting Time</strong>: (0 + 13 + 21 + 22) / 4 = 56 / 4 = <strong>14 ms</strong></li>
                                <li><strong>Evaluation</strong>: FCFS is simple to implement but can lead to poor performance with high average waiting time. The "convoy effect" occurs when longer processes arrive early, causing shorter processes arriving later to wait unnecessarily. It's suitable for batch systems but not optimal for time-sharing environments.</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </section>
            <!-- Unit 3 -->
            <section id="unit-3" class="mb-12">
                <div class="flex items-center gap-3 mb-6">
                    <div class="w-2 h-10 bg-cyan-500 rounded-lg"></div>
                    <h2 class="text-2xl font-bold text-secondary flex items-center gap-2">
                        <i class="fas fa-memory text-cyan-500"></i> UNIT-3: Memory Management
                    </h2>
                </div>
                <div class="grid grid-cols-1 gap-4">
                    <!-- Question 1 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q1.</span>
                                <span class="text-gray-800 font-medium">Explain Paging. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>Paging is a fixed-size partitioning memory management scheme where both logical memory (program) and physical memory (RAM) are divided into equal-sized blocks.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Fixed-Size Partitioning</strong>: Paging uses a fixed-size partitioning approach for memory management.</li>
                                <li><strong>Terminology</strong>:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li><strong>Pages</strong>: Fixed-size blocks of logical memory (secondary storage)</li>
                                        <li><strong>Frames</strong>: Fixed-size blocks of physical memory (RAM)</li>
                                        <li>Page size always equals frame size</li>
                                    </ul>
                                </li>
                                <li><strong>Mechanism</strong>: Process pages are stored in available main memory frames. The OS maintains a page table for each process to map logical page numbers to physical frame numbers.</li>
                                <li><strong>Non-Contiguous Allocation</strong>: Allows processes to be allocated physical memory frames scattered throughout RAM.</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>Consider a system with 16 KB main memory and 1 KB frame size. Memory is divided into 16 frames. A 4 KB process is divided into 4 pages (1 KB each). These pages can load into any 4 available frames regardless of adjacency. If pages 2 and 4 of another process are deallocated, creating 2 free frames, a new process's pages can occupy these scattered free frames.</p>
                            <p class="mt-3"><strong>Advantages and Disadvantages:</strong></p>
                            <p><em>Advantages</em>: Simplifies memory allocation; eliminates external fragmentation; allows efficient use of non-contiguous memory; supports virtual memory effectively.</p>
                            <p><em>Disadvantages</em>: Suffers from internal fragmentation (unused space in last page/frame); requires page table overhead; can increase memory access time (though mitigated by TLB).</p>
                        </div>
                    </div>
                    <!-- Question 1 Alternative -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4 highlighted">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q1.</span>
                                <span class="text-gray-800 font-medium">Explain Swapping Memory management. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>Swapping is a memory management technique where a process is temporarily moved from main memory (RAM) to secondary storage (disk) and later brought back for continued execution.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Mechanism</strong>: Transfers processes between primary memory (RAM) and secondary storage (disk), freeing RAM for other processes.</li>
                                <li><strong>Purpose</strong>: Enables execution of multiple and large parallel processes by effectively increasing available memory space; acts as a memory compaction technique.</li>
                                <li><strong>Process</strong>: When memory is needed, the OS selects a process (often blocked or lower-priority) and moves it entirely to disk swap space. Later, when memory is available or the process needs to run, it's swapped back into RAM.</li>
                                <li><strong>Performance Impact</strong>: Total time includes transfer to disk, potential waiting time, and transfer back to memory, making it significantly slower than RAM access.</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>Consider a system with limited RAM running multiple applications. When a user switches away from a large application (like a browser with many tabs), the OS might swap that browser process to disk to free RAM for the active application (like a video editor). When the user switches back to the browser, it's swapped back into RAM.</p>
                            <p class="mt-3"><strong>Conclusion:</strong></p>
                            <p>Swapping is crucial for managing memory in systems with limited RAM, allowing them to handle processes larger than physical memory or run more processes simultaneously. However, it reduces performance due to slow disk I/O compared to RAM access, making it a trade-off between capacity and speed.</p>
                        </div>
                    </div>
                    <!-- Question 2 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q2.</span>
                                <span class="text-gray-800 font-medium">What is Deadlock? (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>Deadlock is a situation where a set of processes are blocked indefinitely because each process holds a resource and waits for another resource held by another process in the set.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Blocking</strong>: Processes involved cannot proceed as they wait for resources held by others.</li>
                                <li><strong>Mutual Dependency</strong>: Creates a circular chain where each process holds a resource needed by another process.</li>
                                <li><strong>Necessary Conditions</strong>: Four conditions must simultaneously hold for deadlock:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li><strong>Mutual Exclusion</strong>: Resources cannot be shared; only one process uses a resource at a time.</li>
                                        <li><strong>Hold and Wait</strong>: A process holds at least one resource while waiting for additional resources.</li>
                                        <li><strong>No Pre-emption</strong>: Resources cannot be forcibly taken from a process; must be released voluntarily.</li>
                                        <li><strong>Circular Wait</strong>: A circular chain exists where each process waits for a resource held by the next process.</li>
                                    </ul>
                                </li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>Consider two processes, P1 and P2. P1 holds Resource R1 and requests R2 (held by P2), while P2 holds R2 and requests R1 (held by P1). Both processes are deadlocked, waiting for each other indefinitely. This often occurs in database systems when transactions lock different records in conflicting orders.</p>
                            <p class="mt-3"><strong>Conclusion:</strong></p>
                            <p>Deadlock is a problematic state in multiprogramming systems causing processes to be perpetually blocked, wasting resources and reducing throughput. Understanding and managing deadlock is crucial for system stability, with prevention, avoidance, and detection/recovery being primary management strategies.</p>
                        </div>
                    </div>
                    <!-- Question 2 Alternative -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4 highlighted">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q2.</span>
                                <span class="text-gray-800 font-medium">Explain Deadlock Prevention. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>Deadlock Prevention is a set of methods ensuring deadlock never occurs by preventing one or more of the four necessary conditions from holding simultaneously.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <p>Prevention works by violating at least one of the four necessary conditions:</p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Mutual Exclusion</strong>: Allow certain resources to be shared whenever possible (though not always feasible, e.g., printers).</li>
                                <li><strong>Hold and Wait</strong>: Ensure processes request all required resources before execution begins, or require releasing all held resources before requesting new ones.</li>
                                <li><strong>No Pre-emption</strong>: Allow the OS to forcibly take resources from processes, though this must be done carefully to avoid corrupting process state.</li>
                                <li><strong>Circular Wait</strong>: Impose a total ordering on resource types, requiring processes to request resources only in increasing order of this numbering.</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>Requiring a process to request all necessary resources (memory, disk space, printer) at the start prevents "Hold and Wait." Assigning unique numbers to resources (R1=1, R2=2, R3=3) and forcing processes to request them in numerical order prevents "Circular Wait" by eliminating the circular dependency.</p>
                            <p class="mt-3"><strong>Conclusion / Evaluation:</strong></p>
                            <p>While deadlock prevention guarantees no deadlock will occur, it often leads to reduced resource utilization and lower system throughput. Resources might be allocated but not immediately needed (Hold and Wait prevention), or processes might be restricted in resource request ordering (Circular Wait prevention). It is generally less efficient than deadlock avoidance or detection/recovery methods, making it suitable only for specific critical systems.</p>
                        </div>
                    </div>
                    <!-- Question 3 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q3.</span>
                                <span class="text-gray-800 font-medium">Explain Virtual Memory. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>Virtual Memory is a memory management technique creating the illusion of having more main memory available than physically installed, allowing processes larger than RAM to execute.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Illusion of Large Memory</strong>: Makes secondary storage (like a hard disk) appear as part of main memory.</li>
                                <li><strong>Mechanism</strong>: Loads only necessary parts (pages or segments) of processes into main memory; the rest resides on disk.</li>
                                <li><strong>Implementation</strong>: Uses techniques like <strong>Demand Paging</strong> (loading pages only when needed, triggered by page faults) or <strong>Demand Segmentation</strong>.</li>
                                <li><strong>Goal</strong>: Enables execution of processes larger than physical RAM, increasing multiprogramming and CPU utilization.</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>Consider a computer with 4GB RAM running a program requiring 6GB memory. Virtual memory allows this by keeping 4GB in RAM and 2GB on disk. When the program needs data from disk-stored parts, the OS swaps it with less-used RAM data. Modern OS like Windows and Linux use this extensively for large applications.</p>
                            <p class="mt-3"><strong>Advantages and Disadvantages:</strong></p>
                            <p><em>Advantages</em>: Executes processes larger than physical memory; increases multiprogramming and CPU utilization; enables running large applications with less RAM; avoids immediate physical memory upgrades.</p>
                            <p><em>Disadvantages</em>: Slows system due to page fault handling time; involves overhead for address translation using page tables; can cause "thrashing" if too many page faults occur.</p>
                        </div>
                    </div>
                    <!-- Question 3 Alternative -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4 highlighted">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q3.</span>
                                <span class="text-gray-800 font-medium">Explain Segmentation. (3 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>Segmentation is a variable-size partitioning memory management technique that supports a user's view of memory by dividing programs into logical units called segments.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Logical Division</strong>: Breaks down processes based on logical structure (main program, functions, procedures, variables, symbol tables).</li>
                                <li><strong>Variable Size</strong>: Segments have varying sizes determined by the logical unit they represent.</li>
                                <li><strong>Segment Table</strong>: Each process has a Segment Table storing information for each segment:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li><strong>Base</strong>: Starting physical address in main memory</li>
                                        <li><strong>Limit</strong>: Length/size of the segment</li>
                                        <li>Segment Table Base Register (STBR) points to the Segment Table location</li>
                                    </ul>
                                </li>
                                <li><strong>Non-Contiguous Allocation</strong>: Segments can be placed in non-contiguous memory locations.</li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <p>A C program can be divided into segments like the <code>main()</code> function segment, <code>calculate()</code> function segment, global variables segment, and heap segment for dynamic memory. Each segment has different sizes based on content. For instance, the code segment might be 10KB, data segment 5KB, and stack segment 2KB.</p>
                            <p class="mt-3"><strong>Advantages and Disadvantages:</strong></p>
                            <p><em>Advantages</em>: Allows logical program modularization; eliminates internal fragmentation (allocates memory by actual segment size); segment tables typically require less space than page tables for sparse address spaces.</p>
                            <p><em>Disadvantages</em>: Suffers from external fragmentation (free memory scattered in holes); requires complex variable-sized segment swapping; address translation requires segment table access, potentially increasing memory access time.</p>
                        </div>
                    </div>
                    <!-- Question 4 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q4.</span>
                                <span class="text-gray-800 font-medium">What are File Access methods? Explain in detail. (4 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>File Access Methods define how records within a file are accessed, read, or written by programs or users. Different methods suit different application requirements and data retrieval patterns.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Sequential Access</strong>:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li>Records accessed in pre-defined sequential order, one after another</li>
                                        <li>Information processed from beginning to end</li>
                                        <li>Most common for text files or compiler input</li>
                                        <li>Requires reading all preceding records to reach a specific record</li>
                                        <li>Simple implementation but inefficient for random record access</li>
                                    </ul>
                                </li>
                                <li class="mt-3"><strong>Random Access (Direct Access)</strong>:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li>Records accessed directly using unique addresses or keys</li>
                                        <li>No need to traverse preceding records</li>
                                        <li>Each record has a unique address for immediate reading/writing</li>
                                        <li>Ideal for database applications requiring quick record retrieval</li>
                                        <li>More complex implementation than sequential access</li>
                                    </ul>
                                </li>
                                <li class="mt-3"><strong>Index Sequential Access</strong>:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li>Combines sequential and random access features</li>
                                        <li>Creates an index with direct pointers to memory blocks</li>
                                        <li>Index searched sequentially to find pointer, then direct access to record</li>
                                        <li>Improves access efficiency and reduces single-record access time</li>
                                        <li>Multiple indexing levels can be used for large files</li>
                                        <li>Balances performance between sequential scanning and direct record access</li>
                                    </ul>
                                </li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <ul class="list-disc pl-5">
                                <li><strong>Sequential</strong>: Reading a log file line by line from start to finish</li>
                                <li><strong>Random</strong>: Accessing a specific customer record using their unique ID in a database</li>
                                <li><strong>Index Sequential</strong>: Using an index (like a book's index) to quickly locate specific entries in a large data file</li>
                            </ul>
                            <p class="mt-3"><strong>Conclusion / Evaluation:</strong></p>
                            <p>Choosing the appropriate file access method is crucial for application performance. Sequential access is simple for batch processing but inefficient for random access. Random access provides immediate record retrieval but may be complex to implement. Index sequential access offers a balanced approach, providing reasonable performance for both sequential scanning and direct record access, making it suitable for many database applications. The optimal choice depends on the specific data access patterns required by the application.</p>
                        </div>
                    </div>
                </div>
            </section>
            <!-- Unit 4 -->
            <section id="unit-4" class="mb-12">
                <div class="flex items-center gap-3 mb-6">
                    <div class="w-2 h-10 bg-purple-500 rounded-lg"></div>
                    <h2 class="text-2xl font-bold text-secondary flex items-center gap-2">
                        <i class="fas fa-database text-purple-500"></i> UNIT-4: File Systems & I/O
                    </h2>
                </div>
                <div class="grid grid-cols-1 gap-4">
                    <!-- Question 1 -->
                    <div class="question-card bg-white rounded-lg shadow-md p-5 mb-4">
                        <div class="flex flex-wrap gap-3 items-start justify-between">
                            <div>
                                <span class="font-bold text-secondary text-lg">Q1.</span>
                                <span class="text-gray-800 font-medium">What are File Access methods? Explain in detail. (4 marks)</span>
                            </div>
                        </div>
                        <div class="answer">
                            <div class="answer-title">Answer:</div>
                            <p><strong>Definition / Introduction:</strong></p>
                            <p>File Access Methods define how records within a file are accessed, read, or written by programs or users. Different methods suit different application requirements and data retrieval patterns.</p>
                            <p class="mt-3"><strong>Key Points / Explanation:</strong></p>
                            <ol class="list-decimal pl-5 mt-2">
                                <li><strong>Sequential Access</strong>:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li>Records accessed in pre-defined sequential order, one after another</li>
                                        <li>Information processed from beginning to end</li>
                                        <li>Most common for text files or compiler input</li>
                                        <li>Requires reading all preceding records to reach a specific record</li>
                                        <li>Simple implementation but inefficient for random record access</li>
                                    </ul>
                                </li>
                                <li class="mt-3"><strong>Random Access (Direct Access)</strong>:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li>Records accessed directly using unique addresses or keys</li>
                                        <li>No need to traverse preceding records</li>
                                        <li>Each record has a unique address for immediate reading/writing</li>
                                        <li>Ideal for database applications requiring quick record retrieval</li>
                                        <li>More complex implementation than sequential access</li>
                                    </ul>
                                </li>
                                <li class="mt-3"><strong>Index Sequential Access</strong>:
                                    <ul class="list-circle pl-5 mt-2">
                                        <li>Combines sequential and random access features</li>
                                        <li>Creates an index with direct pointers to memory blocks</li>
                                        <li>Index searched sequentially to find pointer, then direct access to record</li>
                                        <li>Improves access efficiency and reduces single-record access time</li>
                                        <li>Multiple indexing levels can be used for large files</li>
                                        <li>Balances performance between sequential scanning and direct record access</li>
                                    </ul>
                                </li>
                            </ol>
                            <p class="mt-3"><strong>Examples / Applications:</strong></p>
                            <ul class="list-disc pl-5">
                                <li><strong>Sequential</strong>: Reading a log file line by line from start to finish</li>
                                <li><strong>Random</strong>: Accessing a specific customer record using their unique ID in a database</li>
                                <li><strong>Index Sequential</strong>: Using an index (like a book's index) to quickly locate specific entries in a large data file</li>
                            </ul>
                            <p class="mt-3"><strong>Conclusion / Evaluation:</strong></p>
                            <p>Choosing the appropriate file access method is crucial for application performance. Sequential access is simple for batch processing but inefficient for random access. Random access provides immediate record retrieval but may be complex to implement. Index sequential access offers a balanced approach, providing reasonable performance for both sequential scanning and direct record access, making it suitable for many database applications. The optimal choice depends on the specific data access patterns required by the application.</p>
                        </div>
                    </div>
                </div>
            </section>
        </div>
        <!-- Key Concepts Review-->
        <section class="mb-12 bg-gradient-to-br from-blue-50 to-white p-6 rounded-xl shadow-lg border border-blue-100">
            <h2 class="text-2xl font-bold text-secondary mb-6">Key Concepts Cheatsheet</h2>
            <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4">
                <div class="bg-white rounded-lg p-4 border border-blue-200 shadow-sm flex flex-col items-center text-center">
                    <div class="bg-blue-100 p-3 rounded-full mb-3">
                        <i class="fas fa-tasks text-blue-600 text-xl"></i>
                    </div>
                    <h3 class="font-bold text-secondary">Process Management</h3>
                    <p class="text-sm text-gray-600 mt-1">Managing execution of multiple processes</p>
                </div>
                <div class="bg-white rounded-lg p-4 border border-indigo-200 shadow-sm flex flex-col items-center text-center">
                    <div class="bg-indigo-100 p-3 rounded-full mb-3">
                        <i class="fas fa-memory text-indigo-600 text-xl"></i>
                    </div>
                    <h3 class="font-bold text-secondary">Memory Management</h3>
                    <p class="text-sm text-gray-600 mt-1">Allocation and management of RAM</p>
                </div>
                <div class="bg-white rounded-lg p-4 border border-purple-200 shadow-sm flex flex-col items-center text-center">
                    <div class="bg-purple-100 p-3 rounded-full mb-3">
                        <i class="fas fa-database text-purple-600 text-xl"></i>
                    </div>
                    <h3 class="font-bold text-secondary">File Systems</h3>
                    <p class="text-sm text-gray-600 mt-1">Organizing and managing data storage</p>
                </div>
                <div class="bg-white rounded-lg p-4 border border-cyan-200 shadow-sm flex flex-col items-center text-center">
                    <div class="bg-cyan-100 p-3 rounded-full mb-3">
                        <i class="fas fa-project-diagram text-cyan-600 text-xl"></i>
                    </div>
                    <h3 class="font-bold text-secondary">Deadlock Management</h3>
                    <p class="text-sm text-gray-600 mt-1">Preventing and resolving resource conflicts</p>
                </div>
            </div>
        </section>
    </main>
    <!-- Footer -->
    <footer class="bg-secondary text-blue-100 py-8">
        <div class="container mx-auto px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white">Operating Systems Exam Revision Guide</h3>
                    <p class="mt-1">Comprehensive preparation material for your Operating Systems exam</p>
                </div>
                <div class="flex space-x-4">
                    <button onclick="window.print()" class="bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-lg flex items-center">
                        <i class="fas fa-print mr-2"></i> Print Summary
                    </button>
                    <button class="bg-cyan-500 hover:bg-cyan-600 text-white py-2 px-4 rounded-lg flex items-center">
                        <i class="fas fa-book-open mr-2"></i> Revise Key Points
                    </button>
                </div>
            </div>
            <div class="mt-8 pt-8 border-t border-blue-800 text-center text-sm text-blue-200">
                <p>This study guide covers essential Operating Systems concepts as presented in standard curriculum and exam patterns.</p>
                <p class="mt-2">Important keywords: <mark>process</mark>, <mark>deadlock</mark>, <mark>virtual memory</mark>, <mark>FCFS</mark>, <mark>memory management</mark>, <mark>scheduling</mark></p>
            </div>
        </div>
    </footer>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Add smooth scrolling for anchor links
            document.querySelectorAll('a[href^="#"]').forEach(anchor => {
                anchor.addEventListener('click', function (e) {
                    e.preventDefault();
                    document.querySelector(this.getAttribute('href')).scrollIntoView({
                        behavior: 'smooth'
                    });
                });
            });
        });
    </script>
</body>
</html>