Subversion Repositories HelenOS

Rev

Rev 4015 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4015 Rev 4022
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (c) 2005 Martin Decky
2
 * Copyright (c) 2009 Jiri Svoboda
3
 * All rights reserved.
3
 * All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
6
 * modification, are permitted provided that the following conditions
7
 * are met:
7
 * are met:
Line 24... Line 24...
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
 
28
 
29
/** @addtogroup ia32
29
/** @addtogroup genarch
30
 * @{
30
 * @{
31
 */
31
 */
32
/** @file
32
/** @file
33
 */
33
 */
34
 
34
 
35
#ifndef KERN_ia32_MULTIBOOT_H__
35
#ifndef KERN_MULTIBOOT_H_
36
#define KERN_ia32_MULTIBOOT_H_
36
#define KERN_MULTIBOOT_H_
37
 
37
 
38
#include <arch/types.h>
38
#include <arch/types.h>
39
#include <arch/boot/memmap.h>
39
#include <arch/boot/memmap.h>
40
 
40
 
-
 
41
/** Multiboot 32-bit address. */
-
 
42
typedef uint32_t mbaddr_t;
-
 
43
 
41
/** Multiboot mod structure */
44
/** Multiboot mod structure */
42
typedef struct {
45
typedef struct {
43
    uintptr_t start;
46
    mbaddr_t start;
44
    uintptr_t end;
47
    mbaddr_t end;
45
    char *string;
48
    mbaddr_t string;
46
    uint32_t reserved;
49
    uint32_t reserved;
47
} __attribute__ ((packed)) mb_mod_t;
50
} __attribute__ ((packed)) multiboot_mod_t;
48
 
51
 
49
/** Multiboot mmap structure */
52
/** Multiboot mmap structure */
50
typedef struct {
53
typedef struct {
51
    uint32_t size;
54
    uint32_t size;
52
    e820memmap_t mm_info;
55
    e820memmap_t mm_info;
53
} __attribute__ ((packed)) mb_mmap_t;
56
} __attribute__ ((packed)) multiboot_mmap_t;
54
 
57
 
55
/** Multiboot information structure */
58
/** Multiboot information structure */
56
typedef struct {
59
typedef struct {
57
    uint32_t flags;
60
    uint32_t flags;
58
    uintptr_t mem_lower;
61
    uint32_t mem_lower;
59
    uintptr_t mem_upper;
62
    uint32_t mem_upper;
60
   
63
   
61
    uint32_t boot_device;
64
    uint32_t boot_device;
62
    char *cmdline;
65
    uint32_t cmdline;
63
   
66
   
64
    uint32_t mods_count;
67
    uint32_t mods_count;
65
    mb_mod_t *mods_addr;
68
    mbaddr_t mods_addr;
66
   
69
   
67
    uint32_t syms[4];
70
    uint32_t syms[4];
68
   
71
   
69
    uint32_t mmap_length;
72
    uint32_t mmap_length;
70
    mb_mmap_t *mmap_addr;
73
    mbaddr_t mmap_addr;
71
   
74
   
72
    /* ... */
75
    /* ... */
73
} __attribute__ ((packed)) mb_info_t;
76
} __attribute__ ((packed)) multiboot_info_t;
74
 
77
 
75
enum mb_info_flags {
78
enum multiboot_info_flags {
76
    MBINFO_FLAGS_MEM     = 0x01,
79
    MBINFO_FLAGS_MEM     = 0x01,
77
    MBINFO_FLAGS_BOOT    = 0x02,
80
    MBINFO_FLAGS_BOOT    = 0x02,
78
    MBINFO_FLAGS_CMDLINE = 0x04,
81
    MBINFO_FLAGS_CMDLINE = 0x04,
79
    MBINFO_FLAGS_MODS    = 0x08,
82
    MBINFO_FLAGS_MODS    = 0x08,
80
    MBINFO_FLAGS_SYMS1   = 0x10,
83
    MBINFO_FLAGS_SYMS1   = 0x10,
Line 82... Line 85...
82
    MBINFO_FLAGS_MMAP    = 0x40
85
    MBINFO_FLAGS_MMAP    = 0x40
83
   
86
   
84
    /* ... */
87
    /* ... */
85
};
88
};
86
 
89
 
-
 
90
#define MULTIBOOT_LOADER_MAGIC  0x2BADB002
-
 
91
 
-
 
92
/** Convert 32-bit multiboot address to a pointer. */
-
 
93
#define MULTIBOOT_PTR(mba) ((void *)(uintptr_t) (mba))
-
 
94
 
-
 
95
extern void multiboot_info_parse(uint32_t, const multiboot_info_t *);
-
 
96
 
87
#endif
97
#endif
88
 
98
 
89
/** @}
99
/** @}
90
 */
100
 */