diff --git a/arch/x64/debug-console.cc b/arch/x64/debug-console.cc
index adf10a360eb15b654542b96fbb14599973f7b5cb..fb740146b2bdfc29c68fdcaae3204ae0dc53104e 100644
--- a/arch/x64/debug-console.cc
+++ b/arch/x64/debug-console.cc
@@ -8,6 +8,8 @@
 #include <drivers/debug-console.hh>
 #include "processor.hh"
 
+namespace console {
+
 // Write to the serial port if the console is not yet initialized.  Because we
 // are just dumping output, no initialization is necessary.  We take advantage
 // of the fact that we are running on virtual hardware that probably does not
@@ -63,3 +65,5 @@ bool debug_console::input_ready()
         return _impl && _impl->input_ready();
     }
 }
+
+}
diff --git a/drivers/console.hh b/drivers/console.hh
index 16b0c04bd78310b652ccc94a9be7159254c02e01..32e50be4562e6834ab1fbebe96c4dfee6f983b7e 100644
--- a/drivers/console.hh
+++ b/drivers/console.hh
@@ -10,6 +10,8 @@
 
 #include <boost/format.hpp>
 
+namespace console {
+
 class Console {
 public:
     virtual ~Console() {}
@@ -18,8 +20,6 @@ public:
     virtual char readch() = 0;
 };
 
-namespace console {
-
 void write(const char *msg, size_t len);
 void write_ll(const char *msg, size_t len);
 void console_init(bool use_vga);
diff --git a/drivers/debug-console.hh b/drivers/debug-console.hh
index 64a2243b48f5a55c8becb360b6422e6e5bf53a27..c9ec16666cee3ba3a17df7d3c1b0b1e823f8140e 100644
--- a/drivers/debug-console.hh
+++ b/drivers/debug-console.hh
@@ -15,6 +15,8 @@
 // Wrap a Console with a spinlock, used for debugging
 // (we can't use a mutex, since we might want to debug the scheduler)
 
+namespace console {
+
 class debug_console : public Console {
 public:
     void set_impl(Console* impl);
@@ -28,5 +30,6 @@ private:
     spinlock _lock;
 };
 
+}
 
 #endif /* DEBUG_CONSOLE_HH_ */
diff --git a/drivers/isa-serial.cc b/drivers/isa-serial.cc
index 248ee8009c615ef1f9fc0087409e7d90d0dead7e..2a2b7f994cffba7dd62073ad9559b652f90fa5d4 100644
--- a/drivers/isa-serial.cc
+++ b/drivers/isa-serial.cc
@@ -8,6 +8,8 @@
 #include "isa-serial.hh"
 #include <string.h>
 
+namespace console {
+
 IsaSerialConsole::IsaSerialConsole(sched::thread* poll_thread, const termios *tio)
     : _irq(4, [=] { poll_thread->wake(); }), _tio(tio)
 {
@@ -77,3 +79,5 @@ void IsaSerialConsole::reset() {
     // bit, but interestingly VMWare does, so we must set it.
     pci::outb(MCR_AUX_OUTPUT_2, ioport + MCR_ADDRESS);
 }
+
+}
diff --git a/drivers/isa-serial.hh b/drivers/isa-serial.hh
index 1791ee12a04a7374068869094671864d07b2d362..0b374686e06999dc7c1dfb495dc3601418cdbd3a 100644
--- a/drivers/isa-serial.hh
+++ b/drivers/isa-serial.hh
@@ -14,6 +14,8 @@
 #include <osv/interrupt.hh>
 #include <termios.h>
 
+namespace console {
+
 class IsaSerialConsole : public Console {
 public:
     explicit IsaSerialConsole(sched::thread* consumer, const termios *tio);
@@ -62,4 +64,6 @@ private:
     void writeByte(const char letter);
 };
 
+}
+
 #endif
diff --git a/drivers/kbd.hh b/drivers/kbd.hh
index 8a8affa2f791f9fbcc079e276b34adb2e6cf3f01..64f6eae670774fe445292b0e9755a6681f4a6115 100644
--- a/drivers/kbd.hh
+++ b/drivers/kbd.hh
@@ -10,7 +10,6 @@
 
 #include "console.hh"
 #include <osv/interrupt.hh>
-#include <termios.h>
 
 enum modifiers {
     MOD_SHIFT = 1<<0,
diff --git a/drivers/vga.cc b/drivers/vga.cc
index 917a0e2d93994e37d7ed229a61bafddc95bf95a9..fb2cc6cfb012f9c6509f4e3fbaa9a7397bab11c7 100644
--- a/drivers/vga.cc
+++ b/drivers/vga.cc
@@ -8,6 +8,8 @@
 #include "vga.hh"
 #include <osv/mmu.hh>
 
+namespace console {
+
 volatile unsigned short * const VGAConsole::_buffer
 = reinterpret_cast<volatile unsigned short *>(mmu::phys_mem + 0xb8000);
 
@@ -189,3 +191,5 @@ char VGAConsole::readch()
             return 0;
     }
 }
+
+}
diff --git a/drivers/vga.hh b/drivers/vga.hh
index 438cf52b5a95bf0c7cbc5a43a76ac6a5e5ff8d38..aba358ae40733ff3c854721073331c254bd661cd 100644
--- a/drivers/vga.hh
+++ b/drivers/vga.hh
@@ -15,6 +15,8 @@
 #include "libtsm/libtsm.hh"
 #include <queue>
 
+namespace console {
+
 class VGAConsole : public Console {
 public:
     explicit VGAConsole(sched::thread* consumer, const termios *tio);
@@ -51,4 +53,6 @@ private:
     bool _offset_dirty;
 };
 
+}
+
 #endif