Before you waste any time hacking on the Berkeley terminal driver, take a look at the one built into all USG UNIXes since at least 1980. It already has full 8-bit capability.