Linux Platform Device and Driver
´ÓLinux 2.6ÆðÒýÈëÁËÒ»Ì×еÄÇý¶¯¹ÜÀíºÍ×¢²á»úÖÆ:Platform_deviceºÍPlatform_driver¡£
LinuxÖд󲿷ֵÄÉ豸Çý¶¯£¬¶¼¿ÉÒÔʹÓÃÕâÌ×»úÖÆ, É豸ÓÃPlatform_device±íʾ£¬Çý¶¯ÓÃPlatform_driver½øÐÐ×¢²á¡£
Linux platform driver»úÖƺʹ«Í³µÄdevice driver »úÖÆ(ͨ¹ýdriver_registerº¯Êý½øÐÐ×¢²á)Ïà±È£¬Ò»¸öÊ®·ÖÃ÷ÏÔµÄÓÅÊÆÔÚÓÚplatform»úÖƽ«É豸±¾ÉíµÄ×ÊÔ´×¢²á½øÄںˣ¬ÓÉÄÚºËͳһ¹ÜÀí£¬ÔÚÇý¶¯³ÌÐòÖÐʹÓÃÕâЩ×ÊԴʱͨ¹ýplatform deviceÌṩµÄ±ê×¼½Ó¿Ú½øÐÐÉêÇ벢ʹÓá£ÕâÑùÌá¸ßÁËÇý¶¯ºÍ×ÊÔ´¹ÜÀíµÄ¶ÀÁ¢ÐÔ£¬²¢ÇÒÓµÓнϺõĿÉÒÆÖ²ÐԺͰ²È«ÐÔ(ÕâЩ±ê×¼½Ó¿ÚÊÇ°²È«µÄ)¡£
Platform»úÖƵı¾ÉíʹÓò¢²»¸´ÔÓ£¬ÓÉÁ½²¿·Ö×é³É£ºplatform_deviceºÍplatfrom_driver¡£
ͨ¹ýPlatform»úÖÆ¿ª·¢·¢µ×²ãÇý¶¯µÄ´óÖÂÁ÷³ÌΪ: ¶¨Òå platform_device à ×¢²á platform_device ඨÒå platform_driver à×¢²á platform_driver¡£
Ê×ÏÈҪȷÈϵľÍÊÇÉ豸µÄ×ÊÔ´ÐÅÏ¢£¬ÀýÈçÉ豸µÄµØÖ·£¬ÖжϺŵȡ£
ÔÚ2.6ÄÚºËÖÐplatformÉ豸ÓýṹÌåplatform_deviceÀ´ÃèÊö£¬¸Ã½á¹¹Ì嶨ÒåÔÚkernel\include\linux\platform_device.hÖУ¬
struct platform_device {
const char * name;
u32 id;
struct device dev;
u32 num_resources;
struct resource * resource;
};
¸Ã½á¹¹Ò»¸öÖØÒªµÄÔªËØÊÇresource£¬¸ÃÔªËØ´æÈëÁË×îΪÖØÒªµÄÉ豸×ÊÔ´ÐÅÏ¢£¬¶¨ÒåÔÚkernel\include\linux\ioport.hÖУ¬
struct resource {
const char *name;
unsigned long start, end;
unsigned long flags;
struct resource *parent, *sibling, *child;
};
ÏÂÃæ¾Ùs3c2410ƽ̨µÄi2cÇý¶¯×÷ΪÀý×ÓÀ´ËµÃ÷£º
/* arch/arm/mach-s3c2410/devs.c */
/* I2C */
static struct resource s3c_i2c_resource[] = {
[0] = {
.start = S3C24XX_PA_IIC,
.end = S3C24XX_P
Ïà¹ØÎĵµ£º
ÒòΪѧϰÐèÒª£¬×î½üÓÃÉÏÁËubuntu 9.10.¿ÉÊÇÈ´·¢ÏÖqq for linux×ÜÊÇĪÃûÆäÃîµÄ×Ô¼ºÍ˳ö¡£½ñÌìÈÌÊܲ»ÁËÁË£¬ÉÏÍøÕҴ𰸡£ÔÀ´²»ÊÇÎÒÈËÆ·µÄÎÊÌâ¡£×îÖÕ´ÓÏÂÃæÕâÎÄÕÂÖÐÕÒµ½Á˽â¾ö·½·¨¡£
ÔÎÄÈçÏ£º
QQ¹Ù·½ÌṩµÄQQ For LinuxÔÚUbuntu
9.10Ï°²×°Ö®ºó£¬¾³£³öÏÖûÁļ¸¾äÌì¾Í»á×Ô¶¯Í˳öµÄbug£¬ÔÒòÊÇQQ For LinuxÓëUbunt ......
ÅäÖÃÎļþ
/etc/syslog.conf
³£Óõļ¸¸ölogÎļþ
1¡¢/var/log/boot.log£¨×Ô¼ì¹ý³Ì£©
2¡¢/var/log/cron £¨crontabÊØ»¤½ø³Ì£©
3¡¢/var/log/maillog £¨·¢Ë͵½ÏµÍ³»ò´Óϵͳ·¢³öµÄµç×ÓÓʼþµÄ»î¶¯£©
4¡¢/var/log/syslog £¨ËüÖ»¼Ç¼¾¯¸æÐÅÏ¢£¬³£³£ÊÇϵͳ³öÎÊÌâµÄÐÅÏ¢£¬ËùÒÔ¸üÓ¦¸Ã¹Ø×¢¸ÃÎļþ£©
5¡¢/va ......
KDevelopÊÇÒ»¸öÖ§³Ö¶à³ÌÐòÉè¼ÆÓïÑԵļ¯³É¿ª·¢»·¾³¡£ËüÔËÐÐÓÚLinuxºÍÆäËüÀàunix»·¾³¡£
¡¡¡¡KDevelop±¾Éí²»°üº¬±àÒëÆ÷£¬¶øÊǵ÷ÓÃÆäËü±àÒëÆ÷À´±àÒë³ÌÐò¡£
¡¡¡¡1.´ò¿ªÐÂÁ¢µÃÈí¼þ°ü¹ÜÀíÆ÷
¡¡¡¡2.²éÕÒKDevelop£¬ÔÚ½á¹ûÖе±È»Êǹ´Ñ¡KDevelop£¬»¹ÓÐKDevelopϵÁÐÀïÃæÄǸö´ø"-dev"ºó׺µÄ°ü£¬µ±È»Äã¿ÉÒÔ²»¹´
¡¡¡¡3.×°ºÃÇ°ÃæµÄ°üºó° ......
½ñÌìѧϰÁËwrite ºÍread ,»¹ÓÐopen º¯Êý¡£×îÏÂÃæÊÇÎÒ×Ô¼ºÐ´µÄÒ»¸öС³ÌÐò£¬ÊìϤһϼ¸¸ö³ÌÐòµÄÓ¦Óá£
writeº¯ÊýÔÐÍÊÇsize_t write(fd, buf, size);ÆäÖÐfdÊÇÎļþÃèÊö·û£¬Ò²ÊÇ»º³åÇøÖеĶ«Î÷½«ÒªÐ´ÈëµÄµØ·½£¬°×»°Ò»µãÀ´Ëµ£¬fd¾ÍÊÇÒ»¸öÄ㽫Ҫ·Å¶«Î÷½øÈ¥µÄÈÝÆ÷µÄ±àºÅ¡£buf ¾ÍÊÇÄãËùÒª´æµÄ¶«Î÷µÄÀ´Ô´¡£size ²»ÓÃ˵£ ......
QtÊÇÒ»¸ö¿çƽ̨µÄC++ͼÐÎÓû§½çÃæ¿â,.ÓÉŲÍþTrollTech¹«Ë¾³öÆ·£¬Ä¿Ç°°üÀ¨Qt/X11£¬»ùÓÚFrambufferµÄQt Embedded,¿ìËÙ¿ª·¢¹¤¾ßQt Designer¼¸¹ú¼Ê»¯¹¤¾ßQt LinguistµÈ£®QtÖ§³ÖUnix¼°Linuxϵͳ,»¹Ö§³ÖWindows NT/Windows 2k¼°Qindows 95/98ƽ̨.QtµÄÁ¼ºÃ·â×°»úÖÆʹÆäÄ£¿é»¯³Ì¶È·Ç³£¸ß,¿ÉÖØÓÃÐÔ ......