Discussion:
Questions about page file setup
(too old to reply)
cs412017
2005-11-09 06:55:28 UTC
Permalink
Okay, a few questions about the page file...as Daniel mentioned,
printing page_device->numSectors gives you 2048, from the description it
seems that it should be 512. I am also not sure about what the
page_device->startSector returns...In init paging when I print it out it
prints out 311...does that mean that the free sectors are only between
block numbers 312 and 2047???

I tried a random approach to writing and reading sectors. I could read
and write from sector number 0 also...so, I'm not sure what that means.
Is page_device->startSector meant for our own bookkeeeping purposes???

If we are given complete freedom over writing to the page device, that
works for me...I am just a little confused about what we are allowed and
not allowed to do.

Thanks..
Michael Altizer
2005-11-09 16:29:50 UTC
Permalink
Post by cs412017
Okay, a few questions about the page file...as Daniel mentioned,
printing page_device->numSectors gives you 2048, from the description it
seems that it should be 512. I am also not sure about what the
page_device->startSector returns...In init paging when I print it out it
prints out 311...does that mean that the free sectors are only between
block numbers 312 and 2047???
I tried a random approach to writing and reading sectors. I could read
and write from sector number 0 also...so, I'm not sure what that means.
Is page_device->startSector meant for our own bookkeeeping purposes???
The paging device is the same as the root device in this case
(pagedev->dev = mountPoint->dev; in pfat.c), the 311 is just the offset
in the device where the pagefile (pagefile.bin) begins. So to answer
your question, the pagefile starts at sector 311 (pagedev->startSector)
and continues for 2048 sectors past that (the first 311 sectors are
taken up by other files on the device). Yes, you can access sector 0
(or any sector on the device for that matter, as the kernel has access
to it all), but it will not be within the limits of the pagefile file,
it will just be at the very beginning of the block device which contains
the pagefile file (in this case the root drive device).

-Michael

Loading...