<div dir="ltr">Awesome details.<br><br>I would definitely give it a try. Not intereseted in font blitting, so would stick to the morse code idea :).<br>Would send out the details (and wiki them).<br><br>--Vikas<br><br><div class="gmail_quote">
On Fri, Aug 22, 2008 at 7:57 AM, Alex Osborne <span dir="ltr">&lt;<a href="mailto:ato@meshy.org">ato@meshy.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On 22/08/2008, at 11:41 AM, Vikas Saurabh wrote:<br>
<br>
&gt; Why can&#39;t I fool the bootloader to think that I am a kernel. I<br>
&gt; always thought boot loaders just load the kernel image, pass it<br>
&gt; some parameters and start executing them.<br>
<br>
</div>Indeed, that&#39;s exactly what it does. &nbsp;It loads the kernel image into<br>
RAM, puts some parameters and a pointer to the ATAGS (which include<br>
stuff the kernel command-line) into registers and jumps to the start<br>
of the image. &nbsp;See here for details:<br>
<br>
<a href="http://www.arm.linux.org.uk/developer/booting.php" target="_blank">http://www.arm.linux.org.uk/developer/booting.php</a><br>
<div class="Ih2E3d"><br>
&gt;<br>
&gt; I had done this helloworld kind of thing with grub during<br>
&gt; college...but then maybe grub is advanced. What puzzles me is how<br>
&gt; exactly?<br>
<br>
</div>Note that the Freerunner doesn&#39;t have a BIOS. &nbsp;When you did it on x86<br>
you probably used the BIOS&#39; printing routines. &nbsp;If you want to do it<br>
on the FR you&#39;ll have to do your own font blitting etc. &nbsp;If you have<br>
a debug board you could print it to a serial port. &nbsp;You can then also<br>
use JTAG to debug your code and figure out what is going on. &nbsp;If you<br>
don&#39;t have the debug board, I guess you could easily enough blink out<br>
hello world in morse code through an LED or by turning on and off the<br>
backlight or something.<br>
<br>
It might also be useful to play with it in qemu, just pass in your<br>
binary with the -kernel option, you can connect gdb to it and step<br>
through line by line (see the qemu documentation for how to do this).<br>
<br>
As to how to actually do it, it&#39;s a bit of a pain. &nbsp;You&#39;ll probably<br>
need to write a little ARM assembler stub entry point to setup a<br>
stack and call your C code. &nbsp;Although you might be able to just reuse<br>
u-boots stack, I guess. &nbsp;Then you&#39;ll need to compile your code with -<br>
nostdlib and link it in a way that ensures your assembler code is at<br>
the start of the image, you might need to investigate custom linker<br>
scripts for this, I can&#39;t remember. &nbsp;You can then use something like<br>
&quot;objcopy -O binary mycode.elf mycode.bin&quot; to pull the raw code out of<br>
the elf file the linker generated, so that you can give it to u-boot.<br>
<br>
Remember also that you won&#39;t have any standard library, so you&#39;ll<br>
have to write every function you want to use yourself (or use<br>
something like the OSKit C library) and if you code has a bug it&#39;s<br>
just going to hang or reset the CPU, unless you define your own error<br>
handling code.<br>
<br>
So yes, certainly doable and a good learning experience but it&#39;s not<br>
exactly straightforward.<br>
<div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
Openmoko community mailing list<br>
<a href="mailto:community@lists.openmoko.org">community@lists.openmoko.org</a><br>
<a href="http://lists.openmoko.org/mailman/listinfo/community" target="_blank">http://lists.openmoko.org/mailman/listinfo/community</a><br>
</div></div></blockquote></div><br></div>