ºìÁªLinuxÃÅ»§
Linux°ïÖú

Qt£­embededµÄ°²×°

·¢²¼Ê±¼ä:2006-11-01 01:20:47À´Ô´:ºìÁª×÷Õß:coolentboy
1£®Qt£­embeded¼ò½é

Ëæ×ÅǶÈëʽLinuxÓ¦ÓõIJ»¶Ï·¢Õ¹£¬Ç¶Èëʽ´¦ÀíÆ÷ÔËËãÄÜÁ¦µÄ²»¶ÏÔöÇ¿£¬Ô½À´Ô½¶àµÄǶÈëʽÉ豸¿ªÊ¼²ÉÓýÏΪ¸´ÔÓµÄGUIϵͳ£¬ÊÖ³ÖÉ豸ÖеÄGUIϵͳ·¢Õ¹µÃ·Ç³£Ñ¸ËÙ¡£´«Í³µÄGUIϵͳ£¬ÈçMicrowindowsµÈ£¬ÓÉÓÚÏîÄ¿¹æÄ£½ÏС¡¢¹¦ÄܽÏΪ±¡Èõ£¬È±·¦µÈÈý·½Èí¼þ¿ª·¢µÄÖ§³ÖµÈÖî¶àÔ­Òò£¬ÔڱȽϸ߼¶µÄÊÖ³Ö»òÒƶ¯ÖÕ¶ËÉ豸£¨ÈçPDA¡¢Smart-Phone¡¢³µÔص¼º½ÏµÍ³£©ÖÐÓ¦ÓýÏÉÙ¡£

Qt/EmbeddedÊÇÖøÃûµÄQt¿â¿ª·¢ÉÌTrolltech¹«Ë¾¿ª·¢µÄÃæÏòǶÈëʽϵͳµÄQt°æ±¾£¬¿ª·¢ÈËÔ±¶àΪKDEÏîÄ¿µÄºËÐÄ¿ª·¢ÈËÔ±¡£Ðí¶à»ùÓÚQtµÄX Window³ÌÐò¿ÉÒԷdz£·½±ãµØÒÆÖ²µ½Qt/EmbeddedÉÏ£¬ÓëX11°æ±¾µÄQtÔÚ×î´ó³Ì¶ÈÉϽӿڼæÈÝ£¬ÑÓÐøÁËÔÚXÉϵÄÇ¿´ó¹¦ÄÜ£¬Ôڵײ㳹µ×ÞðÆúÁËX lib£¬½ö²ÉÓÃframebuffer×÷Ϊµ×²ãͼÐνӿڡ£Qt/EmbeddedÀà¿âÍêÈ«²ÉÓÃC++·â×°¡£·á¸»µÄ¿Ø¼þ×ÊÔ´ºÍ½ÏºÃµÄ¿ÉÒÆÖ²ÐÔÊÇQt/Embedded×îΪÓÅÐãµÄÒ»·½Ã棬ʹÓÃXϵĿª·¢¹¤¾ßQt Designer¿ÉÒÔÖ±½Ó¿ª·¢»ùÓÚQt/EmbeddedµÄUI£¨Óû§²Ù×÷½Ó¿Ú£©½çÃæ¡£Ô½À´Ô½¶àµÄµÚÈý·½Èí¼þ¹«Ë¾Ò²¿ªÊ¼²ÉÓÃQt/Embedded¿ª·¢Ç¶ÈëʽLinuxϵÄÓ¦ÓÃÈí¼þ¡£ÆäÖзdz£ÖøÃûµÄQt Palmtop Environment£¨Qtopia£©ÔçÆÚÊÇÒ»¸öµÚÈý·½µÄ¿ªÔ´ÏîÄ¿£¬²¢ÒѾ­³É¹¦Ó¦ÓÃÓÚ¶à¿î¸ßµµPDA¡£Trolltech¹«Ë¾Õë¶ÔSmart-PhoneÖеÄÓ¦ÓÃÐèÇó£¬ÓÚ2004Äê5Ôµ׷¢²¼ÁËQtopiaµÄPhone°æ±¾¡£

Qt/EmbeddedµÄʵÏÖ¼¼Êõ»ù´¡·ÖÎöºáÏòÀ´¿´£¬ÓÉÓÚ·¢²¼µÄ°æȨÎÊÌ⣬Qt/Embedded²ÉÓÃÁ½ÖÖ·½Ê½½øÐз¢²¼£ºÔÚGPLЭÒéÏ·¢²¼µÄfree°æÓëרÃÅÕë¶ÔÉÌÒµÓ¦ÓõÄcommercial°æ±¾¡£¶þÕß³ýÁË·¢²¼·½Ê½Í⣬ÔÚÔ´ÂëÉÏûÓÐÈκÎÇø±ð¡£×ÝÏò¿´À´£¬µ±Ç°Ö÷Á÷µÄ°æ±¾ÎªQtopiaµÄ2.xϵÁÐÓë×îеÄ3.0xϵÁС£ÆäÖÐ2.0°æ±¾ÏµÍ³½Ï¶àµØÓ¦ÓÃÓÚ²ÉÓÃQtopia×÷Ϊ¸ßµµPDAÖ÷½çÃæµÄÓ¦ÓÃÖУ»3.x°æ±¾ÏµÁÐÔòÓ¦ÓÃÓÚ¹¦ÄÜÏà¶Ôµ¥Ò»£¬µ«ÐèÒª¸ß¼¶GUIͼÐÎÖ§³ÖµÄ³¡ºÏ£¬ÈçVolvo¹«Ë¾µÄÔ¶³Ì¹«½»ÐÅϢϵͳ¡£Í¼1ΪQt/EmbeddedµÄʵÏֽṹ¡£

3.x°æ±¾ÏµÁеÄQt/EmbeddedÏà¶ÔÓÚ2.x°æ±¾ÏµÍ³Ôö¼ÓÁËÐí¶àеÄÄ£¿é£¬ÈçSQLÊý¾Ý¿â²éѯģ¿éµÈ¡£¼¸ºõËùÓÐ2.x°æ±¾ÖÐÔ­ÓеÄÀà¿â£¬ÔÚ3.x°æ±¾Öж¼µÃµ½¼«´ó³Ì¶ÈµÄÔöÇ¿¡£Õâ¾Í¼«´óµØËõ¶ÌÁËÓ¦ÓÃÈí¼þµÄ¿ª·¢Ê±¼ä£¬À©´óÁËQt/EmbeddedµÄÓ¦Ó÷¶Î§

ÔÚ´úÂëÉè¼ÆÉÏ£¬Qt/EmbeddedÇÉÃîµØÀûÓÃÁËC++¶ÀÓеĻúÖÆ£¬Èç¼Ì³Ð¡¢¶à̬¡¢Ä£°åµÈ£¬¾ßÌåʵÏַdz£Áé»î¡£µ«Æäµ×²ã´úÂëÓÉÓÚ×·ÇóÓë¶àÖÖϵͳ¡¢¶àÖÖÓ²¼þµÄ¼æÈÝ£¬´úÂë²¹¶¡½Ï¶à£¬·ç¸ñÉÔÏÔ»ìÂÒ¡£

2£®ÅäÖÃframebuffer

£¨1£©ÅäÖÃkernel£º

Ö´ÐÐ make mrproper

make menuconfig

È»ºó°´ÕÕ¡°ÁõÃ÷¡±ÌṩµÄÏÂÁÐÑ¡Ïî½øÐÐenabling framebuffer support:

Code maturity level options --->
? Prompt for development and/or incomplete code/drivers (CONFIG_EXPERIMENTAL=Y)
Console drivers --->
? VGA text console (CONFIG_VGA_CONSOLE=Y)
? Video mode selection support (CONFIG_VIDEO_SELECT=Y)
o Frame-buffer support --->
o Support for frame buffer devices (EXPERIMENTAL) (CONFIG_FB=Y)
¡ì VESA VGA graphics console (CONFIG_FB_VESA)
¡ì Advanced low level driver options (CONFIG_FBCON_ADVANCED=Y)
¡ì Monochrome support (CONFIG_FBCON_MFB=Y)
¡ì 2 bpp packed pixels support (CONFIG_FBCON_CFB2=Y)
¡ì 4 bpp packed pixels support (CONFIG_FBCON_CFB4=Y)
¡ì 8 bpp packed pixels support (CONFIG_FBCON_CFB8=Y)
¡ì 16 bpp packed pixels support (CONFIG_FBCON_CFB16=Y)
¡ì 24 bpp packed pixels support (CONFIG_FBCON_CFB24=Y)
¡ì 32 bpp packed pixels support (CONFIG_FBCON_CFB32=Y)

ÅäÖýáÊø£¬±£´æÍ˳ö£¬ÒÀ´ÎÖ´ÐÐ

make dep

make bzImage£¨×¢Òâ²»ÄÜÖ´ÐÐmake zImage£¬ÒòΪÆäÖ»ÊÊÓÃÓÚÄÚºËСÓÚ1MµÄÇé¿ö£©¡£

£¨2£©ÐÞ¸Ägrub.conf

ÔÚÄãËù±àÒëÄں˵ÄÏîĿϵÄÒÔkernel¿ªÍ·µÄÒ»ÐеÄ×îºó¼ÓÉÏ VGA=791 £¨Èç¹ûÄãµÄ·Ö±æÂÊΪ1024¡Á768£©£¬that is OK¡£È»ºóÖØÐÂÆô¶¯µçÄÔ£¬ÔÚÆô¶¯×ÀÃæµÄ×óÉϽdzöÏÖÒ»Ö»Æó¶ì£¬framebufer°²×°³É¹¦

ͨ¹ýfbsetÃüÁî¼ì²éframebuffer£º

££fbset

mode¡°1024¡Á768£­76¡±

D£º78.653MHz£¬ H£º59.949KHz£¬ V£º75.694Hz

Geometry 1024 768 1024 768 16

Timings 12714 128 32 16 4 128 4

Rgba 5/11 6/5 5/0 0/0

Endmode

3.qt-embededµÄ°²×°



ͨ¹ý²éѯÎĵµ·¢ÏÖÔÚX windowsÏÂͨ¹ýqmakeÃüÁî¾Í¿ÉÒÔÉú³ÉMakefileÎļþ£¬µ«ÊÇÔÚǶÈëʽÏÂÃæÐèҪʹÓÃtmakeÃüÁî²ÅÄÜÉú³ÉMakefileÃüÁî £¬ËùÒÔÏÂÔØÁËtmake1.11(Éú³ÉQt/EmbededÓ¦Óù¤³ÌµÄMakefileÎļþ)¡£²¢ÇÒÕâ´Î²Î¿¼ÁË¡¶Qt/Embeded¿ª·¢»·¾³½¨Á¢¹ý³Ì¡·Ò»ÎÄ¡£

ÒÔrootÉí·Ý½øÐа²×°¡£

cd /root

tar xfz tmake-1.11.tar.gz

Éú³Étmake-1.11Îļþ¼Ð£¬È»ºóÕÕ¡¶Qt/Embeded¿ª·¢»·¾³½¨Á¢¹ý³Ì¡·½øÐÐÅäÖá£

export TMAKEDIR=$PWD/tmake-1.11
export TMAKEPATH=$TMAKEDIR/lib/qws/linux-x86-g++
export PATH=$TMAKEDIR/bin:$PATH

×¢Ïúroot£¬ÖØÐÂÒÔrootµÇ½ִÐÐ

·¢ÏÖϵͳ¾ÓȻûÓÐtmakeÃüÁ¿´À´exportÃüÁîÖ»ÊÇÔÝʱÓÐЧ£¬ËùÒÔÔÚ/rootϵÄ.bash_profileÏÂÉèÖ÷¾¶½«ÃüÁîÐÞ¸ÄÈçÏ£º

TMAKEDIR=$HOME/tmake-1.11
TMAKEPATH=$TMAKEDIR/lib/qws/linux-x86-g++

PATH=$TMAKEDIR/bin:$PATH

export TMAKEDIR TMAKEPATH PATH

Ö´ÐÐ

££tmake

Usage:

tmake [option] project -files

options:

-e expr Evaluate expression,ignore template file

-nodepend Don¡¯t generate dependency information

-o file Write output to file

-t file Specify a template file

-unix Creat output for Unix (auto detects)

-v Verbose / debug mode

-win32 Create output for Win32 (auto detects)

tmake°²×°³É¹¦¡£

Æä´ÎÔÚ/rootÏ°²×°Qt/Embedded 2.3.7£¬Ö´ÐÐ

tar xfz qt-embedded-2.3.7.tar.gz
cd qt-2.3.7£¬
ÔÚrootϵÄ.bash_profileÏÂÉèÖ÷¾¶£¬´úÂëÈçÏ£º

QTDIR=$HOME
QTEDIR=$QTDIR
PATH=$QTDIR/bin:$PATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

export QTDIR QTEDIR LD_LIBRARY_PATH
./configure -qconfig -qvfb -depths 4,8,16,32
make sub-src
cd ..

ÉÏÊöÃüÁî ./configure -qconfig -qvfb -depths 4,8,16,32 Ö¸¶¨Qt ǶÈëʽ¿ª·¢°üÉú³ÉÐéÄ⻺³åÖ¡¹¤¾ßqvfb£¬²¢Ö§³Ö4£¬8£¬16£¬32 λµÄÏÔʾÑÕÉ«Éî¶È¡£ÁíÍâÎÒÃÇÒ²¿ÉÒÔÔÚconfigure µÄ²ÎÊýÖÐÌí¼Ó£­system£­jpeg ºÍgif£¬Ê¹Qt/Embedded ƽ̨ÄÜÖ§³Öjpeg¡¢gif¸ñʽµÄͼÐΡ£ÉÏÊöÃüÁî make sub-src Ö¸¶¨°´¾«¼ò·½Ê½±àÒ뿪·¢°ü£¬Ò²¾ÍÊÇ˵ÓÐЩQt Ààδ±»±àÒë¡£Qt ǶÈëʽ¿ª·¢°üÓÐ5 ÖÖ±àÒ뷶ΧµÄÑ¡ÏʹÓÃÕâЩѡÏ¿É¿ØÖÆQt Éú³ÉµÄ¿âÎļþµÄ´óС£¬µ«ÊÇÄúµÄÓ¦ÓÃËùʹÓõ½µÄһЩQt Àཫ¿ÉÄÜÒò´ËÔÚQt µÄ¿âÖÐÕÒ²»µ½Á´½Ó¡£±àÒëÑ¡ÏîµÄ¾ßÌåÓ÷¨¿ÉÔËÐÐ./configure £­help ÃüÁî²é¿´¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1904 ÌõÆÀÂÛ

  1. 190.38.156.* ÓÚ 2007-05-16 03:20:13·¢±í:

    http://e20dc5678643ef90c9271f8fad3743d0-t.qwoypw.info e20dc5678643ef90c9271f8fad3743d0 http://e20dc5678643ef90c9271f8fad3743d0-b1.qwoypw.info e20dc5678643ef90c9271f8fad3743d0 http://e20dc5678643ef90c9271f8fad3743d0-b3.qwoypw.info b43a48a848da56275457e93295654b68