summaryrefslogtreecommitdiff
path: root/laden/laden.h
blob: bf8bb184fa23a44b57c8b1d61e07dff54e759b42 (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
89
90
91
92
93
94
95
96
97
98
99
/* laden.h - Generic definitions.
   Copyright (C) 2003 Free Software Foundation, Inc.
   Written by Marcus Brinkmann.

   This file is part of the GNU Hurd.

   The GNU Hurd is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 2, or (at
   your option) any later version.

   The GNU Hurd is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */

#if HAVE_CONFIG_H
#include <config.h>
#endif

#include <string.h>
#include <assert.h>

#include <l4.h>

#include "output.h"
#include "shutdown.h"
#include "loader.h"


/* The program name.  */
extern char *program_name;

#define BUG_ADDRESS	"<bug-hurd@gnu.org>"


/* Find the kernel, the initial servers and the other information
   required for booting.  */
void find_components (void);

/* Start kernel.  IP is the entry point.  */
void start_kernel (l4_word_t ip);


/* For the rootserver components, find_components() must fill in the
   start and end address of the ELF images in memory.  The end address
   is one more than the address of the last byte in the image.  */
extern l4_rootserver_t kernel;
extern l4_rootserver_t sigma0;
extern l4_rootserver_t sigma1;
extern l4_rootserver_t rootserver;

/* The boot info to be inserted into the L4 KIP.  find_components()
   must provide this information.  */
extern l4_word_t boot_info;

/* The memory map to be provided to the kernel.  */
#define MEMORY_MAP_MAX 200
extern l4_memory_desc_t memory_map[MEMORY_MAP_MAX];
extern l4_word_t memory_map_size;

/* START identifies the start of a region and must be 1k aligned.  END
   is the last byte of the region.  END + 1 must be 1k aligned.  */
#define add_memory_map(start, end, mtype, msubtype)			\
  ({									\
    if (memory_map_size == MEMORY_MAP_MAX)				\
      panic ("No more memory descriptor slots available.\n");		\
    /* Make sure START and END are aligned.  */				\
    assert (((start) & ((1 << 10) - 1)) == 0);				\
    assert (((end) & ((1 << 10) - 1)) == (1 << 10) - 1);		\
    memory_map[memory_map_size].low = (start) >> 10;			\
    memory_map[memory_map_size].high = (end) >> 10;			\
    memory_map[memory_map_size].virtual = 0;				\
    memory_map[memory_map_size].type = (mtype);				\
    memory_map[memory_map_size].subtype = (msubtype);			\
    memory_map_size++;							\
  })


/* Every architecture must provide the following functions.  */

/* Return a help text for this architecture.  */
const char *help_arch (void);

/* Load the system's memory descriptors into MEMDESC and return the
   number of memory descriptors loaded.  NR is the maximum number of
   descriptors to be loaded.  */
int load_mem_info (l4_memory_desc_t memdesc, int nr);


/* The generic code defines these functions.  */

void kip_fixup (void);

int main (int argc, char *argv[]);