Age | Commit message (Collapse) | Author |
|
|
|
This parameter can be used to disable the KASLR mechanism.
|
|
Now that we reclaim the memory range that is created by KASLR before
the start of the kernel image, there's no need to be conservative with
the KASLR offset.
|
|
This ensures we don't just waste the memory range between the default
base load address and the actual load address that was shifted by the
KASLR offset.
|
|
This requirement comes from the fact the Prekernel mapping logic only
uses 2 MiB pages.
This unfortunately reduces the bits of entropy in kernel addresses from
16 bits to 7, but it could be further improved in the future by making
the Prekernel mapping logic a bit more dynamic.
|
|
The 32-bit CI runners don't seem to happy with KASLR, so let's make it
x86-64 only for now.
|
|
This initial (and very basic) implementation of KASLR simply randomizes
the kernel base VA in the 256 MiB range following the default load base.
|
|
As there is no need for a Prekernel on aarch64, the Prekernel code was
moved into Kernel itself. The functionality remains the same.
SERENITY_KERNEL_AND_INITRD in run.sh specifies a kernel and an inital
ramdisk to be used by the emulator. This is needed because aarch64
does not need a Prekernel and the other ones do.
|
|
Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.
These changes result in a stripped x86_64 kernel binary size reduction
of 592 bytes.
|
|
|
|
We now have a mechanism to save the current CPU context to the stack,
and then pass that to the C++ common exception handler.
|
|
We now have a function to install a (currently default) vector
table, meaning that any exceptions (or interrupts for that matter)
will be caught by the processor and routed to one of the vectors
inside the table.
|
|
This allows us to print a hex number to the serial
terminal.
|
|
|
|
We should only look at the framebuffer structure members if the
MULTIBOOT_INFO_FRAMEBUFFER_INFO bit is set in the flags field.
Also add some logging if we ignored the fbdev command line argument
due to either not having a framebuffer provided by the bootloader, or
because we don't support the framebuffer format.
|
|
Creating pointers from arbitrary values is not a valid thing to do in
constexpr functions. Furthermore, this functions is always called with
runtime values anyways, so there's no use in having it be constexpr.
Instead, make it ALWAYS_INLINE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is much simpler and more embeddable version than libGFX one.
Solely purpose is to draw initial boot logo on screen before kernel
is even booted.
|
|
It initializes framebuffer and exposes access to its properties.
|
|
The goal was to reduce common setup of messages. Changes:
* MailBox turned into singleton to follow existing patterns
* Removed device specific messages from MailBox requiring
clients to know the details instead
* Created base Message class which clients should deriver from
It really simplify the usage for more complicated message queues
like framebuffer setup - see followup commits.
|
|
Added dbgln() and warnln() debug functions to help bootstraping.
Eventually they are going to be replaced by AK/Format.h implementation.
|
|
This commit updates the Clang toolchain's version to 13.0.0, which comes
with better C++20 support and improved handling of new features by
clang-format. Due to the newly enabled `-Bsymbolic-functions` flag, our
Clang binaries will only be 2-4% slower than if we dynamically linked
them, but we save hundreds of megabytes of disk space.
The `BuildClang.sh` script has been reworked to build the entire
toolchain in just three steps: one for the compiler, one for GNU
binutils, and one for the runtime libraries. This reduces the complexity
of the build script, and will allow us to modify the CI configuration to
only rebuild the libraries when our libc headers change.
Most of the compile flags have been moved out to a separate CMake cache
file, similarly to how the Android and Fuchsia toolchains are
implemented within the LLVM repo. This provides a nicer interface than
the heaps of command-line arguments.
We no longer build separate toolchains for each architecture, as the
same Clang binary can compile code for multiple targets.
The horrible mess that `SERENITY_CLANG_ARCH` was, has been removed in
this commit. Clang happily accepts an `i686-pc-serenity` target triple,
which matches what our GCC toolchain accepts.
|
|
With these changes, the userland builds correctly with Clang's ThinLTO
enabled.
|
|
|
|
|
|
|
|
When booting on RPI3 firmware puts CPU in EL2 mode which is
different from QEMU's default EL3.
I've added logic to discover initial mode at boot
and then act accordingly. This results in Serenity corectly
switching to EL1 on target hardware now.
|
|
|
|
|
|
Just a bit of housekeeping.
|
|
This is a first step to switch to exception level 1.
This is also my first patch for SerenityOS :)
|
|
Add a postbuild step which creates a raw binary file called kernel8.img
from the Prekernel elf file.
|
|
|
|
For now, this can only query microseconds since boot.
Use this to print a timestamp every second. This busy-loops
until a second has passed. This might be a good first use of
interrupts soon.
qemu used to not implement this timer at some point, but
it seems to work fine even in qemu now (qemu v 5.2.0).
|
|
|
|
|
|
After building and running
objcopy -O binary Build/aarch64/Kernel/Prekernel/Prekernel \
/media/sdcard/kernel8.img
things start booting on an actual RPi4 :^)
(Assuming the sdcard contains RPi firmware, an empty config.txt,
and no other kernel*.img files).
|
|
|
|
- .text now starts at 0x80000, where an actual (non-qemu) RPi expects
- use magic section name ".text.first" to make sure the linker script
puts the kernel entry point at the start of the .text section
- remove a few things from the x86 linker script that aren't needed
for aarch64 (yet?)
|
|
This moves Kernel/Prekernel/linker.ld unchanged to
Kernel/Prekernel/Arch/aarch64 and Kernel/Prekernel/Arch/x86.
The aarch64 will change in a future commit.
No behavior change.
|