2009年2月9日 星期一

minigui

安裝 qvfb 在 qt3-dev-tools-embedded 這個套件中就有 qvfb 程式:
$apt-get install qt3-dev-tools-embedded
安裝libjpeg-dev 資料庫 
$sudo apt-get install libjpeg-dev
 ------->>
執行 qvfb 必須調整設定
   640*480-32bpp display mode. 
範例程式必須在640*480以上模式才能正常顯示!!
Installing resource files of MiniGUI
    必須按照下列步驟安裝:
        1) Use `tar' to extract minigui-res-1.6.x.tar.gz. You can use
           the following command:
           $ tar zxf minigui-res-1.6.x.tar.gz
        2) Change to new directory and run `make' as a super user:
           $ sudo make install

Configure and compile MiniGUI
    MiniGUI uses `automake' and `autoconf', so configuration and compilation
    of MiniGUI are very easy:
        1) Use `tar' to extract `libminigui-1.6.x.tar.gz' to a new directory:
           $ tar zxf libminigui-1.6.x.tar.gz
        2) Change to the new directory and run `./configure':
           $ ./configure
        3) Run the following commands to compile and install MiniGUI:
           $ make;sudo make install;
        4) By default, libraries of MiniGUI will be installed in
           `/usr/local/lib'. You should make sure that this directory
           is listed in `/etc/ld.so.conf' file. And after having installed
           them, you should run the following command to update the cache
           of shared library system:
           $ sudo ldconfig
        5) If you want to specify which features MiniGUI provides, you
           can run
           $ ./configure --help
           to see the complete configuration options listed, then disable or
           enable some features by using command line switches. For example,
           if you do not want MiniGUI to load JPEG pictures via the function
           LoadBitmap, you can use
           $ ./configure --disable-jpgsupport
      
 執行範例程式
 $ tar zxvf mde-1.6.10.tar.gz
 $ cd mde-1.6.10
 $ ./configure
 $ make
 $ cd same
 $ ./same
----->> 底下是範例 mgis
  1. Unpack proj-4.4.7.tar.gz
    • ./configure
    • make
    • sudo make install
  2. Unpack gdal-1.2.6.tar.gz
    • ./configure --withou-pg --without-python --without-jasper --without-odbc
    • make
    • sudo make install
  3. Unpack mgis-1.0.tar.gz
    • ./configure
    • make

所須要的程式都在這個網址http://www.minigui.org/downloads/

2009年2月6日 星期五

VIVI Bootloader 如何新增指令?

 STEP1.




先來設定一下工作目錄所在位置, 在這裡我的 Bootloader 資料放在  /home/dclab/bootLoader/vivi  ,所以後面就用 $VIVI表示




# export VIVI=/home/dclab/bootLoader/vivi




 STEP2.




首先我們新增一個檔案 led.c  , 這個檔案內容負責宣告新增指令用!




# vim $VIVI/lib/led.c







[檔案]  $vivi/lib/led.c:




#include <config.h>
#include <command.h>
#include <types.h>
#include "printk.h"

void command_led(int argc, const char **argv){
    printk("show led....\n");               //    當執行指令後, 螢幕顯示出來的資訊內容!
}   

user_command_t led_cmd = {                                //    宣告一個指令結構
    "led",                                                               //     命令的名稱   
    command_led,                                                  //     實現該命令的具體函數
    NULL,                                                              //     指向下一條命令的指
    "help led [{cmds}]\t\t\t -- Led show program"    //     命令的使用說明
};







[參閱]  $vivi/include/command.h:




typedef struct user_command {
const char *name;
void (*cmdfunc)(int argc, const char **);
struct user_command *next_cmd;
const char *helpstr;
} user_command_t;













 STEP3.



[檔案]  修改 $vivi/lib/command.c 檔案, 尋找 int init_builtin_cmds(void)  處, 新增以下內容:





+ :351    extern user_command_t led_cmd;  // 新增於 int init_builtin_cmds(void) 上方

+ :398    add_command(&led_cmd);             // 新增於 int init_builtin_cmds(void)








[檔案]  修改 $vivi/lib/Makefile 檔案, 新增以下內容





+ :10   obj-y += led.o








 STEP4.




接著就可以編譯 vivi 看看




# make clean
# make








開發版上測試指令, 輸入上方宣告的指令  " led "




# led




























參考資料:
http://blog.csdn.net/hansir007/archive/2007/08/29/1764077.aspx




http://www.cublog.cn/u/21948/showart.php?id=379460