Re: Porting Kernel / Drivers to BeagleBoard

"Jim Burnes" <[email protected]> Tue, 2 Dec 2008 16:23:19 -0700
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <[email protected]>
--===============5835093252753076389==
Content-Type: multipart/alternative; 
	boundary="----=_Part_97579_9019584.1228260199814"

------=_Part_97579_9019584.1228260199814
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tue, Dec 2, 2008 at 12:28 PM, Ithamar R. Adema <[email protected]> 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

------=_Part_97579_9019584.1228260199814
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tue, Dec 2, 2008 at 12:28 PM, Ithamar R. Adema <span dir="ltr">&lt;<a href="mailto:[email protected]">[email protected]</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jim,<br>
<div class="Ih2E3d"><br>
Jim Burnes wrote:<br></div><div class="Ih2E3d">&gt; It should be able to run a cross-compiled kernel and Haiku OS.<br>
</div>True ;)<br>
<div class="Ih2E3d">&gt; This would be a significant amount of work, but maybe not impossible.<br>
</div>This is definitely also true ;)<br>
<div class="Ih2E3d">&gt; 1. You would have to port the kernel. &nbsp;I&#39;ve done some ARM assembler.<br>
</div>Actually, the amount of required assembly should be minimal. Actually<br>
knowing the ARM architecture (or learning it) inside out is more essential.</blockquote><div><br>Good point.&nbsp; Knowing the memory access / protection structure, ARM-specific instructions that might support low-level kernel services, interrupt structure, timing, boot behavior, power saving etc.<br>
&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<div class="Ih2E3d">&gt; 2. You would have to create keyboard / video / disk and perhaps USB<br>
&gt; drivers.<br>
</div>Initially, I&#39;d go for a simple console over the UART on the board,<br>
connected via NULL modem cable to your PC.... Much much easier.</blockquote><div><br>That&#39;s what I thought too, but not being totally familiar with BeOS in console-only mode I wasn&#39;t sure how far I could take it.<br>
&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<div class="Ih2E3d">&gt; What other issues would you look at? &nbsp;Probably some sort of custom<br>
&gt; boot loader?<br>
</div>You could look into actually using u-boot for this. I presume (haven&#39;t<br>
checked) that there&#39;s a u-boot version available for this board, and<br>
this could be used to actually bootstrap the Haiku kernel by writing a<br>
small u-boot app.</blockquote><div><br>u-boot is already in ROM/FLASH out-of-the-box.&nbsp;&nbsp; I&#39;ll study the u-boot architecture.&nbsp; I imagine it has some critical information about initial device layout and discovery.<br><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<div class="Ih2E3d">&gt; In addition to reading the kernel sources, is there a hackers, porting<br>
&gt; or architectural guide to the kernel?<br>
</div>I don&#39;t think there is (if it is, I&#39;d love to hear about it though :P)<br>
but a good place to start looking is the architecture specific<br>
implementations, here:<br>
<br>
<a href="http://dev.haiku-os.org/browser/haiku/trunk/src/system/kernel/arch" target="_blank">http://dev.haiku-os.org/browser/haiku/trunk/src/system/kernel/arch</a><br>
<br>
Francois&#39; m68k port might be a good start for a minimal implementation<br>
of an arch, but I&#39;m sure he&#39;ll chime in with some feedback too ;)<br>
</blockquote><div><br>Good idea.&nbsp; That&#39;s mostly what I&#39;ve been studying so far.<br>&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
One thing we&#39;re going to run into is support for multiple ARM cores,<br>
multiple System-on-chips containing these cores, and then support for<br>
the boards built using these System-on-Chips. It might be good to have a<br>
discussion on this setup before actually starting too much of the port,<br>
since I know Francois was looking at the FreeRunner as ARM target, and<br>
I&#39;ve got a whole load of Evaluation Boards here containing all kinds of<br>
different ARM architectures that I would like to boot Haiku on.<br>
</blockquote><br>According to Axel, you&#39;re trying to keep platform specific dependencies in /src/system/boot/platform and CPU architecture differences in .../system/kernel/arch.<br><br>From most-specific to least-specific I think the organization goes something like: OS-&gt;platform-&gt;CPU-&gt;variant<br>
<br>Which leads to:<br><br>beos-&gt;pc-&gt;x86-&gt;64<br>linux-&gt;amiga-&gt;68k-&gt;32<br>amigados-&gt;amiga-&gt;powerpc-&gt;32<br>windowsXP-&gt;pc-&gt;x86-&gt;32<br><br>and finally<br><br>haiku-&gt;beagle-&gt;ARM-&gt;v8<br>
<br>Where the platform is a combination of bus definition, minimal devices and perhaps boot process.<br><br>That&#39;s just a guess though.&nbsp; Maybe it&#39;s too arbitrary.<br><br>I&#39;ll do some more studying and see if I can&#39;t come up with an architecture definition for the beagle that directly addresses Haiku requirements.<br>
<br>jim<br><br><br><br><br></div><br>

------=_Part_97579_9019584.1228260199814--


--===============5835093252753076389==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
--===============5835093252753076389==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Open-beos-kernel-devel mailing list
Open-beos-kernel-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/open-beos-kernel-devel

--===============5835093252753076389==--