Browse Source

add NFSv3 configuration.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@728 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong@gmail.com 15 năm trước cách đây
mục cha
commit
2139edd2eb
3 tập tin đã thay đổi với 32 bổ sung11 xóa
  1. 14 0
      bsp/mini2440/application.c
  2. 6 2
      bsp/mini2440/rtconfig.h
  3. 12 9
      bsp/mini2440/rtconfig.py

+ 14 - 0
bsp/mini2440/application.c

@@ -90,6 +90,20 @@ void rt_init_thread_entry(void* parameter)
 	}
 #endif
 
+/* NFSv3 Initialization */
+#if defined(RT_USING_DFS) && defined(RT_USING_LWIP) && defined(RT_USING_DFS_NFS)
+	{
+		extern void nfs_init(void);
+		nfs_init();
+
+		if (dfs_mount(RT_NULL, "/nfs", "nfs", 0, RT_NFS_HOST_EXPORT) == 0)
+		{
+			rt_kprintf("NFSv3 File System initialized!\n");
+		}
+		else
+			rt_kprintf("NFSv3 File System initialzation failed!\n");
+	}
+#endif
 }
 
 void rt_led_thread_entry(void* parameter)

+ 6 - 2
bsp/mini2440/rtconfig.h

@@ -76,6 +76,7 @@
 /* Using symbol table */
 #define FINSH_USING_SYMTAB
 #define FINSH_USING_DESCRIPTION
+#define FINSH_THREAD_STACK_SIZE 4096
 
 /* SECTION: a runtime libc library */
 /* a runtime libc library */
@@ -91,10 +92,13 @@
 #define RT_USING_DFS_ELMFAT
 /* use long file name feature 			*/
 #define RT_DFS_ELM_USE_LFN			1
-/* the max number of file length 			*/
-#define RT_DFS_ELM_MAX_LFN		32		
+/* the max number of file length 		*/
+#define RT_DFS_ELM_MAX_LFN		32
 /* #define RT_USING_DFS_YAFFS2 */
 
+#define RT_USING_DFS_NFS
+#define RT_NFS_HOST_EXPORT		"192.168.1.5:/"
+
 /* #define DFS_USING_WORKDIR */
 
 /* the max number of mounted filesystem */

+ 12 - 9
bsp/mini2440/rtconfig.py

@@ -3,14 +3,15 @@ import SCons.cpp
 # component options
 
 # make all component false
-RT_USING_FINSH 		= False
-RT_USING_DFS 		= False
+RT_USING_FINSH      = False
+RT_USING_DFS        = False
 RT_USING_DFS_ELMFAT = False
 RT_USING_DFS_YAFFS2 = False
-RT_USING_LWIP 		= False
-RT_USING_WEBSERVER	= False
-RT_USING_RTGUI 		= False
-RT_USING_MODBUS		= False
+RT_USING_DFS_NFS    = False
+RT_USING_LWIP       = False
+RT_USING_WEBSERVER  = False
+RT_USING_RTGUI      = False
+RT_USING_MODBUS     = False
 
 # parse rtconfig.h to get used component
 PreProcessor = SCons.cpp.PreProcessor()
@@ -35,9 +36,11 @@ if rtconfig_ns.has_key('RT_USING_DFS'):
     if rtconfig_ns.has_key('RT_USING_DFS_ELMFAT'):
         RT_USING_DFS_ELMFAT = True
     if rtconfig_ns.has_key('RT_DFS_ELM_USE_LFN'):
-        RT_DFS_ELM_USE_LFN = True			
+        RT_DFS_ELM_USE_LFN = True           
     if rtconfig_ns.has_key('RT_USING_DFS_YAFFS2'):
         RT_USING_DFS_YAFFS2 = True
+    if rtconfig_ns.has_key('RT_USING_DFS_NFS'):
+        RT_USING_DFS_NFS    = True
 
 # lwip options
 if rtconfig_ns.has_key('RT_USING_LWIP'):
@@ -54,8 +57,8 @@ if rtconfig_ns.has_key('RT_USING_RTGUI'):
 RT_USING_LCD_TYPE = 'PNL_T35'
 
 # toolchains options
-ARCH	 = 'arm'
-CPU		 = 's3c24x0'
+ARCH     = 'arm'
+CPU      = 's3c24x0'
 TextBase = '0x30000000'
 
 CROSS_TOOL 	= 'keil'