Attention is currently required from: Arthur Heymans, Benjamin Doron, David Milosevic, Julius Werner.
1 comment:
File src/arch/arm64/armv8/exception.c:
if (idx < 10)
__uart_tx_byte('0' + (char)idx);
else if (idx < 16)
__uart_tx_byte('A' - 10 + (char)idx);
__uart_tx_byte('!');
UART_DIRECT_PRINT(raw_read_esr(), 32)
__uart_tx_byte('!');
Yeah, honestly, I feel like outputting the arguments is a bit much. […]
Sounds good. But I will have to write it like this (even if it is taking a bit more space):
```
__uart_tx_byte('\r');
__uart_tx_byte('\n');
__uart_tx_byte('!');
__uart_tx_byte('E');
__uart_tx_byte('X');
__uart_tx_byte('C');
__uart_tx_byte('E');
__uart_tx_byte('P');
__uart_tx_byte('T');
__uart_tx_byte('!');
```
The reason is the following:
The issue that I hit was linking the bootblock at the wrong memory address (in memlayout.ld). During that time quite some stuff worked fine. But printk didn't work and my only clue was the `__uart_tx_byte` output. The reason why printk didn't work and that is also why this code didn't work:
```
const char *msg = "\r\n!EXCPT!";
while (*msg)
__uart_tx_byte(*msg++);
```
is that the compiler will reference `msg` variable using an address relative to where I linked the bootblock. If I on the other hand write all the `__uart_tx_byte` seperate than the compiler doesn't need to access something using a memory address, but only needs to write a single byte character in a register as argument to `__uart_tx_byte`. I hope my explanation was good enough. I added an explanation into the commit-msg in case someone tries to update this code in the future and wonders why it was written this way.
To view, visit change 80184. To unsubscribe, or for help writing mail filters, visit settings.