Re: Example of ARM based linux board using initramfs and serial console

2008-07-11 Thread Michael Nolin



--- On Fri, 7/11/08, Thomas Charron <[EMAIL PROTECTED]> wrote:

> From: Thomas Charron <[EMAIL PROTECTED]>
> Subject: Re: Example of ARM based linux board using initramfs and serial 
> console

> > > says it can be a root FS by the kernel.
> >  We're still talking Linux, right?
>  (The kernel will panic if it then cannot
> find an initial
> > program to start, but it will still mount the
> filesystem first.)
> >  You may be thinking of the "rdev" field in
> the kernel boot image
> > file.  It gives major and minor numbers for the
> default root device,
> > which are used if you don't specify a
> "root=" argument on the kernel
> > command line.
> 
>   I was talking specifically about an initramfs, which
> specifically
> uses cpio.  initramfs.c checks for a magic flag in the

I would recommend "Understanding the Linux Kernel" and "Linux Kernel 
Development Second Edition"

kernel/init 

do_mounts.h do_mounts_md.cKconfig  Makefile   version.o
do_mounts.cdo_mounts_initrd.c   initramfs.c main.c   
do_mounts_devfs.cdo_mounts_rd.c  version.c

These files and kernel initialization is explained in these references. Very 
little if any ARM specific dependencies here.

grep -i ARM *
Binary file built-in.o matches
Binary file do_mounts_initrd.o matches
Binary file do_mounts.o matches
Binary file do_mounts_rd.o matches
Binary file initramfs.o matches
Kconfig:default y if ARM || H8300
Kconfig:config OBSOLETE_MODPARM
main.c: printk("early_parm_test: %s\n", rest ?: "(null)");
Binary file main.o matches

My own project had a generous block of DDR memory for the creation of this 
ramfs. 

Michael Nolin
Embedded Solutions Unlimited, LLC





  
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: Example of ARM based linux board using initramfs and serial console

2008-07-11 Thread Thomas Charron
On 7/11/08, Ben Scott <[EMAIL PROTECTED]> wrote:
> On Fri, Jul 11, 2008 at 11:53 AM, Thomas Charron <[EMAIL PROTECTED]> wrote:
> >  There IS something that I can't recall the exact specifics of, but
> > it's along the lines of a 'magic identifier' in the filesystem that
> > says it can be a root FS by the kernel.
>  We're still talking Linux, right?
>  To the best of my knowledge, there is no such thing.  Any filesystem
> can be mounted as a root filesystem.  There's no magic in the
> filesystem.  (The kernel will panic if it then cannot find an initial
> program to start, but it will still mount the filesystem first.)
>  You may be thinking of the "rdev" field in the kernel boot image
> file.  It gives major and minor numbers for the default root device,
> which are used if you don't specify a "root=" argument on the kernel
> command line.

  I was talking specifically about an initramfs, which specifically
uses cpio.  initramfs.c checks for a magic flag in the header which
tells the kernel this is indeed a cpio compressed filesystem,
specifically for mounting as the initial root filesystem by the
kernel.  Sorry I wasn't more specific when I said 'filesystem',
perhaps I should have clarified with 'initramfs filesystem'.

-- 
-- Thomas
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: Example of ARM based linux board using initramfs and serial console

2008-07-11 Thread Ben Scott
On Fri, Jul 11, 2008 at 11:53 AM, Thomas Charron <[EMAIL PROTECTED]> wrote:
>  There IS something that I can't recall the exact specifics of, but
> it's along the lines of a 'magic identifier' in the filesystem that
> says it can be a root FS by the kernel.

  We're still talking Linux, right?

  To the best of my knowledge, there is no such thing.  Any filesystem
can be mounted as a root filesystem.  There's no magic in the
filesystem.  (The kernel will panic if it then cannot find an initial
program to start, but it will still mount the filesystem first.)

  You may be thinking of the "rdev" field in the kernel boot image
file.  It gives major and minor numbers for the default root device,
which are used if you don't specify a "root=" argument on the kernel
command line.

-- Ben
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: Example of ARM based linux board using initramfs and serial console

2008-07-11 Thread Thomas Charron
On 7/11/08, Alexander Wolfson <[EMAIL PROTECTED]> wrote:
> This is what I am doing as well.
> Usually there is a statically linked program in the /bin called busybox which 
> provides big chunk of expected command line functionality.
> All the programms - bash, ash, ls, ping, ... are slinks to busybox (init as 
> well) and busybox checks ARGV[0] for the name that was used to call it and 
> acts accordingly. It still has to be part of some filesystem and this is 
> where the problem is. I am doing something wrong creating the initramfs and 
> linking it with the kernel or something is wrong with my busybox or this is 
> something else that I am not even think of.

  There IS something that I can't recall the exact specifics of, but
it's along the lines of a 'magic identifier' in the filesystem that
says it can be a root FS by the kernel.  Forgive me for not recalling
exactly what it is, and I have no time ATM to STFW for it.  :-D

-- 
-- Thomas
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


RE: Example of ARM based linux board using initramfs and serial console

2008-07-11 Thread John Abreau
Just as a simple sanity check, I'd test it without trying to
overcomplicate things. Forget the symlinks to busybox; just
rename the binary to /bin/sh, or whatever name busybox uses
to decide to be a shell; then modify the test kernel to run
/bin/sh instead of /sbin/init. That will at least prove that
the kernel can successfully boot.

And from that, you can try running by hand each command that
your proposed initramfs is supposed to run automatically via init.
By doing that, you should be able to identify where the init
process was failing.



On Fri, July 11, 2008 7:59 am, Alexander Wolfson said:
> This is what I am doing as well.
> Usually there is a statically linked program in the /bin called busybox
> which provides big chunk of expected command line functionality.
>
> All the programms - bash, ash, ls, ping, ... are slinks to busybox (init
> as well) and busybox checks ARGV[0] for the name that was used to call it
> and acts accordingly. It still has to be part of some filesystem and this
> is where the problem is. I am doing something wrong creating the initramfs
> and linking it with the kernel or something is wrong with my busybox or
> this is something else that I am not even think of.
>
> Alex
>
> -Original Message-
> From: [EMAIL PROTECTED] on behalf of John Abreau
> Sent: Thu 7/10/2008 5:59 PM
> To: gnhlug-discuss@mail.gnhlug.org
> Subject: RE: Example of ARM based linux board using initramfs and serial
> console
>
>
> On Thu, July 10, 2008 4:08 pm, Alexander Wolfson said:
>> This is our own board based on our own chip which among other things has
>> ARM926EJ-S (ARMv5TEJ) core.
>> There is no BSP yet, no Flash or USB drivers - only limited access to
>> the board over JTAG. We can boot the board up to the point when kernel
>> dies because there is no init. This why I need initramfs now.
>>
>
>
> While i don't know the details, I understand that it's common practice
> when porting to a new platform to use bash, or perhaps a simpler shell,
> in place of init, as a first step to achieve an initial boot.
>
>
> --
> John Abreau / Executive Director, Boston Linux & Unix
> IM: [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL 
> PROTECTED]
> Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
> PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> ___
> gnhlug-discuss mailing list
> gnhlug-discuss@mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>


-- 
John Abreau / Executive Director, Boston Linux & Unix
IM: [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL 
PROTECTED]
Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


RE: Example of ARM based linux board using initramfs and serial console

2008-07-11 Thread Alexander Wolfson
This is what I am doing as well.
Usually there is a statically linked program in the /bin called busybox which 
provides big chunk of expected command line functionality.

All the programms - bash, ash, ls, ping, ... are slinks to busybox (init as 
well) and busybox checks ARGV[0] for the name that was used to call it and acts 
accordingly. It still has to be part of some filesystem and this is where the 
problem is. I am doing something wrong creating the initramfs and linking it 
with the kernel or something is wrong with my busybox or this is something else 
that I am not even think of.

Alex

-Original Message-
From: [EMAIL PROTECTED] on behalf of John Abreau
Sent: Thu 7/10/2008 5:59 PM
To: gnhlug-discuss@mail.gnhlug.org
Subject: RE: Example of ARM based linux board using initramfs and serial console
 

On Thu, July 10, 2008 4:08 pm, Alexander Wolfson said:
> This is our own board based on our own chip which among other things has
> ARM926EJ-S (ARMv5TEJ) core.
> There is no BSP yet, no Flash or USB drivers - only limited access to
> the board over JTAG. We can boot the board up to the point when kernel
> dies because there is no init. This why I need initramfs now.
>


While i don't know the details, I understand that it's common practice
when porting to a new platform to use bash, or perhaps a simpler shell,
in place of init, as a first step to achieve an initial boot.


-- 
John Abreau / Executive Director, Boston Linux & Unix
IM: [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL 
PROTECTED]
Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


RE: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread John Abreau

On Thu, July 10, 2008 4:08 pm, Alexander Wolfson said:
> This is our own board based on our own chip which among other things has
> ARM926EJ-S (ARMv5TEJ) core.
> There is no BSP yet, no Flash or USB drivers - only limited access to
> the board over JTAG. We can boot the board up to the point when kernel
> dies because there is no init. This why I need initramfs now.
>


While i don't know the details, I understand that it's common practice
when porting to a new platform to use bash, or perhaps a simpler shell,
in place of init, as a first step to achieve an initial boot.


-- 
John Abreau / Executive Director, Boston Linux & Unix
IM: [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL 
PROTECTED]
Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


RE: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Alexander Wolfson
Thank you,

I never heard of that one before

Alex

-Original Message-
From: Thomas Charron [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 5:44 PM
To: Alexander Wolfson
Cc: [EMAIL PROTECTED]; gnhlug-discuss@mail.gnhlug.org
Subject: Re: Example of ARM based linux board using initramfs and serial
console

On Thu, Jul 10, 2008 at 5:41 PM, Thomas Charron <[EMAIL PROTECTED]>
wrote:
>  The tool: Linux Target Image Builder http://www.bitshrine.org/

  I should elaborate.  the Linux Target Image Builder is actually not
done by Freescale, it's an open source utility whos website is located
at http://savannah.nongnu.org/projects/ltib

-- 
-- Thomas

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Thomas Charron
On Thu, Jul 10, 2008 at 5:41 PM, Thomas Charron <[EMAIL PROTECTED]> wrote:
>  The tool: Linux Target Image Builder http://www.bitshrine.org/

  I should elaborate.  the Linux Target Image Builder is actually not
done by Freescale, it's an open source utility whos website is located
at http://savannah.nongnu.org/projects/ltib

-- 
-- Thomas
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Thomas Charron
On Thu, Jul 10, 2008 at 5:13 PM, Alexander Wolfson
<[EMAIL PROTECTED]> wrote:
> Thanks,
> I looked at the docs - unfortunately they don't have details I am
> looking for - it is more a cook book. Source files + the davinci pdf
> would be great.
> I have seen a Gentoo's already. It uses a complicated build system so
> details a sort of hidden.

  If you're looking for a BSP to actually look at, Freescale has
several available, as well as a tool they utilize to allow customers
using freescale chips (including ARM) to build their distros.

  The BSPs:  
http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02VS0l320822D0033202A7

  The tool: Linux Target Image Builder http://www.bitshrine.org/

-- 
-- Thomas
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


RE: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Alexander Wolfson
Thanks,

I looked at the docs - unfortunately they don't have details I am
looking for - it is more a cook book. Source files + the davinci pdf
would be great.

I have seen a Gentoo's already. It uses a complicated build system so
details a sort of hidden.

Alex

-Original Message-
From: Thomas Charron [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 4:54 PM
To: Alexander Wolfson
Cc: [EMAIL PROTECTED]; gnhlug-discuss@mail.gnhlug.org
Subject: Re: Example of ARM based linux board using initramfs and serial
console

On Thu, Jul 10, 2008 at 4:41 PM, Alexander Wolfson
<[EMAIL PROTECTED]> wrote:
> Is it possible to take a look at the code for DaVinci?
> At least kernel configuration file and initramfs directory structure.
> Or you have to pay 7K for the license?
> I am afraid that I am missing some nuance, so I would like to have
some
> sanity check before starting a full blown debugging.

  Take a look at http://focus.ti.com/lit/an/spraah2a/spraah2a.pdf I
think it has basically the 'Idiots Guide' that they use as an example.

  Another thing to read that may help is
http://gentoo-wiki.com/HOWTO_Custom_Initramfs_From_Scratch

-- 
-- Thomas

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Thomas Charron
On Thu, Jul 10, 2008 at 4:41 PM, Alexander Wolfson
<[EMAIL PROTECTED]> wrote:
> Is it possible to take a look at the code for DaVinci?
> At least kernel configuration file and initramfs directory structure.
> Or you have to pay 7K for the license?
> I am afraid that I am missing some nuance, so I would like to have some
> sanity check before starting a full blown debugging.

  Take a look at http://focus.ti.com/lit/an/spraah2a/spraah2a.pdf I
think it has basically the 'Idiots Guide' that they use as an example.

  Another thing to read that may help is
http://gentoo-wiki.com/HOWTO_Custom_Initramfs_From_Scratch

-- 
-- Thomas
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


RE: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Alexander Wolfson
Is it possible to take a look at the code for DaVinci?

At least kernel configuration file and initramfs directory structure.

Or you have to pay 7K for the license?
I am afraid that I am missing some nuance, so I would like to have some
sanity check before starting a full blown debugging.


-Original Message-
From: Michael Nolin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 4:32 PM
To: gnhlug-discuss@mail.gnhlug.org; Alexander Wolfson
Subject: Re: Example of ARM based linux board using initramfs and serial
console




> 
> I would like to find a working example of initramfs on the
> ARM based
> board.
> 
>

> 
> 
>  
> 
> I am porting Linux to the ARM 926 based board. There are no
> network or
> Flash drivers available yet. No LCD is available yet as
> well
> 
> I tried to use initramfs just to test the board , etc. 
> 
> This is a new chip so hardware bugs are possible.
> 

 The Texas Instruments Davinci platform uses a ARM926 core. U-Boot with
a Monta Vista Pro Linux kernel. I would start with U-Boot/arch/ARM to
get started on a new evaluation platform. This platform was not free
about 7K for the licenses, I thought this was a good value considering
rolling your own from uCLinux.org is work.  The hardware was only
$500.00

 I'm using an MMU less ARM966 with no OS, GNU Linux development
environment . ARM embedded question might best be answered on some of
the comp.arch.embedded.. GNUARM Yahoo groups?


Michael Nolin
Embedded Solutions Unlimited, LLC




  

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Michael Nolin



> 
> I would like to find a working example of initramfs on the
> ARM based
> board.
> 
> 
> 
> 
>  
> 
> I am porting Linux to the ARM 926 based board. There are no
> network or
> Flash drivers available yet. No LCD is available yet as
> well
> 
> I tried to use initramfs just to test the board , etc. 
> 
> This is a new chip so hardware bugs are possible.
> 

 The Texas Instruments Davinci platform uses a ARM926 core. U-Boot with a Monta 
Vista Pro Linux kernel. I would start with U-Boot/arch/ARM to get started on a 
new evaluation platform. This platform was not free about 7K for the licenses, 
I thought this was a good value considering rolling your own from uCLinux.org 
is work.  The hardware was only $500.00

 I'm using an MMU less ARM966 with no OS, GNU Linux development environment . 
ARM embedded question might best be answered on some of the 
comp.arch.embedded.. GNUARM Yahoo groups?


Michael Nolin
Embedded Solutions Unlimited, LLC




  
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


RE: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Alexander Wolfson
This is our own board based on our own chip which among other things has
ARM926EJ-S (ARMv5TEJ) core.
There is no BSP yet, no Flash or USB drivers - only limited access to
the board over JTAG. We can boot the board up to the point when kernel
dies because there is no init. This why I need initramfs now.

Alex

-Original Message-
From: Thomas Charron [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 3:59 PM
To: Alexander Wolfson
Cc: gnhlug-discuss@mail.gnhlug.org
Subject: Re: Example of ARM based linux board using initramfs and serial
console

On Thu, Jul 10, 2008 at 2:59 PM, Alexander Wolfson
<[EMAIL PROTECTED]> wrote:
> Hi all,
> I would like to find a working example of initramfs on the ARM based
board.
> I am porting Linux to the ARM 926 based board. There are no network or
Flash
> drivers available yet. No LCD is available yet as well

  I'm confused.  You're trying to make a full Linux system on an
Arm-926 based board which doesn't already have a BSP which includes
Linux?  The kernel itself has run on the 926 for years.

-- 
-- Thomas

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Thomas Charron
On Thu, Jul 10, 2008 at 2:59 PM, Alexander Wolfson
<[EMAIL PROTECTED]> wrote:
> Hi all,
> I would like to find a working example of initramfs on the ARM based board.
> I am porting Linux to the ARM 926 based board. There are no network or Flash
> drivers available yet. No LCD is available yet as well

  I'm confused.  You're trying to make a full Linux system on an
Arm-926 based board which doesn't already have a BSP which includes
Linux?  The kernel itself has run on the 926 for years.

-- 
-- Thomas
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Example of ARM based linux board using initramfs and serial console

2008-07-10 Thread Alexander Wolfson
Hi all,

 

I just subscribed to the list and would like to say hello to everybody.

 

 

I would like to find a working example of initramfs on the ARM based
board.




 

I am porting Linux to the ARM 926 based board. There are no network or
Flash drivers available yet. No LCD is available yet as well

I tried to use initramfs just to test the board , etc. 

This is a new chip so hardware bugs are possible.

 

Unfortunately I never used intramfs before and was looking for a good
doc or better an example.

The closes I found beyond "/Documentation/filesystems/
ramfs-rootfs-initramfs.txt was on free-electrons.com .

They were using framebuffer and Qemu no serial console

 

I built initramfs file system using "buildroot" project.

 

So far board hangs after getting to the point where I assume it tries to
go to initramfs.

 

I started instrument the kernel, etc. to see what is going on, but it
would be nice to have a working example to know that at least I did not
make any stupid mistake.

 

 

Thanks,

 

Alex

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/