Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Book Note: Linux Device Driver Dos and Don'ts

Book Note: Linux Device Driver Dos and Don'ts
http://janitor.kernelnewbies.org/docs/driver-howto.html
what a hardened (robust) device
driver should mean and how it should be implemented and measured.
1.3 Robust device drivers
-Follows the Linux CodingStyle.
-Efficient in managing faults and handling, reporting and recovering from errors.
 (Also not panic() happy.)
-Complies with latest Linux kernel APIs and interfaces.
 (Uses the new device driver model, kobjects and sysfs.)
-Properly manages resources (memory, semaphores, interrupts, etc.).
-Uses kernel-provided "C" I/O functions instead of assembly code.
2.0 Where do I start?
3.0 OK, I'm ready...
3.1 Efficient error handling, reporting and recovery:
1)<printk()>
you should always check printk() calls to include appropriate KERN_* constant.
2)<goto>
3) <Enumerated return codes> <return EWHATEVER should be return -EWHATEVER>
4) <No need to panic()>
Rather, the device driver should try to recover, re-initialize, or finally simply
        return an appropriate error code, release allocated resources, log a message and
        exit gracefully.
3.2.1 Module interface changes
<Initialization and cleanup>
<Module Reference Count macros>
You no longer need to adjust your own module reference count
-Reference counting from other modules:
;A Golden Rule: if you are calling through a function pointer into a (different) module,
        you must hold a reference to that module.
        Otherwise you risk sleeping in the module while it is unloaded.
You can get a reference to a module by using:
            try_module_get(owner);
        and you don't have to check if OWNER != NULL, this is done by try_module_g


Ïà¹ØÎĵµ£º

Linux/UNIX C++Èí¼þ¿ª·¢




< type="text/javascript">
document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
var text = clipboar ......

VmwareÀïLinuxÔÚx windowsÓëÐéÄâÖÕ¶ËÖ®¼äÇл»·½·¨

    µ±ÎÒÃÇÔÚVmware»òÕßÆäËûÐéÄâ»úÖа²×°Linuxºó£¬ÏëÔÚX
WindowsÓëÐéÄâÖÕ¶ËÖ®¼äÇл»Ê±£¬È´·¢ÏÖCtrl+Alt+Fx²»Æð×÷Óã¬ÄÇôÎÒÃÇÈçºÎ½â¾öÕâ¸öÎÊÌâÄØ£¿Æäʵ·½·¨ºÜ¼òµ¥£¬ÎÒÃÇÖ»ÐèÒª½«Vmware»ò
ÕßÆäËûÐéÄâ»úÈí¼þµÄÈȼü¸Ä³ÉCtrl+Alt+Shift¼´¿É£¬ÈçVmware¾ßÌå·½·¨ÈçÏ£ºÖÐÎÄ°æ——Ñ¡Ôñ±à¼­—&mdash ......

ǶÈëʽLinux²Ù×÷ϵͳѧϰ¹æ»®

ǶÈëʽLinux²Ù×÷ϵͳѧϰ¹æ»®
ARM+LINUX·Ïߣ¬Ö÷¹¥Ç¶ÈëʽLinux²Ù×÷ϵͳ¼°ÆäÉÏÓ¦ÓÃÈí¼þ¿ª·¢Ä¿±ê£º 
£¨1£© ÕÆÎÕÖ÷Á÷ǶÈëʽ΢´¦ÀíÆ÷µÄ½á¹¹ÓëÔ­Àí£¨³õ²½¶¨Îªarm9£© 
£¨2£© ±ØÐëÕÆÎÕÒ»¸öǶÈëʽ²Ù×÷ϵͳ £¨³õ²½¶¨Îªuclinux»òlinux,°æ±¾´ý¶¨£© 
£¨3£© ±ØÐëÊìϤǶÈëʽÈí¼þ¿ª·¢Á÷³Ì²¢ÖÁÉÙ×öÒ ......

Linux Shell ÃüÁî ¼ò½é

°²×°openssh ·þÎñ¶Ë
sudo apt-get install openssh-server openssh-client
 
windows Ï¿ͻ§¶Ë
puTTY
  
 
³£ÓÃÃüÁî:
 
Ò»£®Ls ²é¿´Ä¿Â¼ÃüÁî
Ò»°ã·ÅÔÚhome Ŀ¼ÏÂ
Ls –l /  ¸ùĿ¼ÏµÄÁбí
Ls –a /  ¸ùĿ¼ÏÂËùÓеÄÎļþ
Ls –la  ×éºÏµÄÑ¡Ïî
Ls &n ......

±àдǶÈëʽLinuxÓ¦ÓòãÇý¶¯³ÌÐò

ÔÚÑо¿Ä³Ò»Ñù¶«Î÷µÄʱºò£¬Æäʵ×îÖØÒªµÄÒ»µã¾ÍÊÇÁ˽âÇå³þËüµÄ×÷Óã¬Ëü¶Ô×Ô¼ºÓÐûÓÐÓã¬ÒÔÇ°¸Õ¸Õ½øÈë´óѧµÄʱºò×ÜÊÇÌýijijʦÐÖʦ½ãÔÚ½²Ä³¸ö¿Î³ÌûɶÓ㬲»ÓÃÈÏÕæѧ£¬½á¹û×Ô¼ºÓÐʱºòÒ²°ÑijЩÈ˵ÄijЩ»°µ±ÕæÁË£¬ÔÙ½á¹ûÎÒÔÚѧϰijЩ¿Î³ÌµÄʱºò¾Íû°ÑËüµ±»ØÊ£¬×ÜÈÏΪÒÔºóûʲôÓ㬵ȵ½×Ô¼º´óËÄʱ²ÅÖªµÀÄÇЩ¸öËùνµÄʦÐÖʦ½ãÃÇµÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ