used ring buffer for printf