smc driver

Philippe Simons loki_666 at fastmail.fm
Mon Jul 4 19:36:28 UTC 2005


ok i found the error

rtems/ide_part_table.h miss those defines
this at the beginning
#ifdef __cplusplus
extern "C" {
#endif

and this at the end
#ifdef __cplusplus
}
#endif

someone should merge this

Philippe

On Mon, 04 Jul 2005 20:30:30 +0200, "Philippe Simons"
<loki_666 at fastmail.fm> said:
> this is my main.cpp
> 
> #define CONFIGURE_INIT
> #include "system.h"
> 
> #include <rtems/dosfs.h>
> #include <rtems/ide_part_table.h>
> #include <rtems/fsmount.h>
> 
> #include "engine.h"
> #include "systemstub.h"
> 
> fstab_t fs_table[] = {
>   {
>     "/dev/smc1","/mnt/smc1",
>     &msdos_ops, RTEMS_FILESYSTEM_READ_ONLY,
>     FSMOUNT_MNT_OK | FSMOUNT_MNTPNT_CRTERR | FSMOUNT_MNT_FAILED,
>     0
>   }
> };
> 
> rtems_task main_task(
>   rtems_task_argument 
> )
> {
> 	const char *dataPath = "/mnt/smc1/GAME/AW";
> 	const char *savePath = "/mnt/smc1/GAME/AW";
> 	rtems_status_code rc;
> 	
> 	rc = rtems_ide_part_table_initialize("/dev/smc");
> 	printf("rtems_ide_part_table_initialize() result = %d\n",rc);
> 	rc = (rtems_status_code) rtems_fsmount( fs_table,
> 		      sizeof(fs_table)/sizeof(fs_table[0]),
> 		      NULL);
> 	printf("rtems_fsmount() result = %d\n",rc);
> 
> 	SystemStub *stub = SystemStub_GP32_create();
> 	Engine *e = new Engine(stub, dataPath, savePath);
> 	e->run();
> 	delete e;
> 	delete stub;
> 	exit(0);
> }
> 
> in rtems/ide_part_table.h ...
> 
> rtems_status_code
> rtems_ide_part_table_initialize(char *dev_name);
> 
> looks good to me...
> 
> 
> On Mon, 04 Jul 2005 20:05:54 +0200, "Thomas Doerfler"
> <Thomas.Doerfler at imd-systems.de> said:
> > Hi Philippe,
> > 
> > since the linker complaints about the function name INCLUDING the
> > parameters, possibly you (or the linked code) are using the function
> > undeclared and/or with the wrong calling/return parameters?
> > 
> > wkr,
> > thomas.
> > 
> > Philippe Simons schrieb:
> > > Hi,
> > > 
> > > i've been playing with a smc driver for the gp32 bsp, but I ran into a
> > > strage issue...
> > > I was able to sucessfully mount the smc with the fileio sample, read
> > > some files and browse with the shell.
> > > now I'm trying to build an app which mount the smc, like fileio does,
> > > but link fails with
> > > undefined reference to `rtems_ide_part_table_initialize(char*)'
> > > 
> > > I've checked librtemscpu.a and there is an ide_part_table.o with the fct
> > > rtems_ide_part_table_initialize...
> > > btw, the same app was able to link with Untar_FromMemory() fct which is
> > > in librtemscpu.a too...
> > > 
> > > here is my system.h
> > > /* configuration information */
> > > 
> > > #include <bsp.h> /* for device driver prototypes */
> > > #include <smc.h>
> > > 
> > > #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> > > #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
> > > 
> > > #define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
> > > 
> > > #ifdef CONFIGURE_INIT
> > > rtems_driver_address_table Device_drivers[] =
> > > 	{
> > > 	CONSOLE_DRIVER_TABLE_ENTRY
> > > 	,CLOCK_DRIVER_TABLE_ENTRY
> > > 	,SMC_DRIVER_TABLE_ENTRY
> > > 	};
> > > 
> > > #include <rtems/bdbuf.h>
> > > rtems_bdbuf_config rtems_bdbuf_configuration[] = {
> > >   {512,128,NULL}
> > > };
> > > 
> > > int rtems_bdbuf_configuration_size =( sizeof(rtems_bdbuf_configuration)
> > > 				     /sizeof(rtems_bdbuf_configuration[0]));
> > > #endif
> > > 
> > > 
> > > #define CONFIGURE_MAXIMUM_TASKS             20
> > > #define CONFIGURE_MAXIMUM_SEMAPHORES        20
> > > #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES    20
> > > #define CONFIGURE_INIT_TASK_PRIORITY          10
> > > #define CONFIGURE_INIT_TASK_INITIAL_MODES     RTEMS_PREEMPT
> > > 
> > > #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
> > > #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS        20
> > > #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
> > > #define CONFIGURE_INIT_TASK_ENTRY_POINT   main_task
> > > #define CONFIGURE_INIT_TASK_NAME          rtems_build_name( 'A', 'W',
> > > '3', '2' )
> > > #define CONFIGURE_INIT_TASK_STACK_SIZE  (20 * RTEMS_MINIMUM_STACK_SIZE)
> > > 
> > > #define CONFIGURE_EXTRA_TASK_STACKS     (20 * RTEMS_MINIMUM_STACK_SIZE)
> > > 
> > > #include <rtems/confdefs.h>
> > > 
> > > I dont know whats wrong...
> > > TIA
> > > 
> > 
> > 
> > -- 
> > --------------------------------------------
> > IMD Ingenieurbuero fuer Microcomputertechnik
> > Thomas Doerfler           Herbststrasse 8
> > D-82178 Puchheim          Germany
> > email:    Thomas.Doerfler at imd-systems.de
> > PGP public key available at:
> >      http://www.imd-systems.de/pgpkey_en.html
> 
> -- 
> http://www.fastmail.fm - The professional email service
> 

-- 
http://www.fastmail.fm - Does exactly what it says on the tin




More information about the users mailing list