I was confused
Hello, > I am sorry for the subject line, but I am so confused right now I couldn't > think of with a better one. Not anymore. Do you know how when you want to ask a perfect question, you find the answer yourself? Below is an excerpt from the make log. First line is obviously an invocation of the compiler to compile just the init.c file from the hello world sample. The last line links the executable. Where does the rest of RTEMS come in? Is it in the "-qrtems" option? I coudln't find anything about "-q" option in the gcc man page. So do you actually patch GCC sources before building your own special RTEMS compiler toolkit? i386-rtems4.11-gcc -B../../../../../pc386/lib/ -specs bsp_specs -qrtems -DHAVE_CONFIG_H -I. -I../../../../../../../rtems/c/src/../../testsuites/samples/hello -I.. -mtune=i386 -O2 -g -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -MT init.o -MD -MP -MF .deps/init.Tpo -c -o init.o ../../../../../../../rtems/c/src/../../testsuites/samples/hello/init.c mv -f .deps/init.Tpo .deps/init.Po i386-rtems4.11-gcc -B../../../../../pc386/lib/ -specs bsp_specs -qrtems -mtune=i386 -O2 -g -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -Wl,-Ttext,0x0010 -mtune=i386 -o hello.exe init.o Just to make sure then: RTEMS and the target application are compiled into one executable that just runs indefinitely. Correct? While I'm at it, I have trouble using Qemu. This might deserve a thread on its own, but have you recently tested it? Running executables in sparc simulator using GDB works fine, running qemu-system-* also seems ok, but running qemu-i386 on x86 binaries or qemu-sparc with sparc executables gives me just "/path/to/exe: Invalid argument" error, nothing else. And lastly, I get 404 when accessing Joel's pronounciation of "RTEMS". 4th question the FAQ: https://devel.rtems.org/wiki/TBR/Website/FAQ. Merry Christmas. Dominik ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: I was confused
On Tue, Dec 23, 2014 at 1:53 PM, Dominik Táborský wrote: > Hello, > >> I am sorry for the subject line, but I am so confused right now I couldn't >> think of with a better one. > Not anymore. Do you know how when you want to ask a perfect question, you > find the answer yourself? > > Below is an excerpt from the make log. First line is obviously an invocation > of the compiler to compile just the init.c file from the hello world sample. > The last line links the executable. Where does the rest of RTEMS come in? Is > it in the "-qrtems" option? I coudln't find anything about "-q" option in the > gcc man page. So do you actually patch GCC sources before building your own > special RTEMS compiler toolkit? > > > i386-rtems4.11-gcc -B../../../../../pc386/lib/ -specs bsp_specs -qrtems > -DHAVE_CONFIG_H -I. > -I../../../../../../../rtems/c/src/../../testsuites/samples/hello -I.. > -mtune=i386 -O2 -g -Wall -Wmissing-prototypes -Wimplicit-function-declaration > -Wstrict-prototypes -Wnested-externs -MT init.o -MD -MP -MF .deps/init.Tpo -c > -o init.o > ../../../../../../../rtems/c/src/../../testsuites/samples/hello/init.c > > mv -f .deps/init.Tpo .deps/init.Po > > i386-rtems4.11-gcc -B../../../../../pc386/lib/ -specs bsp_specs -qrtems > -mtune=i386 -O2 -g -Wall -Wmissing-prototypes -Wimplicit-function-declaration > -Wstrict-prototypes -Wnested-externs -Wl,-Ttext,0x0010 -mtune=i386 > -o hello.exe init.o > > Just to make sure then: RTEMS and the target application are compiled into > one executable that just runs indefinitely. Correct? > Correct > While I'm at it, I have trouble using Qemu. This might deserve a thread on > its own, but have you recently tested it? Running executables in sparc > simulator using GDB works fine, running qemu-system-* also seems ok, but > running qemu-i386 on x86 binaries or qemu-sparc with sparc executables gives > me just "/path/to/exe: Invalid argument" error, nothing else. > I think you need to use a bootloader for i386 e.g. grub on a disk that qemu reads from. Perhaps there is a way around it. There have been some advancements to run Leon3 on qemu which you might find if you dig through the mailing list. > And lastly, I get 404 when accessing Joel's pronounciation of "RTEMS". 4th > question the FAQ: https://devel.rtems.org/wiki/TBR/Website/FAQ. > Many links broke when the wiki migrated to Trac. Thanks for pointing this one out! Gedare > > Merry Christmas. > > Dominik > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] Add GPIO, I2C and SPI support for the RPi BSP
Sebastian, Makes sense. I think I understand the idea a little better now, we are using the linux uapi i2c API, but not the actual i2c bus and device driver implementations from linux, right? For the Pi ( and others like the Beagleboard ) we need to come up with an i2c BSP bus driver ( similar to cadence-i2c.c/h ) then a set of i2c device drivers to go in cpukit/dev/i2c. Do the individual device drivers, such as cpukit/dev/i2c/gpi-nxp-pca9535.c, resemble the equivalent linux driver? Thanks, Alan On Tue, Dec 23, 2014 at 1:01 AM, Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > > On 22/12/14 22:17, Alan Cudmore wrote: > >> >> Why was the Linux API chosen over FreeBSD? Wouldn't we want to keep going >> down the *BSD path to provide drivers and libraries? >> > > We also looked at the FreeBSD, OpenBSD and NetBSD I2C stuff, but the Linux > I2C API appeared to be the best and most widely used. > > > -- > Sebastian Huber, embedded brains GmbH > > Address : Dornierstr. 4, D-82178 Puchheim, Germany > Phone : +49 89 189 47 41-16 > Fax : +49 89 189 47 41-09 > E-Mail : sebastian.hu...@embedded-brains.de > PGP : Public key available on request. > > Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. > > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH] grspw: descriptor tables no longer statically allocated
From: Daniel Ramirez --- c/src/lib/libbsp/sparc/shared/spw/grspw.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw.c b/c/src/lib/libbsp/sparc/shared/spw/grspw.c index b311500..d3eb9b9 100644 --- a/c/src/lib/libbsp/sparc/shared/spw/grspw.c +++ b/c/src/lib/libbsp/sparc/shared/spw/grspw.c @@ -84,6 +84,7 @@ #include #include #include +#include #include #include #include @@ -149,8 +150,6 @@ typedef struct { #define BUFMEM_PER_LINK (SPACEWIRE_TXBUFS_NR*(SPACEWIRE_TXD_SIZE+SPACEWIRE_TXH_SIZE) + SPACEWIRE_RXBUFS_NR*SPACEWIRE_RXPCK_SIZE) -#define SPW_ALIGN(p,c) unsigned int)(p))+((c)-1))&~((c)-1)) - typedef struct { /* configuration parameters */ spw_config config; @@ -190,9 +189,6 @@ typedef struct { #ifdef GRSPW_STATIC_MEM unsigned int membase, memend, mem_bdtable; -#else - char _rxtable[SPACEWIRE_BDTABLE_SIZE*2]; - char _txtable[SPACEWIRE_BDTABLE_SIZE*2]; #endif LEON3_SPACEWIRE_Regs_Map *regs; @@ -1383,8 +1379,8 @@ static int grspw_hw_init(GRSPW_DEV *pDev) { pDev->rx = (SPACEWIRE_RXBD *) pDev->mem_bdtable; pDev->tx = (SPACEWIRE_RXBD *) pDev->mem_bdtable + SPACEWIRE_BDTABLE_SIZE; #else -pDev->rx = (SPACEWIRE_RXBD *) SPW_ALIGN(&pDev->_rxtable, SPACEWIRE_BDTABLE_SIZE); -pDev->tx = (SPACEWIRE_TXBD *) SPW_ALIGN(&pDev->_txtable, SPACEWIRE_BDTABLE_SIZE); +pDev->rx = (SPACEWIRE_RXBD *) rtems_heap_allocate_aligned_with_boundry( SPACEWIRE_BDTABLE_SIZE, 1024, 0 ); +pDev->tx = (SPACEWIRE_TXBD *) rtems_heap_allocate_aligned_with_boundry( SPACEWIRE_BDTABLE_SIZE, 1024, 0 ); #endif SPACEWIRE_DBG("hw_init [minor %i]\n", pDev->minor); @@ -1425,6 +1421,10 @@ static void grspw_hw_reset(GRSPW_DEV *pDev) SPW_STATUS_WRITE(pDev, SPW_STATUS_TO | SPW_STATUS_CE | SPW_STATUS_ER | SPW_STATUS_DE | SPW_STATUS_PE | SPW_STATUS_WE | SPW_STATUS_IA | SPW_STATUS_EE); /*clear status*/ SPW_CTRL_WRITE(pDev, SPW_CTRL_LINKSTART); /*start link core*/ +#ifndef GRSPW_STATIC_MEM +free(pDev->rx); +free(pDec->tx); +#endif } static void grspw_hw_read_config(GRSPW_DEV *pDev) -- 1.8.3.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] grspw: descriptor tables no longer statically allocated
This is a patch proposed for PR 1761 [https://devel.rtems.org/ticket/1761]. Comment if OK or not. On Tue, Dec 23, 2014 at 10:05 PM, Gedare Bloom wrote: > From: Daniel Ramirez > > --- > c/src/lib/libbsp/sparc/shared/spw/grspw.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw.c > b/c/src/lib/libbsp/sparc/shared/spw/grspw.c > index b311500..d3eb9b9 100644 > --- a/c/src/lib/libbsp/sparc/shared/spw/grspw.c > +++ b/c/src/lib/libbsp/sparc/shared/spw/grspw.c > @@ -84,6 +84,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -149,8 +150,6 @@ typedef struct { > > #define BUFMEM_PER_LINK > (SPACEWIRE_TXBUFS_NR*(SPACEWIRE_TXD_SIZE+SPACEWIRE_TXH_SIZE) + > SPACEWIRE_RXBUFS_NR*SPACEWIRE_RXPCK_SIZE) > > -#define SPW_ALIGN(p,c) unsigned int)(p))+((c)-1))&~((c)-1)) > - > typedef struct { > /* configuration parameters */ > spw_config config; > @@ -190,9 +189,6 @@ typedef struct { > > #ifdef GRSPW_STATIC_MEM > unsigned int membase, memend, mem_bdtable; > -#else > - char _rxtable[SPACEWIRE_BDTABLE_SIZE*2]; > - char _txtable[SPACEWIRE_BDTABLE_SIZE*2]; > #endif > > LEON3_SPACEWIRE_Regs_Map *regs; > @@ -1383,8 +1379,8 @@ static int grspw_hw_init(GRSPW_DEV *pDev) { > pDev->rx = (SPACEWIRE_RXBD *) pDev->mem_bdtable; > pDev->tx = (SPACEWIRE_RXBD *) pDev->mem_bdtable + > SPACEWIRE_BDTABLE_SIZE; > #else > -pDev->rx = (SPACEWIRE_RXBD *) SPW_ALIGN(&pDev->_rxtable, > SPACEWIRE_BDTABLE_SIZE); > -pDev->tx = (SPACEWIRE_TXBD *) SPW_ALIGN(&pDev->_txtable, > SPACEWIRE_BDTABLE_SIZE); > +pDev->rx = (SPACEWIRE_RXBD *) > rtems_heap_allocate_aligned_with_boundry( SPACEWIRE_BDTABLE_SIZE, 1024, 0 ); > +pDev->tx = (SPACEWIRE_TXBD *) > rtems_heap_allocate_aligned_with_boundry( SPACEWIRE_BDTABLE_SIZE, 1024, 0 ); > #endif > SPACEWIRE_DBG("hw_init [minor %i]\n", pDev->minor); > > @@ -1425,6 +1421,10 @@ static void grspw_hw_reset(GRSPW_DEV *pDev) > SPW_STATUS_WRITE(pDev, SPW_STATUS_TO | SPW_STATUS_CE | SPW_STATUS_ER > | SPW_STATUS_DE | SPW_STATUS_PE | > SPW_STATUS_WE | SPW_STATUS_IA | SPW_STATUS_EE); > /*clear status*/ > SPW_CTRL_WRITE(pDev, SPW_CTRL_LINKSTART); /*start link core*/ > +#ifndef GRSPW_STATIC_MEM > +free(pDev->rx); > +free(pDec->tx); > +#endif > } > > static void grspw_hw_read_config(GRSPW_DEV *pDev) > -- > 1.8.3.1 > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel