Skip to contentSkip to conversation

GRUB2 and braille support

RFC Vladimir 'φ-coder/phcoder' Serbinenko 3 participants 6 messages Jul 21, 2010 – Jul 30, 2010

lore
Share & tools
lore
#0 lore raw

-------- Original Message --------
Subject: [RFC] GRUB2 and braille support
Date: Wed, 21 Jul 2010 00:08:45 +0200
From: Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]>
To: The development of GRUB 2 <[email protected]>, [email protected]

Hello, all. RMLL2010 was useful for GRUB project too. On one hand it allowed me to give a speech about it and on the other hand it has brought new ideas. In particular with Samuel Thibault we discussed accessibility. Mainstream color defaults are black and white which gives good contrast and no problems for colorblind people. If distribution changes these defaults they have to ensure that their defaults Next step is to help people having either vision or motor problems. @Samuel: whcih options can we propose for people which aren't blind but have vision problems?
It's already possible to load bigger fonts.
Now I'm working on braille support. I already coded 40x1 menu selector and menuentry editor. For 40x1 console I need to add scrolling first. it's in branches/a11y
I also coded FTDI and PL3203 usbserial drivers. It's in branches/usb. Now we need the braille drivers to go in-between. I thought of importing Linux braille drivers since they seem to be under GPLv2+. I hope that I CC the right list for it. My plan is to have an import similar to what we have with libgcrypt: we copy the patches verbatim and try to emulate the environment similar to native one. If any preprocessing is needed we have 2 directories: one with files as they are imported and another with the files to compile. The second one is generated from the first one with python script at autogen phase. This way we avoid forking and can easily resync
What do you think?

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#2 lore raw
In reply to Mario Lang
Quoted 3 lines · Mario Lang, le Wed 28 Jul 2010 22:50:02 +0200, a écrit :

I guess another approach could be to treat GRUB2 as a platform supported by brltty, but I really dont know anything about GRUBs support for plugins or externally compiled code...

That was also something I had considered. One advantage of copying the code into GRUB is to make sure that it's shipped by default in all distributions. With USB autodetection, that'd be a great systematic progress in GRUB accessibility!

Samuel

#3 lore raw

For the record, here is attached a list of the external references of braille drivers (list-brl, filtered out a bit). Apart from standard C functions, I can see

- timing functions

- bluetooth functions
- serial functions
- usb functions
- io port functions

- dots/character conversion

- logging

- a couple of helpers like isInteger or reallocWrapper which could probably be fetched from the brltty source.

- queueing keypresses

Actually, I'm even wondering whether we could just drop support for braille device keys. Of course, full-fledged support would be great, but that makes maintainability more difficult.

For the braille translation part, I tried to link together

parse.o file.o queue.o dataarea.o datafile.o ttb_compile.o ttb_native.ok

and it gave me the second list of symbols (list-ttb). A couple of them are probably not needed in this context actually (like mkdir).

Samuel

U accurateDelay
U approximateDelay
U atoi
U bthAwaitInput
U bthCloseConnection
U bthOpenConnection
U bthReadData
U bthWriteData
U close
U convertCharacterToDots
U convertDotsToCharacter
U difftime
U disablePorts
U drainBrailleOutput
U enablePorts
U enqueueCommand
U enqueueKeyEvent
U __errno_location
U free
U __fxstat
U getConsole
U gettimeofday
U hasTimedOut
U isBluetoothDevice
U isInteger
U isSerialDevice
U isUsbDevice
U localtime
U logBytes
U logCorruptPacket
U logDiscardedByte
U logDiscardedBytes
U logIgnoredByte
U logInputPacket
U logInputProblem
U logOutputPacket
U logPartialPacket
U LogPrint
U logShortPacket
U logSystemError
U logTruncatedPacket
U logUnexpectedPacket
U logUnknownPacket
U __lxstat
U makeOutputTable
U malloc
U mallocWrapper
U memchr
U memcmp
U memcpy
U memmove
U memset
U message
U millisecondsBetween
U millisecondsSince
U open
U portraitNumber
U read
U readPort1
U realloc
U reallocWrapper
U reverseTranslationTable
U seascapeFlag
U seascapeNumber
U serialAwaitInput
U serialCloseDevice
U serialDiscardInput
U serialDiscardOutput
U serialDrainOutput
U serialGetCharacterBits
U serialOpenDevice
U serialReadChunk
U serialReadData
U serialRestartDevice
U serialSetBaud
U serialSetFlowControl
U serialSetParity
U serialTestLineDSR
U serialValidateBaud
U serialWriteData
U snprintf
U sprintf
U strcmp
U strerror
U strftime
U strlen
U strncmp
U strpbrk
U strrchr
U strstr
U strtok
U textTable
U time
U touchAnalyzeCells
U touchAnalyzePressure
U unsupportedDevice
U usbAwaitInput
U usbCloseChannel
U usbControlRead
U usbControlWrite
U usbDecodeString
U usbFindChannel
U usbGetProduct
U usbHidFillReportDescription
U usbHidGetFeature
U usbHidGetItems
U usbHidGetReport
U usbHidSetReport
U usbReadEndpoint
U usbReapInput
U usbSetSerialParameters
U usbWriteEndpoint
U usleep
U validateChoice
U validateInteger
U validateYesNo
U wmemcmp
U wmemcpy
U wmemset
U write
U writePort1

U LogPrint
U __errno_location
U access
U chdir
U convertCharToWchar
U convertCharsToWchars
U convertStringToWchars
U fclose
U fcntl
U feof
U ferror
U fgets
U fileno
U fopen
U free
U getcwd
U getenv
U gettext
U iswspace
U logMallocError
U logSystemError
U malloc
U mallocWrapper
U memchr
U memcmp
U memcpy
U memset
U mkdir
U realloc
U reallocWrapper
U snprintf
U stat
U strchr
U strcmp
U strdup
U strdupWrapper
U strerror
U strlen
U strncasecmp
U strncmp
U strrchr
U strtod
U strtol
U towlower
U u_charFromName_4_2
U vsnprintf
U wcschr
U wcslen
U wmemchr
U wmemcmp
U wmemcpy

#4 lore raw

Another option of course is to just embed the whole brltty code, and just adding a grub screen driver. That'd be much more demanding in terms of libc functions (see attached rough list on Linux), as well as some refactoring of the brltty main loop to make it live along the grub main loop.

Samuel

                 U __ctype_b_loc@@GLIBC_2.3
                 U __cxa_atexit@@GLIBC_2.2.5
                 U __errno_location@@GLIBC_2.2.5
                 U __fxstat@@GLIBC_2.2.5
                 U __libc_start_main@@GLIBC_2.2.5
                 U __lxstat@@GLIBC_2.2.5
                 U __xmknod@@GLIBC_2.2.5
                 U __xstat@@GLIBC_2.2.5
                 U _exit@@GLIBC_2.2.5
                 U access@@GLIBC_2.2.5
                 U bind@@GLIBC_2.2.5
                 U bsearch@@GLIBC_2.2.5
                 U calloc@@GLIBC_2.2.5
                 U cfsetispeed@@GLIBC_2.2.5
                 U cfsetospeed@@GLIBC_2.2.5
                 U chdir@@GLIBC_2.2.5
                 U chmod@@GLIBC_2.2.5
                 U clearerr@@GLIBC_2.2.5
                 U close@@GLIBC_2.2.5
                 U closedir@@GLIBC_2.2.5
                 U closelog@@GLIBC_2.2.5
                 U exit@@GLIBC_2.2.5
                 U fchdir@@GLIBC_2.2.5
                 U fclose@@GLIBC_2.2.5
                 U fcntl@@GLIBC_2.2.5
                 U fdopen@@GLIBC_2.2.5
                 U feof@@GLIBC_2.2.5
                 U ferror@@GLIBC_2.2.5
                 U fflush@@GLIBC_2.2.5
                 U fgets@@GLIBC_2.2.5
                 U fileno@@GLIBC_2.2.5
                 U fopen@@GLIBC_2.2.5
                 U fprintf@@GLIBC_2.2.5
                 U fputc@@GLIBC_2.2.5
                 U fputs@@GLIBC_2.2.5
                 U fread@@GLIBC_2.2.5
                 U free@@GLIBC_2.2.5
                 U freopen@@GLIBC_2.2.5
                 U ftruncate@@GLIBC_2.2.5
                 U fwrite@@GLIBC_2.2.5
                 U getcwd@@GLIBC_2.2.5
                 U getenv@@GLIBC_2.2.5
                 U getopt_long@@GLIBC_2.2.5
                 U getpid@@GLIBC_2.2.5
                 U gettext@@GLIBC_2.2.5
                 U gettimeofday@@GLIBC_2.2.5
                 U glob@@GLIBC_2.2.5
                 U globfree@@GLIBC_2.2.5
                 U gnu_dev_makedev@@GLIBC_2.3.3
                 U iconv@@GLIBC_2.2.5
                 U iconv_close@@GLIBC_2.2.5
                 U iconv_open@@GLIBC_2.2.5
                 U ioctl@@GLIBC_2.2.5
                 U ioperm@@GLIBC_2.2.5
                 U isatty@@GLIBC_2.2.5
                 U iswalpha@@GLIBC_2.2.5
                 U iswcntrl@@GLIBC_2.2.5
                 U iswdigit@@GLIBC_2.2.5
                 U iswlower@@GLIBC_2.2.5
                 U iswpunct@@GLIBC_2.2.5
                 U iswspace@@GLIBC_2.2.5
                 U iswupper@@GLIBC_2.2.5
                 U kill@@GLIBC_2.2.5
                 U localtime@@GLIBC_2.2.5
                 U lseek@@GLIBC_2.2.5
                 U malloc@@GLIBC_2.2.5
                 U memchr@@GLIBC_2.2.5
                 U memcmp@@GLIBC_2.2.5
                 U memcpy@@GLIBC_2.2.5
                 U memmove@@GLIBC_2.2.5
                 U memset@@GLIBC_2.2.5
                 U mkdir@@GLIBC_2.2.5
                 U mkfifo@@GLIBC_2.2.5
                 U mount@@GLIBC_2.2.5
                 U nl_langinfo@@GLIBC_2.2.5
                 U open@@GLIBC_2.2.5
                 U opendir@@GLIBC_2.2.5
                 U openlog@@GLIBC_2.2.5
                 U poll@@GLIBC_2.2.5
                 U pthread_mutex_lock@@GLIBC_2.2.5
                 U pthread_mutex_unlock@@GLIBC_2.2.5
                 U pthread_rwlock_destroy@@GLIBC_2.2.5
                 U pthread_rwlock_init@@GLIBC_2.2.5
                 U pthread_rwlock_rdlock@@GLIBC_2.2.5
                 U pthread_rwlock_tryrdlock@@GLIBC_2.2.5
                 U pthread_rwlock_trywrlock@@GLIBC_2.2.5
                 U pthread_rwlock_unlock@@GLIBC_2.2.5
                 U pthread_rwlock_wrlock@@GLIBC_2.2.5
                 U qsort@@GLIBC_2.2.5
                 U read@@GLIBC_2.2.5
                 U readdir@@GLIBC_2.2.5
                 U readlink@@GLIBC_2.2.5
                 U realloc@@GLIBC_2.2.5
                 U realpath@@GLIBC_2.3
                 U regcomp@@GLIBC_2.2.5
                 U regexec@@GLIBC_2.3.4
                 U regfree@@GLIBC_2.2.5
                 U select@@GLIBC_2.2.5
                 U setlocale@@GLIBC_2.2.5
                 U sigaction@@GLIBC_2.2.5
                 U sigaddset@@GLIBC_2.2.5
                 U sigemptyset@@GLIBC_2.2.5
                 U sigprocmask@@GLIBC_2.2.5
                 U snprintf@@GLIBC_2.2.5
                 U sprintf@@GLIBC_2.2.5
                 U sscanf@@GLIBC_2.2.5
                 U statfs@@GLIBC_2.2.5
                 U strcasecmp@@GLIBC_2.2.5
                 U strchr@@GLIBC_2.2.5
                 U strcmp@@GLIBC_2.2.5
                 U strcspn@@GLIBC_2.2.5
                 U strdup@@GLIBC_2.2.5
                 U strerror@@GLIBC_2.2.5
                 U strlen@@GLIBC_2.2.5
                 U strncasecmp@@GLIBC_2.2.5
                 U strncmp@@GLIBC_2.2.5
                 U strncpy@@GLIBC_2.2.5
                 U strrchr@@GLIBC_2.2.5
                 U strspn@@GLIBC_2.2.5
                 U strstr@@GLIBC_2.2.5
                 U strtod@@GLIBC_2.2.5
                 U strtok@@GLIBC_2.2.5
                 U strtol@@GLIBC_2.2.5
                 U sysconf@@GLIBC_2.2.5
                 U tcdrain@@GLIBC_2.2.5
                 U tcflush@@GLIBC_2.2.5
                 U tcgetattr@@GLIBC_2.2.5
                 U tcsetattr@@GLIBC_2.2.5
                 U textdomain@@GLIBC_2.2.5
                 U time@@GLIBC_2.2.5
                 U tolower@@GLIBC_2.2.5
                 U toupper@@GLIBC_2.2.5
                 U towlower@@GLIBC_2.2.5
                 U towupper@@GLIBC_2.2.5
                 U unlink@@GLIBC_2.2.5
                 U usleep@@GLIBC_2.2.5
                 U vfprintf@@GLIBC_2.2.5
                 U vsnprintf@@GLIBC_2.2.5
                 U vsyslog@@GLIBC_2.2.5
                 U waitpid@@GLIBC_2.2.5
                 U wcschr@@GLIBC_2.2.5
                 U wcslen@@GLIBC_2.2.5
                 U wmemchr@@GLIBC_2.2.5
                 U wmemcmp@@GLIBC_2.2.5
                 U wmemcpy@@GLIBC_2.2.5
                 U wmemmove@@GLIBC_2.2.5
                 U wmemset@@GLIBC_2.2.5
                 U write@@GLIBC_2.2.5
#1 lore raw
In reply to Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 4 lines · Vladimir 'φ-coder/phcoder' Serbinenko

Now I'm working on braille support. I already coded 40x1 menu selector and menuentry editor. For 40x1 console I need to add scrolling first. it's in branches/a11y
I also coded FTDI and PL3203 usbserial drivers. It's in branches/usb.

Some of our existing drivers implement well-known serial adaptors, others need more low-level USB access which we provide through our own internal USB stack impementation.

Quoted 9 lines

Now we need the braille drivers to go in-between. I thought of importing Linux braille drivers since they seem to be under GPLv2+. I hope that I CC the right list for it. My plan is to have an import similar to what we have with libgcrypt: we copy the patches verbatim and try to emulate the environment similar to native one. If any preprocessing is needed we have 2 directories: one with files as they are imported and another with the files to compile. The second one is generated from the first one with python script at autogen phase. This way we avoid forking and can easily resync

That sounds like a nice plan.

Quoted 1 line

What do you think?

The drivers you want to import are at

svn://mielke.cc/main/brltty in subdirectory Drivers/Braille minus a few like Skeleton, Libbraille and possibly BrlAPI.

As mentioned, these drivers use IO functions provides in Programs/io_{serial,usb,bluetooth}.h which are implemented for several platforms (Linux, BSDs, Windows and a few others).

The way the drivers work is currently a bit of a mixture. These days, most of the drivers enqueue driver-specific keycodes which are mapped to commands in so-called keytables. However, a few drivers still return commands, hardcoding the mapping from keycodes to commands in the driver itself.

That said, there is probably quite some infrastructure code which you will need to copy as well to get the drivers to work.

I guess another approach could be to treat GRUB2 as a platform supported by brltty, but I really dont know anything about GRUBs support for plugins or externally compiled code...

Signature · 2 lines
CYa,
  ⡍⠁⠗⠊⠕
#5 lore raw
In reply to Samuel Thibault
Quoted 5 lines · Samuel Thibault, le Thu 29 Jul 2010 01:19:42 +0200, a écrit :

Another option of course is to just embed the whole brltty code, and just adding a grub screen driver.

some refactoring of the brltty main loop to make it live along the grub main loop.

Ok, Dave made the biggest part of it already :)

Samuel