The Gateway to Computer Science Excellence
+1 vote

 Consider the following segment table in segmentation scheme:

Segment Id Base Limit
          0 200 200
          1 5000 1210
          2  1527 498
          3 2500 50

 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 by Active (2.5k points) | 2.7k views

3 Answers

+7 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.

by Active (2.4k points)
selected by
+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
by Boss (16.1k points)
what kind of trap hardware or software?
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.
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?

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 .


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.
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 votes
It should be a TRAP  as the limit   > offset  here for id 2
by Junior (777 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,741 questions
57,241 answers
104,603 users