]> rtime.felk.cvut.cz Git - l4.git/blobdiff - kernel/fiasco/src/kern/ia32/boot_console-ia32-amd64.cpp
update
[l4.git] / kernel / fiasco / src / kern / ia32 / boot_console-ia32-amd64.cpp
index 4863c7c019db6432dd997c371bd8fb3cfa58a557..06688b3bb1258c342d39bb6a2e8e9dc927a4fb7c 100644 (file)
@@ -6,10 +6,6 @@ class Boot_console
 {
 public:
   static void init();
-  static inline Console * cons();
-
-private:
-  static Console *_c;
 };
 
 IMPLEMENTATION[ia32,amd64]:
@@ -17,53 +13,40 @@ IMPLEMENTATION[ia32,amd64]:
 #include <cstring>
 #include <cstdio>
 
-#include "cmdline.h"
 #include "kernel_console.h"
 #include "keyb.h"
 #include "mux_console.h"
 #include "initcalls.h"
+#include "koptions.h"
 #include "static_init.h"
 #include "vga_console.h"
 #include "mem_layout.h"
 
-
-Console *Boot_console::_c;
-
-
-static Console *vga_console()
-{
-#if defined(CONFIG_IRQ_SPINNER)
-  static Vga_console v(Mem_layout::Adap_vram_cga_beg,80,20,true,true);
-#else
-  static Vga_console v(Mem_layout::Adap_vram_cga_beg,80,25,true,true);
-#endif
-  return &v;
-}
-
-//STATIC_INITIALIZE_P(Boot_console, BOOT_CONSOLE_INIT_PRIO);
+static Static_object<Vga_console> vga;
+static Static_object<Keyb> keyb;
 
 IMPLEMENT FIASCO_INIT
 void Boot_console::init()
 {
-  static Keyb k;
-  Kconsole::console()->register_console(&k);
+  keyb.init();
+  Kconsole::console()->register_console(keyb.get());
 
-  if (strstr(Cmdline::cmdline(), " -noscreen"))
+  if (Koptions::o()->opt(Koptions::F_noscreen))
     return;
 
-  Vga_console *c = (Vga_console*)vga_console();
-  if(c->is_working())
-    Kconsole::console()->register_console(c);
+#if defined(CONFIG_IRQ_SPINNER)
+  vga.init((unsigned long)Mem_layout::Adap_vram_cga_beg,80,20,true,true);
+#else
+  vga.init((unsigned long)Mem_layout::Adap_vram_cga_beg,80,25,true,true);
+#endif
+
+  if (vga->is_working())
+    Kconsole::console()->register_console(vga.get());
 
 #if defined(CONFIG_IRQ_SPINNER)
   for (int y = 20; y < 25; ++y)
     for (int x = 0; x < 80; ++x)
-      c->printchar(x, y, ' ', 8);
+      vga->printchar(x, y, ' ', 8);
 #endif
 };
 
-IMPLEMENT inline
-Console * Boot_console::cons()
-{
-  return _c;
-}