Hello, everyone! I’m Adithya A a second year undergrad at National Institute Of Technology Karnataka, India. I have been exploring low level system programming and operating systems from past 1-2 years and I absolutely love it! I have also been exploring various embedded devices (rpi and bbb) and working with them and it’s truly amazing. I’m interested in working on ARM port for Haiku and the progress for ARM port has been going pretty great here. So I have tried emulating the ARM image in qemu. Using TianoCore throws “Prefetch Abort Exception”. The page tables are completely empty, the addresses are not mapped properly (TTBR0 has garbage address). I’m still investigating on the issue and get back when I get any questions.
Looking forward to contribute and interact with this amazing community
Hello and welcome!
It seems the ARM ports (both 64 and 32 bit) are in a bit of a rough state regarding the MMU at the moment indeed.
Let us know what you find and if you need some help!
There is a mailing list discussion with another person currently investigating it: [haiku-development] Re: Porting HaikuOs to ARM64 - haiku-development - FreeLists
Maybe you can find some useful information there (if you are both hitting the same problem).
Hello, Thanks for the mailing list!. I have gone through the whole discussion but my problem was not exactly as that as I’m trying to boot ARM32 . I have made some progress till now. I’m using Tianocore firmware to emulate Haiku and I always get the error “Prefetch Abort Exception at 0x7fffe000” which was the address of the trampoline page. I dumped the memory map after every function call to analyze what was exactly wrong, I have figured out that the address pointed by TTBR0 was invalid. So before calling main() function from src/system/boot/loader/main.cpp
(which sets the base environment from kernel) I have initialized my own page table and loaded the base address of this table to TTBR0 register, and It worked!
Now it is able to boot the kernel!
I have attached my log file (After the fix):
(I’m not sure if it is allowed to use any other file hosting platforms )
I’m not that sure on what’s happening and what’s the error. (I still have to investigate)
Thank you
Ah, I didn’t notice you were working on 32 bit!
Your fix appears to be working, the kernel has started, mounted the root filesystem and started to load some drivers. That’s great, maybe starting userspace isn’t so far away!
Some of the last messages are about virtio_net being unhappy. So you can try to disable that and see if it goes a bit further. Otherwise, you’ll have to try to find where the kernel is stopping. That means either figuring out how to attach a debugger (I think waddlesplash or x512 may explain some of their tricks here?), or adding some debug traces in the kernel to figure out how far in the boot we get.
Oh alright! I will try disabling that and see what happens. Exams are going on in my uni here I will try to find a sweet time time this weekend and try it out!
Unfortunately Haiku didn’t made it to GSOC this year , but I’m still willing to contribute to this project and try my best to boot Haiku in ARM