diff --git a/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c index a853b6b39..791e60e38 100644 --- a/examples/nxflat/nxflat_main.c +++ b/examples/nxflat/nxflat_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/nxflat/nxflat_main.c + * apps/examples/nxflat/nxflat_main.c * * Copyright (C) 2009, 2011, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -153,12 +154,18 @@ int main(int argc, FAR char *argv[]) FAR char *args[1]; int ret; int i; + struct boardioc_romdisk_s desc; /* Create a ROM disk for the ROMFS filesystem */ message("Registering romdisk\n"); - ret = romdisk_register(0, (FAR uint8_t *)romfs_img, - NSECTORS(romfs_img_len), SECTORSIZE); + + desc.minor = 0; /* Minor device number of the ROM disk. */ + desc.nsectors = NSECTORS(romfs_img_len); /* The number of sectors in the ROM disk */ + desc.sectsize = SECTORSIZE; /* The size of one sector in bytes */ + desc.image = (FAR uint8_t *)romfs_img; /* File system image */ + + ret = boardctl(BOARDIOC_ROMDISK, (uintptr_t)&desc); if (ret < 0) { errmsg("ERROR: romdisk_register failed: %d\n", ret); @@ -173,7 +180,7 @@ int main(int argc, FAR char *argv[]) ret = mount(ROMFSDEV, MOUNTPT, "romfs", MS_RDONLY, NULL); if (ret < 0) { - errmsg("ERROR: mount(%s,%s,romfs) failed: %s\n", + errmsg("ERROR: mount(%s,%s,romfs) failed: %d\n", ROMFSDEV, MOUNTPT, errno); } diff --git a/examples/thttpd/thttpd_main.c b/examples/thttpd/thttpd_main.c index 1b4dff311..d3500848a 100644 --- a/examples/thttpd/thttpd_main.c +++ b/examples/thttpd/thttpd_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/thttpd/thttpd_main.c + * apps/examples/thttpd/thttpd_main.c * * Copyright (C) 2009-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -59,6 +59,10 @@ #include +#ifdef CONFIG_THTTPD_NXFLAT +# include +#endif + #ifdef CONFIG_THTTPD_BINFS # include #endif @@ -204,6 +208,9 @@ int main(int argc, FAR char *argv[]) #endif char *thttpd_argv = "thttpd"; int ret; +#ifdef CONFIG_THTTPD_NXFLAT + struct boardioc_romdisk_s desc; +#endif /* Configure SLIP */ @@ -252,12 +259,18 @@ int main(int argc, FAR char *argv[]) netlib_ifup("eth0"); +#ifdef CONFIG_THTTPD_NXFLAT /* Create a ROM disk for the ROMFS filesystem */ printf("Registering romdisk\n"); - ret = romdisk_register(0, (uint8_t *)romfs_img, NSECTORS(romfs_img_len), - SECTORSIZE); + desc.minor = 0; /* Minor device number of the ROM disk. */ + desc.nsectors = NSECTORS(romfs_img_len); /* The number of sectors in the ROM disk */ + desc.sectsize = SECTORSIZE; /* The size of one sector in bytes */ + desc.image = (FAR uint8_t *)romfs_img; /* File system image */ + + ret = boardctl(BOARDIOC_ROMDISK, (uintptr_t)&desc); + if (ret < 0) { printf("ERROR: romdisk_register failed: %d\n", ret); @@ -275,6 +288,7 @@ int main(int argc, FAR char *argv[]) printf("ERROR: mount(%s,%s,romfs) failed: %d\n", ROMFSDEV, ROMFS_MOUNTPT, errno); } +#endif #ifdef CONFIG_THTTPD_BINFS /* Mount the BINFS file system */