Le Wed, 30 Sep 2009 16:47:33 +1300, Michal Ludvig <mludvig@xxxxxxxxxxxx> a écrit : > I've got two questions: > 1) Can I speed it up somehow? > 2) Apparently it's quite a lot of time between calling outb() and its > return. Can the kernel do something else in the meantime, like > scheduling another process or handling interrupts, or is it blocked > waiting for the outb() return? I'm on a uniprocessor x86 system. You can read the implementation of outb() for x86 in /home/thomas/local/linuxdev/arch/x86/include/asm/io_32.h. Unless you use outb_p() (which introduces a pause after the write), outb() is only a static inline function that does the "outb" CPU instruction. No more, no less. If you want to be 100%, for testing purposes, you can hand-code the outb() using an asm("") statement. But I don't think it'll make any difference. You can also make an accurate measurement of the instruction duration using the TSC, to get the number of cycles spent during the execution of the instruction. Finally, my hardware knowledge is a bit limited, but I'm not sure that a 8 Mhz bus necessarly means that you can do 8 millions outb() per second through this bus. One outb() probably requires several (if not many) clock ticks. Sincerly, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ