Re: [Qemu-devel] Re: Question about KVM and PC speaker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Kiszka wrote:
I have implemented the beep for vgabios-6b and it works on bochs but
fails on qemu.
With "-soundhw pcspk" i should hear it thru the hosts pc speaker, right?

Yep, that's how it should work. Mind to share your code and tell us
which test case you used?

FreeDOS floppy with "debug" command and assembly code:
mov ax,0e07
xor bx,bx
int 10

With the modified vgabios (see below) it does beep on bochs on vista,
but not on qemu.

- Sebastian

--- vgabios.c.orig 2009-05-12 22:24:22.000000000 +0200
+++ vgabios.c 2009-05-12 22:24:32.000000000 +0200
@@ -80,6 +80,9 @@
static void memcpyb();
static void memcpyw();

+static void delay_ticks();
+static void beep();
+
static void biosfn_set_video_mode();
static void biosfn_set_cursor_shape();
static void biosfn_set_cursor_pos();
@@ -1965,7 +1968,7 @@
 switch(car)
  {
   case 7:
-    //FIXME should beep
+    beep();
    break;

   case 8:
@@ -3765,6 +3768,57 @@
ASM_END
}

+  void
+delay_ticks(ticks)
+  Bit16u ticks;
+{
+ASM_START
+  pusha
+  push ds
+  xor dx,dx
+  mov ds,dx
+  mov cx,4[bp]
+  add cx,0x46c
+  adc dx,0x46e
+  sti
+delay_ticks_wait:
+  hlt
+  mov ax,0x46c
+  mov bx,0x46e
+  cmp dx,bx
+  jb delay_ticks_out
+  cmp cx,ax
+  ja delay_ticks_wait
+delay_ticks_out:
+  pop ds
+  popa
+ASM_END
+}
+
+void beep()
+{
+ASM_START
+  pusha
+  mov al,#0xb6
+  out #0x43,al
+  mov al,#0x33
+  out #0x42,al
+  mov al,#0x5
+  out #0x42,al
+  in al,#0x61
+  push ax
+  or al,#0x03
+  out #0x61,al
+  mov cx,#0x4
+  push cx
+  call _delay_ticks
+  pop cx
+  pop ax
+  out #0x61,al
+  popa
+ASM_END
+}
+
#ifdef DEBUG
void unimplemented()
{

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux