Here's how this new scheme works:

Hijack creates a new tty device: /proc/ttyH (under /proc/, since we cannot easily write to /dev/). The H is for Hijack.

Whenever the program /empeg/bin/player is launched, the stdin stdout and stderr streams are closed (disconnecting them from the console), and then reopened as /proc/ttyH. Any subsequent open of /dev/ttyS1 by the player program is also redirected to /proc/ttyH.

The new /proc/ttyH device has it's own tty driver code, in drivers/char/tty_io.c. This code simply passes outgoing strings to Hijack for "notify" parsing, and receives characters injected by Hijack from the web interface and pals.

Cheers