public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* Default for BOOTP in redboot [Sec=Unclassified]
@ 2007-01-05  0:06 Peter Jansen
  2007-01-05  1:26 ` Carl Zhou
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Jansen @ 2007-01-05  0:06 UTC (permalink / raw)
  To: ecos-devel

Hi,

I have some confusion on how to configure redboot not to try and find a 
BOOTP server by default. I'm using redboot to boot a Technologic Systems 
TS7260 with a ARM processor.

The logic in

packages/redboot/current/src/net/net_io.c

Does not seem quite correct.

The start of this file line 95 has

#ifndef CYGSEM_REDBOOT_DEFAULT_NO_BOOTP
#define CYGSEM_REDBOOT_DEFAULT_NO_BOOTP 0
#endif

So the macro CYGSEM_REDBOOT_DEFAULT_NO_BOOTP will always be defined.

then on line 684 we have

#ifdef CYGSEM_REDBOOT_DEFAULT_NO_BOOTP
     use_bootp = false;
#else
     use_bootp = true;
#endif

So however the macro CYGSEM_REDBOOT_DEFAULT_NO_BOOTP is set the variable 
use_bootp will always be false.

then we have on line 703

     if (!use_bootp) {
         flash_get_IP("bootp_my_ip", &__local_ip_addr);

So if use_bootp is false we set the IP address for the bootp_my_ip address.

Then we have line 758

     // Initialize the network [if present]
     if (use_bootp) {
         if (__bootp_find_local_ip(&my_bootp_info) == 0) {
             have_net = true;

Which seems ok, should the line 684 be #if not #ifdef ?

Thanks,


-- 
Peter Jansen
Antarctic Division


___________________________________________________________________________

    Australian Government Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.aad.gov.au/
___________________________________________________________________________

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

* RE: Default for BOOTP in redboot [Sec=Unclassified]
  2007-01-05  0:06 Default for BOOTP in redboot [Sec=Unclassified] Peter Jansen
@ 2007-01-05  1:26 ` Carl Zhou
  2007-01-05  3:41   ` Peter Jansen
  0 siblings, 1 reply; 3+ messages in thread
From: Carl Zhou @ 2007-01-05  1:26 UTC (permalink / raw)
  To: 'Peter Jansen', ecos-devel

Peter:

The logic seems clear to me. Please correct me if I am wrong.

Suppose that you want to boot from flash, what you do is to define the top
level macro CYGSEM_REDBOOT_DEFAULT_NO_BOOTP (This is done manually? I think
that there should be a configuration mechanism). Then:

1. Line 95: The macro won't be redefined to be 0;
2. Line 684: "use_bootp" will be assigned value "false";
3. Line 703: condition evaluated to be true, so the block (boot from flash
procedure)is entered, and IP address is got from flash;
4. Line 758: condition evaluated to be false, so the block (bootp procedure)
is not entered.


Carl

-----Original Message-----
From: Peter Jansen [mailto:peter.jansen@aad.gov.au] 
Sent: Thursday, January 04, 2007 4:06 PM
To: ecos-devel@ecos.sourceware.org
Subject: Default for BOOTP in redboot [Sec=Unclassified]

Hi,

I have some confusion on how to configure redboot not to try and find a 
BOOTP server by default. I'm using redboot to boot a Technologic Systems 
TS7260 with a ARM processor.

The logic in

packages/redboot/current/src/net/net_io.c

Does not seem quite correct.

The start of this file line 95 has

#ifndef CYGSEM_REDBOOT_DEFAULT_NO_BOOTP
#define CYGSEM_REDBOOT_DEFAULT_NO_BOOTP 0
#endif

So the macro CYGSEM_REDBOOT_DEFAULT_NO_BOOTP will always be defined.

then on line 684 we have

#ifdef CYGSEM_REDBOOT_DEFAULT_NO_BOOTP
     use_bootp = false;
#else
     use_bootp = true;
#endif

So however the macro CYGSEM_REDBOOT_DEFAULT_NO_BOOTP is set the variable 
use_bootp will always be false.

then we have on line 703

     if (!use_bootp) {
         flash_get_IP("bootp_my_ip", &__local_ip_addr);

So if use_bootp is false we set the IP address for the bootp_my_ip address.

Then we have line 758

     // Initialize the network [if present]
     if (use_bootp) {
         if (__bootp_find_local_ip(&my_bootp_info) == 0) {
             have_net = true;

Which seems ok, should the line 684 be #if not #ifdef ?

Thanks,


-- 
Peter Jansen
Antarctic Division


___________________________________________________________________________

    Australian Government Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are
not the
intended recipient, you are notified that use or dissemination of this
communication is
strictly prohibited by Commonwealth law. If you have received this
transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232
3209 and
DELETE the message.
        Visit our web site at http://www.aad.gov.au/
___________________________________________________________________________

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

* Re: Default for BOOTP in redboot [Sec=Unclassified]
  2007-01-05  1:26 ` Carl Zhou
@ 2007-01-05  3:41   ` Peter Jansen
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Jansen @ 2007-01-05  3:41 UTC (permalink / raw)
  To: carlz; +Cc: ecos-devel

Hi Carl,

Thanks for the quick reply, I have done more more digging.

> The logic seems clear to me. Please correct me if I am wrong.
> 
> Suppose that you want to boot from flash, what you do is to define the top
> level macro CYGSEM_REDBOOT_DEFAULT_NO_BOOTP (This is done manually? I think
> that there should be a configuration mechanism). Then:

I think this comes from the redboot.cdl file or the user ones in the 
particular port, in my case redboot_ROMRAM_ts7250.ecm

I found that I need to set

cdl_component CYGDAT_REDBOOT_DEFAULT_IP_ADDR {user_value 1 192,168,1,254};

then the macro DEFAULT_NO_BOOTP get set from the configuration.

> 1. Line 95: The macro won't be redefined to be 0;
> 2. Line 684: "use_bootp" will be assigned value "false";

Does this not mean that by line 684 the macro is always defined (either 
in the configuration or line 96), so use_bootp is always set false by 
line 685. I guess this means that its always set to false if there is no 
flash configuration, although the #ifdef is a but redundant.

Should line 684 be a #if (not #ifdef)?

Ok, I was wondering how use_bootp was getting set in my port, and I 
found that line 702 reads the use_bootp variable from flash, this was 
setting the use_bootp variable for the test in line 703. The default 
flash value is set in line 102.

> 3. Line 703: condition evaluated to be true, so the block (boot from flash
> procedure)is entered, and IP address is got from flash;
> 4. Line 758: condition evaluated to be false, so the block (bootp procedure)
> is not entered.

So yes I guess the logic does work out, I was missing setting the IP_ADDR.

Regards,

-- 
Peter Jansen
Australian Government Antarctic Division


___________________________________________________________________________

    Australian Government Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.aad.gov.au/
___________________________________________________________________________

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

end of thread, other threads:[~2007-01-05  3:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-05  0:06 Default for BOOTP in redboot [Sec=Unclassified] Peter Jansen
2007-01-05  1:26 ` Carl Zhou
2007-01-05  3:41   ` Peter Jansen

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 read-only IMAP folder(s) and NNTP newsgroup(s).