📄 面向实时嵌入式系统的图形用户界面支持系统――minigui 编译、安装和配置 .htm
字号:
...... --enable-debug build with run-time debugging --enable-tracemsg trace messages of MiniGUI --disable-svgalib don't build the svgalib graphics engine --disable-libggi don't build the libggi graphics engine --enable-allegro build the allegro graphics engine --enable-microwin build the microwindows graphics engine --enable-ep7211 build the ep7211 graphics engine --enable-ads build the ads graphics engine --enable-gifjpg build old GIF & JPG image support --enable-fileid include fileid in binary --disable-rbfsupport exclude raw bitmap font support --disable-vbfsupport exclude var bitmap font support --disable-fontsansserif exclude incore font sansserif --disable-fontcourier exclude incore font courier --disable-fontsymbol exclude incore font symbol --disable-fontvgas exclude incore font vgas --disable-ttfsupport exclude truetype font support --disable-type1support exclude type1 font support --disable-gbsupport exclude GB2312-1980.0 charset (EUC) support --disable-big5support exclude Big5 charset (Big5) support --enable-jissupport include JIS charset support, not implemented --disable-pcxsupport exclude PCX file support --disable-lbmsupport exclude LBM/PBM file support --disable-tgasupport exclude TGA file support --disable-gifsupport exclude GIF file support --disable-jpgsupport exclude JPG file support --enable-pngsupport include PNG file support, not implemented</pre></td></tr></table><br />上面是这些参数我们在 configure 脚本中设置好的命令行参数,可以控制在编译好的 MiniGUI中包含什么的代码。比如,运行 <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>$ ./configure --disable-svgalib --disable-gifsupport --disable-ttfsupport</pre></td></tr></table><br /> 就可以取消 MiniGUI 对 SVGALib、GIF 图形格式以及 TrueType 字体的支持。相反,如果运行 <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>$ ./configure --enable-svgalib</pre></td></tr></table><br />则可以打开 MiniGUI 对 SVGALib 的支持。不带任何参数执行 ./configure 命令将按照默认选项生成 Makefile。 <br />根据自己的需求确定好 MiniGUI 库中要包含的功能特色之后,就可以运行类似上面的命令生成定制的 Makefile 文件。如果你不清楚某些选项的含义,可以简单地运行 ./configure 命令。 <br />如果运行 ./configure 命令的时候没有出现问题,就可以继续运行 make 和 make install 命令编译并安装 libminigui,注意要有 root 权限才能向系统中安装函数库: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>$ make$ su -c make install</pre></td></tr></table><br />如果在运行 ./configure 命令时出现函数库检查错误,通常是 LibGGI 或者 SVGALib 函数库的检查错误,则说明你可能忘记安装第 2 小节中提到的依赖函数库了。需要注意的是,LibGGI 和 SVGALib 中只需安装一个即可。 <br />在一切正常之后,运行 ldconfig 命令刷新系统的共享库搜索缓存: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>$ su -c ldconfig</pre></td></tr></table> 4.2 安装 miniguires <br />MiniGUI 资源的安装比较简单,只需解开软件包并以 root 身份运行 make 命令,如下所示: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>$ tar zxf miniguires-0.9.92.tar.gz$ cd miniguires-0.9.92$ su -c make</pre></td></tr></table> 4.3 编译并安装 miniguiapps <br />编译和安装 miniguiapps 的过程与 libminigui 类似,所需命令如下: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>$ cd miniguiapps-0.9.92$ tar zxf miniguiapps-0.9.92.tar.gz$ ./autogen.sh$ ./configure$ make$ su -c make install</pre></td></tr></table><br />在正确执行上述命令之后,进入 bomb 目录,即可运行 bomb 示例程序。如果在运行过程中出现错误,首先可运行 ldd bomb 命令检查 Linux 是否正确找到 bomb 程序所需要的共享库,若没有找到,则需要检查是否设置了正确的共享库搜索路径并运行了 ldconfig 命令。若出现其他问题,请参阅第 5 小节“MiniGUI 的配置”。 4.4 编译 miniguiexec <br />编译 miniguiexec 的过程与 libminigui 类似,只是这个软件包不需要安装到系统当中。所需命令如下: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>$ tar zxf miniguiexec-0.9.92.tar.gz$ cd miniguiexec-0.9.92$ ./autogen.sh$ ./configure$ make</pre></td></tr></table><br /> 在正确编译结束之后,可进入 demos 目录运行其中的演示程序,比如 dlgtesst、edittest、fontest 等等。 <br /> 如果在运行过程中出现错误,首先可运行 ldd命令检查 Linux 是否正确找到演示程序所需要的共享库,若没有找到,则需要检查是否设置了正确的共享库搜索路径并运行了 ldconfig 命令。若出现其他问题,请参阅第 5 小节“MiniGUI 的配置”。 <a name="5"><p><strong class="subhead">5 MiniGUI 的配置</strong><br />不能正确运行 MiniGUI 应用程序的原因除编译和安装错误之外,还有另外一个常见原因是配置。其中的配置又与 MiniGUI 的底层图形引擎库相关。如果你使用 SVGALib 为图形引擎,则需要编辑 /etc/vga/libvga.config 文件;如果你使用 LibGGI 为图形引擎并在 Linux 控制台上运行 MiniGUI,则需要确保 Linux 内核中包含了 FrameBuffer 驱动程序。 </p> 5.1 与 SVGALib 相关的设置 <br />SVGALib 的相关配置保存在 /etc/vga/libvga.conf 文件中。你需要检查该文件,并正确设置如下参数: <ol><li>鼠标类型。需要制定正确的鼠标类型,SVGALib 默认的鼠标类型为 Microsoft,如果你的鼠标为 PS/2,则需要将 mouse 设置为 PS2。 </li><li>取消 SVGALib 的鼠标加速选项。将 mouse_accel_type 设置为 off。 </li><li>鼠标端口。将 mdev 设置为正确的鼠标设备。比如对 PS/2 鼠标来讲,需要将 mdev 设置为 /dev/psaux。 </li><li>设置正确的显示芯片。 /etc/vga/libvga.conf 中的 chipset 指定了显示芯片类型和型号,如果你的显示芯片没有列在其中,则可以试试将 chipset 设置为 VESA。VESA 指 VESA 兼容的显示芯片,SVGALib 将通过 VESA BIOS 接口操作显示卡。因为大多数显示卡都是 VESA BIOS 2.0 兼容的,所以将 chipset 设置为 VESA 可以得到较好的颜色深度和分辨率。 </li></ol><br />在将上述程序设置好之后,在试着运行 MiniGUI,如果还有问题,请发信到我们的邮件列表 minigui-devel@egroups.com 上说明你遇到的问题。 5.2 如何设置 FrameBuffer <br />如果使用 LibGGI 作为 MiniGUI 的图形引擎,并且运行在 Linux 控制台上的话,则首先需要 Linux 内核中包含有 FrameBuffer 的驱动程序。许多发行版安装之后就默认运行在 FrameBuffer 的支持下,即图形模式之下,比如 BluePoint Linux 和 TurboLinux 6.x。但有可能 FrameBuffer 的显示模式并不适合于运行 MiniGUI。为此,你可以使用 fbset 命令修改显示模式。但是,某些 FrameBuffer 是不支持显示模式的修改的,比如 VESA FrameBuffer。如果你使用 VESA FrameBuffer,则可以通过编辑 Linux 的内核引导参数设置正确的显示模式。对 VESA FrameBuffer 驱动程序,可以如下编辑 /etc/lilo.conf 文件: <br />MiniGUI 资源的安装比较简单,只需解开软件包并以 root 身份运行 make 命令,如下所示: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>boot=/dev/hdamap=/boot/mapinstall=/boot/boot.bprompttimeout=10default=linuximage=/boot/vmlinuz-2.2.14-5.0 label=linux read-only vga=0x0317 root=/dev/hda1</pre></td></tr></table><br /> 注意添加了 vga=0x0317 一行。该行右边以十六进制表示的数字是 VESA 的显示模式编号,下表给出了可用的 VESA 模式号: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre> Colours 640x400 640x480 800x600 1024x768 1280x1024 1600x1200 --------+----------------------------------------------------- 4 bits | ? ? 0x302 ? ? ? 8 bits | 0x300 0x301 0x303 0x305 0x307 0x31C 15 bits | ? 0x310 0x313 0x316 0x319 0x31D 16 bits | ? 0x311 0x314 0x317 0x31A 0x31E 24 bits | ? 0x312 0x315 0x318 0x31B 0x31F 32 bits | ? ? ? ? ? ?</pre></td></tr></table><br />你应该根据自己的显示卡和显示器确定应该使用哪种显示模式。 <br />在设置了正确的 /etc/lilo.conf 之后,运行 lilo 并重新启动计算机。如果一切正常,则 Linux 引导时,会在屏幕的左上方显示一个可爱的小企鹅。 <br />其他关于 Linux FrameBuffer 的信息,可参阅 Framebuffer-HOWTO 文档。 5.3 /etc/MiniGUI.cfg <br />/etc/MiniGUI.cfg 是 MiniGUI 的配置文件,在默认安装的情况下,基本不需要进行修改。因为该配置文件采用了非常简介的格式,所以修改起来也很容易。其格式如下: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>[section-name1]key-name1=key-value1key-name2=key-value2[section-name2]key-name3=key-value3key-name4=key-value4</pre></td></tr></table><br />该配置文件中的参数以 section 分组,然后用 key=value 的形式指定参数及其值。下面介绍一些重要的段(section)。 5.3.1 system <br />system 段中指定了 MiniGUI 要使用的图形引擎以及鼠标设备和类型,分别由 engine、mdev 和 mtype 键指定。因为 MiniGUI 库中可以同时包含多个图形引擎,通过 engine 可以指定要使用哪个图形引擎。mdev 和 mtype 分别用来指定鼠标设备和鼠标类型。 5.3.2 SVGALib 和 LibGGI <br />这两个段分别用来设置与 SVGALib 和 LibGGI 相关的配置。目前只有 SVGALib 段中使用 defaultmode 定义 SVGALib 所使用的图形模式,LibGGI 段中没有参数。 5.3.2 systemfont <br />systemfont 段定义了 MiniGUI 的系统字体,默认情况下不应作改动。font_number 指定了要装载的系统字体个数,然后用 name 和 fontfile 分别表示编号为 nr 的字体名称和字体文件所在路径。字体名的格式如下: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre><type>-<name>-<style>-<width>-<height>-<charset1[,charset2]></pre></td></tr></table><br />对于系统字体,你可以修改要装载的个数,但至少要装载字符集为 ISO8859-1 的字体。还可以修改系统字体的大小,比如,下面的 systemfont 就指定 MiniGUI使用 16 点阵的系统字体,并只装载了用于显示 ISO8859-1 字符集和 GB2312-80 字符集的字体: <table border="0" cellpadding="0" class="code-sample" width="100%"><tr><td><pre>[systemfont]font_number=2name0=rbf-song-rrncnn-8-16-ISO8859-1fontfile0=/usr/local/lib/minigui/fonts/8x16.binname1=rbf-song-rrncnn-16-16-GB2312.1980-0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -