Basic braille screen reader support
Subsystems (4)
PATCH 1/1 Basic braille screen reader support
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.
drivers/char/consolemap.c +1 -0
@@ -277,6 +277,7 @@return p->inverse_translations[m][glyph]; } } +EXPORT_SYMBOL_GPL (inverse_translate);static void update_user_maps (void ) {
drivers/char/vt.c +1 -0
@@ -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)
drivers/char/keyboard.c +2 -0
@@ -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.
drivers/Kconfig +2 -0
@@ -95,4 +95,6 @@ source "drivers/uio/Kconfig" source "drivers/virtio/Kconfig" + +source "drivers/a11y/Kconfig" endmenu
drivers/Makefile +2 -0
@@ -28,6 +28,8 @@ obj-$(CONFIG_FB_INTEL) += video/intelfb/ obj-y += serial/ +# a11y comes after serial because it depends on it +obj-$(CONFIG_A11Y) += a11y/ obj-$(CONFIG_PARPORT) += parport/ obj-y += base/ block/ misc/ mfd/ net/ media/ obj-$(CONFIG_NUBUS) += nubus/
include/linux/serial_8250.h +2 -0
@@ -66,4 +66,6 @@extern int serial8250_find_port_for_earlycon (void );extern int setup_early_serial8250_console (char *cmdline); +extern struct console serial8250_console; +#endif
drivers/serial/8250.c +2 -1
@@ -2547,7 +2547,7 @@ }static struct uart_driver serial8250_reg; -static struct console serial8250_console = { +struct console serial8250_console = { .name ="ttyS" , .write = serial8250_console_write, .device = uart_console_device,
@@ -2557,6 +2557,7 @@ .index = -1, .data = &serial8250_reg, }; +EXPORT_SYMBOL_GPL (serial8250_console);static int __init serial8250_console_init (void ) {
drivers/a11y/braille/braille_console.c +390 -0
390 lines not on this page · raw message
drivers/a11y/Kconfig +22 -0
@@ -0,0 +1,22 @@ +menuconfig A11Y + bool "Accessibility support" + ---help--- + Enable a submenu where accessibility items may be enabled. + + If unsure, say N. + +if A11Y +config A11Y_BRAILLE_CONSOLE + tristate "Console on braille device" + depends on SERIAL_8250_CONSOLE + ---help--- + Enables console output on a braille device connected to a 8250 + serial port. For now only the VisioBraille device is supported. + + To actually enable it, you need to pass option + console=brl0 + to the kernel. Options are the same as for serial console. + + If unsure, say N. + +endif # A11Y
drivers/a11y/Makefile +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille/braille_console.o
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
Quoted 3 lines · Samuel Thibault
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.
Will this api work with the SpeakUp kernel drivers? Are the hooks sufficient for what those drivers are expecting?
Quoted 1 line
Signed-off-by Samuel Thibault <[email protected]
You forgot a trailing '>' :)
thanks,
greg k-h
Hello,
Quoted 7 lines · Greg KH, le Mon 04 Feb 2008 09:10:08 -0800, a écrit :
Quoted 3 lines · Samuel Thibault
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.Will this api work with the SpeakUp kernel drivers? Are the hooks sufficient for what those drivers are expecting?
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(), kd_mksound, etc.
Quoted 3 lines
Quoted 1 line
Signed-off-by Samuel Thibault <[email protected]You forgot a trailing '>' :)
Ergl :)
Samuel
Quoted 17 lines · Samuel Thibault
Hello,
Greg KH, le Mon 04 Feb 2008 09:10:08 -0800, a ?crit :
Quoted 7 lines · Samuel Thibault
Quoted 3 lines
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.Will this api work with the SpeakUp kernel drivers? Are the hooks sufficient for what those drivers are expecting?
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.
Quoted 3 lines
However, they share the same low-level primitives: the recently added keyboard and vc notifiers,
screen_glyph(),inverse_translate(),kd_mksound, etc.
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
Quoted 7 lines · Greg KH, le Mon 04 Feb 2008 10:06:17 -0800, a écrit :
Quoted 3 lines
However, they share the same low-level primitives: the recently added keyboard and vc notifiers,
screen_glyph(),inverse_translate(),kd_mksound, etc.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.
Actually, speakup already just use these and no others.
Quoted 4 lines
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.
I _am_ considering both needs. Actually, most of the recent commits to SpeakUp are mines :)
Quoted 2 lines
But, if you feel that both will work properly with these limited exports, I have no objections.
They already both do :)
Samuel
Quoted 10 lines · Samuel Thibault
Greg KH, le Mon 04 Feb 2008 10:06:17 -0800, a ?crit :
Quoted 7 lines
Quoted 3 lines
However, they share the same low-level primitives: the recently added keyboard and vc notifiers,
screen_glyph(),inverse_translate(),kd_mksound, etc.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.
Actually, speakup already just use these and no others.
Great. I have no objection to this patch then :)
thanks,
greg k-h
PATCH RESEND 1/1 Basic braille screen reader support
In reply to Samuel ThibaultThis 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.
---
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.
drivers/char/consolemap.c +1 -0
@@ -277,6 +277,7 @@return p->inverse_translations[m][glyph]; } } +EXPORT_SYMBOL_GPL (inverse_translate);static void update_user_maps (void ) {
drivers/char/vt.c +1 -0
@@ -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)
drivers/char/keyboard.c +2 -0
@@ -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.
drivers/Kconfig +2 -0
@@ -95,4 +95,6 @@ source "drivers/uio/Kconfig" source "drivers/virtio/Kconfig" + +source "drivers/a11y/Kconfig" endmenu
drivers/Makefile +2 -0
@@ -28,6 +28,8 @@ obj-$(CONFIG_FB_INTEL) += video/intelfb/ obj-y += serial/ +# a11y comes after serial because it depends on it +obj-$(CONFIG_A11Y) += a11y/ obj-$(CONFIG_PARPORT) += parport/ obj-y += base/ block/ misc/ mfd/ net/ media/ obj-$(CONFIG_NUBUS) += nubus/
include/linux/serial_8250.h +2 -0
@@ -66,4 +66,6 @@extern int serial8250_find_port_for_earlycon (void );extern int setup_early_serial8250_console (char *cmdline); +extern struct console serial8250_console; +#endif
drivers/serial/8250.c +2 -1
@@ -2547,7 +2547,7 @@ }static struct uart_driver serial8250_reg; -static struct console serial8250_console = { +struct console serial8250_console = { .name ="ttyS" , .write = serial8250_console_write, .device = uart_console_device,
@@ -2557,6 +2557,7 @@ .index = -1, .data = &serial8250_reg, }; +EXPORT_SYMBOL_GPL (serial8250_console);static int __init serial8250_console_init (void ) {
drivers/a11y/braille/braille_console.c +390 -0
390 lines not on this page · raw message
drivers/a11y/Kconfig +22 -0
@@ -0,0 +1,22 @@ +menuconfig A11Y + bool "Accessibility support" + ---help--- + Enable a submenu where accessibility items may be enabled. + + If unsure, say N. + +if A11Y +config A11Y_BRAILLE_CONSOLE + tristate "Console on braille device" + depends on SERIAL_8250_CONSOLE + ---help--- + Enables console output on a braille device connected to a 8250 + serial port. For now only the VisioBraille device is supported. + + To actually enable it, you need to pass option + console=brl0 + to the kernel. Options are the same as for serial console. + + If unsure, say N. + +endif # A11Y
drivers/a11y/Makefile +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille/braille_console.o
Quoted 3 lines · On Tue, 5 Feb 2008 22:00:54 +0000 Samuel Thibault…
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.
Could you feed it through scritps/checkpatch.pl please? That finds a lot of trivial stuff which we'd prefer be fixed.
Quoted 1 line
+#define beep(freq) do { if (sound)
kd_mksound(freq, HZ/10); } while(0)
This can (and hence should!) be impemented in a C function (I think?).
drivers/a11y/braille/braille_console.c line 59
Quoted 6 lines
drivers/a11y/braille/braille_console.c +6
-0+ +/* mini console */ +#define WIDTH 40 +#define BRAILLE_KEY KEY_INSERT +static u16 console_buf[WIDTH ]; +static int console_cursor =0 ;
Unneeded initialisation (checkpatch will tell you about this)
Quoted 15 lines
drivers/a11y/braille/braille_console.c +15
-0+/* mini view of VC */ +static int vc_x, vc_y, lastvc_x, lastvc_y; + +/* show console ? (or show VC) */ +static int console_show =1 ; +/* pending newline ? */ +static int console_newline =1 ; +static int lastVC =-1 ; + +static struct console *braille_co; + +/* Very VisioBraille-specific */ +static void braille_write (u16 *buf) +{ +static u16 lastwrite[WIDTH ];
drivers/a11y/braille/braille_console.c line 85
Quoted 10 lines
drivers/a11y/braille/braille_console.c +10
-0+unsigned char data[1 +1 +2 *WIDTH +2 +1 ], csum =0 , *c; +u16 out; +int i; + +if (!braille_co) +return ; + +if (!memcmp (lastwrite, buf,WIDTH *sizeof (*buf))) +return ; +memcpy (lastwrite, buf,WIDTH *sizeof (*buf));
`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, presumably accessed by file.private_data.
Quoted 22 lines
drivers/a11y/braille/braille_console.c +22
-0+#define SOH 1 +#define STX 2 +#define ETX 2 +#define EOT 4 +#define ENQ 5 + data[0 ] =STX ; + data[1 ] ='>' ; + csum ^='>' ; + c = &data[2 ]; +for (i=0 ; i<WIDTH ; i++) { + out = buf[i]; +if (out >=0x100 ) + out ='?' ; +else if (out ==0x00 ) + out =' ' ; + csum ^= out; +if (out <=0x05 ) { + *c++ =SOH ; + out |=0x40 ; + } + *c++ = out; + }
drivers/a11y/braille/braille_console.c line 118
Quoted 10 lines
drivers/a11y/braille/braille_console.c +10
-0+ +if (csum <=0x05 ) { + *c++ =SOH ; + csum =0x40 ; + } + *c++ = csum; + *c++ =ETX ; + + serial8250_console.write (braille_co, data, c - data); +}
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 like that?
Quoted 5 lines
drivers/a11y/braille/braille_console.c +5
-0+/* +* Link to keyboard +*/ + +static int keyboard_notifier_call (struct notifier_block *blk,unsigned long code,void *_param)
drivers/a11y/braille/braille_console.c line 163
Quoted 10 lines
drivers/a11y/braille/braille_console.c +10
-0+{ +struct keyboard_notifier_param *param = _param; +struct vc_data *vc = param->vc; +int ret =NOTIFY_OK ; + +if (!param->down) +return ret; + +switch (code) { +case KBD_KEYCODE :
Maybe Dmitry and Jiri would have time to review this code?
Quoted 83 lines
drivers/a11y/braille/braille_console.c +83
-0+static struct notifier_block keyboard_notifier_block = { + .notifier_call = keyboard_notifier_call, +}; + +static int vt_notifier_call (struct notifier_block *blk,unsigned long code,void *_param) +{ +struct vt_notifier_param *param = _param; +struct vc_data *vc = param->vc; +switch (code) { +case VT_ALLOCATE : +break ; +case VT_DEALLOCATE : +break ; +case VT_WRITE : + { +unsigned char c = param->c; +switch (c) { +case '\b' : +case 127 : +if (console_cursor >0 ) { + console_cursor--; + console_buf[console_cursor] =' ' ; + } +break ; +case '\n' : +case '\v' : +case '\f' : +case '\r' : + console_newline =1 ; +break ; +case '\t' : + c =' ' ; +/* Fallthrough */ +default : +if (c <32 ) +/* Ignore other control sequences */ +break ; +if (console_newline) { +memset (console_buf,0 ,sizeof (console_buf)); + console_cursor =0 ; + console_newline =0 ; + } +if (console_cursor ==WIDTH ) +memmove (console_buf, &console_buf[1 ], (WIDTH -1 ) *sizeof (*console_buf)); +else + console_cursor++; + console_buf[console_cursor-1 ] = c; +break ; + } +if (console_show) +braille_write (console_buf); +else { +vc_maybe_cursor_moved (vc); +vc_refresh (vc); + } +break ; + } +case VT_UPDATE : +/* Maybe a VT switch, flush */ +if (console_show) { +if (vc->vc_num != lastVC) { + lastVC = vc->vc_num; +memset (console_buf,0 ,sizeof (console_buf)); + console_cursor =0 ; +braille_write (console_buf); + } + }else { +vc_maybe_cursor_moved (vc); +vc_refresh (vc); + } +break ; + } +return NOTIFY_OK ; +} + +static struct notifier_block vt_notifier_block = { + .notifier_call = vt_notifier_call, +}; + +/* +* Link to serial console +*/ +
drivers/a11y/braille/braille_console.c line 359
Quoted 10 lines
drivers/a11y/braille/braille_console.c +10
-0+static int __init braille_console_setup (struct console *co,char *options) +{ +int ret =0 ; +if (co->index ==-1 ) + co->index =0 ; +#ifndef MODULE + ret = serial8250_console.setup (co, options); +if (ret <0 ) +return ret; +#endif
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 them under userspace control (like a line discipline), all this would get better.
Quoted 18 lines
drivers/a11y/braille/braille_console.c +11
-0+ braille_co = co; +return ret; +} + +static struct console braille_console = { + .name ="brl" , + .setup = braille_console_setup, + .flags =CON_PRINTBUFFER , + .index =-1 , +}; +diff -urN linux-2.6.24-orig/drivers/a11y/Kconfig linux-2.6.24-perso/drivers/a11y/Kconfig
drivers/a11y/Kconfig line 2
Quoted 2 lines
drivers/a11y/Kconfig +2
-0@@ -0,0 +1,22 @@ +menuconfig A11Y + bool "Accessibility support"
That's cute, but perhaps we should be boring and call it CONFIG_ACCESSIBILITY. That would be more accessible ;)
drivers/a11y/Kconfig line 9
Quoted 7 lines
drivers/a11y/Kconfig +7
-0+ ---help--- + Enable a submenu where accessibility items may be enabled. + + If unsure, say N. + +if A11Y +config A11Y_BRAILLE_CONSOLE
And that would get very lengthy.
Quoted 13 lines
drivers/a11y/Kconfig +13
-0+ tristate "Console on braille device" + depends on SERIAL_8250_CONSOLE + ---help--- + Enables console output on a braille device connected to a 8250 + serial port. For now only the VisioBraille device is supported. + + To actually enable it, you need to pass option + console=brl0 + to the kernel. Options are the same as for serial console. + + If unsure, say N. + +endif # A11Y
Quoted 9 lines · Andrew Morton, le Tue 05 Feb 2008 16:58:53 -0800, a écrit :
Quoted 3 lines · On Tue, 5 Feb 2008 22:00:54 +0000 Samuel Thibault…
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.Could you feed it through
scritps/checkpatch.plplease? That finds a lot of trivial stuff which we'd prefer be fixed.
Oops, sorry, it's probably been some time since I last read SubmittingPatches. Actually, this discovered a false positive in checkpatch.pl for kbd_table :)
Quoted 4 lines
`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.
It is meant to be yes, though it was lacking protection against this. Fixed in this new version.
Quoted 4 lines
Review
Quoted 1 line
(quoted diff) +1
-0+ serial8250_console.write(braille_co, data, c - data);hm. Is it appropriate that this driver wire itself directly into serial8250?
We want to have output as early as possible for debugging, just like early serial consoles.
Quoted 2 lines
What if the screen reader is attached to some other sort of uart, or a terminal server, or...
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 to use.
Quoted 2 lines
Maybe this all should be implemented as a line discipline, or something like that?
For a permanent screen reader, yes (that's what we will probably do for SpeakUp), but for an boot reader, I don't think it may even work.
Quoted 7 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+#ifndef MODULE + ret = serial8250_console.setup(co, options); + if (ret < 0) + return ret; +#endifThat's pretty ungainly.
The problem is that there is currently no better way to setup the serial port so early.
Quoted 3 lines
Again, if we had some clear spearation between the
protocol layer and the device-driver layer and some way of binding them under userspace control (like a line discipline), all this would get better.
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 userspace can't be booted :)
Quoted 5 lines
Review line 2
Quoted 3 lines
(quoted diff) +2
-0@@ -0,0 +1,22 @@ +menuconfig A11Y + bool "Accessibility support"That's cute,
Well, that's the official name (www.a11y.org) :)
Quoted 2 lines
but perhaps we should be boring and call it
CONFIG_ACCESSIBILITY. That would be more accessible ;)
Why not :)
Quoted 9 lines
Review line 9
Quoted 7 lines
(quoted diff) +7
-0+ ---help--- + Enable a submenu where accessibility items may be enabled. + + If unsure, say N. + +if A11Y +config A11Y_BRAILLE_CONSOLEAnd that would get very lengthy.
Then 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.
drivers/char/consolemap.c +1 -0
@@ -277,6 +277,7 @@return p->inverse_translations[m][glyph]; } } +EXPORT_SYMBOL_GPL (inverse_translate);static void update_user_maps (void ) {
drivers/char/vt.c +1 -0
@@ -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)
drivers/char/keyboard.c +2 -0
@@ -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.
drivers/Kconfig +2 -0
@@ -95,4 +95,6 @@ source "drivers/uio/Kconfig" source "drivers/virtio/Kconfig" + +source "drivers/a11y/Kconfig" endmenu
drivers/Makefile +2 -0
@@ -28,6 +28,8 @@ obj-$(CONFIG_FB_INTEL) += video/intelfb/ obj-y += serial/ +# a11y comes after serial because it depends on it +obj-$(CONFIG_ACCESSIBILITY) += a11y/ obj-$(CONFIG_PARPORT) += parport/ obj-y += base/ block/ misc/ mfd/ net/ media/ obj-$(CONFIG_NUBUS) += nubus/
include/linux/serial_8250.h +2 -0
@@ -66,4 +66,6 @@extern int serial8250_find_port_for_earlycon (void );extern int setup_early_serial8250_console (char *cmdline); +extern struct console serial8250_console; +#endif
drivers/serial/8250.c +2 -1
@@ -2547,7 +2547,7 @@ }static struct uart_driver serial8250_reg; -static struct console serial8250_console = { +struct console serial8250_console = { .name ="ttyS" , .write = serial8250_console_write, .device = uart_console_device,
@@ -2557,6 +2557,7 @@ .index = -1, .data = &serial8250_reg, }; +EXPORT_SYMBOL_GPL (serial8250_console);static int __init serial8250_console_init (void ) {
drivers/a11y/braille/braille_console.c +404 -0
404 lines not on this page · raw message
drivers/a11y/Kconfig +22 -0
@@ -0,0 +1,22 @@ +menuconfig ACCESSIBILITY + bool "Accessibility support" + ---help--- + Enable a submenu where accessibility items may be enabled. + + If unsure, say N. + +if ACCESSIBILITY +config A11Y_BRAILLE_CONSOLE + tristate "Console on braille device" + depends on SERIAL_8250_CONSOLE + ---help--- + Enables console output on a braille device connected to a 8250 + serial port. For now only the VisioBraille device is supported. + + To actually enable it, you need to pass option + console=brl0 + to the kernel. Options are the same as for serial console. + + If unsure, say N. + +endif # ACCESSIBILITY
drivers/a11y/Makefile +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille/braille_console.o
Quoted 10 lines · Samuel Thibault, le Wed 06 Feb 2008 02:04:23 +0000, a écrit :
Quoted 8 lines · Andrew Morton, le Tue 05 Feb 2008 16:58:53 -0800, a écrit :
Review
Quoted 1 line · On Tue, 5 Feb 2008 22:00:54 +0000 Samuel Thibault…
(quoted diff) +1
-0+ serial8250_console.write(braille_co, data, c - data);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...
Quoted 2 lines
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,
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.
drivers/char/consolemap.c +1 -0
@@ -277,6 +277,7 @@return p->inverse_translations[m][glyph]; } } +EXPORT_SYMBOL_GPL (inverse_translate);static void update_user_maps (void ) {
drivers/char/keyboard.c +2 -0
@@ -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.
drivers/char/vt.c +1 -0
@@ -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)
drivers/Kconfig +2 -0
@@ -95,4 +95,6 @@ source "drivers/uio/Kconfig" source "drivers/virtio/Kconfig" + +source "drivers/accessibility/Kconfig" endmenu
drivers/Makefile +1 -0
@@ -5,6 +5,7 @@ # Rewritten to use lists instead of if-statements. # +obj-$(CONFIG_ACCESSIBILITY) += accessibility/ obj-$(CONFIG_PCI) += pci/ obj-$(CONFIG_PARISC) += parisc/ obj-$(CONFIG_RAPIDIO) += rapidio/
include/linux/console.h +4 -0
@@ -91,6 +91,7 @@#define CON_ENABLED (4)#define CON_BOOT (8)#define CON_ANYTIME (16)/* Safe to call when cpu is offline */ +#define CON_BRL (32)/* Used for a braille device */ struct console {char name[16 ];
@@ -121,6 +122,9 @@extern void console_stop (struct console *);extern void console_start (struct console *);extern int is_console_locked (void ); +extern int braille_register_console (struct console *,int index, +char *console_options,char *braille_options); +extern int braille_unregister_console (struct console *);extern int console_suspend_enabled;
kernel/printk.c +63 -24
131 lines not on this page · raw message
drivers/accessibility/braille/braille_console.c +397 -0
397 lines not on this page · raw message
drivers/accessibility/Kconfig +22 -0
@@ -0,0 +1,22 @@ +menuconfig ACCESSIBILITY + bool "Accessibility support" + ---help--- + Enable a submenu where accessibility items may be enabled. + + If unsure, say N. + +if ACCESSIBILITY +config A11Y_BRAILLE_CONSOLE + bool "Console on braille device" + depends on SERIAL_CORE_CONSOLE + ---help--- + Enables console output on a braille device connected to a 8250 + serial port. For now only the VisioBraille device is supported. + + To actually enable it, you need to pass option + console=brl,ttyS0 + to the kernel. Options are the same as for serial console. + + If unsure, say N. + +endif # ACCESSIBILITY
drivers/accessibility/Makefile +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille/braille_console.o
Quoted 20 lines · On Fri, 22 Feb 2008 01:28:22 +0100 Samuel Thibault…
Samuel Thibault, le Wed 06 Feb 2008 02:04:23 +0000, a
__crit:Quoted 10 lines
Andrew Morton, le Tue 05 Feb 2008 16:58:53 -0800, a
__crit:Quoted 8 lines
Review
Quoted 1 line · On Tue, 5 Feb 2008 22:00:54 +0000 Samuel Thibault…
(quoted diff) +1
-0+ serial8250_console.write(braille_co, data, c - data);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...Quoted 2 lines
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,
In the patch below, I hook into kernel/printk.c's console= parser, which now gives me attachment to any kind of console.
Quoted 4 lines
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.
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 and Dmitry appear to be hiding.
Review
Quoted 2 lines
+++
linux-2.6.24.1-perso/kernel/printk.c2008-02-21 12:09:06.000000000 +0100(quoted diff) +0
-0@@ -105,6 +105,7 @@
Please use `diff -p'
kernel/printk.c line 109
Quoted 5 lines
kernel/printk.c +1
-0char name[8 ];/* Name of the driver */ int index;/* Minor dev. to use */ char *options;/* Options for the driver */ +char *brl_options;/* Options for braille driver */ };
Should this depend on CONFIG_A11Y_BRAILLE_CONSOLE or whatever?
Quoted 14 lines
kernel/printk.c +9
-0#define MAX_CMDLINECONSOLES 8@@ -766,15 +767,59 @@#endif +static int __add_preferred_console (char *name,int idx,char *options, +char *brl_options) +{ +struct console_cmdline *c; +int i; + +/* +* See if this tty is not yet registered, and +* if we have a slot free.
kernel/printk.c line 788
Quoted 10 lines
kernel/printk.c +10
-0+*/ +for (i =0 ; i <MAX_CMDLINECONSOLES && console_cmdline[i].name[0 ]; i++) +if (strcmp (console_cmdline[i].name, name) ==0 && + console_cmdline[i].index == idx) { +if (!brl_options) + selected_console = i; +return 0 ; + } +if (i ==MAX_CMDLINECONSOLES ) +return -E2BIG ;
Does the array of consles have any locking here?
kernel/printk.c line 793
Quoted 5 lines
kernel/printk.c +5
-0+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()?
Quoted 19 lines
kernel/printk.c +10
-1+ c->options = options; + c->brl_options = brl_options; + c->index = idx; +return 0 ; +}/* * Set up a list of consoles. Called from init/main.c */ static int __init console_setup (char *str) {char buf[sizeof (console_cmdline[0 ].name) +4 ];/* 4 for index */ -char *s, *options; +char *s, *options, *brl_options =NULL ;int idx; +#ifdef CONFIG_A11Y_BRAILLE_CONSOLE +if (!memcmp (str,"brl," ,4 )) { + brl_options ="" ; + str +=4 ;
kernel/printk.c line 821
Quoted 10 lines
kernel/printk.c +10
-0+ } else if (!memcmp(str, "brl=", 4)) { + brl_options = str +4 ; + str =strchr (brl_options,',' ); +if (!str) { +printk (KERN_ERR "need port name after brl=\n" ); +return 1 ; + } + *(str++) =0 ; + } +#endif
Update Documentation/kernel-parameters.txt, please. And additional documentation would be nice, if justified?
Quoted 9 lines
kernel/printk.c +1
-1/* * Decode str into name, index, options. */ @@ -799,7 +844,7 @@ idx =simple_strtoul (s,NULL ,10 ); *s =0 ; -add_preferred_console (buf, idx, options); +__add_preferred_console (buf, idx, options, brl_options);
kernel/printk.c
Quoted 10 lines
kernel/printk.c +5
-0return 1 ; } +static void beep (unsigned int freq) +{ +if (sound) +kd_mksound (freq,HZ /10 ); +}
hm, do we have enough Kconfig dependencies here to ensure that kd_mksound() is always available?
Quoted 4 lines · Andrew Morton, le Sat 23 Feb 2008 00:04:10 -0800, a écrit :
Review
Quoted 2 lines
+++
linux-2.6.24.1-perso/kernel/printk.c2008-02-21 12:09:06.000000000 +0100(quoted diff) +0
-0@@ -105,6 +105,7 @@Please use `diff -p'
Argl, that's editdiff's fault. We need to fix it to keep the -p comments.
Quoted 7 lines
kernel/printk.c line 109
Quoted 5 lines
kernel/printk.c +1
-0char name[8 ];/* Name of the driver */ int index;/* Minor dev. to use */ char *options;/* Options for the driver */ +char *brl_options;/* Options for braille driver */ };Should this depend on
CONFIG_A11Y_BRAILLE_CONSOLEor whatever?
It can, indeed. It just makes the code a little more clumsy to save 32 or 64 bytes.
Quoted 11 lines
kernel/printk.c line 788
Quoted 9 lines
kernel/printk.c +9
-0+for (i =0 ; i <MAX_CMDLINECONSOLES && console_cmdline[i].name[0 ]; i++) +if (strcmp (console_cmdline[i].name, name) ==0 && + console_cmdline[i].index == idx) { +if (!brl_options) + selected_console = i; +return 0 ; + } +if (i ==MAX_CMDLINECONSOLES ) +return -E2BIG ;Does the array of consles have any locking here?
Well, that's actually just the original code that I moved a bit earlier, so the code path is not changed.
Quoted 7 lines
kernel/printk.c line 793
Quoted 5 lines
kernel/printk.c +5
-0+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()?
Again, that's the original code, unmodified, but we can put an strlcpy here yes.
Quoted 8 lines
drivers/accessibility/braille/braille_console.c line 56
Quoted 5 lines
drivers/accessibility/braille/braille_console.c +5
-0+static void beep (unsigned int freq) +{ +if (sound) +kd_mksound (freq,HZ /10 ); +}hm, do we have enough
Kconfigdependencies here to ensure thatkd_mksound()is always available?
Ah, CONFIG_VT is needed indeed.
I'll address those in replies to this mail.
Samuel
PATCH 1/1 Braille screen reader fixes
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.
kernel/printk.c +5 -2
@@ -105,7 +105,9 @@ struct console_cmdlinechar 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_consoleif (!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 ; }
drivers/accessibility/Kconfig +1 -0
@@ -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
PATCH 1/1 Braille screen reader documentation
In reply to Samuel ThibaultDocument the console=brl option and the usage of the braille screen reader.
Documentation/kernel-parameters.txt +5 -0
@@ -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]
Documentation/braille-console.txt +34 -0
@@ -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 screen, and the home key goes back +to the cursor, hence providing very basic screen reviewing facility. + +Sound feedback can be obtained by adding the braille_console.sound=1 kernel +parameter. + +For simplicity, only one braille console can be enabled, other uses of +console=brl,... will be discarded. Also note that it does not interfere with +the console selection mecanism described in serial-console.txt + +For now, only the VisioBraille device is supported. + +Samuel Thibault <[email protected]>
Quoted 9 lines · Randy Dunlap, le Wed 19 Mar 2008 11:57:26 -0700, a écrit :
when O=dir is used in make:
CC
drivers/accessibility/braille/braille_console.o
Assembler messages:
Fatal error: can't createdrivers/accessibility/braille/braille_console.o: No such file or directory
CCcrypto/aes_generic.o
make[3]: *** [drivers/accessibility/braille/braille_console.o] Error 2
make[2]: *** [drivers/accessibility] Error 2
make[1]: *** [drivers] Error 2
Oh, right, the patch below should fix it
Properly recurse Makefiles into accessibility and accessibility/braille/
drivers/accessibility/Makefile renamed from drivers/accessibility/Makefile.orig +1 -1
@@ -1 +1 @@ -obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille/braille_console.o +obj-y += braille/
drivers/accessibility/braille/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille_console.o
Randy Dunlap
Acked-byQuoted 11 lines · On Thu, 20 Mar 2008 02:07:59 +0000 Samuel Thibault wrote:
Quoted 9 lines · Randy Dunlap, le Wed 19 Mar 2008 11:57:26 -0700, a écrit :
when O=dir is used in make:
CC
drivers/accessibility/braille/braille_console.o
Assembler messages:
Fatal error: can't createdrivers/accessibility/braille/braille_console.o: No such file or directory
CCcrypto/aes_generic.o
make[3]: *** [drivers/accessibility/braille/braille_console.o] Error 2
make[2]: *** [drivers/accessibility] Error 2
make[1]: *** [drivers] Error 2
Quoted 2 lines
Oh, right, the patch below should fix it
Thanks.
Quoted 15 lines
Properly recurse Makefiles into accessibility and accessibility/braille/
Signed-off-by Samuel Thibault <[email protected]>drivers/accessibility/Makefile renamed from drivers/accessibility/Makefile.orig +1
-1@@ -1 +1 @@ -obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille/braille_console.o +obj-y += braille/drivers/accessibility/braille/Makefile new file +1
-1@@ -0,0 +1 @@ +obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille_console.o --
Quoted 5 lines
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
---
~Randy
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
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.
drivers/char/consolemap.c +1 -0
@@ -277,6 +277,7 @@return p->inverse_translations[m][glyph]; } } +EXPORT_SYMBOL_GPL (inverse_translate);static void update_user_maps (void ) {
drivers/char/keyboard.c +2 -0
@@ -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.
drivers/char/vt.c +1 -0
@@ -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)
Quoted 2 lines · On Thu, 24 Apr 2008 01:39:00 +0100 Samuel Thibault…
Could the basic braille screen reader be pushed to 2.6.26?
I was intending to do that.
(I don't like the code much but can't suggest anything better)
Alan Cox
Acked-byQuoted 9 lines · On Thu, 24 Apr 2008 01:39:00 +0100 Samuel Thibault…
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...)
Quoted 5 lines
Samuel
Export functions typically used by screen reading modules.
Signed-off-by Samuel Thibault <[email protected]>
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.
Quoted 47 lines
diff -ur
linux-2.6.24.1-orig/drivers/char/consolemap.clinux-2.6.24.1-perso/drivers/char/consolemap.cdrivers/char/consolemap.c +1
-0@@ -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.clinux-2.6.24.1-perso/drivers/char/keyboard.cdrivers/char/keyboard.c +2
-0@@ -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.clinux-2.6.24.1-perso/drivers/char/vt.cdrivers/char/vt.c +1
-1@@ -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) --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 3 lines
-- "Alan, I'm getting a bit worried about you." -- Linus Torvalds
Quoted 7 lines · Alan Cox, le Thu 24 Apr 2008 11:21:26 +0100, a écrit :
Quoted 1 line · On Thu, 24 Apr 2008 01:39:00 +0100 Samuel Thibault…
Export functions typically used by screen reading modules.
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.
Ok.
Additionnal exports which will be of much use is selection, see patch below.
Samuel
Export set_selection and paste_selection for accessibility modules.
drivers/char/selection.c renamed from drivers/char/selection.c.orig +2 -0
@@ -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 *ttty_ldisc_deref (ld);return 0 ; } +EXPORT_SYMBOL_GPL (paste_selection);