This adds a minimalistic braille screen reader support.
This is meant to be used by blind people e.g. on boot failures or when /
cannot be mounted etc and thus the userland screen readers can not work.Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org
--- linux-2.6.24-orig/drivers/char/consolemap.c 2008-01-25 08:32:05.000000000 +0000
+++ linux-2.6.24-perso/drivers/char/consolemap.c 2008-02-03 21:27:04.000000000 +0000
@@ -277,6 +277,7 @@
return p->inverse_translations[m][glyph];
}
}
+EXPORT_SYMBOL_GPL(inverse_translate);static void update_user_maps(void)
{
--- linux-2.6.24-orig/drivers/char/vt.c 2008-01-25 08:32:06.000000000 +0000
+++ linux-2.6.24-perso/drivers/char/vt.c 2008-02-03 21:27:04.000000000 +0000
@@ -3982,6 +3982,7 @@
c |= 0x100;
return c;
}
+EXPORT_SYMBOL_GPL(screen_glyph);/* used by vcs - note the word offset */
unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed)
--- linux-2.6.24-orig/drivers/char/keyboard.c 2008-01-25 08:32:06.000000000 +0000
+++ linux-2.6.24-perso/drivers/char/keyboard.c 2008-02-04 02:44:37.000000000 +0000
@@ -110,6 +110,7 @@
const int NR_TYPES = ARRAY_SIZE(max_vals);struct kbd_struct kbd_table[MAX_NR_CONSOLES];
+EXPORT_SYMBOL_GPL(kbd_table);
static struct kbd_struct *kbd = kbd_table;struct vt_spawn_console vt_spawn_con = {
@@ -260,6 +261,7 @@
} else
kd_nosound(0);
}
+EXPORT_SYMBOL_GPL(kd_mksound);/*
* Setting the keyboard rate.
--- linux-2.6.24-orig/drivers/Kconfig 2008-01-25 08:32:04.000000000 +0000
+++ linux-2.6.24-perso/drivers/Kconfig 2008-02-04 01:32:17.000000000 +0000
@@ -95,4 +95,6 @@
source "drivers/uio/Kconfig"source "drivers/virtio/Kconfig"
+
+source "drivers/a11y/Kconfig"
endmenu
--- linux-2.6.24-orig/drivers/Makefile 2008-01-25 08:32:04.000000000 +0000
+++ linux-2.6.24-perso/drivers/Makefile 2008-02-04 01:33:27.000000000 +0000
@@ -28,6 +28,8 @@
obj-$(CONFIG_FB_INTEL) += video/intelfb/obj-y += serial/
+# a11...
This adds a minimalistic braille screen reader support.
This is meant to be used by blind people e.g. on boot failures or when /
cannot be mounted etc and thus the userland screen readers can not work.Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
Greg KH was OK with this patch and there was no other complains, so I
resubmit it, with a fixed signed-off-by.
I think it should fine for mainline, as it is not enable by default and
doesn't change anything else and exporting a few functions that will be
needed for SpeakUp too.--- linux-2.6.24-orig/drivers/char/consolemap.c 2008-01-25 08:32:05.000000000 +0000
+++ linux-2.6.24-perso/drivers/char/consolemap.c 2008-02-03 21:27:04.000000000 +0000
@@ -277,6 +277,7 @@
return p->inverse_translations[m][glyph];
}
}
+EXPORT_SYMBOL_GPL(inverse_translate);static void update_user_maps(void)
{
--- linux-2.6.24-orig/drivers/char/vt.c 2008-01-25 08:32:06.000000000 +0000
+++ linux-2.6.24-perso/drivers/char/vt.c 2008-02-03 21:27:04.000000000 +0000
@@ -3982,6 +3982,7 @@
c |= 0x100;
return c;
}
+EXPORT_SYMBOL_GPL(screen_glyph);/* used by vcs - note the word offset */
unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed)
--- linux-2.6.24-orig/drivers/char/keyboard.c 2008-01-25 08:32:06.000000000 +0000
+++ linux-2.6.24-perso/drivers/char/keyboard.c 2008-02-04 02:44:37.000000000 +0000
@@ -110,6 +110,7 @@
const int NR_TYPES = ARRAY_SIZE(max_vals);struct kbd_struct kbd_table[MAX_NR_CONSOLES];
+EXPORT_SYMBOL_GPL(kbd_table);
static struct kbd_struct *kbd = kbd_table;struct vt_spawn_console vt_spawn_con = {
@@ -260,6 +261,7 @@
} else
kd_nosound(0);
}
+EXPORT_SYMBOL_GPL(kd_mksound);/*
* Setting the keyboard rate.
--- linux-2.6.24-orig/drivers/Kconfig 2008-01-25 08:32:04.000000000 +0000
+++ linux-2.6.24-perso/drivers/Kconfig 2008-02-04 01:32:17.000000000 +0000
@@ -95,4 +95,6 @@
source "drivers/uio/Kconfig"source "drivers/virtio/Kconfig"
+
+s...
when O=dir is used in make:
CC drivers/accessibility/braille/braille_console.o
Assembler messages:
Fatal error: can't create drivers/accessibility/braille/braille_console.o: No such file or directory
CC crypto/aes_generic.o
make[3]: *** [drivers/accessibility/braille/braille_console.o] Error 2
make[2]: *** [drivers/accessibility] Error 2
make[1]: *** [drivers] Error 2---
~Randy
Oh, right, the patch below should fix it
Properly recurse Makefiles into accessibility and accessibility/braille/
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
--- linux-2.6.24.1-perso/drivers/accessibility/Makefile.orig 2008-03-20 01:51:09.000000000 +0000
+++ linux-2.6.24.1-perso/drivers/accessibility/Makefile 2008-03-20 01:52:30.000000000 +0000
@@ -1 +1 @@
-obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille/braille_console.o
+obj-y += braille/
--- /dev/null 2008-03-20 02:39:28.130012041 +0000
+++ linux-2.6.24.1-perso/drivers/accessibility/braille/Makefile 2008-03-20 01:52:44.000000000 +0000
@@ -0,0 +1 @@
+obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille_console.o
--
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
---
~Randy
--
On Tue, 5 Feb 2008 22:00:54 +0000
Could you feed it through scritps/checkpatch.pl please? That finds a lot
`lastwrite' is a kernel-wide singleton and hence at least needs some
locking protecting its consistency.If this is a single-opener-only device then I _guess_ this approach is OK.
If not, `lastwrite' really should be some dynamically-allocated, per-open thing,hm. Is it appropriate that this driver wire itself directly into
serial8250? What if the screen reader is attached to some other sort of
uart, or a terminal server, or...Maybe this all should be implemented as a line discipline, or something
That's pretty ungainly. Again, if we had some clear spearation between the
protocol layer and the device-driver layer and some way of binding themThat's cute, but perhaps we should be boring and call it
--
Oops, sorry, it's probably been some time since I last read
SubmittingPatches. Actually, this discovered a false positive inIt is meant to be yes, though it was lacking protection against this.
We want to have output as early as possible for debugging, just like
Indeed that's an issue. For now, there is no clean way to attach to the
early serial drivers, that's why I chose 8250, which should be correct
99% of the time for the current users of this. We could add a parameter
to the console=brl option that specifies which early serial console toFor a permanent screen reader, yes (that's what we will probably do for
The problem is that there is currently no better way to setup the serial
Again, we need the screen reader working during boot, even before init
exists. A line discipline would indeed be fine if we had userspace
control, but this tool is precisely intended for the case when userspaceThen keep A11Y here?
Here is a revised patch.
Samuel
This adds a minimalistic braille screen reader support.
This is meant to be used by blind people e.g. on boot failures or when /
cannot be mounted etc and thus the userland screen readers can not work.Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
--- linux-2.6.24-orig/drivers/char/consolemap.c 2008-01-25 08:32:05.000000000 +0000
+++ linux-2.6.24-perso/drivers/char/consolemap.c 2008-02-03 21:27:04.000000000 +0000
@@ -277,6 +277,7 @@
return p->inverse_translations[m][glyph];
}
}
+EXPORT_SYMBOL_GPL(inverse_translate);static void update_user_maps(void)
{
--- linux-2.6.24-orig/drivers/char/vt.c 2008-01-25 08:32:06.000000000 +0000
+++ linux-2.6.24-perso/drivers/char/vt.c 2008-02-03 21:27:04.000000000 +0000
@@ -3982,6 +3982,7 @@
c |= 0x100;
return c;
}
+EXPORT_SYMBOL_GPL(screen_glyph);/* used by vcs - note the word offset */
unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed)
--- linux-2.6.24-orig/drivers/char/keyboard.c 2008-01-25 08:32:...
In the patch below, I hook into kernel/printk.c's console= parser, which
now gives me attachment to any kind of console.This adds a minimalistic braille screen reader support.
This is meant to be used by blind people e.g. on boot failures or when /
cannot be mounted etc and thus the userland screen readers can not work.Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
diff -ur linux-2.6.24.1-orig/drivers/char/consolemap.c linux-2.6.24.1-perso/drivers/char/consolemap.c
--- linux-2.6.24.1-orig/drivers/char/consolemap.c 2008-01-25 09:32:05.000000000 +0100
+++ linux-2.6.24.1-perso/drivers/char/consolemap.c 2008-02-03 22:27:04.000000000 +0100
@@ -277,6 +277,7 @@
return p->inverse_translations[m][glyph];
}
}
+EXPORT_SYMBOL_GPL(inverse_translate);static void update_user_maps(void)
{
diff -ur linux-2.6.24.1-orig/drivers/char/keyboard.c linux-2.6.24.1-perso/drivers/char/keyboard.c
--- linux-2.6.24.1-orig/drivers/char/keyboard.c 2008-01-25 09:32:06.000000000 +0100
+++ linux-2.6.24.1-perso/drivers/char/keyboard.c 2008-02-04 03:44:37.000000000 +0100
@@ -110,6 +110,7 @@
const int NR_TYPES = ARRAY_SIZE(max_vals);struct kbd_struct kbd_table[MAX_NR_CONSOLES];
+EXPORT_SYMBOL_GPL(kbd_table);
static struct kbd_struct *kbd = kbd_table;struct vt_spawn_console vt_spawn_con = {
@@ -260,6 +261,7 @@
} else
kd_nosound(0);
}
+EXPORT_SYMBOL_GPL(kd_mksound);/*
* Setting the keyboard rate.
diff -ur linux-2.6.24.1-orig/drivers/char/vt.c linux-2.6.24.1-perso/drivers/char/vt.c
--- linux-2.6.24.1-orig/drivers/char/vt.c 2008-01-25 09:32:06.000000000 +0100
+++ linux-2.6.24.1-perso/drivers/char/vt.c 2008-02-03 22:27:04.000000000 +0100
@@ -3982,6 +3982,7 @@
c |= 0x100;
return c;
}
+EXPORT_SYMBOL_GPL(screen_glyph);/* used by vcs - note the word offset */
unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed)
diff -ur linux-2.6.24.1-orig/drivers/Kconfig linux-2.6.24.1-perso/drivers/Kconfig
--- linux-2.6.24....
Sorry, but I can't say that this is my favoritest ever patch. But I can't
immediately think of any way of significantly improving it :( Jiri andUpdate Documentation/kernel-parameters.txt, please. And additional
hm, do we have enough Kconfig dependencies here to ensure that kd_mksound()
is always available?--
Argl, that's editdiff's fault. We need to fix it to keep the -p
It can, indeed. It just makes the code a little more clumsy to save 32
Well, that's actually just the original code that I moved a bit earlier,
Again, that's the original code, unmodified, but we can put an strlcpy
Ah, CONFIG_VT is needed indeed.
I'll address those in replies to this mail.
Samuel
--
Hello,
Could the basic braille screen reader be pushed to 2.6.26?
Else, could at least the patch below be applied, so that people can
compile external accessibility modules a lot more easily? (no need to
patch vanilla kernel, which is a huge win for people who already have a
hard time just using their computer...)Samuel
Export functions typically used by screen reading modules.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
diff -ur linux-2.6.24.1-orig/drivers/char/consolemap.c linux-2.6.24.1-perso/drivers/char/consolemap.c
--- linux-2.6.24.1-orig/drivers/char/consolemap.c 2008-01-25 09:32:05.000000000 +0100
+++ linux-2.6.24.1-perso/drivers/char/consolemap.c 2008-02-03 22:27:04.000000000 +0100
@@ -277,6 +277,7 @@
return p->inverse_translations[m][glyph];
}
}
+EXPORT_SYMBOL_GPL(inverse_translate);static void update_user_maps(void)
{
diff -ur linux-2.6.24.1-orig/drivers/char/keyboard.c linux-2.6.24.1-perso/drivers/char/keyboard.c
--- linux-2.6.24.1-orig/drivers/char/keyboard.c 2008-01-25 09:32:06.000000000 +0100
+++ linux-2.6.24.1-perso/drivers/char/keyboard.c 2008-02-04 03:44:37.000000000 +0100
@@ -110,6 +110,7 @@
const int NR_TYPES = ARRAY_SIZE(max_vals);struct kbd_struct kbd_table[MAX_NR_CONSOLES];
+EXPORT_SYMBOL_GPL(kbd_table);
static struct kbd_struct *kbd = kbd_table;struct vt_spawn_console vt_spawn_con = {
@@ -260,6 +261,7 @@
} else
kd_nosound(0);
}
+EXPORT_SYMBOL_GPL(kd_mksound);/*
* Setting the keyboard rate.
diff -ur linux-2.6.24.1-orig/drivers/char/vt.c linux-2.6.24.1-perso/drivers/char/vt.c
--- linux-2.6.24.1-orig/drivers/char/vt.c 2008-01-25 09:32:06.000000000 +0100
+++ linux-2.6.24.1-perso/drivers/char/vt.c 2008-02-03 22:27:04.000000000 +0100
@@ -3982,6 +3982,7 @@
c |= 0x100;
return c;
}
+EXPORT_SYMBOL_GPL(screen_glyph);/* used by vcs - note the word offset */
unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed)
--
On Thu, 24 Apr 2008 01:39:00 +0100
Seems the right small set of changes to get us started with the real
merge and its useful for the tty cleanup to have these exports visible so
I know what will affect others.--
--
"Alan, I'm getting a bit worried about you."
-- Linus Torvalds
--
Ok.
Additionnal exports which will be of much use is selection, see patch
below.Samuel
Export set_selection and paste_selection for accessibility modules.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
--- linux/drivers/char/selection.c.orig 2008-04-24 12:00:07.000000000 +0100
+++ linux/drivers/char/selection.c 2008-04-24 11:59:56.000000000 +0100
@@ -299,6 +299,7 @@ int set_selection(const struct tiocl_sel
sel_buffer_lth = bp - sel_buffer;
return 0;
}
+EXPORT_SYMBOL_GPL(set_selection);/* Insert the contents of the selection buffer into the
* queue of the tty associated with the current console.
@@ -336,3 +337,4 @@ int paste_selection(struct tty_struct *t
tty_ldisc_deref(ld);
return 0;
}
+EXPORT_SYMBOL_GPL(paste_selection);
--
I was intending to do that.
(I don't like the code much but can't suggest anything better)
--
Document the console=brl option and the usage of the braille screen
reader.Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
--- linux-2.6.24.1-orig/Documentation/kernel-parameters.txt 2008-01-25 09:31:45.000000000 +0100
+++ linux-2.6.24.1-perso/Documentation/kernel-parameters.txt 2008-02-23 13:21:27.000000000 +0100
@@ -463,6 +463,11 @@
switching to the matching ttyS device later. The
options are the same as for ttyS, above.+ If the device connected to the port is not a TTY but a braille
+ device, prepend "brl," before the device type, for instance
+ console=brl,ttyS0
+ For now, only VisioBraille is supported.
+
earlycon= [KNL] Output early console device and options.
uart[8250],io,<addr>[,options]
uart[8250],mmio,<addr>[,options]
--- linux-2.6.24.1-orig/Documentation/braille-console.txt 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.24.1-perso/Documentation/braille-console.txt 2008-02-23 13:20:31.000000000 +0100
@@ -0,0 +1,34 @@
+ Linux Braille Console
+
+To get early boot messages on a braille device (before userspace screen
+readers can start), you first need to compile the support for the usual serial
+console (see serial-console.txt), and for braille device (in Device Drivers -
+Accessibility).
+
+Then you need to specify a console=brl, option on the kernel command line, the
+format is:
+
+ console=brl,serial_options...
+
+where serial_options... are the same as described in serial-console.txt
+
+So for instance you can use console=brl,ttyS0 if the braille device is connected
+to the first serial port, and console=brl,ttyS0,115200 to override the baud rate
+to 115200, etc.
+
+By default, the braille device will just show the last kernel message (console
+mode). To review previous messages, press the Insert key to switch to the VT
+review mode. In review mode, the arrow keys permit to browse in the VT content,
+page up/down keys go at the top/bottom of the...
Braille screen reader fixes:
- console_cmdline's brl_options field is only required when braille
console support is enabled.
- Use strlcpy to copy the console name.
- braille console support depends on VT support.Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
--- linux-2.6.24.1-orig/kernel/printk.c 2008-02-21 12:09:06.000000000 +0100
+++ linux-2.6.24.1-perso/kernel/printk.c 2008-02-23 12:57:42.000000000 +0100
@@ -105,7 +105,9 @@ struct console_cmdline
char name[8]; /* Name of the driver */
int index; /* Minor dev. to use */
char *options; /* Options for the driver */
+#ifdef CONFIG_A11Y_BRAILLE_CONSOLE
char *brl_options; /* Options for braille driver */
+#endif
};#define MAX_CMDLINECONSOLES 8
@@ -789,10 +791,11 @@ static int __add_preferred_console
if (!brl_options)
selected_console = i;
c = &console_cmdline[i];
- memcpy(c->name, name, sizeof(c->name));
- c->name[sizeof(c->name) - 1] = 0;
+ strlcpy(c->name, name, sizeof(c->name));
c->options = options;
+#ifdef CONFIG_A11Y_BRAILLE_CONSOLE
c->brl_options = brl_options;
+#endif
c->index = idx;
return 0;
}
--- linux-2.6.24.1-orig/drivers/accessibility/Kconfig 2008-02-23 13:32:38.000000000 +0100
+++ linux-2.6.24.1-perso/drivers/accessibility/Kconfig 2008-02-23 13:23:21.000000000 +0100
@@ -8,6 +8,7 @@ menuconfig ACCESSIBILITY
if ACCESSIBILITY
config A11Y_BRAILLE_CONSOLE
bool "Console on braille device"
+ depends on VT
depends on SERIAL_CORE_CONSOLE
---help---
Enables console output on a braille device connected to a 8250
--
Will this api work with the SpeakUp kernel drivers? Are the hooks
You forgot a trailing '>' :)
thanks,
greg k-h
--
Hello,
SpeakUp and this are quite independant (though they will probably both
end up in the drivers/a11y/ directory), at least just because the way
they review the screen is very different. Speech synthesis' matter is
the time to say things, while braille's matter is the space to show
things.However, they share the same low-level primitives: the recently added
keyboard and vc notifiers, screen_glyph(), inverse_translate(),Ergl :)
Samuel
--
I guess I'm worried that the hooks that you add here will not be usable
by speakup, and we'll have to add more in places close to this, but not
quite the same.I know speaking and "showing" are two different things, but they both
require the same data flow going into them in order to achieve their
goals, I just don't want to see this work being done without considering
both needs.But, if you feel that both will work properly with these limited
exports, I have no objections.thanks,
greg k-h
--
I _am_ considering both needs. Actually, most of the recent commits to
They already both do :)
Samuel
--
Great. I have no objection to this patch then :)
thanks,
greg k-h
--
Note: as said in the comments, this is currently only for the
VisioBraille device, but having this in the vanilla kernel will help a
lot to get people testing drivers for other devices, as they will not
have to recompile a patched kernel but just insert test modules
(remember that for blind people it is already not so easy to just _use_
computers...)Samuel
--
| Rafael J. Wysocki | [Bug #10493] mips BCM47XX compile error |
| Ingo Molnar | [patch 02/13] syslets: add syslet.h include file, user API/ABI definitions |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Andrea Arcangeli | [PATCH 00 of 11] mmu notifier #v16 |
git: | |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| Mark Lord | Re: [BUG] New Kernel Bugs |
