Linux MIPS Architecture development
 help / color / mirror / Atom feed
* loading kernel via EJTAG interface
@ 2004-02-04 23:38 Prashant Viswanathan
  2004-02-05  0:15 ` Shaun Savage
  0 siblings, 1 reply; 5+ messages in thread
From: Prashant Viswanathan @ 2004-02-04 23:38 UTC (permalink / raw)
  To: Prashant Viswanathan; +Cc: 'linux-mips@linux-mips.org'

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

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

* Re: loading kernel via EJTAG interface
  2004-02-04 23:38 loading kernel via EJTAG interface Prashant Viswanathan
@ 2004-02-05  0:15 ` Shaun Savage
  2004-02-05  0:36   ` Nathan Field
  0 siblings, 1 reply; 5+ messages in thread
From: Shaun Savage @ 2004-02-05  0:15 UTC (permalink / raw)
  To: Prashant Viswanathan; +Cc: 'linux-mips@linux-mips.org'

Prashant Viswanathan wrote:
> 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
> 
> 
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

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

* Re: loading kernel via EJTAG interface
  2004-02-05  0:15 ` Shaun Savage
@ 2004-02-05  0:36   ` Nathan Field
  0 siblings, 0 replies; 5+ messages in thread
From: Nathan Field @ 2004-02-05  0:36 UTC (permalink / raw)
  To: Shaun Savage; +Cc: Prashant Viswanathan, 'linux-mips@linux-mips.org'

> > 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

> > 
> > Thanks!
> > Prashant
> > 
> > 
> 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
> 
> 
> 
> 

-- 
Nathan Field (ndf@ghs.com)			          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)

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

* RE: loading kernel via EJTAG interface
@ 2004-02-05  0:44 Prashant Viswanathan
  0 siblings, 0 replies; 5+ messages in thread
From: Prashant Viswanathan @ 2004-02-05  0:44 UTC (permalink / raw)
  To: 'Nathan Field', Shaun Savage; +Cc: 'linux-mips@linux-mips.org'


> -----Original Message-----
> From: Nathan Field [mailto:ndf@ghs.com]
> Sent: Wednesday, February 04, 2004 4:36 PM
> To: Shaun Savage
> Cc: Prashant Viswanathan; 'linux-mips@linux-mips.org'
> Subject: Re: loading kernel via EJTAG interface
> 
> 
> > > 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

Thanks for the input.

I have a bootrom (different operating system) on my device and if I just
boot up from the bootrom it would set up all the registers, controllers for
me. Also, visionProbe (which I am using to download over the EJTAG
interface) sets up all the controllers for me. 

So, can't I just load the kernel image and just start executing from
"kernel_entry"?

Prashant

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

* RE: loading kernel via EJTAG interface
@ 2004-02-05  7:58 Andre.Messerschmidt
  0 siblings, 0 replies; 5+ messages in thread
From: Andre.Messerschmidt @ 2004-02-05  7:58 UTC (permalink / raw)
  To: vprashant; +Cc: linux-mips

Hi,

>So, can't I just load the kernel image and just start executing from
>"kernel_entry"?

For testing purposes it might be feasible to hard code a command line and
environment into the kernel. I did this during test with a Lauterbach
debugger.
Of course you still have to setup SDRAM, clocks etc. before executing the
kernel.

regards
Andre

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

end of thread, other threads:[~2004-02-05  7:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-04 23:38 loading kernel via EJTAG interface Prashant Viswanathan
2004-02-05  0:15 ` Shaun Savage
2004-02-05  0:36   ` Nathan Field
  -- strict thread matches above, loose matches on Subject: below --
2004-02-05  0:44 Prashant Viswanathan
2004-02-05  7:58 Andre.Messerschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox