On Tue, Dec 2, 2008 at 12:28 PM, Ithamar R. Adema <ithamar@unet.nl> wrote:
Hi Jim,

Jim Burnes wrote:
> It should be able to run a cross-compiled kernel and Haiku OS.
True ;)
> This would be a significant amount of work, but maybe not impossible.
This is definitely also true ;)
> 1. You would have to port the kernel.  I've done some ARM assembler.
Actually, the amount of required assembly should be minimal. Actually
knowing the ARM architecture (or learning it) inside out is more essential.

Good point.  Knowing the memory access / protection structure, ARM-specific instructions that might support low-level kernel services, interrupt structure, timing, boot behavior, power saving etc.
 

> 2. You would have to create keyboard / video / disk and perhaps USB
> drivers.
Initially, I'd go for a simple console over the UART on the board,
connected via NULL modem cable to your PC.... Much much easier.

That's what I thought too, but not being totally familiar with BeOS in console-only mode I wasn't sure how far I could take it.
 

> What other issues would you look at?  Probably some sort of custom
> boot loader?
You could look into actually using u-boot for this. I presume (haven't
checked) that there's a u-boot version available for this board, and
this could be used to actually bootstrap the Haiku kernel by writing a
small u-boot app.

u-boot is already in ROM/FLASH out-of-the-box.   I'll study the u-boot architecture.  I imagine it has some critical information about initial device layout and discovery.


> In addition to reading the kernel sources, is there a hackers, porting
> or architectural guide to the kernel?
I don't think there is (if it is, I'd love to hear about it though :P)
but a good place to start looking is the architecture specific
implementations, here:

http://dev.haiku-os.org/browser/haiku/trunk/src/system/kernel/arch

Francois' m68k port might be a good start for a minimal implementation
of an arch, but I'm sure he'll chime in with some feedback too ;)

Good idea.  That's mostly what I've been studying so far.
 

One thing we're going to run into is support for multiple ARM cores,
multiple System-on-chips containing these cores, and then support for
the boards built using these System-on-Chips. It might be good to have a
discussion on this setup before actually starting too much of the port,
since I know Francois was looking at the FreeRunner as ARM target, and
I've got a whole load of Evaluation Boards here containing all kinds of
different ARM architectures that I would like to boot Haiku on.

According to Axel, you're trying to keep platform specific dependencies in /src/system/boot/platform and CPU architecture differences in .../system/kernel/arch.

From most-specific to least-specific I think the organization goes something like: OS->platform->CPU->variant

Which leads to:

beos->pc->x86->64
linux->amiga->68k->32
amigados->amiga->powerpc->32
windowsXP->pc->x86->32

and finally

haiku->beagle->ARM->v8

Where the platform is a combination of bus definition, minimal devices and perhaps boot process.

That's just a guess though.  Maybe it's too arbitrary.

I'll do some more studying and see if I can't come up with an architecture definition for the beagle that directly addresses Haiku requirements.

jim