mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
Add basic zero faults.
mmap() will now map uncommitted pages that get allocated and zeroed upon the first access. I also made /proc/PID/vm show number of "committed" bytes in each region. This is so cool! :^)
This commit is contained in:
parent
e88f306d07
commit
629c5be10b
5 changed files with 42 additions and 7 deletions
|
@ -52,12 +52,13 @@ ByteBuffer procfs$pid_vm(Process& process)
|
|||
auto stringImpl = StringImpl::createUninitialized(80 + process.regionCount() * 160 + 4096, buffer);
|
||||
memset(buffer, 0, stringImpl->length());
|
||||
char* ptr = buffer;
|
||||
ptr += ksprintf(ptr, "BEGIN END SIZE NAME\n");
|
||||
ptr += ksprintf(ptr, "BEGIN END SIZE COMMIT NAME\n");
|
||||
for (auto& region : process.regions()) {
|
||||
ptr += ksprintf(ptr, "%x -- %x %x %s\n",
|
||||
ptr += ksprintf(ptr, "%x -- %x %x %x %s\n",
|
||||
region->linearAddress.get(),
|
||||
region->linearAddress.offset(region->size - 1).get(),
|
||||
region->size,
|
||||
region->committed(),
|
||||
region->name.characters());
|
||||
}
|
||||
*ptr = '\0';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue