summaryrefslogtreecommitdiff
path: root/src/console/logbuf_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/console/logbuf_console.c')
-rw-r--r--src/console/logbuf_console.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/console/logbuf_console.c b/src/console/logbuf_console.c
new file mode 100644
index 0000000000..e605ae5c23
--- /dev/null
+++ b/src/console/logbuf_console.c
@@ -0,0 +1,19 @@
+#include <console/console.h>
+
+#define LOGBUF_SIZE 1024
+
+// KEEP THIS GLOBAL.
+// I need the address so I can watch it with the ARIUM hardware. RGM.
+char logbuf[LOGBUF_SIZE];
+int logbuf_offset = 0;
+
+static void logbuf_tx_byte(unsigned char byte)
+{
+ logbuf[logbuf_offset] = byte;
+ logbuf_offset = (logbuf_offset +1) % LOGBUF_SIZE;
+}
+
+static struct console_driver __console = {
+ .init = 0,
+ .tx_byte = logbuf_tx_byte,
+};}