diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-07 15:03:03 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-07 15:03:03 -0600 |
commit | b20c2c13f229704f5b4b9a43d8323f24e18977f2 (patch) | |
tree | 7e2daa8004160827a8b9d19c92ddaacc3f8d7b63 /apps/examples | |
parent | 1c5e93117d6951dc65d4914ee8e9507af143d2b4 (diff) | |
download | nuttx-b20c2c13f229704f5b4b9a43d8323f24e18977f2.tar.gz nuttx-b20c2c13f229704f5b4b9a43d8323f24e18977f2.tar.bz2 nuttx-b20c2c13f229704f5b4b9a43d8323f24e18977f2.zip |
BAS: Rename examples/bas to examples/bastest. Hook into build and configuration system. Finish ROMFS logic
Diffstat (limited to 'apps/examples')
-rw-r--r-- | apps/examples/Kconfig | 1 | ||||
-rw-r--r-- | apps/examples/Makefile | 2 | ||||
-rw-r--r-- | apps/examples/README.txt | 16 | ||||
-rw-r--r-- | apps/examples/bastest/.gitignore | 11 | ||||
-rw-r--r-- | apps/examples/bastest/Kconfig | 31 | ||||
-rw-r--r-- | apps/examples/bastest/Makefile | 153 | ||||
-rw-r--r-- | apps/examples/bastest/README.txt (renamed from apps/examples/bas/README.txt) | 52 | ||||
-rw-r--r-- | apps/examples/bastest/bastest_main.c | 121 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test01.bas (renamed from apps/examples/bas/tests/test01.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test02.bas (renamed from apps/examples/bas/tests/test02.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test03.bas (renamed from apps/examples/bas/tests/test03.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test04.bas (renamed from apps/examples/bas/tests/test04.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test05.bas (renamed from apps/examples/bas/tests/test05.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test06.bas (renamed from apps/examples/bas/tests/test06.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test07.bas (renamed from apps/examples/bas/tests/test07.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test08.bas (renamed from apps/examples/bas/tests/test08.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test09.bas (renamed from apps/examples/bas/tests/test09.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test10.bas (renamed from apps/examples/bas/tests/test10.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test11.bas (renamed from apps/examples/bas/tests/test11.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test12.bas (renamed from apps/examples/bas/tests/test12.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test13.bas (renamed from apps/examples/bas/tests/test13.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test14.bas (renamed from apps/examples/bas/tests/test14.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test15.bas (renamed from apps/examples/bas/tests/test15.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test16.bas (renamed from apps/examples/bas/tests/test16.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test17.bas (renamed from apps/examples/bas/tests/test17.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test18.bas (renamed from apps/examples/bas/tests/test18.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test19.bas (renamed from apps/examples/bas/tests/test19.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test20.bas (renamed from apps/examples/bas/tests/test20.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test21.bas (renamed from apps/examples/bas/tests/test21.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test22.bas (renamed from apps/examples/bas/tests/test22.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test23.bas (renamed from apps/examples/bas/tests/test23.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test24.bas (renamed from apps/examples/bas/tests/test24.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test25.bas (renamed from apps/examples/bas/tests/test25.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test26.bas (renamed from apps/examples/bas/tests/test26.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test27.bas (renamed from apps/examples/bas/tests/test27.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test28.bas (renamed from apps/examples/bas/tests/test28.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test29.bas (renamed from apps/examples/bas/tests/test29.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test30.bas (renamed from apps/examples/bas/tests/test30.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test31.bas (renamed from apps/examples/bas/tests/test31.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test32.bas (renamed from apps/examples/bas/tests/test32.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test33.bas (renamed from apps/examples/bas/tests/test33.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test34.bas (renamed from apps/examples/bas/tests/test34.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test35.bas (renamed from apps/examples/bas/tests/test35.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test36.bas (renamed from apps/examples/bas/tests/test36.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test37.bas (renamed from apps/examples/bas/tests/test37.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test38.bas (renamed from apps/examples/bas/tests/test38.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test39.bas (renamed from apps/examples/bas/tests/test39.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test40.bas (renamed from apps/examples/bas/tests/test40.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test41.bas (renamed from apps/examples/bas/tests/test41.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test42.bas (renamed from apps/examples/bas/tests/test42.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test43.bas (renamed from apps/examples/bas/tests/test43.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test44.bas (renamed from apps/examples/bas/tests/test44.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test45.bas (renamed from apps/examples/bas/tests/test45.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test46.bas (renamed from apps/examples/bas/tests/test46.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test47.bas (renamed from apps/examples/bas/tests/test47.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test48.bas (renamed from apps/examples/bas/tests/test48.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test49.bas (renamed from apps/examples/bas/tests/test49.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test50.bas (renamed from apps/examples/bas/tests/test50.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test51.bas (renamed from apps/examples/bas/tests/test51.bas) | 0 | ||||
-rw-r--r-- | apps/examples/bastest/tests/test52.bas (renamed from apps/examples/bas/tests/test52.bas) | 0 |
60 files changed, 386 insertions, 1 deletions
diff --git a/apps/examples/Kconfig b/apps/examples/Kconfig index 3c1639923..9b14a5bca 100644 --- a/apps/examples/Kconfig +++ b/apps/examples/Kconfig @@ -4,6 +4,7 @@ # source "$APPSDIR/examples/adc/Kconfig" +source "$APPSDIR/examples/bastest/Kconfig" source "$APPSDIR/examples/buttons/Kconfig" source "$APPSDIR/examples/can/Kconfig" source "$APPSDIR/examples/cc3000/Kconfig" diff --git a/apps/examples/Makefile b/apps/examples/Makefile index 815b410a3..b2e04be81 100644 --- a/apps/examples/Makefile +++ b/apps/examples/Makefile @@ -37,7 +37,7 @@ # Sub-directories -SUBDIRS = adc buttons can cc3000 cpuhog cxxtest dhcpd discover elf +SUBDIRS = adc bastest buttons can cc3000 cpuhog cxxtest dhcpd discover elf SUBDIRS += flash_test ftpc ftpd hello helloxx hidkbd igmp i2schar json SUBDIRS += keypadtest lcdrw mm modbus mount mtdpart mtdrwb netpkt nettest SUBDIRS += nrf24l01_term nsh null nx nxterm nxffs nxflat nxhello nximage diff --git a/apps/examples/README.txt b/apps/examples/README.txt index a1d754ae1..caac77e4a 100644 --- a/apps/examples/README.txt +++ b/apps/examples/README.txt @@ -48,6 +48,22 @@ examples/adc CONFIG_EXAMPLES_ADC_GROUPSIZE - The number of samples to read at once. Default: 4 +examples/bastest +^^^^^^^^^^^^^^^^ + This directory contains a small program that will mount a ROMFS file system + containing the BASIC test files extracted from the BAS 2.4 release. See + examples/bastest/README.txt for licensing and usage information. + + CONFIG_EXAMPLES_BASTEST_DEVMINOR - The minor device number of the ROMFS block + driver. For example, the N in /dev/ramN. Used for registering the RAM + block driver that will hold the ROMFS file system containing the BASIC + files to be tested. Default: 0 + + CONFIG_EXAMPLES_BASTEST_DEVPATH - The path to the ROMFS block driver device. This + must match EXAMPLES_BASTEST_DEVMINOR. Used for registering the RAM block driver + that will hold the ROMFS file system containing the BASIC files to be + tested. Default: "/dev/ram0" + examples/buttons ^^^^^^^^^^^^^^^^ diff --git a/apps/examples/bastest/.gitignore b/apps/examples/bastest/.gitignore new file mode 100644 index 000000000..fa1ec7579 --- /dev/null +++ b/apps/examples/bastest/.gitignore @@ -0,0 +1,11 @@ +/Make.dep +/.depend +/.built +/*.asm +/*.obj +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src diff --git a/apps/examples/bastest/Kconfig b/apps/examples/bastest/Kconfig new file mode 100644 index 000000000..3c56df48d --- /dev/null +++ b/apps/examples/bastest/Kconfig @@ -0,0 +1,31 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# + +config EXAMPLES_BASTEST + bool "Setup Test Files for BAS" + default n + depends on INTERPRETERS_BAS + ---help--- + Mount the ROMFS file system containing the BAS test files. + +if EXAMPLES_BASTEST + +config EXAMPLES_BASTEST_DEVMINOR + int "ROMFS Minor Device Number" + default 0 + ---help--- + The minor device number of the ROMFS block. For example, the N in /dev/ramN. + Used for registering the RAM block driver that will hold the ROMFS file system + containing the BASIC files to be tested. Default: 0 + +config EXAMPLES_BASTEST_DEVPATH + string "ROMFS Device Path" + default "/dev/ram0" + ---help--- + The path to the ROMFS block driver device. This must match EXAMPLES_BASTEST_DEVMINOR. + Used for registering the RAM block driver that will hold the ROMFS file system + containing the BASIC files to be tested. Default: "/dev/ram0" + +endif diff --git a/apps/examples/bastest/Makefile b/apps/examples/bastest/Makefile new file mode 100644 index 000000000..144a9cfd6 --- /dev/null +++ b/apps/examples/bastest/Makefile @@ -0,0 +1,153 @@ +############################################################################ +# apps/examples/bastest/Makefile +# +# Copyright (C) 2014 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# BAS test volume mounter + +APPNAME = bastest +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Hello, World! Example + +ASRCS = +CSRCS = +MAINSRC = bastest_main.c + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) +OBJS = $(AOBJS) $(COBJS) + +ifneq ($(CONFIG_BUILD_KERNEL),y) + OBJS += $(MAINOBJ) +endif + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + BIN = ..\..\libapps$(LIBEXT) +else +ifeq ($(WINTOOL),y) + BIN = ..\\..\\libapps$(LIBEXT) +else + BIN = ../../libapps$(LIBEXT) +endif +endif + +ifeq ($(WINTOOL),y) + INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" +else + INSTALL_DIR = $(BIN_DIR) +endif + +BASTEST_DIR = $(APPDIR)$(DELIM)examples$(DELIM)bastest +TESTS_DIR = $(BASTEST_DIR)$(DELIM)tests +ROMFS_IMG = $(BASTEST_DIR)$(DELIM)romfs.img +ROMFS_HDR = $(BASTEST_DIR)$(DELIM)romfs.h + +PROGNAME = bastest$(EXEEXT) + +ROOTDEPPATH = --dep-path . + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend distclean + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +.built: $(OBJS) + $(call ARCHIVE, $(BIN), $(OBJS)) + @touch .built + +# Create the romfs.h header file from the tests/ directory + +$(ROMFS_HDR) : $(ROMFS_IMG) + $(Q) genromfs -f $@ -d $(TESTS_DIR) -V "BASTEST" + $(Q) (xxd -i romfs.img | sed -e "s/^unsigned/static const unsigned/g" >$@) + +# Link and install the program binary + +ifeq ($(CONFIG_BUILD_KERNEL),y) +$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) + @echo "LD: $(PROGNAME)" + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) + $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) + +install: $(BIN_DIR)$(DELIM)$(PROGNAME) + +else +install: + +endif + +# Register the NSH builtin appliation + +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Housekeeping stuff + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + $(call DELFILE, .built) + $(call CLEAN) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/apps/examples/bas/README.txt b/apps/examples/bastest/README.txt index c1a47429d..846fad0e0 100644 --- a/apps/examples/bas/README.txt +++ b/apps/examples/bastest/README.txt @@ -1,3 +1,55 @@ +README +====== + + This directory contains a small program that will mount a ROMFS file system + containing the BASIC test files extracted from the BAS 2.4 release. + +Background +========== + Bas is an interpreter for the classic dialect of the programming language + BASIC. It is pretty compatible to typical BASIC interpreters of the 1980s, + unlike some other UNIX BASIC interpreters, that implement a different + syntax, breaking compatibility to existing programs. Bas offers many ANSI + BASIC statements for structured programming, such as procedures, local + variables and various loop types. Further there are matrix operations, + automatic LIST indentation and many statements and functions found in + specific classic dialects. Line numbers are not required. + + The interpreter tokenises the source and resolves references to variables + and jump targets before running the program. This compilation pass + increases efficiency and catches syntax errors, type errors and references + to variables that are never initialised. Bas is written in ANSI C for + UNIX systems. + +License +======= + BAS 2.4 is released as part of NuttX under the standard 3-clause BSD license + use by all components of NuttX. This is not incompatible with the original + BAS 2.4 licensing + + Copyright (c) 1999-2014 Michael Haardt + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +TEST OVERVIEW +============= + test01.bas ========== Scalar variable assignment diff --git a/apps/examples/bastest/bastest_main.c b/apps/examples/bastest/bastest_main.c new file mode 100644 index 000000000..3cf70c681 --- /dev/null +++ b/apps/examples/bastest/bastest_main.c @@ -0,0 +1,121 @@ +/**************************************************************************** + * examples/bastest/bastest_main.c + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> +#include <stdio.h> + +#include "romfs.h" + +/**************************************************************************** + * Pre-processor 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_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 + +/* Describe the ROMFS file system */ + +#define SECTORSIZE 512 +#define NSECTORS(b) (((b)+SECTORSIZE-1)/SECTORSIZE) +#define MOUNTPT "/mnt/romfs" + +#ifndef CONFIG_EXAMPLES_BASTEST_DEVMINOR +# define CONFIG_EXAMPLES_BASTEST_DEVMINOR 0 +#endif + +#ifndef CONFIG_EXAMPLES_BASTEST_DEVPATH +# define CONFIG_EXAMPLES_BASTEST_DEVPATH "/dev/ram0" +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * bastest_main + ****************************************************************************/ + +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char *argv[]) +#else +int bastest_main(int argc, char *argv[]) +#endif +{ + /* Create a ROM disk for the ROMFS filesystem */ + + printf("Registering romdisk at /dev/ram%d\n", CONFIG_EXAMPLES_BASTEST_DEVMINOR); + ret = romdisk_register(CONFIG_EXAMPLES_BASTEST_DEVMINOR, (FAR uint8_t *)romfs_img, + NSECTORS(romfs_img_len), SECTORSIZE); + if (ret < 0) + { + err("ERROR: romdisk_register failed: %d\n", ret); + return 1; + } + + /* Mount the file system */ + + message("Mounting ROMFS filesystem at target=%s with source=%s\n", + MOUNTPT, CONFIG_EXAMPLES_BASTEST_DEVPATH); + + ret = mount(CONFIG_EXAMPLES_BASTEST_DEVPATH, MOUNTPT, "romfs", MS_RDONLY, NULL); + if (ret < 0) + { + err("ERROR: mount(%s,%s,romfs) failed: %s\n", + CONFIG_EXAMPLES_BASTEST_DEVPATH, MOUNTPT, errno); + return 1; + } + + return 0; +} diff --git a/apps/examples/bas/tests/test01.bas b/apps/examples/bastest/tests/test01.bas index d2c3494e0..d2c3494e0 100644 --- a/apps/examples/bas/tests/test01.bas +++ b/apps/examples/bastest/tests/test01.bas diff --git a/apps/examples/bas/tests/test02.bas b/apps/examples/bastest/tests/test02.bas index cc8b50ebc..cc8b50ebc 100644 --- a/apps/examples/bas/tests/test02.bas +++ b/apps/examples/bastest/tests/test02.bas diff --git a/apps/examples/bas/tests/test03.bas b/apps/examples/bastest/tests/test03.bas index 5d991d330..5d991d330 100644 --- a/apps/examples/bas/tests/test03.bas +++ b/apps/examples/bastest/tests/test03.bas diff --git a/apps/examples/bas/tests/test04.bas b/apps/examples/bastest/tests/test04.bas index f2755e5a9..f2755e5a9 100644 --- a/apps/examples/bas/tests/test04.bas +++ b/apps/examples/bastest/tests/test04.bas diff --git a/apps/examples/bas/tests/test05.bas b/apps/examples/bastest/tests/test05.bas index 49100a00e..49100a00e 100644 --- a/apps/examples/bas/tests/test05.bas +++ b/apps/examples/bastest/tests/test05.bas diff --git a/apps/examples/bas/tests/test06.bas b/apps/examples/bastest/tests/test06.bas index ddd6efe78..ddd6efe78 100644 --- a/apps/examples/bas/tests/test06.bas +++ b/apps/examples/bastest/tests/test06.bas diff --git a/apps/examples/bas/tests/test07.bas b/apps/examples/bastest/tests/test07.bas index 12c0cbdc7..12c0cbdc7 100644 --- a/apps/examples/bas/tests/test07.bas +++ b/apps/examples/bastest/tests/test07.bas diff --git a/apps/examples/bas/tests/test08.bas b/apps/examples/bastest/tests/test08.bas index 0e6f13ad6..0e6f13ad6 100644 --- a/apps/examples/bas/tests/test08.bas +++ b/apps/examples/bastest/tests/test08.bas diff --git a/apps/examples/bas/tests/test09.bas b/apps/examples/bastest/tests/test09.bas index 7d5f72735..7d5f72735 100644 --- a/apps/examples/bas/tests/test09.bas +++ b/apps/examples/bastest/tests/test09.bas diff --git a/apps/examples/bas/tests/test10.bas b/apps/examples/bastest/tests/test10.bas index 41a935cca..41a935cca 100644 --- a/apps/examples/bas/tests/test10.bas +++ b/apps/examples/bastest/tests/test10.bas diff --git a/apps/examples/bas/tests/test11.bas b/apps/examples/bastest/tests/test11.bas index 78eb6d1c6..78eb6d1c6 100644 --- a/apps/examples/bas/tests/test11.bas +++ b/apps/examples/bastest/tests/test11.bas diff --git a/apps/examples/bas/tests/test12.bas b/apps/examples/bastest/tests/test12.bas index ecbb9d138..ecbb9d138 100644 --- a/apps/examples/bas/tests/test12.bas +++ b/apps/examples/bastest/tests/test12.bas diff --git a/apps/examples/bas/tests/test13.bas b/apps/examples/bastest/tests/test13.bas index e3be7a00b..e3be7a00b 100644 --- a/apps/examples/bas/tests/test13.bas +++ b/apps/examples/bastest/tests/test13.bas diff --git a/apps/examples/bas/tests/test14.bas b/apps/examples/bastest/tests/test14.bas index 56040112a..56040112a 100644 --- a/apps/examples/bas/tests/test14.bas +++ b/apps/examples/bastest/tests/test14.bas diff --git a/apps/examples/bas/tests/test15.bas b/apps/examples/bastest/tests/test15.bas index a9195bf4b..a9195bf4b 100644 --- a/apps/examples/bas/tests/test15.bas +++ b/apps/examples/bastest/tests/test15.bas diff --git a/apps/examples/bas/tests/test16.bas b/apps/examples/bastest/tests/test16.bas index 809137d75..809137d75 100644 --- a/apps/examples/bas/tests/test16.bas +++ b/apps/examples/bastest/tests/test16.bas diff --git a/apps/examples/bas/tests/test17.bas b/apps/examples/bastest/tests/test17.bas index bfe0c9c2c..bfe0c9c2c 100644 --- a/apps/examples/bas/tests/test17.bas +++ b/apps/examples/bastest/tests/test17.bas diff --git a/apps/examples/bas/tests/test18.bas b/apps/examples/bastest/tests/test18.bas index 73ab93e1b..73ab93e1b 100644 --- a/apps/examples/bas/tests/test18.bas +++ b/apps/examples/bastest/tests/test18.bas diff --git a/apps/examples/bas/tests/test19.bas b/apps/examples/bastest/tests/test19.bas index aa19fa4ae..aa19fa4ae 100644 --- a/apps/examples/bas/tests/test19.bas +++ b/apps/examples/bastest/tests/test19.bas diff --git a/apps/examples/bas/tests/test20.bas b/apps/examples/bastest/tests/test20.bas index 6b982bf89..6b982bf89 100644 --- a/apps/examples/bas/tests/test20.bas +++ b/apps/examples/bastest/tests/test20.bas diff --git a/apps/examples/bas/tests/test21.bas b/apps/examples/bastest/tests/test21.bas index dd0f63beb..dd0f63beb 100644 --- a/apps/examples/bas/tests/test21.bas +++ b/apps/examples/bastest/tests/test21.bas diff --git a/apps/examples/bas/tests/test22.bas b/apps/examples/bastest/tests/test22.bas index e10b03a14..e10b03a14 100644 --- a/apps/examples/bas/tests/test22.bas +++ b/apps/examples/bastest/tests/test22.bas diff --git a/apps/examples/bas/tests/test23.bas b/apps/examples/bastest/tests/test23.bas index faf5c5593..faf5c5593 100644 --- a/apps/examples/bas/tests/test23.bas +++ b/apps/examples/bastest/tests/test23.bas diff --git a/apps/examples/bas/tests/test24.bas b/apps/examples/bastest/tests/test24.bas index 95678830b..95678830b 100644 --- a/apps/examples/bas/tests/test24.bas +++ b/apps/examples/bastest/tests/test24.bas diff --git a/apps/examples/bas/tests/test25.bas b/apps/examples/bastest/tests/test25.bas index bf4d34c93..bf4d34c93 100644 --- a/apps/examples/bas/tests/test25.bas +++ b/apps/examples/bastest/tests/test25.bas diff --git a/apps/examples/bas/tests/test26.bas b/apps/examples/bastest/tests/test26.bas index 8055735a1..8055735a1 100644 --- a/apps/examples/bas/tests/test26.bas +++ b/apps/examples/bastest/tests/test26.bas diff --git a/apps/examples/bas/tests/test27.bas b/apps/examples/bastest/tests/test27.bas index 92ba744a8..92ba744a8 100644 --- a/apps/examples/bas/tests/test27.bas +++ b/apps/examples/bastest/tests/test27.bas diff --git a/apps/examples/bas/tests/test28.bas b/apps/examples/bastest/tests/test28.bas index d5185ca98..d5185ca98 100644 --- a/apps/examples/bas/tests/test28.bas +++ b/apps/examples/bastest/tests/test28.bas diff --git a/apps/examples/bas/tests/test29.bas b/apps/examples/bastest/tests/test29.bas index fbc20942c..fbc20942c 100644 --- a/apps/examples/bas/tests/test29.bas +++ b/apps/examples/bastest/tests/test29.bas diff --git a/apps/examples/bas/tests/test30.bas b/apps/examples/bastest/tests/test30.bas index 06cea549a..06cea549a 100644 --- a/apps/examples/bas/tests/test30.bas +++ b/apps/examples/bastest/tests/test30.bas diff --git a/apps/examples/bas/tests/test31.bas b/apps/examples/bastest/tests/test31.bas index d168bd072..d168bd072 100644 --- a/apps/examples/bas/tests/test31.bas +++ b/apps/examples/bastest/tests/test31.bas diff --git a/apps/examples/bas/tests/test32.bas b/apps/examples/bastest/tests/test32.bas index 43fdc4cf5..43fdc4cf5 100644 --- a/apps/examples/bas/tests/test32.bas +++ b/apps/examples/bastest/tests/test32.bas diff --git a/apps/examples/bas/tests/test33.bas b/apps/examples/bastest/tests/test33.bas index 2d64a4d05..2d64a4d05 100644 --- a/apps/examples/bas/tests/test33.bas +++ b/apps/examples/bastest/tests/test33.bas diff --git a/apps/examples/bas/tests/test34.bas b/apps/examples/bastest/tests/test34.bas index 2cd77b914..2cd77b914 100644 --- a/apps/examples/bas/tests/test34.bas +++ b/apps/examples/bastest/tests/test34.bas diff --git a/apps/examples/bas/tests/test35.bas b/apps/examples/bastest/tests/test35.bas index 158f20719..158f20719 100644 --- a/apps/examples/bas/tests/test35.bas +++ b/apps/examples/bastest/tests/test35.bas diff --git a/apps/examples/bas/tests/test36.bas b/apps/examples/bastest/tests/test36.bas index c7bd6f054..c7bd6f054 100644 --- a/apps/examples/bas/tests/test36.bas +++ b/apps/examples/bastest/tests/test36.bas diff --git a/apps/examples/bas/tests/test37.bas b/apps/examples/bastest/tests/test37.bas index 80f65a7de..80f65a7de 100644 --- a/apps/examples/bas/tests/test37.bas +++ b/apps/examples/bastest/tests/test37.bas diff --git a/apps/examples/bas/tests/test38.bas b/apps/examples/bastest/tests/test38.bas index c1b151eee..c1b151eee 100644 --- a/apps/examples/bas/tests/test38.bas +++ b/apps/examples/bastest/tests/test38.bas diff --git a/apps/examples/bas/tests/test39.bas b/apps/examples/bastest/tests/test39.bas index 076c07be9..076c07be9 100644 --- a/apps/examples/bas/tests/test39.bas +++ b/apps/examples/bastest/tests/test39.bas diff --git a/apps/examples/bas/tests/test40.bas b/apps/examples/bastest/tests/test40.bas index 5ddc05009..5ddc05009 100644 --- a/apps/examples/bas/tests/test40.bas +++ b/apps/examples/bastest/tests/test40.bas diff --git a/apps/examples/bas/tests/test41.bas b/apps/examples/bastest/tests/test41.bas index f307a866d..f307a866d 100644 --- a/apps/examples/bas/tests/test41.bas +++ b/apps/examples/bastest/tests/test41.bas diff --git a/apps/examples/bas/tests/test42.bas b/apps/examples/bastest/tests/test42.bas index 5be79ac26..5be79ac26 100644 --- a/apps/examples/bas/tests/test42.bas +++ b/apps/examples/bastest/tests/test42.bas diff --git a/apps/examples/bas/tests/test43.bas b/apps/examples/bastest/tests/test43.bas index 26ac0dd02..26ac0dd02 100644 --- a/apps/examples/bas/tests/test43.bas +++ b/apps/examples/bastest/tests/test43.bas diff --git a/apps/examples/bas/tests/test44.bas b/apps/examples/bastest/tests/test44.bas index 72cb37ccf..72cb37ccf 100644 --- a/apps/examples/bas/tests/test44.bas +++ b/apps/examples/bastest/tests/test44.bas diff --git a/apps/examples/bas/tests/test45.bas b/apps/examples/bastest/tests/test45.bas index cea534dda..cea534dda 100644 --- a/apps/examples/bas/tests/test45.bas +++ b/apps/examples/bastest/tests/test45.bas diff --git a/apps/examples/bas/tests/test46.bas b/apps/examples/bastest/tests/test46.bas index f7a08468d..f7a08468d 100644 --- a/apps/examples/bas/tests/test46.bas +++ b/apps/examples/bastest/tests/test46.bas diff --git a/apps/examples/bas/tests/test47.bas b/apps/examples/bastest/tests/test47.bas index 960ac46c5..960ac46c5 100644 --- a/apps/examples/bas/tests/test47.bas +++ b/apps/examples/bastest/tests/test47.bas diff --git a/apps/examples/bas/tests/test48.bas b/apps/examples/bastest/tests/test48.bas index 223bc1c3e..223bc1c3e 100644 --- a/apps/examples/bas/tests/test48.bas +++ b/apps/examples/bastest/tests/test48.bas diff --git a/apps/examples/bas/tests/test49.bas b/apps/examples/bastest/tests/test49.bas index d9b167af0..d9b167af0 100644 --- a/apps/examples/bas/tests/test49.bas +++ b/apps/examples/bastest/tests/test49.bas diff --git a/apps/examples/bas/tests/test50.bas b/apps/examples/bastest/tests/test50.bas index de12fbe87..de12fbe87 100644 --- a/apps/examples/bas/tests/test50.bas +++ b/apps/examples/bastest/tests/test50.bas diff --git a/apps/examples/bas/tests/test51.bas b/apps/examples/bastest/tests/test51.bas index 503cb2693..503cb2693 100644 --- a/apps/examples/bas/tests/test51.bas +++ b/apps/examples/bastest/tests/test51.bas diff --git a/apps/examples/bas/tests/test52.bas b/apps/examples/bastest/tests/test52.bas index 4470bb5b2..4470bb5b2 100644 --- a/apps/examples/bas/tests/test52.bas +++ b/apps/examples/bastest/tests/test52.bas |