This reverts commit 8f04deadc1f1620dbd0aaea07f04a6c7f82f58c0.
The actual issue was triggered by a memory corruption due to the fact
that the exception handling gate code did not preserve XMM regs.
The bug manifested itself as a series of null bytes appearing to the
tty device when the ring buffer gets linked to it and its contents are
flushed to the tty.
Using gdb, I was able to track the problem into the ringbuf's Read
method and specifically to the call to copy(). I have replaced the call
with a for loop that the compiler would anyway optimize into a rep stosb
or equivalent asm instruction.
The ring-buffer implements both io.Reader and io.Writer and uses a fixed
size of 2048 bytes (set by the ringBufferSize constant). This provides
enough space to hold a standard 80x25 screen's output.