Having the ability to use the `FrameAlloctor`, simulating via the heap
is a very useful pattern when testing libkernel code. Make the test
fixture public for other modules to use.
The CpuOps trait should never hold a reference to any other object. In
fact, it should be a singleton object which is constructed at kernel
boot and live for the entire lifetime of the system. Therefore, it's
safe to add the `'static` trait bound.
Using mtools to prepare the initrd image results in an image that
exclusively uses 8.3 filenames; as per the spec, the 8.3 filenames are
stored uppercase. However, on most UNIX systems, people are used to
dealing with down-case names; therefore convert the strings to
lower-case before passing back to the user.
'bool' has become a reserved keyword in c23. If gcc is modern enough
that this is the default standard, it results in an error. Default to
c99 for the host compiler to fix the problem.
Patch suggested by: @dec-mcgraw
Fixes: #43
I was having a hard time figuring out what this meant when I was going through the instructions the first time, and I believe that this would help clarify things for people who got stuck like I did. I also corrected the name for "Any OS" to clarify this is for X86-64 Linux OSes, because of the command I provided in the README.
Implement a `shrink_to` function for a VMA. This shrinks the VMA's
region to the specified region, while recalculating file offsets and
size if the VMA is file-backed.
The `expand` function adds bytes size into the region; the check `size
>= self.size` isn't needed since this is an expanding function, not a
resizing one. To emphasise that, rename the function to `expand_by`.
Also include a bunch of unit tests to ensure that expansion by regions
with differing sizes works correctly.
libc uses the program headers to find the TLS pheader. Therefore, we
need to push these values into the aux vector when creating the
userspace mappings for the process.
libc bringup checks the version of the kernel and it appears as though
it's not happy with `0.1.0`:
```
FATAL: kernel too old
```
For now, fudge the version to keep libc happy.
Determine whether the program break needs extending with aligned logic,
but always return the requested, non-aligned, address.
Use `brk_addr` in unit tests instead.