241
12

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

4mon 22d ago by lemmy.world/u/poplargrove in linux from crescentro.se

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:

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)

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.

Ortho-linear 40% reporting for service

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%?

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

I guess laptop keyboards are out.

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)

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.

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

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.