[haiku-development] Raspberry Pi - Was: Trying current status of ARM port on Raspberry Pi

  • From: kallisti5 <kallisti5@xxxxxxxxxxx>
  • To: <tschlabach@xxxxxxx>
  • Date: Fri, 19 Oct 2012 16:59:16 -0500

I've sent this to haiku-development as i'm not on the gmane haiku ports mailing list (and it didn't seem like the right location for this.)


http://permalink.gmane.org/gmane.os.haiku.ports.devel/1515


Torsten Schlabach <TSchlabach@...> writes:

I got hold of a nice Raspberry Pi and I wanted to check out the current status of the ARM port of Haiku on the Pi. I am fully aware it may be in an early state, so I don't actually expect a lot. I just want to understand what
works what doesn't work yet.

So I tried to follow the instructions at

http://www.haiku-os.org/guides/building/compiling-arm

using a git clone for last week or so.

It worked quited fine for me until I was wondering where exactly I would find the image to dd into my SD card
afterwards, until I noticed two things:

a) that instructions, the kernel and the haiku_loader and the kernel are bilt, but no image at all. The instrcutions for other ARM plattforms include building a target called haiku-mmc-image.

b) trying to build an image using the haiku-image target, I run into a compilation problem around ICU not
being available for the ARM platform.

The Haiku disk image currently isn't done yet for the Pi. Things are still at a *very* low level.

So maybe someone could be so kind and tell me what I am missing. Is the port to the Raspberry Pi so basic until now that there would just be no point to create an image at all? If not, how do I turn my loader and kernel into
anything I could boot on my device.

http://dev.haiku-os.org/ticket/8379 details the build environment for the loader. Currently the general process is
as follows:

 * Build the arm cross tools as documented
* Build the haiku_loader (this is the boot loader that gets the machine ready for the Haiku Kernel)
 * Set up a basic SD card for the Pi:
See http://cgit.haiku-os.org/haiku/tree/build/jam/board/raspberry_pi for more info :) * Copy the haiku_loader onto the SD card (you can call it whatever you want.. haiku_loader.bin works) * Point the RaspberryPi bootloader blob mess at the haiku_loader.bin (as per the config.txt at that link) * Boot the Pi off of the SD card... the LED lights... great success!! (yeah... boring)

Here is whats happening to make that LED light:
 * The Raspberry Pi binary "Blob" jumps to the haiku_loader code
* http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/raspberrypi_arm/entry.S
 * We jump into pi_start via the assembly above.
* http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/raspberrypi_arm/start.c#n105
 * We flick the OK LED on using raw hardware access (no mmu)
* http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/raspberrypi_arm/start.c#n118 * We set the MMU up.. this means all of the raw hardware addresses will be mapped to virtual addresses * http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/raspberrypi_arm/start.c#n121
 * We attempt to start talking to the remapped virtual addresses
   * Everything breaks because the MMU isn't mapped properly somehow.

I *did* finish the serial driver for the Pi (pl011), so you can get serial output from the Pi.

To get the serial output you need to move serial_init before mmu_init.. that way we map the serial driver using raw addresses and can get some output before getting "stuck" on the broken mmu. (The serial driver now maps itself based on where the peripheral base is... either the "raw" base or the "virtual"
(MMU mapped) base.

You will need to wire a 3.3v serial adapter to the Pi to connect to the arm uart... DANGER: 3.3v != your standard serial port. http://www.sparkfun.com/tutorials/215


I should note that i've gotten jtag debugging working on the Pi after *lots* of hacking... it's tough to get set up, includes soldering on your Raspberry Pi, and involves an expensive $89 JTAG debugger :)
http://twitpic.com/aymqok.


Also if there is any other ARM based platform on which Haiku is more advanced already, just let me know. I
would be willing to try that board first to educate myself a bit.

Several... I have no experience with any of them though.

I still plan on putting in some Haiku Arm love... I've just been struck with a few weeks of "real life" stuff
plus a vacation.

Maybe tomorrow would be a good day to fire up the JTAG and see if we can nail the MMU issues.

irc.freenode.net

 -- Alexander von Gluck IV

Other related posts: