[OSy] assignment 1
Martin Decky
decky at d3s.mff.cuni.cz
Sun Nov 6 23:16:05 CET 2016
Dear Mr. Finger,
> I cannot figure out a way to get the size of physical memory in
> Kalisto.
In MSIM, the physical memory can be probed simply by writing specific
values to it (e.g. by accessing KSEG1, or more generally by establishing
a specific mapping in TLB) and then testing whether the value was
retained by the memory. Non-present physical memory locations read as
all bits set to 1 in MSIM.
This is also the only reliable way since the MSIM virtual machine does
not provide any hardware device or descriptor that could be possibly
queried to get the physical memory configuration.
Remember to use proper variable type modifiers (volatile) to avoid
unwanted compiler optimizations and also make sure you avoid probing
those parts of the physical memory that contain live data (e.g. the code
and data of the kernel).
> Also, it is not clear to me whether we should re-implement bitmap.obj/.c
> or not and why?
That depends completely upon the way you implement the physical memory
management. If you plan to use the bitmap as a backing store for the
frame allocator and if you like the API as defined by bitmap.h, then
please provide a source code re-implementation of bitmap.obj.
If you decide to use a different data structure (or a bitmap, but with a
different API), then you don't have to do anything with the original
bitmap.obj. In other words, we don't require you to re-implement
bitmap.obj if you don't actually use it.
M.D.
More information about the NSWI004
mailing list