From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clarence Dang Subject: PC speaker in DOSEMU CVS Date: Sat, 3 Dec 2005 19:42:11 +1100 Message-ID: <200512031942.14404.clarencedang@yahoo.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline Sender: linux-msdos-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: linux-msdos@vger.kernel.org Hi, Just an update: 1. In Fedora Core, if you want the PC speaker to work: * in xdosemu * in dosemu with $_speaker = "emulated" * in bash and ViM (those annoying beeps), you need: modprobe pcspkr 2. dosemu with $_speaker = "native" was fixed by Stas in CVS at approximately 2005-11-27 11:51 UTC. Just for the record, before this fix: The port server forks a copy of the port handling tables at extra_port_init() time. At that point, port 0x61 has not been registered. The port server believes that 0x61 is an invalid port. Later, 0x61 is registered by the main DOSEMU process into its separate copy of the port handling tables. DOSEMU traps an 0x61 port speaker access and calls std_port_{inb,outb}. This calls the port server, with the intention that the port server will call std_port_{inb,outb} in its process, which will invoke port_real_{inb,outb}. Unfortunately, the port server with an out-of-date set of port handling tables will call port_not_avail_{inb,outb} instead of std_port_{inb,outb}. The moral of the story is that port handlers that eventually access real ports must be initialised before extra_port_init(). This should be audited: port_register_handler('8254 Timer0',40-40) port_register_handler('8254 Timer1',41-41) port_register_handler('8254 Timer2',42-42) port_register_handler('8254 Ctrl02',43-43) port_register_handler('PCI Emulated Config',cf8-cff) port_register_handler('std port io',a000-a0ff) port_register_handler('8042 Keyboard data',60-60) port_register_handler('8042 Keyboard command',64-64) port_register_handler('Keyboard controller port B',61-61) starting port server - nothing below this can access real ports port_register_handler('CMOS RAM',70-71) port_register_handler('8259 PIC0',20-21) port_register_handler('8259 PIC1',a0-a1) port_register_handler('Parallel printer',378-37a) port_register_handler('Parallel printer',278-27a) port_register_handler('Parallel printer',3bc-3be) port_register_handler('DMA - XT Controller',0-f) port_register_handler('DMA - XT Pages',81-87) port_register_handler('DMA - AT Controller',c0-de) port_register_handler('DMA - AT Pages',89-8f) port_register_handler('Floppy Drive',3f0-3f7) port_register_handler('SB Emulation',220-233) port_register_handler('Adlib (+ Advanced) Emulation',388-38b) port_register_handler('Midi Emulation',330-331)