
Side note: I gave it a try in the x86 architecture, but getting the interrupts working has been hellish, so I moved on to arm.
I wrote a minimalist hello world kernel for AARCH64 and it works fine. However, when I try to implement variable argument for a custom printf using va_list, things start misbehaving.
* If I compile my code with -O2, it works.
* If I compile with -O0, it doesn't.
Here is what I've been working with: https://gist.github.com/cmaruan/de60bf7 ... f42235f9fb
I don't understand ARM assembly that well to make sense of that the compiler is generating that makes it work when optimisation is enabled.
I'd appreciate help here. Thanks!