Writing a basic Linux device driver when you know nothing about Linux drivers or USB

https://crescentro.se/posts/writing-drivers/

241 points · 12 comments · view on lemmy.world

12 Comments

Fubarberry@sopuli.xyz · 56 pts · 224d (8 replies)

I read this on hacker news awhile back, and enjoyed it quite a bit. The unrelated trivia part about USB keyboards needing at least 103 keys or they're just a keypad especially stuck with me, and has been cited in discussions of a certain meme:

Shady_Shiroe@lemmy.world · 11 pts · 224d

And I went past full sized keyboard with that 110% sh#t with extra programmable buttons and color profile modes (aka going back into mental disorder territory)

caurvo@lemmy.blahaj.zone · 7 pts · 224d (4 replies)

I'm so mentally disordered that I'm not even pictured on the graph...

Prime_E and Southpaw Candybar 4 lyf. I'm not even that deep in the water compared to some.

Sludge@sh.itjust.works · 9 pts · 224d (3 replies)

Ortho-linear 40% reporting for service

Gaja0@lemmy.zip · 8 pts · 223d (2 replies)

Sludge@sh.itjust.works · 5 pts · 223d (1 reply)

This totally custom or did you buy the kit from somewhere? I picked up a hot swappable plank to mitigate the need for soldering but stuff like this makes me feel like I need to dive back in. What is this? 30%?

Gaja0@lemmy.zip · 3 pts · 222d

Soldering is zen. It's slow and careful, but satisfying. Like coloring with a 350°C iron. You gently heat the pad with the iron, and slowly introduce the solder. Flux will guide solder to the pads. Don't worry if you mess up a couple, by the 72nd pad, it's becomes second nature. Micro controllers are a little trickier, but planning and slow pace really takes care of it. You might burn off a pad if you keep the iron too hot for too long, but not long enough and you might get a cold joint that isn't complete. Look up tutorials for a beetter idea.

I went for handwired initially, but didn't have a great seat for the knobs or board. Hot glue got annoying, so I got splitkb aurora corne and snapped off columns.

I used QMK to do stuff. You can use python pip to install qmk.

python3 -m pip install qmk

qmk setup # after installing

Then config with

qmk config compile.keyboard=splitkb/aurora/corne/rev1 compile.keymap=default

Flash to each half with

qmk flash # double click reset to flash

There is a ton of amazing customization options. I have layers and combos for passwords, pins, shortcuts, macros, gaming, etc...

https://splitkb.com/collections/keyboard-kits/products/aurora-corne

https://www.littlekeyboards.com/collections/corne-cases/products/mini-corne-technician-keyboard-case?variant=40212013449283

cholesterol@lemmy.world · 5 pts · 223d (1 reply)

I guess laptop keyboards are out.

Fubarberry@sopuli.xyz · 4 pts · 223d

I think you mean laptop keypads

(Actually the 103+ keys thing is specifically USB standard stuff, so if it doesn't connect via USB I don't know if it counts)

TropicalDingdong@lemmy.world · 17 pts · 224d

This is great and I appreciate it being posted.

I really want to figure out how to get into at least some linux development, purely for my own greedy purposes of wanting to have a working machine.

Lembot_0006@programming.dev · 10 pts · 224d

Trivial! The tricky part is to make this driver to work correctly :)

UNY0N@lemmy.wtf · 8 pts · 224d

This is a delightful article. Parts of it had me giggling to myself, and I honestly learned more about some linux basics than I expected.