in Operating System edited by
5,429 views
2 votes
2 votes

 Consider the following segment table in segmentation scheme :

$\begin{array}{|l|l|l|l|l|}\hline  \textbf{Segment ID} & \textbf{Base} & \textbf{Limit} \\\hline \text{0} & \text{200} & \text{200} \\\hline \text{1} & \text{5000} & \text{1210} \\\hline \text{2} & \text{1527} & \text{498} \\\hline \text{3} & \text{2500} & \text{50} \\\hline  \end{array}$

 What happens if the logical address requested is – Segment Id $2$ and offset $1000$?

  1. Fetches the entry at the physical address $2527$ for segment Id $2$
  2. A trap is generated
  3. Deadlock
  4. Fetches the entry at offset $27$ in Segment Id $3$
in Operating System edited by
by
5.4k views

3 Answers

6 votes
6 votes
Best answer

Answer: (b)

Explanation: Offset 1000 in Segment Id 2 is crossing the Segment Id 2 memory area. Here Segment Id 2 memory area is 1527 to 1527 + 498 = 2025.

selected by
4 votes
4 votes
an os trap signal will be generated. as offset tell how much deeper we have to go in the segment. as we have given 1000 as offset while the segment size is 498 . it will try to read another process memory which should not be allowed in any case

7 Comments

what kind of trap hardware or software?
0
0
it is a software trap as the trap signal is given to os. no need to use hardware interrupt here, this is an protection issue which not implemented as hardware but is implemented in operating system.
1
1
but here we are using comparator at limit register when value is greater than then it will generate trap to os,therefore it should be hardware interrupt na?
0
0

Hardware and software interrupts primarily differ by how they're generated: hardware interrupts are generated by hardware, e.g. a timer, keyboard, network card etc while software interrupts are triggered by a special software instruction (e.g. int 0x80). There is also a related difference in their role: hardware interrupt handlers are supposed to handle hardware events (e.g. a packet arriving on a network interface) while software handlers are supposed to serve another piece of software,

i am 90% sure about it but i still think u should consult someone too. but according to the above its software .

 

0
0
Trap will be generated by hardware. Becz  Hardware will take care of protection of memory space..But i think it can vary from system to system. It should be based on implementation.
0
0
What i think it will be software ..segmentation and paging are not actual . they are all logical. Cpu dosen't even know if segmentation is there or not. If hardware dosen't knows it then how u thnk hardware is going to generte and interrup and how will it be serviced.
0
0
0
0
0 votes
0 votes
It should be a TRAP  as the limit   > offset  here for id 2
by
Answer:

Related questions