// IOREMAP 試験 // gcc -c moduletest.c -Wall -Wstrict-prototypes -O -pipe -m486 // -pipe: 中間ファイルをつくらず // -Wall -Wstrict-prototypes: 最大限警告をうるさく // -m486: 486 用に最適化 (386ではなく) #define MODULE #define __KERNEL__ #include // printk をつかうためだけ :-) #include #include int init_module(void) { int i; unsigned char *map; map=(unsigned char *)ioremap(0xe4000000,16); printk("ioremap: %p\n",map); for(i=0;i<16;i++) printk("%02X ",map[i]); printk("\n"); iounmap(map); return -1; // rmmod しないで済むように手抜き } void cleanup_module(void) { };