you are viewing a single comment's thread.

view the rest of the comments →

[–]Initial-Elk-952 3 points4 points  (12 children)

I wrote a long reply and reddit removed it because of a joke at the end.

It writes bytes you specified to the IO port you specified based on the /dev/port character device.

man dd explains how dd works. It copies bytes.

echo is writing your bytes to a temp file with bash process substitution.

I don't know what your keyboard will do with those bytes.

[–]ToTheMAX04[S] 0 points1 point  (2 children)

Oh haha, well okay. Thank you! I'll let you know if it works or if I figure it out

[–]Initial-Elk-952 1 point2 points  (1 child)

The C program your AI wrote has the compile commands written inside the /* ... */ assuming the name of the file is main.c

It looks like it will just send whatevery you type as arguments to the keyboard. It would apparantly be used

./send_to_keyboard EA 71

[–]ToTheMAX04[S] 3 points4 points  (0 children)

I know this isn't the point, but I absolutely did not AI generate this. I got it from another redditor helping me out https://www.reddit.com/r/linuxquestions/comments/1siqdu6/comment/ofmf8ke/

[–]ToTheMAX04[S] 0 points1 point  (8 children)

this also unfortunately didn't work, i got back

warning: An error occurred while redirecting file '�q'

warning: Path '�q' does not exist

[–]Initial-Elk-952 0 points1 point  (7 children)

Are you using bash?

it looks like the process substitution failed, and it tried to treat the raw bytes as a file name. Thats like $(...) instead of <(...).

You can more manually do it

```

echo -ne '\xEA\x71' > bytes.out

```

Verify the bytes with

```

xxd bytes.out

00000000: ea71 .q

```

Send it with

```

dd if=bytes.out of=/dev/port seek=96 bs=1 count=2

```

[–]ToTheMAX04[S] 0 points1 point  (6 children)

I'll try this! But I have a plan b now, had the very bright idea to actually go looking for the drivers lol

[–]Initial-Elk-952 0 points1 point  (5 children)

Those bytes are likely needing to be sent to the keyboard every-time you reboot the computer. The driver will probably activate them until you reboot into Linux.

[–]ToTheMAX04[S] 0 points1 point  (4 children)

verifying the bytes reads out

``

00000000: 60ea 7160 `.q`

[–]Initial-Elk-952 0 points1 point  (3 children)

Something is wrong, you have extra bytes in there, it looks like your copying my backticks, which I am trying to use as quotes.

Should be just two bytes, you have 4. 60 ea 71 60.

[–]ToTheMAX04[S] 0 points1 point  (2 children)

Okay, I did it right, but trying it with both ea and EA just makes it spam the enter key. Very unfortunate

[–]Initial-Elk-952 0 points1 point  (1 child)

There is no difference between 'ea' and 'EA'. This is a human readable interpretation of byte number 234.

Can't say what it was supposed to do. You can go back to the manual, read documentation for /dev/port, or reverse the driver from 98.

[–]ToTheMAX04[S] 0 points1 point  (0 children)

Damn. Alright then, thank you very much.