ローダブル・モジュールのキャラクタ・デバイス static ssize_t h_write(struct file * file, const char * buf, size_t count, loff_t *ppos) { unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); printk("LKM-hello:write minor=%d¥n", minor); if(count == 0) return 0; if(*buf & 1) outb(0xF0, 0x3f2); /* Motor ON */ else outb(0x00, 0x3f2); /* Motor OFF */ return count; }