From 2c647575b35a56e900f766dc83d83ce96f95c5d8 Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Wed, 17 Nov 2010 23:40:33 +0000 Subject: [PATCH] add ROMFS initialization. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1058 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/mini2440/application.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bsp/mini2440/application.c b/bsp/mini2440/application.c index 780971af8..697dddeeb 100644 --- a/bsp/mini2440/application.c +++ b/bsp/mini2440/application.c @@ -51,6 +51,10 @@ extern void rt_hw_touch_init(void); #define RT_INIT_THREAD_STACK_SIZE (2*1024) #endif +#ifdef RT_USING_DFS_ROMFS +#include +#endif + void rt_init_thread_entry(void* parameter) { /* Filesystem Initialization */ @@ -62,7 +66,6 @@ void rt_init_thread_entry(void* parameter) #if defined(RT_USING_DFS_ELMFAT) /* init the elm chan FatFs filesystam*/ elm_init(); - /* mount sd card fat partition 1 as root directory */ if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) { @@ -72,6 +75,16 @@ void rt_init_thread_entry(void* parameter) rt_kprintf("File System initialzation failed!\n"); #endif +#if defined(RT_USING_DFS_ROMFS) + dfs_romfs_init(); + if (dfs_mount(RT_NULL, "/rom", "rom", 0, &romfs_root) == 0) + { + rt_kprintf("ROM File System initialized!\n"); + } + else + rt_kprintf("ROM File System initialzation failed!\n"); +#endif + #if defined(RT_USING_DFS_DEVFS) devfs_init(); if (dfs_mount(RT_NULL, "/dev", "devfs", 0, 0) == 0) @@ -79,8 +92,10 @@ void rt_init_thread_entry(void* parameter) else rt_kprintf("Device File System initialzation failed!\n"); + #ifdef RT_USING_NEWLIB /* init libc */ libc_system_init("uart0"); + #endif #endif } #endif