usb: getting string descriptors, minor improvements
[quarnos.git] / modules / modules_start.cpp
blob3af46fbb286437705eff55d02c85b27015ac53b9
1 /* Quarn OS
3 * Startup code for modules
5 * Copyright (C) 2008-2009 Pawel Dziepak
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "manes/manec.h"
24 #include "services/logger.h"
25 #include "resources/memm.h"
26 #include "services/kernel_state.h"
28 using namespace manes;
30 extern p<resources::memm> allocator;
32 extern "C" void module_init();
34 extern "C" void start_module(/*component *mgr,*/ ) {
35 manec::connect_manes();
37 p<services::logger> log = manec::get()->get<services::logger>("/tty_logger");
38 log->print("Module successfully loaded.\n",services::logger::log_critical);
40 module_init();
43 void *operator new(unsigned int size) {
44 return allocator->allocate_space(size);
47 void *operator new[](unsigned int size) {
48 return operator new(size);
51 void operator delete(void *ptr) {
52 allocator->deallocate_space(ptr);
55 void operator delete[](void *ptr) {
56 operator delete(ptr);
60 /* Code that should be executed when program exit, which won't ever
61 * happen to Manes
63 void *__dso_handle __attribute__((weak));
64 extern "C" void __cxa_atexit(void (*)(void *), void *, void *) {
65 /* manes::error er("runtime: attempt to terminate kernel process");
66 er.critical(); */
69 namespace __cxxabiv1 {
70 /* Function shows error message when a call to pure virtual function
71 * has happened */
72 extern "C" void __cxa_pure_virtual(void) {
73 critical("runtime: call to pure virtual function");
74 while(1);