Skip to content

Instantly share code, notes, and snippets.

@bstreiff
bstreiff / predictable_serial_port_names.md
Last active January 8, 2025 03:24
Predictable Serial Port Names

[NOTE: this is mostly a collection of notes and not quite a specification nor an implementation thereof]

Predictable Serial Port Names

"How do I identify what I should open() for my RS-232 or RS-485 serial port?" is a surprisingly difficult question to answer on Linux.

You might think that "/dev/ttyS0, /dev/ttyS1, etc are my serial ports in order, right?" and the answer to that is Maybe.

@bstreiff
bstreiff / Sun-Type-M.kbd.json
Created October 1, 2021 18:57
Sun Type M (planning)
[
{
"name": "Sun Type M",
"author": "bstreiff",
"switchMount": "cherry",
"switchBrand": "cherry",
"switchType": "MX1A-G1xx"
},
[
{
[
{
"name": "XBAND Genesis Keyboard",
"author": "Catapult Entertainment",
"background": {
"name": "PBT Black",
"style": "background-image: url('/bg/plastic/pbt-black.png');"
}
},
[
@bstreiff
bstreiff / XBAND-SNES-Keyboard.kbd.json
Last active October 5, 2021 13:48
XBAND SNES Keyboard
[
{
"name": "XBAND SNES Keyboard",
"author": "Catapult Entertainment",
"background": {
"name": "PBT Black",
"style": "background-image: url('/bg/plastic/pbt-black.png');"
}
},
[
[
{
"backcolor": "#d6d5d0",
"name": "Sun Type 6 - UNIX Layout",
"author": "Sun Microsystems",
"radii": "10px"
},
[
{
"c": "#a8a6a0",
@bstreiff
bstreiff / Sun-Type-M.kbd.json
Last active October 5, 2021 13:49
Sun Type M
[
{
"name": "Sun Type M",
"author": "bstreiff",
"switchMount": "cherry",
"switchBrand": "cherry",
"switchType": "MX1A-G1xx"
},
[
{
# note: I have lightly preprocessed this trace to symbolicate the 'op' field
# for sys_futex calls.
#
# tracing configuration:
# for x in "task" "migrate" "sched" "syscalls"; do
# echo 1 > /sys/kernel/debug/tracing/events/$x/enable
# done
LV_ESyse-1960 1d...2.. 1338906100002us : sched_switch: prev_comm=LV_ESyse_Thr3 prev_pid=1960 prev_prio=93 prev_state=S ==> next_comm=LV_Occurrence next_pid=1918 next_prio=93
LV_Occur-1918 1....1.. 1338906100008us : sys_futex -> 0x0
fixup_pi_state_owner (uaddr=0x120ad38, argowner=0x0 <irq_stack_union>, q=<optimized out>, q=<optimized out>)
at /home/bstreiff/git/linux-rmb-hack/kernel/futex.c:2317
2317 /home/bstreiff/git/linux-rmb-hack/kernel/futex.c: No such file or directory.
(gdb) bt
#0 fixup_pi_state_owner (uaddr=0x120ad38, argowner=0x0 <irq_stack_union>, q=<optimized out>, q=<optimized out>)
at /home/bstreiff/git/linux-rmb-hack/kernel/futex.c:2317
#1 0xffffffff810c0001 in fixup_owner (uaddr=<optimized out>, q=<optimized out>, locked=0)
at /home/bstreiff/git/linux-rmb-hack/kernel/futex.c:2454
#2 0xffffffff810c1000 in futex_wait_requeue_pi (uaddr=<optimized out>, flags=<optimized out>, val=<optimized out>,
abs_time=<optimized out>, uaddr2=<optimized out>, bitset=<optimized out>)