diff --git a/binfmt/nxflat.c b/binfmt/nxflat.c index 53f689a9be..20795dae45 100644 --- a/binfmt/nxflat.c +++ b/binfmt/nxflat.c @@ -94,9 +94,9 @@ static void nxflat_dumpmemory(void *addr, int nbytes) bdbg(" %p: %02x %02x %02x %02x\n", ptr, ptr[0], ptr[1], ptr[2], ptr[3]); } } -#else /* CONFIG_XFLAT_DEBUG */ +#else # define nnxflat_dumpmemory(a,n) -#endif /* CONFIG_XFLAT_DEBUG */ +#endif /**************************************************************************** * Name: nxflat_dumploadinfo @@ -131,9 +131,9 @@ static void nxflat_dumploadinfo(struct nxflat_loadinfo_s *loadinfo) bdbg(" NXFLT HEADER:"); bdbg(" header: %p\n", loadinfo->header); } -#else /* CONFIG_XFLAT_DEBUG */ +#else # define nxflat_dumploadinfo(i) -#endif /* CONFIG_XFLAT_DEBUG */ +#endif /**************************************************************************** * Name: nxflat_loadbinary diff --git a/configs/eagle100/nxflat/defconfig b/configs/eagle100/nxflat/defconfig index 14b4c795eb..c04156e28c 100644 --- a/configs/eagle100/nxflat/defconfig +++ b/configs/eagle100/nxflat/defconfig @@ -247,9 +247,6 @@ CONFIG_HAVE_LIBM=n # CONFIG_SDCLONE_DISABLE. Disable cloning of all socket # desciptors by task_create() when a new task is started. If # set, all sockets will appear to be closed in the new task. -# CONFIG_NXFLAT. Enable support for the NXFLAT binary format. -# This format will support execution of NuttX binaries located -# in a ROMFS filesystem (see examples/nxflat). # CONFIG_EXAMPLE=nxflat CONFIG_DEBUG=n @@ -273,7 +270,17 @@ CONFIG_SEM_NNESTPRIO=0 CONFIG_FDCLONE_DISABLE=n CONFIG_FDCLONE_STDIO=n CONFIG_SDCLONE_DISABLE=y + +# +# Settings for examples/nxflat +# CONFIG_NXFLAT. Enable support for the NXFLAT binary format. +# This format will support execution of NuttX binaries located +# in a ROMFS filesystem (see examples/nxflat). +# CONFIG_SYMTAB_ORDEREDBYNAME. Select if the system symbol table +# is ordered by symbol name +# CONFIG_NXFLAT=y +CONFIG_SYMTAB_ORDEREDBYNAME=y # # The following can be used to disable categories of diff --git a/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c index 4c4de43135..f31c21973d 100644 --- a/examples/nxflat/nxflat_main.c +++ b/examples/nxflat/nxflat_main.c @@ -60,6 +60,32 @@ * Definitions ****************************************************************************/ +/* Check configuration. This is not all of the configuration settings that + * are required -- only the more obvious. + */ + +#if CONFIG_NFILE_DESCRIPTORS < 1 +# error "You must provide file descriptors via CONFIG_NFILE_DESCRIPTORS in your configuration file" +#endif + +#ifndef CONFIG_NXFLAT +# error "You must select CONFIG_NXFLAT in your configuration file" +#endif + +#ifndef CONFIG_FS_ROMFS +# error "You must select CONFIG_FS_ROMFS in your configuration file" +#endif + +#ifdef CONFIG_DISABLE_MOUNTPOINT +# error "You must not disable mountpoints via CONFIG_DISABLE_MOUNTPOINT in your configuration file" +#endif + +#ifdef CONFIG_BINFMT_DISABLE +# error "You must not disable loadable modules via CONFIG_BINFMT_DISABLE in your configuration file" +#endif + +/* Describe the ROMFS file system */ + #define SECTORSIZE 512 #define NSECTORS(b) (((b)+SECTORSIZE-1)/SECTORSIZE) #define ROMFSDEV "/dev/ram0"