ENVS 1800 Lecture 9: ENVS 1800 Tutorial 9 Notes

25 views2 pages
ENVS 1800 Tutorial 9 Notes Subroutines
Introduction
When a fixed size segment is further divided into pages, the program address is divided
into three parts, a segment, a page, and an offset, and the mapping process takes place
in two steps
The procedure is otherwise identical to our previous discussion.
Program segments can represent parts of a program such as main routines and
subroutines or functions, or they can represent program code and data, even separate
data tables.
The crucial difference between segments and pages is that due to their variability in
size, the boundaries between segments do not fall on natural borders, as pages do.
Therefore, in the segment table, it is necessary to provide the entire physical address for
the start of the segment instead of just a page number.
It is also necessary to record the size or upper limit location of the segment
So that the system can check to make sure that the requested location does not fall
outside the limit of the segment.
Otherwise, it would be possible to read or write data to a location belonging to another
segment, which would compromise the integrity of the system.
This is not a problem with paging, since it is impossible for the offset to exceed the size
of a page.
The program segment numbers are stored with each segment and are treated similarly
to page numbers.
For each segment number, there is an entry in the segment table containing the starting
location of the segment in physical memory plus the limit of the segment.
The physical address is calculated by adding the program segment offset from the start
of the segment to the memory starting location and checking this value against the limit.
As with the page table, part of the segment table can be stored in associative memory
for faster access.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions