linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Booting Linux Kernel without bootloader
@ 2006-07-25 22:30 Clint Thomas
  2006-07-25 23:38 ` bennett78
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Clint Thomas @ 2006-07-25 22:30 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

Hey guys,

I have gone through the Linuxppc embedded and dev lists for information
related to what I am trying to do, but was unable to find exactly what
i'm looking for.

Basically, the system I want linux running on does not require the
initialization of hardware that U-boot provides, or at least it does not
need it to boot the linux kernel. I want to load an uncompressed linux
kernel into memory and start the execution of the kernel, without using
any kind of bootloader. Is this possible? Or does linux need some kind
of firmware or other software to tell it to start executing? Thanks for
any info you might have.
 
Clinton Thomas
cthomas@soneticom.com
 

[-- Attachment #2: Type: text/html, Size: 1100 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Booting Linux Kernel without bootloader
@ 2006-07-26 14:06 Milton Miller
  2006-08-02  3:49 ` Parav Pandit
  0 siblings, 1 reply; 15+ messages in thread
From: Milton Miller @ 2006-07-26 14:06 UTC (permalink / raw)
  To: cthomas, linuxppc-embedded

On Tue Jul 25 2006 05:30:39 PM CDT,  Clint Thomas  wrote:

> Basically, the system I want linux running on does not require the
> initialization of hardware that U-boot provides, or at least it does not
> need it to boot the linux kernel. I want to load an uncompressed linux
> kernel into memory and start the execution of the kernel, without using
> any kind of bootloader. Is this possible? Or does linux need some kind
> of firmware or other software to tell it to start executing? Thanks for
> any info you might have.
 
To run a powerpc (not ppc, which will be removed) kernel, in addition to the uncompressed kernel you will need to supply a device tree structure, point r3 to it, zero r5, and set r4 to the load address (zero as you have described).  See Documentation/powerpc/booting-without-of.txt for details.  Then arrange for you processor to start executing at address 0.  Note that /vmlinux has an elf header, you can use objcopy to remove it or adjust r4 and your start point; the kernel will copy itself to 0, clear bss and set up the stack. The device tree structure must be placed above the bss space in memory, not just the initialized data.  

milton

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Booting Linux Kernel without bootloader
@ 2006-08-03  7:48 Milton Miller
  2006-08-03 14:34 ` Grant Likely
  0 siblings, 1 reply; 15+ messages in thread
From: Milton Miller @ 2006-08-03  7:48 UTC (permalink / raw)
  To: grant.likely, cthomas; +Cc: linuxppc-embedded

On Tue Aug  1 2006 11:17:41 PM CDT,  Grant Likely  wrote:
> On 7/25/06, Clint Thomas <cthomas@soneticom.com> wrote:
> >
> > Basically, the system I want linux running on does not require the
> > initialization of hardware that U-boot provides, or at least it does not
> > need it to boot the linux kernel. I want to load an uncompressed linux
> > kernel into memory and start the execution of the kernel, without using any
> > kind of bootloader. Is this possible? Or does linux need some kind of
> > firmware or other software to tell it to start executing? Thanks for any
> > info you might have.
> 
> Loading a kernel into memory and starting execution *is* a boot loader.  :)

If it's running on the cpu, then I agreee.   But he didn't say how he was loading
the image into memory, and if it is via an external agent then I would not
necessarly call that a boot loader, altough it is performing those tasks. 
Actually, that may be too broad.  Is kexec a boot loader?

> 
> You could use the bootwrapper that is in the kernel source tree
> (zImage).  If a zImage's entry point is at the execution entry point,
> then it will start the Linux kernel correctly.  However, it is still a
> compressed image.
> 

The boot wrapper is a reference implementation, not a required piece of the
boot sequence.  As I stated in my previous post, the kernel entry conditions
are documted and loading the vmlinux raw is reasonable, asssuming that
the other conditions can be met (registers and device  treee, and maybe
initrd).

> If you *really* need an uncompressed image, I would start with the
> bootwrapper and hack it to work with an non-gzipped kernel image.
> However, why do you want to do it this way?  You probably won't gain
> much in boot time and it will be more difficult to maintain.

Actually, the code is aready there to just copy anything inthe kernel
section that is without the gzip header.

milton

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Booting Linux Kernel without bootloader
@ 2006-08-03 18:02 Milton Miller
  0 siblings, 0 replies; 15+ messages in thread
From: Milton Miller @ 2006-08-03 18:02 UTC (permalink / raw)
  To: dhlii, grant.likely, linuxppc-embedded

On Thu Aug  3 2006 11:49:24 AM CDT, David H. Lynch Jr. wrote:
>  Grant Likely wrote:
>  >
>  > I've got a similar situation on my Virtex-4 platform.  The FPGA takes
>  > care of all device initialization.  However, the kernel is loaded of a
>  > CF card via a *slow* JTAG interface.  Loading an uncompressed image is
>  > more time consuming than loading a compressed image and uncompressing
>  > it in software.
>  >
>   
>      I am working with the Pico E-12. It is a CF formfactor device. It
>  has only a pseudo Parallel/Jtag
>      interface exported through the >  CF connector Pico calls the Keyhole
>  Port, and A UartLite, and TEMAC off some mini connector.
>      Pico has their own "monitor" program that fits in 32K of ram inside
>  the FPGA that loads and executes ELF files (or FPGA bit images)
>      from a very simple FileSystem (basically a linked list). Then they
>  have Host software to Read/Write the Flash, update files in Flash, ...
>      that works primarily through the Keyhole.
>  
>      I just build the Kernel as an ELF file, update the ELF File in Flash
>  and tell it to boot that file and away it goes.


The kernel requires some data be passed to it via both memory (the
device tree struct) and registers (pointer to same and a bit), or registers
set and a client interface.  You don't want the later.  See
Documentation/powerpc/booting-without-of.txt. 

If loading from the filesystem is faster than decompressing and copying
the image to place, and the loader supports multiple load segments, 
defined entry points, and loading to address 0, then you could construct 
an elf that is the kernel load segment, the device tree, and an entry point 
that sets the few registers and jumps to the kernel.  Generating such an 
image would still belong to the boot directory.

A zImage based compressed image may still be faster.

milton

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-08-03 18:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-25 22:30 Booting Linux Kernel without bootloader Clint Thomas
2006-07-25 23:38 ` bennett78
2006-07-26  6:15 ` Kalle Pokki
2006-07-26 10:45 ` Andrei Konovalov
2006-07-28  8:03 ` David H. Lynch Jr.
2006-07-28 14:02   ` bennett78
2006-08-02  4:17 ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2006-07-26 14:06 Milton Miller
2006-08-02  3:49 ` Parav Pandit
2006-08-03  7:48 Milton Miller
2006-08-03 14:34 ` Grant Likely
2006-08-03 16:27   ` Milton Miller
2006-08-03 16:34     ` Grant Likely
2006-08-03 16:49   ` David H. Lynch Jr.
2006-08-03 18:02 Milton Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).