⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 嵌入式linux与minigui移植到vr4181.htm

📁 再做嵌入式开发的时候
💻 HTM
📖 第 1 页 / 共 3 页
字号:
                        board<BR>&nbsp; &nbsp; Host system:&nbsp; &nbsp; 
                        &nbsp;&nbsp; Red Hat 6.2<BR>&nbsp; &nbsp; 交叉编译工具:&nbsp; 
                        &nbsp; &nbsp; Hard Hat 1.2 所带的交叉编译工具<BR>&nbsp; &nbsp; 
                        Embadded system:&nbsp;&nbsp; LinuxVR<BR>&nbsp; &nbsp; 
                        BootLoad:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
                        vrboot<BR>&nbsp; &nbsp; MiniGUI:&nbsp; &nbsp; &nbsp; 
                        &nbsp; &nbsp;&nbsp; 1.0.00<BR><BR><B>二、方案</B><BR>&nbsp; 
                        1) 交叉编译环境<BR>&nbsp; &nbsp; Hard 
                        Hat安装在/opt/hardhat下,其交叉编译工具在/opt/hardhat/devkit/mips/41xx_le/bin下,编译工具都用mips_41xx_le-做前缀,如:mips_41xx_le-gcc。<BR>&nbsp; 
                        &nbsp; 
                        通常用这些工具来进行编译有两种做法:(a)修改Makefile,把gcc改成mips_41xx_le-gcc;(b)做连接,在某个自建的目录下把mips_41xx_le-gcc连接成gcc,然后把该目录加入环境变量PATH。<BR>&nbsp; 
                        &nbsp; 
                        我认为后一种方法比较好,因为这样如果要使用不同的编译工具来编译就会比较方便,改一下PATH变量就可以了。由于我是采用第二种方法,以下的过程都是基于此方法上的。<BR>&nbsp; 
                        &nbsp; 
                        另外,由于LinuxVR本身也带有一套交叉编译工具,是以mipsel-linux-作为前缀,因此在LinuxVR的Makefile里使用的工具都带有mipsel-linux-前缀,这就需要以mipsel-linux-为前缀在做一套连接(其实当初如果使用LinuxVR带的交叉编译工具的话就可以少做一套连接了)。<BR><BR>&nbsp; 
                        2) 文件系统<BR>&nbsp; &nbsp; 采用NFS通过网络接口将文件系统放在PC上,debugger 
                        board上只要传个bootload和kernal就可以了,再将debugger 
                        board上的串行口连至PC,就可以在PC上操作了。这样主要是为了方便调试。<BR><BR><B>三、建立交叉编译环境、代码修改</B><BR>&nbsp; 
                        1) 安装Hard Hat 1.2(Hard Hat 的文档中有详细说明)<BR>&nbsp; &nbsp; 
                        进入/mnt/cdrom/install/ospray,执行rpm -ihv *.noarch.rpm 
                        *.i386.rpm<BR>&nbsp; &nbsp; 进入/mnt/cdrom/common,执行rpm 
                        -ihv 
                        hhl-kernel-2.4.0-text2-1.2.3.1.noarch.rpm<BR><BR>&nbsp; 
                        2) 建立连接<BR>&nbsp; &nbsp; 
                        建立一个目录/cc_bin,并在其下建立连接,把mips_41xx_le-*连接成*和mipsel-linux-*。<BR><BR>&nbsp; 
                        3) 在PC上建立DHCP、NFS,配置好MiniCom<BR>&nbsp; &nbsp; 
                        建立DHCP、NFS的方法,Hard Hat 的文档中有详细说明,这里就不重复了。<BR>&nbsp; 
                        &nbsp; MiniCom中波特率选9600,串口嘛就看你用哪个了。<BR><BR>&nbsp; 4) 
                        对LinuxVR的修改<BR>&nbsp; &nbsp; 
                        LCD刷新率问题。LinuxVR的LCD刷新率有问题,闪得厉害。分析后发现有一参数设置错误。将drives/video/vr4181fb.c文件中的结构struct 
                        fb_var_screeninfo 
                        var_def中第4行第6个数据20000改成0x707便可解决。<BR><BR>&nbsp; 5) 
                        MiniGUI 1.0.00 的几个问题<BR>&nbsp; &nbsp; (a) 
                        把src/gal/native/native.h中 #define HAVETEXTMODE 1 改成 
                        #define HAVETEXTMODE 0<BR>&nbsp; &nbsp; (b) 
                        native引擎在处理16位色时调用了ioperm,这个好像只有i386系统才支持,因此要将src/gal/native下的native.c、fb.c、fb.h中有关16位、24位、32位色的处理全部删除,并将Makefile中的fbvga16.c、fbvga16.h、fbvga16i.c删除。<BR>&nbsp; 
                        &nbsp; (c) 
                        修改helio.c文件(由于改动较多,一下子说不清楚,请看附件源代码)<BR><BR><B>四、编译LinuxVR、MiniGUI</B><BR>&nbsp; 
                        1)LinuxVR<BR>&nbsp; &nbsp; 
                        编译LinuxVR时要注意,要将/cc_bin加到PATH的末尾。因为编译LinuxVR时会编译产生一些二进制文件来协助编译,而这些二进制文件必须是i386的,要用i386的gcc来编译。由于前面在/cc_bin目录下建立了连接gcc,此时如果把/cc_bin放在PATH最前面,系统就会先找到/cc_bin下的gcc,生成的二进制文件就是mips的了。所以把/cc_bin放在末尾,可以让系统先找到i386的gcc。<BR>&nbsp; 
                        &nbsp; 我在LinuxVR中修改的内核选项({*}表示选中,{ }表示不选):<BR>&nbsp; 
                        &nbsp; 
                        <P></P>
                        <CENTER>
                        <TABLE width="90%" border=0>
                          <TBODY>
                          <TR>
                            <TD>
                              <HR>

                              <P><FONT face=宋体 color=#993b0>Machine 
                              selection:<BR>&nbsp; &nbsp; &nbsp; {*} Class -&gt; 
                              Handheld/PDA<BR>&nbsp; &nbsp; &nbsp; {*} Platform 
                              -&gt; Nec_Osprey<BR>&nbsp; &nbsp; Loadable module 
                              support:<BR>&nbsp; &nbsp; &nbsp; { } Enable 
                              loadable module support<BR>&nbsp; &nbsp; General 
                              setup:<BR>&nbsp; &nbsp; &nbsp; {*} Kernel support 
                              for MISC binaries<BR>&nbsp; &nbsp; &nbsp; {*} 
                              Execute-in-place from rom (XIP ROM)<BR>&nbsp; 
                              &nbsp; &nbsp; {*} Power management 
                              support<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
                              &nbsp;&nbsp; {*} Support syspend/wakeup (VR41xx 
                              hibernate)<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
                              &nbsp;&nbsp; {*} Support non-volatile suspend 
                              (VR41xx suspend)<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
                              &nbsp;&nbsp; {*} Support standby (VR41xx 
                              standby)<BR>&nbsp; &nbsp; Netword device 
                              support:<BR>&nbsp; &nbsp; &nbsp; Ethernet (10 or 
                              100Mbit)<BR>&nbsp; &nbsp; &nbsp; &nbsp; {*} 
                              Ethernet (10 or 100Mbit)<BR>&nbsp; &nbsp; &nbsp; 
                              &nbsp; &nbsp; &nbsp; &nbsp; {*} Other ISA 
                              cards<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
                              &nbsp; &nbsp; &nbsp;&nbsp; {*} NE2000/NE1000 
                              support<BR>&nbsp; &nbsp; Character 
                              devices:<BR>&nbsp; &nbsp; &nbsp; {*} Touch-panel 
                              support<BR>&nbsp; &nbsp; &nbsp; {*} Button input 
                              support<BR>&nbsp; &nbsp; File system:<BR>&nbsp; 
                              &nbsp; &nbsp; Network File Systems<BR>&nbsp; 
                              &nbsp; &nbsp; &nbsp; { } NFS server 
                              support<BR>&nbsp; &nbsp; &nbsp; Partition 
                              Types<BR>&nbsp; &nbsp; &nbsp; &nbsp; { } Advanced 
                              partition selection<BR>&nbsp; &nbsp; Console 
                              srivers:<BR>&nbsp; &nbsp; &nbsp; Frame-buffer 
                              support<BR>&nbsp; &nbsp; &nbsp; &nbsp; {*} Support 
                              for frame buffer devices<BR>&nbsp; &nbsp; &nbsp; 
                              &nbsp; &nbsp; &nbsp; &nbsp; {*} NEC VR4181 LCD 
                              Controller</FONT></P>
                              <HR>
                            </TD></TR></TBODY></TABLE></CENTER>
                        <P><BR>&nbsp; &nbsp; 编译的最后一步生成目标文件请用 make 
                        vmlinux.binary,生成的文件在arch/mips/boot下<BR><BR>&nbsp; 
                        2)MiniGUI<BR>&nbsp; &nbsp; 我用到的选项有:<BR>&nbsp; &nbsp; 
                        &nbsp; &nbsp; </P>
                        <CENTER>
                        <TABLE width="90%" border=0>
                          <TBODY>
                          <TR>
                            <TD>
                              <HR>

                              <P><FONT face=宋体 
                              color=#993b0>--enable-flatstyle<BR>&nbsp; &nbsp; 
                              &nbsp; &nbsp; --enable-helioial<BR>&nbsp; &nbsp; 
                              &nbsp; &nbsp; --disable-move 
                              windowbymouse<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
                              --disable-purefbgfx<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
                              --disable-cursorsupport<BR>&nbsp; &nbsp; &nbsp; 
                              &nbsp; --disable-jpgsupport<BR>&nbsp; &nbsp; 
                              &nbsp; &nbsp; --disable-pngsupport</FONT></P>
                              <HR>
                            </TD></TR></TBODY></TABLE></CENTER>
                        <P><BR><B>五、下载运行</B><BR>&nbsp; &nbsp; 
                        通过TFTP把内核文件和编译好的vrboot下载到debugger board内,找根网线连接debugger 
                        board上的网络接口和主机上的网卡,找根串行线连接debugger 
                        board和主机上的串口,打开MiniCom,然后给debugger board上电运行。<BR>&nbsp; 
                        &nbsp; 
                        如果顺利的话,在LCD上就能看到带VR标志的小企鹅了,而且MiniCom里会收到启动的信息。<BR>&nbsp; 
                        &nbsp; 
                        正确启动后,就可以在主机用来做NFS的目录里放上minigui的库文件、演示程序,在/var目录下建立一个tmp目录,MiniGUI会在其下建一些文件(好像是文件锁?),在/etc目录下新建一个pointercal文件。一切就绪后,在MiniCom里运行演示程序,看看LCD上是不是有东东出来。呵呵,触摸屏也是可用的,试试看。<BR><BR><BR>以上是我根据以前的试验笔记整理出来的,由于有一段时间没琢磨了,肯定会有错误和遗漏。 
                        再说minigui1.0.00版早了一点,现在的版本很多问题都解决了。<BR>仅作参考,仅作参考。<BR><BR><BR></P></DIV>
                        <TABLE cellSpacing=0 cellPadding=0 width="100%" 
border=0>
                          <TBODY>
                          <TR>
                            <TD vAlign=top>
                              <DIV><A 
                              href="http://www.fengbin.com/bbs/showthread.php?s=&amp;threadid=970"><FONT 
                              color=#ff0000><B>发表您的意见</B></FONT></A>&nbsp;(已有 0 
                              条) </DIV></TD></TR>
                          <TR>
                            <TD height=16></TD></TR>
                          <TR>
                            <TD 
                            background=嵌入式Linux与MiniGUI移植到VR4181.files/list_split.gif 
                            height=1></TD></TR>
                          <TR>
                            <TD width="100%" height=24>
                              <DIV><IMG height=15 
                              src="嵌入式Linux与MiniGUI移植到VR4181.files/arrow1.gif" 
                              width=14>&nbsp;<STRONG>相关文档</STRONG></DIV></TD></TR></TBODY></TABLE>
                        <DIV><A 
                        href="http://www.fengbin.com/doc.php?doc=38">用Windows2000、XP引导Linux</A><BR></DIV></TD></TR></TBODY></TABLE></TD></TR>
              <TR></TR></TBODY></TABLE>
            <TABLE height=4 cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
              <TR>
                <TD></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE class=foottable height=80 cellSpacing=0 cellPadding=0 width=800 
align=center bgColor=#cbe1fa 
background=嵌入式Linux与MiniGUI移植到VR4181.files/foot_bg.gif border=0>
  <TBODY>
  <TR>
    <TD>
      <DIV align=center><BR>版权所有(c) 2002-2005 阿斌软件 Fengbin Soft. All rights 
      reserved<BR><IMG height=32 alt=Apache2 
      src="嵌入式Linux与MiniGUI移植到VR4181.files/apache_pb.gif" width=259><BR>
      <SCRIPT language=javascript 
      src="嵌入式Linux与MiniGUI移植到VR4181.files/visit.js"></SCRIPT>
      </DIV></TD></TR></TBODY></TABLE></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -