您的位置:首页 > 运维架构 > Linux

Windows下Linux开发环境设置(一)--TFTP服务器设置和NFS服务器设置

2007-03-08 08:45 986 查看
 
序言
本系列文章介绍在windows下如何进行Linux开发应用。如何在windows下通过tftp启动目标板,如何在windows通过NFS与目标板相“沟通”。 以及如何在cygwin下生成交叉编译工具链。本文中所有操作均在windows XP下进行。
TFTP服务器设置
软件需求:tftpsrv.exe
文件要求:zImage,ramdisk   这两个文件为用户自己的启动文件。
 
1.         在C盘新建目录c:/tftpserver/
2.         将程序TFTPSRV.exe拷入该目录
3.         在c:/tftpserver/目录下创建tftpboot目录
4.         将zImage和ramdisk拷入tftpboot下
5.         确保zImage属性->安全里的有用户everyone,并且有执行,读的权限(可省略)
6.         打开DOS命令窗口,转入到c:/tftpserver/下
7.         在 DOS窗口下键入tftpsrv.exe dtftpboot/ ,此时 tftpserver则启动
[align=left]注:如右键里没有“安全”选项,则首先确认分区是否是NTFS格式,如不是则更换成NTFS格式,然后在资源管理器里点击“工具”菜单-“文件夹选项”,将“使用简单文件共享(推荐)”前的勾去掉即可。如下图:[/align]



 
Windows下NFS服务器设置
软件需求:SFU
文件要求:passwd ,group 这两个文件为用户自己的密码和组文件。
示例:passwd内容
root:x:0:0:root:/root:/bin/sh
group内容
root:x:0:
[align=left]安装[/align]
[align=left]a)       将passwd和group两个文件直接复制到本地C:/盘

[/align]
[align=left]b)       运行SFU35BETA_EN.exe,这是一个自解压文件,指定一个目录,释放压缩的文件。 [/align]
[align=left]c)       在释放目录中,运行SfuSetup.msi,出现Micorsoft Windows Services for UNIX Setup wizard窗口。 [/align]
[align=left]d)       点击Next,出现Customer Information窗口。 [/align]
[align=left]e)       点击Next,出现License and Support Information窗口,选中“I accept the agreement”。 [/align]
[align=left]f)       点击Next,出现Installation Options窗口。 [/align]
[align=left]g)       选择Custom Installation,点击Next,出现Selecting Components窗口。 [/align]
[align=left]h)       点击Utilities目录项,选择Entire feature will not be available,该项的图标变为一个棕色的叉号。 [/align]
[align=left]i)       对“Interix GNU components”“Remote Connectivity”使用相同的选择。 [/align]
[align=left]j)       点击NFS目录项,选择Entire Feature (including all subfeature if any) will be installed on local hard drive,该项的图标变为一个白色背景的驱动器。 [/align]
[align=left]k)       对“Authentication tools for NFS”使用相同的选择, 选择Entire Feature (including all subfeature if any) will be installed on local hard drive。 [/align]
[align=left]l)       最终只有“Authentication tools for NFS”和“NFS”两项是完全安装,其他各项都不安装。 [/align]
[align=left]m)       点击Next,出现User Name Mapping窗口,选中Password and group files。 [/align]
[align=left]n)       点击Next,在Password file path and name下的空白栏中输入C:/passwd,在Group file path and name下的空白栏中输入C:/group。 [/align]
[align=left]o)       点击Next,出现Installationg Location窗口,选择安装位置。 [/align]
[align=left]p)       点击Next,开始安装(约21MB)。最后选择Finish,结束安装。如提示重启,则重启。 (以上安装过程比较简单,引用网络上文章。)
注:与卡巴斯基互联网套装6.0有冲突,需安装之前关闭卡巴斯基。[/align]
[align=left]共享Windows主机目录[/align]
[align=left]a)       不需重启,对要共享的目录,右键点击出现下拉菜单,选择“属性”,出现目录属性窗口。如图[/align]



[align=left] [/align]
b)       选择“NFS Sharing”选项卡,选中share this folder;指定共享名(Share name,一个简单的名字,大小写无关,如dir);字符编码(Encoding)选择GB2312-80;选中Allow anonymous access;点击Permissions,出现NFS Share Permissions窗口,设置共享文件夹读写属性。如图:



[align=left]c)       在Type of access下拉菜单中选择Read-Write(可读可写);要使目标板对本机文件有root权限,选中Allow root access。 [/align]
[align=left]d)       设置完,点击OK按钮,回到目录属性窗口。[/align]
[align=left]e)       点击“安全”选项,添加everyone,使之允许读取,控制。如图[/align]



点击“应用”或“确定”,使共享生效。
要设置NFS属性,选择开始->程序->Windows Services for Unix->Services for Unix Administration。
f)      出现设置窗口后,点击 左边子窗口User Name Mapping,再点击标签栏“Map”,然后点击 show User Maps,出现如下画面:



[align=left]g)       在windows user name 和unix user name框中分别输入guest和root
然后点击add,则添加到mapped users中。[/align]
[align=left]h)       然后再点击 show group Maps, 在windows group name 和unix group name框中分别输入guests和root
然后点击add,则添加到mapped groups中。[/align]
[align=left]注:如右键里没有“安全”选项,则首先确认分区是否是NTFS格式,如不是则更换成NTFS格式,然后在资源管理器里点击“工具”菜单-“文件夹选项”,将“使用简单文件共享(推荐)”前的勾去掉即可。如下图:[/align]



[align=left]启动目标板,并在目标板上挂装Windows目录[/align]
[align=left]将主机IP设为192.168.1.1,交叉线与目标板相连,启动目标板,主机启动tftp服务,运行mount命令来挂装NFS目录:
      mount –t nfs –o nolock 192.168.1.1: share_name /mnt
share_name为共享的目录名。显示一下目录内容,应为Windows机器上的共享NFS目录内容。[/align]
[align=left]    这样,我们编译好的程序便可以放入共享目录中,然后在目标板上运行。[/align]
注:如出现网络不通的问题,则应检查本地连接是否有防火墙,如有,则去掉防火墙保护。
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐