logo

Understanding Operating Systems: Memory Management and TLB in a Nutshell

   

Added on  2023-04-24

7 Pages870 Words248 Views
Running head: OPERATING SYSTEM
Operating System
Name of the Student
Name of the University
Author’s Note
Understanding Operating Systems: Memory Management and TLB in a Nutshell_1
1
OPERATING SYSTEM
Answer to Question 1:
The pages in physical memory is owned by the systems. The pages are contiguous
blocks of fixed length and can be described as a single entry in page table. The pages are
mapped with the operating system and it can be transferred between the hard drive and
known as paging or swapping. For the extraction of the page number the logical address is
used and TLB is consulted for obtaining the frame number. In case the TLB is missed the
page table is consulted and frame number is fetched.
The system is responsible for mapping the physical memory with the virtual memory
addresses. It also automatically manages the space of physical memory transparently and thus
the programmer is needed to know the size of physical memory for running any program. The
physical memory acts as a cache for the pages stored on the disk and mapping with any
physical frame.
Answer to Question 2:
During replacement of an entry in the TLB there is need to write it back to the
physical memory. This is can be described form the demand paging where a backing store is
used for the management of page fault. For storing the frame the page table and TLB are
updated and the access of the page is resolved either by page table or the TLB. The backing
store file is needed to be treated as random access file such that certain position of the file can
be seek for reading.
Answer to Question 3:
TLB consists of mapped virtual page number for the physical page number and
includes the present bit, referenced bits, protection, dirty bits and process ID. It also contains
Understanding Operating Systems: Memory Management and TLB in a Nutshell_2
2
OPERATING SYSTEM
98% of the pages that are accessed and the size ranges from 64 to 128 entries. Smaller TLB is
fully associative and page fault and TLB miss is also different from each other.
For the simulation the program is written for reding 1001 addresses ranging from 0 to
65535 and the logical address is translated into physical addresses. The contents of the signed
bytes are determined and outputs the translated logical addresses read from the
addresses23.txt file, physical address of the corresponding logical address and signed byte
value stored for the translated physical address.
while((read = getline(&line, &len, pFile)) != -1){
int offset = atoi(line) & 255;
int page = atoi(line) & 65280;
int page_table_number = page >> 8;
int tlb_hit = 0;
for(int i = 0; i < TLB_SIZE; i++){
if(tlb[i][0] == page_table_number){
tlb_hit = 1;
printf("TLB HIT\n");
break;
}
}
if(v_memory[page_table_number][0] < 0 && !tlb_hit){
pageFaultCount++;
Understanding Operating Systems: Memory Management and TLB in a Nutshell_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Designing a Virtual Memory Manager
|4
|553
|446

Address Calculation in Memory
|3
|962
|107

Introduction to Cloud Computing (Storage)
|11
|2155
|349

Operating System
|14
|1916
|122

Operating System Assignment: Memory Management
|7
|1491
|433

Operating System - Desklib
|7
|544
|268