Re: [9fans] 9phone
Emil Holmström <[email protected]> Mon, 24 Mar 2025 18:25:00 -0700
| Newsgroups | gmane.os.9front.general,gmane.os.plan9.general |
|---|---|
| Message-ID | <CANMNSSnfqyQL0bBFeyS2Qg6moz0i26VxtjO3h=2DOjzJ4pNW4Q@mail.gmail.com> |
--00000000000086087a0631209710 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sounds interesting, Dave! I don't know about prior work with 9front on iPhone, but 10 years ago Inferno was ported to Android: https://defcon.org/images/defcon-20/dc-20-presentations/Floren/DEFCON-20-Fl= oren-Hellaphone.pdf /emil On Mon, Mar 24, 2025 at 6:01=E2=80=AFAM Dave MacFarlane via 9fans <9fans@9f= ans.net> wrote: > Hello all, > > I've been working on trying to get a pinephone kernel that can run > 9front at https://github.com/driusan/9front-A64 > > I spent some time this weekend on the userspace getting readings off > the i2c sensors. > > I've managed to use /dev/i2c*/ to get data from the: > 1. Touch panel > 2. Light/proximity sensor > 3. Magnetometer > 4. Accelerometer/gyroscope > > and now I want to expose the data in a filesystem before I put it > online in some other repo. I've done some looking around but can't > find any prior art for any of the above sensor types in Plan9. Does > anyone know of any? I'd like to aim for compatibility if they exist. > > Assuming they don't, I'm looking for input if anyone has any strong > opinions on what the interface should look like. > > Left to my own devices my plan is: > > 1. TouchPanel -- just write to /dev/mousein and treat touches as > button 1. Since it's a userspace driver we can experiment with > multitouch later. > 2. Light/proximity sensor - create a /dev/lightsensor that > returns light readings. A /dev/proximity read returns "close" or > "notclose". No ctl files or scaling. > 3. Magnetometer - /dev/compass blocks until there's enough > data to calibrate. Reads return 3 values, x y z that are the raw > (short int) readings. /dev/compassctl for calibrating > sensitivity/etc. > 4. Accel/gyroscope - /dev/accel returns 6 readings of the > raw (also short) value ax ay az gx gy gz. /dev/accelctl > for customizing sensitivity/etc. > > x/y/z aren't the raw sensor orientation, but normalized so that +y is the > top of the screen, +x is to the right, and +z is towards the back of the > phone. > > I've done the work to read the values but haven't done any work to > expose it other than printing debugging to stdout, so I'm open to > suggestions to other interfaces. > > - Dave > > ------------------------------------------ > 9fans: 9fans > Permalink: > https://9fans.topicbox.com/groups/9fans/T4d13b3016d2a2310-Mdce06ae0664328= 023dd4b496 > Delivery options: https://9fans.topicbox.com/groups/9fans/subscription > --00000000000086087a0631209710 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">Sounds interesting, Dave!</div><div dir=3D"auto"><br></di= v><div dir=3D"auto">I don't know about prior work with 9front on iPhone= , but 10 years ago Inferno was ported to Android:</div><div dir=3D"auto"><b= r></div><div dir=3D"auto"><div><a href=3D"https://defcon.org/images/defcon-= 20/dc-20-presentations/Floren/DEFCON-20-Floren-Hellaphone.pdf">https://defc= on.org/images/defcon-20/dc-20-presentations/Floren/DEFCON-20-Floren-Hellaph= one.pdf</a></div><div dir=3D"auto"><br></div><div dir=3D"auto">/emil</div><= br><div class=3D"gmail_quote gmail_quote_container" dir=3D"auto"><div dir= =3D"ltr" class=3D"gmail_attr">On Mon, Mar 24, 2025 at 6:01=E2=80=AFAM Dave = MacFarlane via 9fans <<a href=3D"mailto:[email protected]">[email protected]= </a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:= 0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-lef= t:1ex;border-left-color:rgb(204,204,204)">Hello all,<br> <br> I've been working on trying to get a pinephone kernel that can run<br> 9front at <a href=3D"https://github.com/driusan/9front-A64" rel=3D"noreferr= er" target=3D"_blank">https://github.com/driusan/9front-A64</a><br> <br> I spent some time this weekend on the userspace getting readings off<br> the i2c sensors.<br> <br> I've managed to use /dev/i2c*/ to get data from the:<br> 1. Touch panel<br> 2. Light/proximity sensor<br> 3. Magnetometer<br> 4. Accelerometer/gyroscope<br> <br> and now I want to expose the data in a filesystem before I put it<br> online in some other repo.=C2=A0 I've done some looking around but can&= #39;t<br> find any prior art for any of the above sensor types in Plan9.=C2=A0 Does<b= r> anyone know of any?=C2=A0 I'd like to aim for compatibility if they exi= st.<br> <br> Assuming they don't, I'm looking for input if anyone has any strong= <br> opinions on what the interface should look like.<br> <br> Left to my own devices my plan is:<br> <br> 1. TouchPanel -- just write to /dev/mousein and treat touches as<br> =C2=A0 =C2=A0button 1.=C2=A0 Since it's a userspace driver we can exper= iment with<br> =C2=A0 =C2=A0multitouch later.<br> 2. Light/proximity sensor - create a /dev/lightsensor that<br> =C2=A0 =C2=A0returns light readings.=C2=A0 A /dev/proximity read returns &q= uot;close" or<br> =C2=A0 =C2=A0"notclose".=C2=A0 No ctl files or scaling.<br> 3. Magnetometer - /dev/compass blocks until there's enough<br> =C2=A0 =C2=A0data to calibrate.=C2=A0 Reads return 3 values, x y z that are= the raw<br> =C2=A0 =C2=A0(short int) readings.=C2=A0 /dev/compassctl for calibrating<br= > =C2=A0 =C2=A0sensitivity/etc.<br> 4. Accel/gyroscope - /dev/accel returns 6 readings of the<br> =C2=A0 =C2=A0raw (also short) value ax ay az gx gy gz.=C2=A0 /dev/accelctl<= br> =C2=A0 =C2=A0for customizing sensitivity/etc.<br> <br> x/y/z aren't the raw sensor orientation, but normalized so that +y is t= he<br> top of the screen, +x is to the right, and +z is towards the back of the<br= > phone.<br> <br> I've done the work to read the values but haven't done any work to<= br> expose it other than printing debugging to stdout, so I'm open to<br> suggestions to other interfaces.<br> <br> - Dave<br> <br> ------------------------------------------<br> 9fans: 9fans<br> Permalink: <a href=3D"https://9fans.topicbox.com/groups/9fans/T4d13b3016d2a= 2310-Mdce06ae0664328023dd4b496" rel=3D"noreferrer" target=3D"_blank">https:= //9fans.topicbox.com/groups/9fans/T4d13b3016d2a2310-Mdce06ae0664328023dd4b4= 96</a><br> Delivery options: <a href=3D"https://9fans.topicbox.com/groups/9fans/subscr= iption" rel=3D"noreferrer" target=3D"_blank">https://9fans.topicbox.com/gro= ups/9fans/subscription</a><br> </blockquote></div></div> --00000000000086087a0631209710--