From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20598 invoked by alias); 24 Jun 2002 15:30:33 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 20583 invoked from network); 24 Jun 2002 15:30:29 -0000 Received: from unknown (HELO MAILHOST.stratalight.com) (206.184.26.51) by sources.redhat.com with SMTP; 24 Jun 2002 15:30:29 -0000 X-Mimeole: Produced By Microsoft Exchange V6.0.4712.0 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Jun 2002 12:23:00 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "George Sosnowski" To: "eCos Discussion" Subject: RE: [ECOS] gdb over ethernet network support for ECOS RAMapplication X-SW-Source: 2002-06/txt/msg00434.txt.bz2 One thought I had about this was possibly the use of some select() api which would block (actually sleep the thread) until a read on Stdin was=20 possible. Is something like this supported in Ecos?=20 It seems like otherwise a getc from a thread will not let other lower priority=20 threads have time since the getc is an active poll and not put the thread to sleep until some data is available. Is this a correct assessment? >Given the scenario, where RedBoot and the application start up on their >own and at a later time a serial gdb session is initiated where the gdb >stubs of the ROM monitor are used. I wanted to implement a sort of shell=20 >in the application on the one serial port on the platform (SMC1 for the >860T). Currently my shell uses fgetc which down to the calling chain finally=20 >calls cyg_hal_plf_serial_getc in ROM which does a hard poll. It was called=20 >indirectly by hal_if_diag_read_char in RAM via macro CYGACC_COMM_IF_GETC that=20 >executed ENTER_MONITOR which disabled interrupts and locked the scheduler.=20 >Thus when a Ctrl-C or any other character is typed to the serial port the=20 >thing doing the fgetc gets the character, but this character didn't go through=20 >hal_ctrlc_isr in RAM and cyg_hal_plf_serial_isr in ROM which check for Ctrl-C=20 >to initiate gdb. In fact, hal_ctrlc_isr in RAM and cyg_hal_plf_serial_isr in=20 >ROM still execute after interrupts get reenabled when EXIT_MONITOR is executed=20 >because the Rx Char interrupt was not cleared is still pending, but there's no=20 >more data in the receive buffers. >So my question is under this configuration, what's the best serial character=20 >read interface to use for the shell so all Rxed characters are gotten through=20 >interrupt (cyg_hal_plf_serial_isr) and a Ctrl-C is intercepted and gdb initiated? >Thanks for your suggestions! -----Original Message----- From: Gary Thomas [mailto:gary@chez-thomas.org]=20 Sent: Wednesday, June 19, 2002 11:48 AM To: George Sosnowski Cc: eCos Discussion Subject: RE: [ECOS] gdb over ethernet network support for ECOS RAMapplication On Wed, 2002-06-19 at 12:34, George Sosnowski wrote: > >As I said earlier, yes it is possible to establish a GDB session > >using > >the serial port even when the program was not started via GDB. You=20 > >could let RedBoot start up your application and then at any later time, >=20 > >break into the program and start using GDB. It's even possible to > later > >disconnect GDB and allow the program to carry on its merry way. >=20 > I'm sorry to be such a pain on this topic. ;-) I'm not very familiar > with the workings of gdb, but I think I'm understanding, thanks to=20 > your responses! One last (hopefully) question I had regarding the=20 > scenario you describe above, where RedBoot and the application start=20 > up on their own and at a later time a serial gdb session is initiated. > What would be the proper configuration for the application in this > situation? Would it still use the gdb stubs of the ROM monitor or=20 > should it have its own gdb stubs that would take over? >=20 Either way works. If you use things as they are normally setup, then you don't need to include the GDB stubs code in your application, that's only required if your application make it so that RedBoot can no longer execute (e.g. erase all of it's memory). > -----Original Message----- > From: Gary Thomas [mailto:gary@chez-thomas.org] > Sent: Wednesday, June 19, 2002 9:24 AM > To: George Sosnowski > Cc: eCos Discussion > Subject: RE: [ECOS] gdb over ethernet network support for ECOS > RAMapplication >=20 >=20 > On Wed, 2002-06-19 at 10:14, George Sosnowski wrote: > > >It is only possible to initiate a network GDB connection before the > > >program starts. However, you can load and execute a program via a=20 > > >serial connection and later start up a serial GDB session, but not a=20 > > >network one. > >=20 > > why is there this difference between a serial and network gdb=20 > > session? >=20 > > One of the things I wanted to do is keep gdb support always=20 > > available > > (preferrably via network). Normally, redboot would come up and start > > the application by default through its script. So while the=20 > > application is running, if I wanted to examine it for some reason,=20 > > then I could connect and do so. But it sounds like this is not=20 > > possible for network gdb sessions? How about for serial sessions, is > > it possible to connect after an application is running? Or must an=20 > > application be started by gdb in order for it to be debugged by it?=20 > > One thought I had was merging the Redboot functionality into the=20 > > application, does this not make sense? > >=20 >=20 > As I said earlier, yes it is possible to establish a GDB session using > the serial port even when the program was not started via GDB. You=20 > could let RedBoot start up your application and then at any later=20 > time, break into the program and start using GDB. It's even possible=20 > to later disconnect GDB and allow the program to carry on its merry=20 > way. >=20 > The only reason it works for serial connections is that it's possible=20 > (i.e. relatively easy) to detect the presence of a ^C (the interrupt > sequence) on a serial line, even while the system is running, perhaps=20 > using that same serial device. On the other hand, to detect a TCP=20 > open operation on the network would require that incoming network data > be processed, then some how magically decide that this is an open=20 > destined for the GDB code, etc. It would also mean that you'd need=20 > the whole RedBoot/GDB network stack available. It all seems not only=20 > expensive, messy and fragile, but really hard to make work. >=20 > > >There's nothing to keep you from doing this, but alas, at this time > > >there's not much to help you either. The FIS directory is laid out > so > > >that finding things should be straight forward, but there aren't=20 > > >any support routines (or a supported API) for doing so. Of course, > > >if > you > > >wanted to contribute such support, we'd be more than happy :-) > >=20 > > I actually did a quick and dirty in this case and stole the lookup > > function and entry structure to just retrieve the location and size of >=20 > > the file. I noticed there was packages/fs/rom. Is this a different > > fuller rom file system than FIS or a framework of some sort? > >=20 >=20 > It's completely different and not related. >=20 > >=20 > > -----Original Message----- > > From: Gary Thomas [mailto:gary@chez-thomas.org] > > Sent: Tuesday, June 18, 2002 5:06 PM > > To: George Sosnowski > > Cc: eCos Discussion > > Subject: RE: [ECOS] gdb over ethernet network support for ECOS=20 > > RAMapplication > >=20 > >=20 > > On Tue, 2002-06-18 at 16:13, George Sosnowski wrote: > > > Thanks for the replies they've been very inciteful. > > > I am running ecos that I download via anonymous CVS back in > > > December. I've been afraid to get the 2.0 alpha code because I=20 > > > wasn't sure how much reconfiguration and lost changes there might be >=20 > > > on my part. > > >=20 > >=20 > > There would be few, if any, such impacts. The version number belies > > the code changes (they are major, but still incremental). The main=20 > > reason for a major version number jump was the change in licensing. > >=20 > > > Does a gdb session have to be already established via network or > > serial > > > before the RAM application runs? Or can one connect via gdb even > > > after the application image is loaded and running? Showing my=20 > > > ignorance of gdb, if connected after the application image is=20 > > > running, can it still be debugged or does it have to be rerun? > > >=20 > >=20 > > It is only possible to initiate a network GDB connection before the > > program starts. However, you can load and execute a program via a=20 > > serial connection and later start up a serial GDB session, but not a > > network one. > >=20 > > > On a somewhat related issue, can RAM applications somehow access=20 > > > the >=20 > > > FIS? I have some fpga images that I want to store there and wasn't > > sure > > > if there was an interface that provided the RedBoot functionality=20 > > > of >=20 > > > lookup, create, load, etc. > > >=20 > >=20 > > There's nothing to keep you from doing this, but alas, at this time=20 > > there's not much to help you either. The FIS directory is laid out=20 > > so that finding things should be straight forward, but there aren't=20 > > any support routines (or a supported API) for doing so. Of course,=20 > > if you wanted to contribute such support, we'd be more than happy=20 > > :-) > >=20 > > > Thanks again! > > >=20 > > > -----Original Message----- > > > From: Gary Thomas [mailto:gary@chez-thomas.org] > > > Sent: Tuesday, June 18, 2002 11:30 AM > > > To: George Sosnowski > > > Cc: eCos Discussion > > > Subject: RE: [ECOS] gdb over ethernet network support for ECOS=20 > > > RAMapplication > > >=20 > > >=20 > > > On Tue, 2002-06-18 at 11:52, George Sosnowski wrote: > > > > I was using a target based on powerpc mbx and viper boards which > > > > has > >=20 > > > > an 860T. > > > >=20 > > > > The thing I'm not clear about is that my ECOS 1.3.1 application=20 > > > > is using the NET package which is a fuller version IP stack than > > > > what >=20 > > > > Redboot has. Do these stacks run concurrently somehow? Or are=20 > > > > the > > > > ethernet (fec) driver and IP stack in the ecos application > > inheriting > > > > the Redboot driver and stack? > > > >=20 > > >=20 > > > Actually neither. > > >=20 > > > The network stacks are split into a logical and physical driver. > > Which > > > logical driver is in use depends on the mode; there is a separate > > driver > > > for RedBoot than from an eCos application. However, the physical > > driver > > > is the same for both environments (or at least equivalent). What > > > happens is the physical driver in RedBoot is used until the eCos=20 > > > application takes over. Once that happens, only the physical driver > > in > > > the eCos application is used, but it gets shared by both the eCos > > stack > > > (xxxBSD based) and the RedBoot stack. When there is network > > > activity (incoming packets primarily), both logical stacks get a=20 > > > chance to process the data/packet. In this way, both the eCos stack >=20 > > > and the RedBoot stack can run, more or less in tandem. > > >=20 > > > It's all rather complicated, but it does work, because of how the > > > drivers are structured. > > >=20 > > > BTW - I assume you mean by 1.3.1 that you are using anonymous CVS, > > > possibly before the 2.0 alpha was announced. I would suggest that > > > you update to the latest code base since there have been significant > > changes > > > since 1.3.1 was officially relased *in March of 2000*! > > >=20 > > > > -----Original Message----- > > > > From: Gary Thomas [mailto:gary@chez-thomas.org] > > > > Sent: Tuesday, June 18, 2002 10:40 AM > > > > To: George Sosnowski > > > > Cc: eCos Discussion > > > > Subject: Re: [ECOS] gdb over ethernet network support for ECOS > > > > RAMapplication > > > >=20 > > > >=20 > > > > On Tue, 2002-06-18 at 11:20, George Sosnowski wrote: > > > > > I'm running RedBoot on my target (powerpc 860T based) from > > > > > flash, which has both serial and network (TCP 9000) support for=20 > > > > > GDB. When > >=20 > > > > > RedBoot loads an ECOS > > > > > (v1.3) RAM > > > > > application, what's the best way to configure the ecos ram > > > application > > > >=20 > > > > > to have support/ maintain support for GDB over the > > network/ethernet > > > > > (fec) , as well as serial? > > > > >=20=20 > > > > > >From what I understand it looks like RAM applications are=20 > > > > > >only > > > > > >supposed > > > > > to inherit > > > > > serial gdb functionality? Although the Redboot documentation > > > > > says > > > > "ecos > > > > > contains > > > > > special network sharing code to allow for this situation". I > > didn't > > > > > notice anything at the ethernet (fec) or IP stack level. Have=20 > > > > > I overlooked this? > > > > >=20=20 > > > > > One thought I had on doing this was to merge in the Redboot=20 > > > > > RAM > > > > > functionality into my application. This wouldn't maintain a gdb >=20 > > > > > session over the > > > network > > > > > from the ROM > > > > > Redboot, but would give gdb support over the network in RAM > > > > application > > > > > at least. > > > >=20 > > > > If you're running RedBoot from ROM, any network GDB connection > > > > will > > > > remain, even after the eCos application starts up. One caveat is > > that > > >=20 > > > > RedBoot and your eCos application have to use unique IP=20 > > > > addresses. This is normally done by giving RedBoot a static=20 > > > > address and then letting the eCos application either use a=20 > > > > different static address > > or > > > > get an address dynamically via DHCP. > > > >=20 > > > > Also note that once you start debugging via the network, the > > > > serial > > is > > >=20 > > > > no longer part of the GDB "path". Your application can do=20 > > > > things > > with > > >=20 > > > > it directly, e.g. by accessing it via the serial device drivers, > > > > but > >=20 > > > > only the network will be used for GDB control and/or output. > > > >=20 > > > > What platform are you using (just for my information)? > > > >=20 > > > >=20 > > > > -- > > > > Before posting, please read the FAQ: > > > http://sources.redhat.com/fom/ecos > > > > and search the list archive: > > http://sources.redhat.com/ml/ecos-discuss > > >=20 > > >=20 > > >=20 > > > -- > > > Before posting, please read the FAQ: > > http://sources.redhat.com/fom/ecos > > > and search the list archive: > > > http://sources.redhat.com/ml/ecos-discuss > >=20 >=20 >=20 >=20 > -- > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos > and search the list archive: http://sources.redhat.com/ml/ecos-discuss --=20 Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss