在VxWorks的target上架設WIND Web Server (轉)

worldblog發表於2007-12-10
在VxWorks的target上架設WIND Web Server (轉)[@more@]

如何在Target上架設WIND Server?:namespace prefix = o ns = "urn:schemas--com::office" />

1.  WIND Web Server 給我們帶來的好處

將帶有WIND Web Server的VxWorks核心載入到嵌入裝置中後,我們就可以讓任何一臺了標準Web的機器作為該嵌入裝置的控制維護終端。

 

對WIND Web Server並不是必需的,我們可以在嵌入裝置中建立映象檔案靜態網頁,WIND Web Server 也支援Server S Includes.

2.  步驟

1.  建立必須的HTML檔案;

2.  設定c:tornado2hostx86-bin為系統路徑,重新啟動。控制皮膚->系統->高階->環境變數,在變數的path和系統變數的Path的值的後面新增“;c:tornado2hostx86-win32bin”;

3.  執行命令pagepack -r -s www -d / -o httpMemFs轉換HTML檔案為C檔案;

說明:

-r  轉換 –s所指定的HTML檔案目錄的子目錄;

-s  指定將要轉換的HTML檔案目錄;

-d  指定Target上的記憶體檔案系統的根目錄;

-o  指定目標檔案的檔名;

成功後,將生成兩個檔案:一個C檔案,一個H檔案。

4.  WIND Web Server;

在目錄C:tornado2targetsrchttpconfig下修改httpconf.c,httpconf.h檔案。

a)  在httpconf.h檔案中註釋掉/*#define INCLUDE_HTTP_LOG*/

b)  加入 #include "httpMemFs.h". httpMemFs.h為第3步生成的標頭檔案;

c)  修改httpd。httpMemFsInit_在httpMemFs.h申明,在httpMemFs.c中定義;

HTTP_STATUS httpd (void)

  { 

  if (httpInit() != HTTP_OK)

  return HTTP_ERROR;

  /*

  * Configure directory accesses to pick up "index.htm".

  */

  httpAlianfAdd ("*/", "*/index.htm");

 

  /*

  * Configure the pagepacked content files (the HTML, images, ,

  * etc.) into the memory filesystem.

  */

  httpMemFsInit_();

 

  /* Enable filesystem RPM to access pages from some filesystem */

  httpFsConfInit (HTTP_FS_CONF_MAX);

 

  httpRpmConfAdd (HTTP_M_GET, "/", httpRpmFs);

  httpFsConfAdd  (  "/",  "/");

  /* end of user definable initialization area */

  return (httpServerL ());

}

 

5.  編譯連線生成httpconf.o,httpglob.o,httpmemfs.o目標檔案;

a)  將httpMemFs.c和httpMemFs.h複製到C:tornado2targetsrchttpconfig目錄下;

b)  在C:tornado2targetsrchttpconfig目錄下執行make =PENTIUM WIND_BASE=c:tornado2 WIND_HOST_TYPE=x86-win32;

6.  編譯VxWorks核心;

a)  VxWorks核心中加入HTTP Server;

ectratio="t" v:ext="edit">

b)  修改編譯設定;

c)  編譯

 

7.  加入新的VxWorks核心到Target上。

 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-991115/,如需轉載,請註明出處,否則將追究法律責任。

相關文章