Linux×Ö·ûÉ豸Çý¶¯³ÌÐò¿ª·¢
LinuxϵÄÉ豸Çý¶¯³ÌÐò±»×é֯Ϊһ×éÍê³É²»Í¬ÈÎÎñµÄº¯ÊýµÄ¼¯ºÏ£¬Í¨¹ýÕâЩº¯ÊýʹµÃWindowsµÄÉ豸²Ù×÷ÓÌÈçÎļþÒ»°ã¡£ÔÚÓ¦ÓóÌÐò¿´À´£¬Ó²¼þÉ豸ֻÊÇÒ»¸öÉ豸Îļþ£¬Ó¦ÓóÌÐò¿ÉÒÔÏó²Ù×÷ÆÕͨÎļþÒ»Ñù¶ÔÓ²¼þÉ豸½øÐвÙ×÷£¬Èçopen ()¡¢close ()¡¢read ()¡¢write () µÈ¡£
LinuxÖ÷Òª½«É豸·ÖΪ¶þÀࣺ×Ö·ûÉ豸ºÍ¿éÉ豸¡£×Ö·ûÉ豸ÊÇÖ¸É豸·¢ËͺͽÓÊÕÊý¾ÝÒÔ×Ö·ûµÄÐÎʽ½øÐУ»¶ø¿éÉ豸ÔòÒÔÕû¸öÊý¾Ý»º³åÇøµÄÐÎʽ½øÐС£×Ö·ûÉ豸µÄÇý¶¯Ïà¶Ô±È½Ï¼òµ¥¡£
¡¡¡¡ÏÂÃæÎÒÃÇÀ´¼ÙÉèÒ»¸ö·Ç³£¼òµ¥µÄÐéÄâ×Ö·ûÉ豸£ºÕâ¸öÉ豸ÖÐÖ»ÓÐÒ»¸ö4¸ö×Ö½ÚµÄÈ«¾Ö±äÁ¿int global_var£¬¶øÕâ¸öÉ豸µÄÃû×Ö½Ð×ö"gobalvar"¡£¶Ô"gobalvar"É豸µÄ¶ÁдµÈ²Ù×÷¼´ÊǶÔÆäÖÐÈ«¾Ö±äÁ¿global_varµÄ²Ù×÷¡£
¡¡¡¡Çý¶¯³ÌÐòÊÇÄں˵ÄÒ»²¿·Ö£¬Òò´ËÎÒÃÇÐèÒª¸øÆäÌí¼ÓÄ£¿é³õʼ»¯º¯Êý£¬¸Ãº¯ÊýÓÃÀ´Íê³É¶ÔËù¿ØÉ豸µÄ³õʼ»¯¹¤×÷£¬²¢µ÷ÓÃregister_chrdev() º¯Êý×¢²á×Ö·ûÉ豸£º
static int __init gobalvar_init(void)
{
¡¡if (register_chrdev(MAJOR_NUM, " gobalvar ", &gobalvar_fops))
¡¡{
¡¡¡¡//…×¢²áʧ°Ü
¡¡}
¡¡else
¡¡{
¡¡¡¡//…×¢²á³É¹¦
¡¡}
}
¡¡¡¡ÆäÖУ¬register_chrdevº¯ÊýÖеIJÎÊýMAJOR_NUMΪÖ÷É豸ºÅ,"gobalvar"ΪÉ豸Ãû£¬gobalvar_fopsΪ°üº¬»ù±¾º¯ÊýÈë¿ÚµãµÄ½á¹¹Ì壬ÀàÐÍΪfile_operations¡£µ±gobalvarÄ£¿é±»¼ÓÔØʱ£¬gobalvar_init±»Ö´ÐУ¬Ëü½«µ÷ÓÃÄں˺¯Êýregister_chrdev£¬°ÑÇý¶¯³ÌÐòµÄ»ù±¾Èë¿ÚµãÖ¸Õë´æ·ÅÔÚÄں˵Ä×Ö·ûÉ豸µØÖ·±íÖУ¬ÔÚÓû§½ø³Ì¶Ô¸ÃÉ豸ִÐÐϵͳµ÷ÓÃʱÌṩÈë¿ÚµØÖ·¡£
¡¡¡¡ÓëÄ£¿é³õʼ»¯º¯Êý¶ÔÓ¦µÄ¾ÍÊÇÄ£¿éжÔغ¯Êý£¬ÐèÒªµ÷ÓÃregister_chrdev()µÄ"·´º¯Êý" unregister_chrdev()£º
static void __exit gobalvar_exit(void)
{
¡¡if (unregister_chrdev(MAJOR_NUM, " gobalvar "))
¡¡{
¡¡¡¡//…жÔØʧ°Ü
¡¡}
¡¡else
¡¡{
¡¡¡¡//…жÔسɹ¦
¡¡}
}
¡¡¡¡Ëæ×ÅÄں˲»¶ÏÔö¼ÓÐµĹ¦ÄÜ£¬file_operations½á¹¹ÌåÒÑÖð½¥±äµÃÔ½À´Ô½´ó£¬µ«ÊÇ´ó¶àÊýµÄÇý¶¯³ÌÐòÖ»ÊÇÀûÓÃÁËÆäÖеÄÒ»²¿·Ö¡£¶ÔÓÚ×Ö·ûÉ豸À´Ëµ£¬ÒªÌṩµÄÖ÷ÒªÈë¿ÚÓУºopen ()¡¢release ()¡¢read ()¡¢write ()¡¢ioctl ()¡¢llseek()¡¢poll()µÈ¡£
¡¡¡¡open()º¯Êý¡¡¶ÔÉ豸ÌØÊâÎļþ½øÐÐopen()ϵͳµ÷ÓÃʱ£¬½«µ÷ÓÃÇý¶¯³ÌÐòµÄopen () º¯Êý£º
int (*open)(struct inode * ,struct file *);
¡¡¡¡ÆäÖвÎÊýinodeΪÉ豸ÌØÊâÎļþµÄinode (Ë÷Òý½áµã) ½á¹¹µÄÖ¸Õ룬²ÎÊýfileÊÇÖ¸ÏòÕâÒ»É豸µÄÎļþ½á¹¹µÄÖ¸Õë¡£open()µÄÖ÷
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
RPM ÓÐÎåÖÖ»ù±¾µÄ²Ù×÷·½Ê½(²»°üÀ¨´´½¨Èí¼þ°ü): °²×°, жÔØ, Éý¼¶, ²éѯ,ºÍÑéÖ¤¡£ ÏÂÃæÎÒÃǾÍÀ´ÖðÒ»µÄ½²½â°É¡£
Ò»¡¢ °²×°RPM°ü
RPM Èí¼þ°üͨ³£¾ßÓÐÀàËÆfoo-1.0-1.i386.rpm µÄÎļþÃû¡£ÆäÖаüÀ¨ Èí¼þ°üµÄÃû³Æ(foo)£¬°æ±¾ºÅ(1.0)£¬·¢ÐкÅ(1)£¬ ºÍ Ó²¼þƽ̨(i386)¡£°²×°Ò»¸öÈí¼þ°üÖ»Ðè¼òµ¥µÄ¼üÈëÒÔÏÂÃüÁ
$ rpm -ivh foo-1. ......
Linux»·¾³Ï¸÷¸öä¯ÀÀÆ÷µÄ±È½Ï
2009Äê05ÔÂ11ÈÕ ÐÇÆÚÒ» 09:46
kingliyouдµÀ "Èç¹ûÄ㻹ÊÇÒ»¸öLinuxµÄ²ËÄñ£¬ÄÇôÄãÊ×ÏÈ»á¶ÔËü¼¯³ÉµÄÍøÒ³ä¯ÀÀÆ÷ÓÐÐËȤ¶ø²»ÊÇÄÇЩÎÄ×Ö±à¼Æ÷£¬¿ª·¢ÓÃIDEµÈ¡£ÄÇô³ýÁ˶úÊìÄÜÏêµÄFirefoxÍâÄ㻹¶ÔÏÂÃæÄÇÒ»¿î¸ÐÐËȤÄØ£¿
Konqueror:KDE×ÀÃæ»·¾³ÏÂÖøÃûµÄ"°ëºì²»ºÚ"µÄä¯ÀÀÆ÷£»ËüÎȶ¨£¬Ëü¼ò½à£¬Ëü×°ÔØÒ ......
ÔÚredhat2.4.20-8ϱàÒëͨ¹ý£º
ÓÉÓÚ±¾³ÌÐò´°¿Ú²¿·ÖÓÉglad¹¤¾ß±àÖÆ£¬Ô´´úÂë²»Ò×Ìù³ö£¬ÏÖÖ»¸ø³ö²¿·Ö»Øµ÷º¯ÊýµÄ´úÂ룺
1£¬“Í˳ö”°´Å¥»Øµ÷º¯Êý£º
void
on_button9_clicked (G ......
LinuxÈÕ³£Ó¦ÓÃ
×¢£ºÎÒÊÇÒÔFC6Ϊ»·¾³
Ò»¡¢FC6¹ÒÔØNTFS
1.°²×°ntfs-3g
££yum install ntfs-3g
2.´´½¨/sbin/mount.ntfsÎļþ
cat > /sbin/mount.ntfs
> #!/bin/sh
> export LANG=en_US.UTF-8
& ......