Skip to contentSkip to conversation

Braille device support

Qemu-devel Samuel Thibault 2 participants 2 messages Apr 3, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello,

This adds support for a Baum Vario braille device (both serial and USB). It uses BrlAPI to make the actual output available on a real braille device or on a fake device. Tested on the guest side with brltty, libbraille and suseblinux.

Samuel

Makefile.target +1 -1
Index: Makefile.target
===================================================================
@@ -658,7 +658,7 @@
 endif
 
 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
-	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS)
 
 endif # !CONFIG_USER_ONLY
 
vl.c +11 -1
Index: vl.c
===================================================================
@@ -29,6 +29,7 @@
 #include "hw/fdc.h"
 #include "hw/audiodev.h"
 #include "hw/isa.h"
+#include "hw/baum.h"
 #include "net.h"
 #include "console.h"
 #include "sysemu.h"
@@ -3474,8 +3475,13 @@
     } else
     if (strstart(filename, "file:", &p)) {
         return qemu_chr_open_win_file_out(p);
-    }
+    } else
 #endif
+#ifdef CONFIG_BRLAPI
+    if (!strcmp(filename, "braille")) {
+        return chr_baum_init();
+    } else
+#endif
     {
         return NULL;
     }
@@ -5282,6 +5288,10 @@
         dev = usb_wacom_init();
     } else if (strstart(devname, "serial:", &p)) {
         dev = usb_serial_init(p);
+#ifdef CONFIG_BRLAPI
+    } else if (!strcmp(devname, "braille")) {
+        dev = usb_baum_init();
+#endif
     } else {
         return -1;
     }
Makefile +5 -0
Index: Makefile
===================================================================
@@ -57,6 +57,11 @@
 OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o usb-serial.o
 OBJS+=sd.o ssi-sd.o
 
+ifdef CONFIG_BRLAPI
+OBJS+= baum.o
+LIBS+=-lbrlapi
+endif
+
 ifdef CONFIG_WIN32
 OBJS+=tap-win32.o
 endif

Modification de propriétés sur qemu-doc.texi
___________________________________________________________________
Nom : svn:mime-type
- application/x-texinfo
+ text/plain

configure +23 -0
Index: configure
===================================================================
@@ -286,6 +286,8 @@
   ;;
   --disable-kqemu) kqemu="no"
   ;;
+  --disable-brlapi) brlapi="no"
+  ;;
   --enable-profiler) profiler="yes"
   ;;
   --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
@@ -416,6 +418,7 @@
 echo "  --enable-esd             enable EsoundD audio driver"
 echo "  --enable-fmod            enable FMOD audio driver"
 echo "  --enable-dsound          enable DirectSound audio driver"
+echo "  --disable-brlapi         disable BrlAPI"
 echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
 echo "  --disable-curses         disable curses output"
 echo "  --enable-system          enable all system emulation targets"
@@ -674,6 +677,20 @@
 fi
 
 ##########################################
+# BrlAPI probe
+
+if test -z "$brlapi" ; then
+    brlapi=no
+cat > $TMPC << EOF
+#include <brlapi.h>
+int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
+EOF
+    if $cc -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /tmp/qemu-$$-brlapi.log ; then
+	    brlapi=yes
+    fi # brlapi compile test
+fi # -z $brlapi
+
+##########################################
 # curses probe
 
 if test "$curses" = "yes" ; then
@@ -770,6 +787,7 @@
     echo "Target Sparc Arch $sparc_cpu"
 fi
 echo "kqemu support     $kqemu"
+echo "brlapi support    $brlapi"
 echo "Documentation     $build_docs"
 [ ! -z "$uname_release" ] && \
 echo "uname -r          $uname_release"
@@ -1001,6 +1019,11 @@
   echo "CONFIG_CURSES=yes" >> $config_mak
   echo "CURSES_LIBS=-lcurses" >> $config_mak
 fi
+if test "$brlapi" = "yes" ; then
+  echo "CONFIG_BRLAPI=yes" >> $config_mak
+  echo "#define CONFIG_BRLAPI 1" >> $config_h
+  echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
+fi
 
 # XXX: suppress that
 if [ "$bsd" = "yes" ] ; then
baum.c +643 -0

643 lines not on this page · raw message

baum.h +29 -0
Index: hw/baum.h
===================================================================
@@ -0,0 +1,29 @@
+/*
+ * QEMU Baum
+ *
+ * Copyright (c) 2008 Samuel Thibault
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/* usb device */
+USBDevice *usb_baum_init(void);
+
+/* char device */
+CharDriverState *chr_baum_init(void);
qemu-doc.texi.mine renamed from qemu-doc.texi +11 -0
@@ -545,6 +545,10 @@
 Serial converter to host character device @var{dev}, see @code{-serial} for the
 available devices.
 
+@item braille
+Braille device.  This will use BrlAPI to display the braille output on a real
+or fake device.
+
 @end table
 
 @end table
@@ -858,6 +862,10 @@
 @item -serial mon:telnet::4444,server,nowait
 @end table
 
+@item braille
+Braille device.  This will use BrlAPI to display the braille output on a real
+or fake device.
+
 @end table
 
 @item -parallel @var{dev}
@@ -1613,6 +1621,9 @@
 @end example
 will connect to tcp port 4444 of ip 192.168.0.2, and plug that to the virtual
 serial converter, faking a Matrix Orbital LCD Display (USB ID 0403:FA00).
+@item braille
+Braille device.  This will use BrlAPI to display the braille output on a real
+or fake device.
 @end table
 
 @node host_usb_devices
#1 lore raw
Quoted 1 line · Samuel Thibault, le Thu 03 Apr 2008 23:45:16 +0200, a écrit :

This adds support for a Baum Vario braille device (both serial and USB).

Ooops, the From address is wrong, please use
[email protected] instead.

Samuel