[docs] Update docs: kernel mem, process init

Updated documentation: Added documentation on the kernel address space
layout, process initialization, and rebuilt the syscall docs.
This commit is contained in:
Justin C. Miller
2024-08-10 23:11:14 -07:00
parent d3f5db2479
commit ff64d1989f
7 changed files with 265 additions and 13 deletions

View File

@@ -1,6 +1,18 @@
def unit(size):
units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB']
o = 0
while size >= 1024 and o < len(units):
o += 1
size = size >> 10
return f"{size} {units[o]}"
class Layout:
from collections import namedtuple
Region = namedtuple("Region", ("name", "start", "size", "shared"))
Region = namedtuple("Region", ("name", "desc", "start", "size", "shared"))
sizes = {'G': 1024 ** 3, 'T': 1024 ** 4}
@@ -26,7 +38,7 @@ class Layout:
for r in data:
size = Layout.get_size(r["size"])
addr -= size
regions.append(Layout.Region(r["name"], addr, size,
regions.append(Layout.Region(r["name"], r["desc"], addr, size,
r.get("shared", False)))
self.regions = tuple(regions)