Hi Samuel, Apologies for the delay - got abducted by aliens while I was sniffing hot coffee through nose. Please bear with me as I try and understand this. So we have: 1. speakup tty line discipline N_SPEAKUP 2. device /dev/ttyx N_SPEAKUP is set as line discipline for /dev/ttyx. The challenge is enabling speakup before userland. Is the above correct? And how will /dev/ttyx be used? Also is there a link to where you pasted your idea from? Someone attempted something similar back in 2005: http://lkml.iu.edu/hypermail/linux/kernel/0510.2/0803.html Thanks, Okash On Sat, Nov 12, 2016 at 10:18 PM, Samuel Thibault < samuel.thibault@xxxxxxxxxxxx> wrote: > Okash Khawaja, on Sat 12 Nov 2016 16:13:22 +0000, wrote: > > Could you explain your idea a bit more? I have been reading the driver > code and > > want to contribute to this project. > > Just copy/pasting some previous thoughts. The idea would be to make > speakup a tty line discipline, just like it is for a mouse, ppp, etc. > > “ > land? One of the goals of speakup is to be available before userland > works (otherwise we could as well just move the drivers to userland), so > we don't have any userland helper to set the line disciline up. > > And even before setting up the line discipline, how can speakup open > the port? We don't have a process context or /dev/, so we can't just > use sys_open and alike. What we could use is some function which takes > a minor/major pair or a device name, and returns a filp, then we can > tty_set_ldisc(N_SPEAKUP) on file_tty(filp), but I don't know if such > thing exists? That would probably be building a struct inode (getting > inspired from fs/ramfs/), then just open it? Something like: > > struct inode *inode = new_inode(sb); > > init_special_inode(inode, S_IFCHR, MKDEV(major, minor)); > filp = get_empty_filp(); > do_dentry_open(filp, inode, NULL, NULL); > struct tty_struct *tty = file_tty(filp); > tty_set_ldisc(tty, N_SPEAKUP); > ” > > Samuel > _______________________________________________ Speakup mailing list Speakup@xxxxxxxxxxxxxxxxx http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup