From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id 9E2651EFD0A; Sun, 27 Nov 2016 15:41:59 -0500 (EST) Received: from mail-qt0-x22d.google.com (mail-qt0-x22d.google.com [IPv6:2607:f8b0:400d:c0d::22d]) by befuddled.reisers.ca (Postfix) with ESMTPS id 81FFB1EFCCE for ; Sun, 27 Nov 2016 15:41:57 -0500 (EST) Received: by mail-qt0-x22d.google.com with SMTP id w33so105904234qtc.3 for ; Sun, 27 Nov 2016 12:41:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cIiZio1TAi4do4aXdPPDQq9uhbddIxH3dI9gyeIqCAM=; b=iZSDll57FOAL42Ph/cyzuOxEPKWzPjUxyniDSpyYOfLSnHj92HhgRJcfisNE3Ty4Kl 1rjgdI2B60aAR7gzjvohP3GX7XP0LxQ99oTIo4FynPkEICDwCGpNcSpDdZUt2SoGkyhX QSVCXLzRLdgf9h58bpBWB1YvilFiMoKnqNUaPnVIah4R/XeU9zEBQUF2B+eC7AlxkedB aCgVhhhvVPMjXP1xvY6eslp7hQ9ngwHQJslOz0IyAxaNQQhc7+oP29I1kIshhhXxtUr6 sghxOTT2OdTFNeC/l98oha1emH1+5sbOq3Vc4rgzpoWKKNxB2wHPOTLH2F8PYY0I1Ggu 6/Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cIiZio1TAi4do4aXdPPDQq9uhbddIxH3dI9gyeIqCAM=; b=i7esSh+cvBqjUJ9T7t1p4d7Py3+3aeQ71TH9tX9Bd2NjWLjN9hLx3/z76cwcwY5JWP ma4UuhOPM/PetHOWGDs0qqcxmmXzpl7x9GbxvouvfQiHQgK/9WX8SBwtkvWG+K7IeB0a 6e8O6VtSRxwB1i4cJxroasvpaAydi/bc62MZEN1mdEcGS/4DBVC+ronPqj59835HL/Df rEiCdwiwX6jBAqWuFb5bojxw4RGK7yzqULtWGKqKnE2Xwd1beaP7LIpea2rusbVhR95F 7AxYZm+utkLfnBlPLXHL9CvW85SoNfntlGsjzZ7oIWr3/hByz48LHefx+6B8ElnxtTTt 5Xyw== X-Gm-Message-State: AKaTC029zXvdtLamSu2lOTKwRbOg073ptA7djMNsDlSmgcon63QQ1Z+sk8q/MYWoh7ftP8ZptFDOAVfL6t6b3g== X-Received: by 10.200.37.52 with SMTP id 49mr15162051qtm.240.1480279311208; Sun, 27 Nov 2016 12:41:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.37.179 with HTTP; Sun, 27 Nov 2016 12:41:50 -0800 (PST) In-Reply-To: <20161123145659.GB3012@var.bordeaux.inria.fr> References: <20161121223631.GY2755@var.home> <20161123145659.GB3012@var.bordeaux.inria.fr> From: Okash Khawaja Date: Sun, 27 Nov 2016 20:41:50 +0000 Message-ID: Subject: Re: Line discipline To: Samuel Thibault Cc: "Speakup is a screen review system for Linux." X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 20:41:59 -0000 Hi, Thanks for explanation. I have not been able to work on this recently - pulled away for something urgent. As soon as it's over, I'll be back on it. Probably third week of December. Cheers, Okash On Wed, Nov 23, 2016 at 2:56 PM, Samuel Thibault < samuel.thibault@ens-lyon.org> wrote: > Okash Khawaja, on Wed 23 Nov 2016 14:46:59 +0000, wrote: > > So I have a simple kernel module that registers a new ldisc. When > userspace > > attaches that ldisc to /dev/ttyS0, the kernel module is able to write t= o > that > > serial port using tty->ops->write(). > > Ok, good for a start :) > > > Currently I'm investigating the core problem of opening /dev/ttyS0 from > kernel > > space and attaching our ldisc to it. Are there any existing ideas aroun= d > this? > > What I wrote before: > > =E2=80=9C > 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 =3D new_inode(sb); > > init_special_inode(inode, S_IFCHR, MKDEV(major, minor)); > filp =3D get_empty_filp(); > do_dentry_open(filp, inode, NULL, NULL); > struct tty_struct *tty =3D file_tty(filp); > tty_set_ldisc(tty, N_SPEAKUP); > =E2=80=9D > > > Is this worth investigating: to find correct tty without opening > /dev/ttyS0 and > > assigning our ldisc to it. > > > Realistically, how early in boot process do we want the ldisc > > assigned? > > As early as possible :) > > That'll mean after tty initialization and after serial driver > initialization > > Samuel >