Operating System
Operating System
● Preemption and context switching are two different things. Inside the
critical section, context switch can happen but preemption cannot
happen. https://gateoverflow.in/210027/my-doubt
● At compile time we cannot know about where the program will be loaded
at which address, so we cannot assign any real address to the
instruction, we assign some relocatable code/address i.e., relocation.
First Power-On-Self Test to verify all hardware is working fine, then BIOS is activated, then it
checks the setting for which device, Operating System etc. to Boot, then loads Operating
System to RAM.
● different pids
● in the parent, fork( ) returns the pid of the child process if a child process is created
● in the child, fork( ) always returns 0
● separate copies of all data, including variables with their current values and the stack
● separate program counter (PC) indicating where to execute next; originally both have
the same value but they are thereafter separate
● after fork, the two processes do not share variables
Child and parent process run parallel, so, no specific order. If the scheduler first prints child
then parent we will get output as 65 .If the scheduler first prints parent then child we will get
output as 56.After fork the child and parent process has separate copies of all data, including
variables with their current values and the stack thats why 66 is not possible.
Must Read deadlock question: GATE CSE 2021 Set 2 | Question: 43 - GATE Overflow for
GATE CSE
GATE IT 2004 | Question: 63 - GATE Overflow for GATE CSE
(C)
Scheduler Process is the correct answer.
The reason being, A scheduler process only schedules or we can say selects a process from the ready
queue to be run on CPU. So no interrupt is generated in that case. When there is power failure, surely
an interrupt "power-off signal" will be generated.
GATE CSE 2021 Set 1 | Question: 14 - GATE Overflow for GATE CSE
malloc – This is a function defined in the standard C library and it does not always
invoke the system call. When a process is created, a certain amount of heap memory is
already allocated to it, when required to expand or shrink that memory, it internally uses
sbrk/brk system call on Unix/Linux. i.e., not every malloc call needs a system call but if
the current allocated size is not enough, it’ll do a system call to get more memory.
In the case of Computing, transparency means functioning without being aware.
● Address space
● Heap
● Static data
● Code segments
● File descriptors
● Global variables
● Child processes
● Pending alarms
● Signals and signal handlers
● Accounting information
● Program counter
● Registers
● Stack
● State
V and Y are the logical/addresses that maps to different physical location [different copies of a here]
after if either parent/child writes ..so these are same logical addresses , mapping to different
physical pages ..hence v = y.
Full clarity :
Let's say your process has a var name X that has a virtual address 100 and
physical address 200. The PTE is holding a mapping of addresses from virtual 100
to physical 200.
After the fork, each process (parent and child) will have his private PTE. at this
point both PTEs will map virtual 100 to physical 200.
as long as both processes just read from there they both will read from physical
address 200.
When the first one tries to write there, the data from the physical address will be
copied to a new physical space, let's say 300, and his (and only his) PTE will be
updated so virtual 100 will be mapped to physical 300. That way it's transparent to
the process because he is still using the same (virtual) address.
Redirection simply means capturing output from a file, command, program, script, or even
code block within a script and sending it as input to another file, command, program, or
script. Answer :B
(C) is the answer. Interrupt processing is LIFO because when we are processing an
interrupt, we
disable the interrupts originating from lower priority devices so lower priority interrupts
can not be raised. If an interrupt is detected then it means that it has higher priority
than currently executing interrupt so this new interrupt will preempt the current
interrupt so, LIFO. Other matches are easy.
Hence answer is D.
A
nswer is (A).
(C) is the correct answer. We can use one Interrupt line for all the devices connected
and pass it through OR gate. On receiving by the CPU, it executes the corresponding
ISR and after exec INTA is sent via one line. For Vectored Interrupts it is always
possible if we implement in daisy chain mechanism.
GATE CSE 2005 | Question: 20 - GATE Overflow for GATE CSE
Confused here : Does High CPU bandwidth means that, CPU is least idle or CPU is very busy?
Also, does high I/O bandwidth mean that, I/O device can transfer very high amount of data in a fixed
time?
Read the whole discussions : GATE IT 2006 | Question: 8 - GATE Overflow for GATE
CSE
In part B, Either you allocate or increase in demand? We don't increase the max need,
instead we allocate and then check. That means increase the current allocation and
decrease in available.
GATE CSE 2015 Set 2 | Question: 23 - GATE Overflow for GATE CSE
GATE CSE 2016 Set 1 | Question: 50 - GATE Overflow for GATE CSE
When there is a deadlock possibility, progress is definitely not satisfied, because progress states
that in a finite amount of time a decision must be taken which process will get to execute CS
next.When a deadlock is present, bounded waiting may or may not be satisfied.
GATE CSE 1997 | Question: 3.9 - GATE Overflow for GATE CSE
GATE CSE 2004 | Question: 21, ISRO2007-44 - GATE Overflow for GATE CSE
Optimal page replacement policy me did a mistake (20th page will be a hit at the end):
GATE CSE 2016 Set 1 | Question: 49 - GATE Overflow for GATE CSE
A page replacement algorithm suffers from Belady's anomaly when it is not a stack
algorithm. Eg: LRU and optimal page replacements are stack based.
GATE CSE 2017 Set 1 | Question: 40 - GATE Overflow for GATE CSE
Very good question : Didn't understand why 2GB is given in the question :
GATE CSE 2021 Set 2 | Question: 48 - GATE Overflow for GATE CSE
Good question :
Check the discussion once, didn't understand the point : GATE CSE 1990 | Question:
1-v - GATE Overflow for GATE CSE
GATE CSE 1990 | Question: 7-b - GATE Overflow for GATE CSE
GATE CSE 1991 | Question: 03-xi - GATE Overflow for GATE CSE
GATE CSE 1994 | Question: 1.21 - GATE Overflow for GATE CSE
I assumed that there are only 3 physical frames available by looking at the figure
but you have to calculate no of frames first by the given information in the question
We also need at least 2 modes of execution to ensure user processes share resources
properly and the OS maintains control. This is not required for a single user OS like the
early version of MS-DOS.
Demand paging and DMA enhances the performances- not a strict necessity.
GATE CSE 1999 | Question: 2.11 - GATE Overflow for GATE CSE
GOOD QUESTION
GATE CSE 2006 | Question: 62, ISRO2016-50 - GATE Overflow for GATE CSE
Please study what is the relation between Multiuser support and virtual memory :
GATE CSE 2006 | Question: 63, UGCNET-June2012-III: 45 - GATE Overflow for GATE
CSE
I blindly guessed that each entry of any page table contains the frame no… and as
frame no is of 24 bits…I chose option B .
But it is wrong !
We should not assume that page tables are page aligned (page table size
need not be same as page size unless told so in the question and different
level page tables can have different sizes.
GATE CSE 2008 | Question: 67 - GATE Overflow for GATE CSE
R/W bit : If the bit is set, the page is read/write. Otherwise when it is not set, the page is
read-only.
Question says "single sequential user process". So, all the requests to the disk
scheduler will be in sequence and each one will be blocking the execution and hence
there is no use of any disk scheduling algorithm. Any disk scheduling algorithm gives
the same input sequence and hence the improvement will be 0% for SSTF over
FCFS.Correct Answer: D
Question me formatted disk ka size diya pehle phir unformatted ka size puch liya :)
TOUGH AND GOOD QUESTION including pipeline concepts and disk scheduling !
MUST TRY.
GATE CSE 1998 | Question: 2-9 - GATE Overflow for GATE CSE
RAID : RAID, short for redundant array of independent (originally inexpensive) disks is
a disk subsystem that stores your data across multiple disks to either increase the
performance or provide fault tolerance to your system (some levels provide both).
GATE CSE 1999 | Question: 2-18, ISRO2008-46 - GATE Overflow for GATE CSE
GATE CSE 2001 | Question: 1.22 - GATE Overflow for GATE CSE
Confusing : GATE CSE 2001 | Question: 20 - GATE Overflow for GATE CSE
Interrupt overhead counted in CPU utilisation time only not in transfer time !
Confused !
Answer is (A). Larger block size means less number of blocks to fetch and hence
better throughput. But larger block size also means space is wasted when only small
size is required.
GATE CSE 2008 | Question: 32 - GATE Overflow for GATE CSE
Question me 64 sectors per cylinder diya hai aur solution me 64 sectors per track le
liya, ye kya baat hui :\
GATE CSE 2015 Set 1 | Question: 48 - GATE Overflow for GATE CSE
VERY RARE AND GOOD CONCEPT OF LINEAR and ANGULAR VELOCITY in disk
scheduling :
CAV: In this, each track consist of equal capacity & the density varies such that the
innermost track have the maximum density & the outermost track have the minimum
density. In CAV mode, the spindle motor turns at a constant speed, which makes the
medium pass by the read/write head faster when the head is positioned at the outside of
the disk.
CLV: In this, each track consist of equal density & the capacity varies such that the
innermost track have the minimum capacity & the outermost track have the maximum
capacity. In CLV mode, the spindle motor speed varies so that the medium passes by the
head at the same speed regardless of where on the disk the head is positioned.
Disk is constantly Rotating so when head moved from innermost track to outermost track
total movement of disk =(3.5/0.5)=7 sectors
Jab seek time k liye head move hoga us beech me rotations continue rahenge to no of
sectors to cross calculate karte time rotation ka bhi dhyan rakho…na samajh aaay?
Solution dekh lo !
In questions like this, you should calculate the average seek time by your own.
GOOD QUESTION
GATE IT 2007 | Question: 44, ISRO2015-34 - GATE Overflow for GATE CSE
GATE CSE 2002 | Question: 2.22 - GATE Overflow for GATE CSE
GOOD QUESTION !
GATE CSE 2021 Set 1 | Question: 15 - GATE Overflow for GATE CSE
GATE CSE 1992 | Question: 12-b - GATE Overflow for GATE CSE
VERY GOOD QUESTION. The reasoning is more of an intuition rather than any
formula. GATE CSE 1996 | Question: 2.18 - GATE Overflow for GATE CSE
GOOD QUESTION :
GATE CSE 2014 Set 2 | Question: 55 - GATE Overflow for GATE CSE
VERY GOOD Question ! Will clear all doubts in paging, segmentation and
segmented paging.
Overlay concept :
See here the 20KB wali process , if some partition has extra 20KB space then
also the 20KB process doesn't go inside that partition…it will have its own
fixed partition.