If a process references the virtual address 0x100F3557, the values of the three fields, in which the virtual address can be splitted, are:
Offset = 0x557
Page Table = 0x0F3
Page Directory = 0x040
The Page Table Entry of this address has the value 0x71248021.
What is my start address of the page in memory?
Assuming x86 paging the page table entry consist of the (physical) address of the frame the page is mapped into plus some control information. The later occupies the lower 12 bit of the entry, which are the last 3 digits of your hexadecimal value. Thus
frame address = 0x71248000
control information = 0x021
The control information here tells us that this page is
present, bit 0 set, thus there is an active mapping.
read-only, bit 1 unset
user mode accessible, bit 2 unset
(write back cached, bit 3 unset)
(cached, bit 4 unset)
accessed, but not written to (bit 5 set, bit 6 unset)
(not a global page, bit 8 unset)
Thus, assuming a read operation, the process will access address 0x71248000 | 0x557 == 0x71248557, with 0x557 being the offset extracted from the virtual address.
Related
I'm struggling with my interface item measurements Send and Received Bits.
The item of network interface for measure the send and receive bits I have added preprocessing with Custom multiplier to 8 .
When I using the snmpwalk to get the current interface traffic, I got the value is:
IF-MIB::ifHCOutOctets.2 = Counter64: 11057731246261
But back to zabbix web monitoring system, it show only have for this interface sent, did anyone have these problem or findings can be fix it can provide?
My advice for you is to get inspired by the default zabbix templates and how things are set in them.
do not forget to set a correct unit for your item - these can make difference how the final value of the item is calculated:
https://www.zabbix.com/documentation/5.0/en/manual/config/items/item
as far as post-processing goes it seems to be set correcly in your case.
Your item may be incorrecly detected as unixtime and therefore you see date instead of bytes per second so I advise to put in bps in the Units field.
I am studying for my final OS exam and am currently stuck in a question:
Assume a system uses demand paging as its fetch policy.
The resident size is 2 pages.
Replacement policy is Least Recently Used (LRU).
Initial free frame list: 10, 20. 30, 40, 50
Assume a program runs with the following sequence of page references:
3(read), 2(read), 3(write), 1(write), 1(write), 0(write), 3(read)
I am asked to show the final contents of the free frame list, modified list, and the page table.
Here is the model answer.
This is what I managed to do.
The final Resident Set is correct, but the free frame list and the modified list are not. I just cannot see how the modified list does not contain page number 0 (as in it got written to memory), while page number 1 was not written even though it was referenced before it.
Any help would be appreciated.
Why do you recycle 3(10) to the free list in step 4? It was the least recently used (and is dirty) so you would want to keep it, and get rid of 2(20). That appears to be what the model answer is based on.
I know how to use page references to determine a page fault using FIFO. I was confused if how to determine if we have FIFO table.
A process consists of six pages, 0 1 2 3 4 5. Page 0 is automatically loaded when we start running the program. Other pages are loaded (as they are referenced) by the page fault mechanism. This process is allowed only 3 pages in memory at any one time.
How to get a sequence of page references that this process can make (starting with 0, 2, 4)? Asterisks represent page faults.
enter image description here
I use mozilla's pdf.js library to render a pdf in my application. It uses byte-range requests for the same. I know that the requests for the first and the last set of bytes are made first for metadata purposes. But the range of the last set of bytes differs with respect to the pdf. How is the range for the last set of bytes identified and set? Also the first set of bytes is obtained with 200 OK status. I want to know why 200 and not 206 partial content status.
I know that the requests for the first and the last set of bytes are made first for metadata purposes.
It partially incorrect: even if it is reaching the xref/metadata, it is loading last chunk of PDF. File is logically split into chunks of 65536 bytes (see https://github.com/mozilla/pdf.js/blob/master/src/display/api.js#L32)
But the range of the last set of bytes differs with respect to the pdf.
PDF.js loads only whole chunks (for efficiency), probably except the incomplete last one. Hence range of last chunk size might be different for different PDF size.
Also the first set of bytes is obtained with 200 OK status. I want to know why 200 and not 206 partial content status.
Depends on the browser you are talking about. For browsers with streaming support (for now it is only Firefox), PDF.js continues fetching data in addition to range requests. Some browsers (Safari and old Chrome) have cache defect: it is reporting 200 for cached files, even for range range request.
Say for example I am getting a range of integers from a user:
Generate between nnn and nnn widgets.
Yes, most users will ensure that the first number is equal to or less than the second number:
Generate between 3 and 7 widgets.
But then there's that user, who wants to enter this data "back to front";
Generate between 7 and 3 widgets.
Do you quietly switch the fields around when the user clicks OK/Apply so, in the example above, you change the range of 7 to 3 back to 3 to 7 in the GUI? This might not be so practical on a web form where the user enters some data and then submits the form never to see it again but I'm thinking more in terms of a desktop application's settings page where the user's input is saved and subsequently viewed and edited again by the user.
Is it more important to try and educate users to enter a range that "makes sense" via error/alert messages, or quietly cajole their entries into the shape an application is expecting?
I suspect the "cajoling option" is more preferable, but could this "hey the program messed with my data!" approach be a problem for users?
I am currently writing an application that has a handful of these user-configurable ranges so I'm very interested to follow the general consensus of the SO experts.
If the user enters data incorrectly you shouldn't assume a particular pattern of error and automatically correct it. Either report the error to the user and ask them to correct it or suggest a correction that they can approve. In your example, what if the user intended to type 7 and 13 but simply mistyped. If you changed it to 3 and 7 you've entered incorrect data without the user's knowledge. I'd probably do the simple thing and use a visual alert when incorrect data is entered (but before it's actually submitted) and refuse to accept incorrect data, returning an error if it is submitted incorrectly.