This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Still on ethernet configuration


Hi again,

I debugged through the ioctl function and found out that the code
is crashing when function i82559_configure returns (at the return 0
statement, which means it executed successfully) from the call
executed at the function i82559_start. Any clue why this happens?

Another thing which a noticed and let me curious is that when I issue
the command "info threads" on gdb during the debugging I get the
following answer:

(gdb) info threads
5 thread 4 0xc0052070 in hal_thread_switch_context () at heaps.cxx:19
4 thread 3 0xc0052070 in hal_thread_switch_context () at heaps.cxx:19
3 thread 2 0xc0052070 in hal_thread_switch_context () at heaps.cxx:19
2 thread 1 idle_thread_main (data=1243983)
at /opt/ecoscvs/packages/kernel/current/src/common/thread.cxx:1226
* 1 thread 5 i82559_start (sc=0xc00693fc,
enaddr=0x100000 '˙' <repeats 200 times>..., flags=16385)
at /opt/ecoscvs/packages/devs/eth/intel/i82559/current/src/if_i82559.c:1625

As far as I understood there are 5 threads running in my system. One
is the network thread, the other is the net_init thread which I
created (see the code below) and the third should be the idle thread,
right? Why are there 5 threads then?

Here is my whole code (it's quite small but has been giving me big
headache):

#include <stdio.h>
#include <cyg/kernel/kapi.h>
#include <pkgconf/net.h>
#include <network.h>

#define STACK_SIZE 4096


cyg_thread thread_s; /* space for two thread objects */
char stack[STACK_SIZE];

/* now the handler for the threads */
cyg_handle_t thread_handle;

/* and now variables for the procedure which is the thread */

void
net_test(cyg_addrword_t p);

static struct bootp bootp_info;

void cyg_start(void)
{
diag_printf("creating thread\n");
cyg_thread_create(10,
net_test, // entry
0, // entry parameter
"Network test", // Name
&stack, // Stack
STACK_SIZE, // Size
&thread_handle, // Handle
&thread_s // Thread data structure
);
cyg_thread_resume(thread_handle); // Start it
cyg_scheduler_start();
}

void
net_test(cyg_addrword_t p)
{
diag_printf("net_test created\n");

cyg_thread_delay(5);

build_bootp_record(&bootp_info,
"128.195.11.220",
"255.255.255.0",
"128.195.11.255",
"128.195.11.1",
"");

diag_printf("called init_net\n");
init_net("eth0", &bootp_info);
diag_printf("returned from init_net\n");
}

Thanks in advance,
Cristiano.

From: Gary Thomas <gthomas@ecoscentric.com>
To: Cristiano Pereira <ligieri2002@hotmail.com>
CC: Andrew Lunn <andrew.lunn@ascom.ch>,eCos Discussion <ecos-discuss@sources.redhat.com>
Subject: Re: [ECOS] Still on ethernet configuration
Date: 15 Oct 2002 14:38:21 -0600
MIME-Version: 1.0
Received: from sources.redhat.com ([209.249.29.67]) by mc3-f37.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Tue, 15 Oct 2002 13:38:33 -0700
Received: (qmail 5559 invoked by alias); 15 Oct 2002 20:38:23 -0000
Received: (qmail 5550 invoked from network); 15 Oct 2002 20:38:22 -0000
Received: from unknown (HELO hermes.chez-thomas.org) (63.225.98.241) by sources.redhat.com with SMTP; 15 Oct 2002 20:38:22 -0000
Received: from localhost.localdomain (localhost [127.0.0.1])by hermes.chez-thomas.org (Postfix) with ESMTPid E57CD2360F; Tue, 15 Oct 2002 14:38:21 -0600 (MDT)
Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:ecos-discuss-unsubscribe-ligieri2002=hotmail.com@sources.redhat.com>
List-Subscribe: <mailto:ecos-discuss-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/ecos-discuss/>
List-Post: <mailto:ecos-discuss@sources.redhat.com>
List-Help: <mailto:ecos-discuss-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: ecos-discuss-owner@sources.redhat.com
Delivered-To: mailing list ecos-discuss@sources.redhat.com
In-Reply-To: <F2869aZbLAX3cf3ednH0000011a@hotmail.com>
References: <F2869aZbLAX3cf3ednH0000011a@hotmail.com>
Message-Id: <1034714302.21272.188.camel@hermes.chez-thomas.org>
Return-Path: ecos-discuss-return-17512-ligieri2002=hotmail.com@sources.redhat.com
X-OriginalArrivalTime: 15 Oct 2002 20:38:35.0910 (UTC) FILETIME=[D5AEB260:01C2748A]

On Tue, 2002-10-15 at 14:33, Cristiano Pereira wrote:
> I'm loading it through Redboot and debugging through the serial port
> using gdb. But I'm basically debugging through diag_printf messages and not
> step by step.
>
> Cristiano.
>
> > > You were right. That was such a silly mistake. Thanks. But now I have
> > > another proble (this is endless :( ...). init_net never >Good. I mostly wanted to know if you were trying to debug
this over the network.

You should be able to step through the ioctl() call and
see where it hangs up. This particular call doesn't do
anything spectacular - it just sets some database fields.

--
------------------------------------------------------------
Gary Thomas |
eCosCentric, Ltd. |
+1 (970) 229-1963 | eCos & RedBoot experts
gthomas@ecoscentric.com |
http://www.ecoscentric.com/ |
------------------------------------------------------------


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

_________________________________________________________________
Get faster connections -- switch to MSN Internet Access! http://resourcecenter.msn.com/access/plans/default.asp


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]