Works on real hardware again! #8
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds various changes to ClashOS to get the stack traces
and bootloader to work again in qemu and on real hardware.
The linker scripts are changed to allow the binary to be linked at the
address 0x80000. This is the default address at which the raspberry pi
will load kernel8.img when no 'config.txt' file is present on the sd card.
To allow stack traces to work, the link register had to be zero'ed, because
it contains random stuff on start up on real hardware. It work on qemu,
because it sets the link register to zero.
The code for the framebuffer is currently comment out, because for some reason
the loading over serial fails to work when that code is compiled. But
loading over serial now works!
The current implementation of the DWARF debug info parsing doesn't work for freestanding, because of some assert, which is actually part of the DWARF specification according to @LemonBoy. Also in
FixedBufferAllocator.alloc
there is some code generated that causes an alignment exception on real hardware. The following patch was used to solve these two issues:BTW: I know that the target_specific_features shouldn't be solved like this, but that's a different issue. For this to work it needs "+strict-align".