Hi! Why won’t the PC speaker (connected to motherboard) beep without the Audio drivers? It works in VMWare with all the audio things disabled, but not on a native PC.
Is there a way to bypass the integrated audio shit? The BIOS does it…
Code:
#include <stdlib.h>
#include <stdio.h>
#include <x86/inout.h>
#include <sys/neutrino.h>
#include <unistd.h>
#include <stdint.h>
#include <qnx/mma.h>
int main()
{
int system_control=0;
unsigned long i;
unsigned long kbd, clk;
ThreadCtl(_NTO_TCTL_IO, 0);
kbd = mmap_device_io(4,0x60);
clk = mmap_device_io(4,0x40);
// turn on bits 0 & 1 of kbd 0x61
system_control=in8(kbd + 1);
out8(kbd + 1,system_control | 0x03);
// load control word for 8254
out8(clk + 3, 0xb7); // bcd count, square wave,
// r/w lsb then msb, channel 2
// load counts
// to get 440Hz tone, divide 8254 clock (1.1892 MHz) by 2702
out8(clk + 2,0x02); // lsb count
out8(clk + 2,0x27); // msb count - remember, we’re using BCD
// pause a bit…
sleep(1);
// shut it off
system_control=in8(kbd + 1);
out8(kbd + 1,system_control & 0xfc);
return(0);
}