interrupts mechanisms, serial port data receiver
[quarnos.git] / services / early_logger.cpp
blob035fd7665426dbbdfe563f7d2a024fe9cb6c8fe3
1 /* Quarn OS
3 * Early logger
5 * Copyright (C) 2008 Pawel Dziepak
7 * Implementation of a logger that can be used immediately after booting kernel.
8 * It does not uses any high-level kernel structures and objects, so it can be
9 * a good way to inform about their corruption. However it is not reccomended
10 * to use it after setting up "standard" tty logger.
13 #include "../arch/x86/console.h"
14 #include "early_logger.h"
15 #include "service.h"
16 #include "service_manager.h"
18 using namespace services;
20 /* Start writting after loader's message "Booting kernel..." */
21 early_logger::early_logger() : logger(SERVICE(early_logger)), x(17), y(0) {
22 /* delegate<void, const char*, logger::log_level> *m_print = new delegate<void, const char*, logger::log_level>;
23 m_print->method(this,&early_logger::print);
24 add_method("print",m_print);*/
27 /* Print a log message. This logger prints everything on the screen regardless
28 * of its level. At the stage when it is used, all information is imported.
30 void early_logger::print(const char *message, log_level) {
31 /*for (int i = 0; message[i] != 0; i++) {
33 if (message[i] == '\n') {
34 y++;
35 x = 0;
36 } else {
37 arch::screen_print(message[i],arch::scr_white,x,y);
38 x++;
41 y += x / arch::scr_width;
42 x = x % arch::scr_width;
43 }*/