summaryrefslogtreecommitdiff
path: root/windhoek/main.c
blob: 587864799a53abbda6889dcbce30c54b574a76f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
 * \file   windhoek/server/src/main.c
 * \brief  Windhoek main function
 *
 * \date   2008-01-29
 * \author Bjoern Doebel <doebel@tudos.org>
 *
 * (c) 2008 Technische Universitaet Dresden
 * This file is part of DROPS, which is distributed under the terms of the
 * GNU General Public License 2. Please see the COPYING file for details.
 */
#include <asm/current.h>

#include <linux/kernel.h>
#include <linux/completion.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/genhd.h>
#include <linux/bio.h>
#include <linux/hdreg.h>
#include <linux/list.h>
#include <linux/buffer_head.h>

#include <l4/dde/dde.h>
#include <l4/dde/ddekit/initcall.h>
#include <l4/dde/ddekit/assert.h>
#include <l4/dde/linux26/dde26.h>

#include <l4/util/parse_cmd.h>
#include <l4/util/util.h>
#include <l4/log/l4log.h>
#include <l4/names/libnames.h>

#include "windhoek_local.h"
#include <l4/windhoek/server-internal-server.h>

extern int bdev_cache_init(void);
extern int ide_generic_init(void);
extern int ide_cdrom_init(void);
extern int genhd_device_init(void);

l4_threadid_t main_thread = L4_INVALID_ID;

int main(int argc, const char **argv)
{
	int err;

	l4dde26_init();
	l4dde26_process_init();
	l4dde26_init_timers();
	l4dde26_softirq_init();
	printk("DDE base system initialized.\n");
	err = bdev_cache_init();
	printk("Initialized blockdev caches. (%x)\n", err);

	gendisk_init();
	client_state_init();
	l4dde26_do_initcalls();

	/* no generic driver, we use a dedicated one
	 * XXX: make this a fallback if no other driver is found */
#if 0
	err = ide_generic_init();
	printk("Initialized generic IDE driver. (%x)\n", err);
#endif


	err = names_register("windhoek");
	printk("registered at names. \n", err);

	main_thread = l4_myself();

	printk("+----------------------------------------+\n");
	printk("| Windhoek block server                  |\n");
	printk("| ready to rumble....                    |\n");
	printk("+----------------------------------------+\n");

	windhoek_server_server_loop(NULL);

	l4_sleep_forever();

	return 0;
}