#define MODULE #define __KERNEL__ #include void pcsp_beep(int count, int cycles) { /* enable counter 2 */ outb_p(inb_p(0x61)|3, 0x61); /* set command for counter 2, 2 byte write */ outb_p(0xB6, 0x43); /* select desired HZ */ outb_p(count & 0xff, 0x42); outb((count >> 8) & 0xff, 0x42); while (cycles--); /* disable counter 2 */ outb(inb_p(0x61)&0xFC, 0x61); } int init_module(void) { printk("Start beeps..\n"); pcsp_beep(12000,800000); pcsp_beep(10000,800000); printk("Beeps done\n"); return 1; } void cleanup_module(void) { } /* * Local variables: * compile-command: "gcc -Wall -Wstrict-prototypes -O6 -c irate.c" * End: */