Berkus Decker
d85d824bfd
Switch on MMU immediately to avoid unaligned access
...
Since enabling armv6 unaligned access bit U in CP15 C1
requires AArch32 assembly and I don't want to introduce
yet another boot stub, I'll just initialize MMU right away
- this causes CPU to treat SCTLR_EL1.A differently and not
cause any alignment faults.
In the future, a small AArch32 boot stub that uses
now commented out fn enable_armv6_unaligned_access()
should be used to set U=1 and A=0 for full unaligned
access even when MMU is off. See ARM documentation
linked from that fn.
2020-11-20 03:09:43 +02:00
Berkus Decker
1de52fa109
Disable stack align checks
...
As with data align checks lets not fault on this yet.
2020-11-20 03:09:00 +02:00
Berkus Decker
696307f30c
Improve traps printing
2020-11-20 03:08:40 +02:00
Berkus Decker
4cb6f29e0d
Clean up boot-order
...
Extract shared code, fix comments.
2020-11-20 03:08:40 +02:00
Berkus Decker
367ad5bbb2
Adjust for nightly rustfmt bug
...
See https://github.com/rust-lang/rustfmt/issues/4528
for the bug description, namely rustfmt removes
this comment completely if it's left in the
extern block.
2020-11-17 22:56:56 +02:00
Berkus Decker
09003a7da2
Traps: print more detailed exception report
2020-11-14 17:33:43 +02:00
Berkus Decker
373f4753dc
Disable alignment checks right on boot
...
Specifically, before we print any numbers - rust
core fmt_u64 uses a little optimisation that
ldrh/strh to unaligned addresses.
2020-11-14 17:33:43 +02:00
Berkus Decker
482c62d341
Change mmu detail printer formatting
...
Print mmu features before and after init.
2020-11-14 17:33:43 +02:00
Berkus Decker
df0510266e
Fix formatting
2020-11-14 17:33:43 +02:00
Berkus Decker
50d9caa5f6
Set stack pointer immediately upon boot
2020-11-14 17:33:43 +02:00
Berkus Decker
20c7c8bd7e
Refactor non-DRY boot code
2020-11-14 17:33:43 +02:00
Berkus Decker
3415ccd68c
Add JTAG helpers
2020-11-03 14:03:22 +02:00
Berkus Decker
ab696eca8e
Implement Error type for traps module
...
Recommended by the clippy lint
https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
Using snafu because it already has a no_std feature
unlike thiserror.
2020-10-28 21:38:53 +02:00
Berkus Decker
ea75413df0
Add looping/delay helpers
2020-10-27 11:34:36 +02:00
Berkus Decker
6c5d7a13fc
Add more information to READMEs
...
https://scarfolk.blogspot.com/
2020-10-21 05:52:08 +03:00
Berkus Decker
4672ddace6
Add mm module and move memory alignment functions there
2020-10-20 05:40:26 +03:00
Berkus Decker
c823b42447
Update license identification
2020-10-17 22:32:16 +03:00
Berkus Decker
0692c324af
Add trap handling and test
2020-10-15 23:42:01 +03:00
Berkus Decker
504dcd1f65
Update copyrights
2020-10-15 23:04:01 +03:00
Berkus Decker
408857fcb6
Add documentation
2020-10-15 22:49:31 +03:00
Berkus Decker
4898ad3139
Move global options to main.rs
2020-10-15 22:36:52 +03:00
Berkus Decker
2f663f61de
Move stack start constant to linker script
2020-10-15 22:36:52 +03:00
Berkus Decker
ded53c16a7
Add MMU init code
...
Switch to cortex-a git version temporarily
(waiting for PR to be merged) with support
for all necessary registers.
2020-10-15 22:36:52 +03:00
Berkus Decker
9fd9612b77
Fix entry point to always start a binary
...
Keep vectors table.
Do not keep boot data if not referenced.
2020-09-21 04:01:21 +03:00
Berkus Decker
f485629fb6
Add boot code for RPi and QEMU
2020-09-21 04:01:17 +03:00
Berkus Decker
668296b8e0
Fix clippy warning
2020-08-10 00:34:49 +03:00
Berkus Decker
57e4b81e1c
Implement power-efficient sleep after boot-up
...
* arch-based crates, inspired by Redox
* Do not burn cpu uselessly.
* Start using cortex-a registers.
* Important: initialise stack pointer!
2020-08-09 22:00:36 +03:00