]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/ia32/boot_console-ia32-amd64.cpp
4863c7c019db6432dd997c371bd8fb3cfa58a557
[l4.git] / kernel / fiasco / src / kern / ia32 / boot_console-ia32-amd64.cpp
1 INTERFACE[ia32,amd64]:
2
3 class Console;
4
5 class Boot_console
6 {
7 public:
8   static void init();
9   static inline Console * cons();
10
11 private:
12   static Console *_c;
13 };
14
15 IMPLEMENTATION[ia32,amd64]:
16
17 #include <cstring>
18 #include <cstdio>
19
20 #include "cmdline.h"
21 #include "kernel_console.h"
22 #include "keyb.h"
23 #include "mux_console.h"
24 #include "initcalls.h"
25 #include "static_init.h"
26 #include "vga_console.h"
27 #include "mem_layout.h"
28
29
30 Console *Boot_console::_c;
31
32
33 static Console *vga_console()
34 {
35 #if defined(CONFIG_IRQ_SPINNER)
36   static Vga_console v(Mem_layout::Adap_vram_cga_beg,80,20,true,true);
37 #else
38   static Vga_console v(Mem_layout::Adap_vram_cga_beg,80,25,true,true);
39 #endif
40   return &v;
41 }
42
43 //STATIC_INITIALIZE_P(Boot_console, BOOT_CONSOLE_INIT_PRIO);
44
45 IMPLEMENT FIASCO_INIT
46 void Boot_console::init()
47 {
48   static Keyb k;
49   Kconsole::console()->register_console(&k);
50
51   if (strstr(Cmdline::cmdline(), " -noscreen"))
52     return;
53
54   Vga_console *c = (Vga_console*)vga_console();
55   if(c->is_working())
56     Kconsole::console()->register_console(c);
57
58 #if defined(CONFIG_IRQ_SPINNER)
59   for (int y = 20; y < 25; ++y)
60     for (int x = 0; x < 80; ++x)
61       c->printchar(x, y, ' ', 8);
62 #endif
63 };
64
65 IMPLEMENT inline
66 Console * Boot_console::cons()
67 {
68   return _c;
69 }