Subject: loading kernel via EJTAG interface

From: Prashant Viswanathan <[email-masked]>
Date: Wed, 4 Feb 2004 15:38:30 -0800

Hi, 

I am trying to load a linux kernel through a EJTAG device. I was told that I
should modify the kernel so that it doesnt attempt to use the parameters
passed to it by the loader. However, I am not quite sure as to what it means
and what exactly one has to do. I would really appreciate any
pointers/help/suggestions.

Thanks!
Prashant

---

From: Shaun Savage <[email-masked]>
Date: Wed, 04 Feb 2004 16:15:37 -0800

> pointers/help/suggestions.
Ouch!  The best way would be to load a bootloader that knows about bootp 
and TFTP. Then do a network boot.

If you dont't have a ethernet connection on the board then in 
/arch/mips/kernel/head.S is where the loader  info is read into the kernel.

But I am sure there is a better way.

shaun

---

From: Nathan Field <[email-masked]>
Date: Wed, 4 Feb 2004 16:36:24 -0800 (PST)

> > I am trying to load a linux kernel through a EJTAG device. I was told
> > that I should modify the kernel so that it doesnt attempt to use the
> > parameters passed to it by the loader. However, I am not quite sure as
> > to what it means and what exactly one has to do. I would really
> > appreciate any pointers/help/suggestions.
	One approach is to create some sort of setup script that 
"emulates" the boot loader. I've done that for a Malta board (which uses a 
boot loader called YAMON). Basically it does something like this:

	reset and run the board
	sleep for 7 seconds to let YAMON do its normal setup
	halt the board
	do all the setup that YAMON would do when it runs a program

That last step is where the magic happens. Basically I do things like
setup various registers to point to memory regions, and then in those
regions create arrays of pointers, which point to strings containing
things like the "environment" that YAMON fills in for programs and
arguments that it passes. Depending on the capabilities of your debugging
environment this can either be easy or hard. My setup is really nice,
downloads for small kernels take about the same time as going through
tftp, but bigger kernels with a ramdisk are actually faster to push
through EJTAG, which is nice :)

	nathan

-- 
Nathan Field ([email-masked])			          All gone.

But the trouble with analogies is that analogies are like goldfish:
sometimes they have nothing to do with the topic at hand.
        -- Crispin (from a posting to the Bugtraq mailing list)