4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
35 * Definitions of structures/data for using a multiboot compliant OS loader.
37 #define MB_HEADER_MAGIC 0x1BADB002 /* magic */
39 /* The 32-bit kernel does not require the use of the AOUT kludge */
40 #define MB_HEADER_FLAGS_32 0x00000003 /* flags we use */
41 #define MB_HEADER_CHECKSUM_32 -0x1BADB005 /* -(magic + flag) */
43 #define MB_HEADER_FLAGS_64 0x00010003 /* flags we use */
44 #define MB_HEADER_CHECKSUM_64 -0x1BAEB005 /* -(magic + flag) */
47 * passed by boot loader to kernel
49 #define MB_BOOTLOADER_MAGIC 0x2BADB002
51 #ifndef _ASM /* excluded from assembly routines */
53 #include <sys/types.h>
54 #include <sys/types32.h>
57 * The Multiboot header must be somewhere in the 1st 8K of the image that
58 * the loader loads into memory.
60 typedef struct multiboot_header
{
64 caddr32_t header_addr
; /* use as (mutliboot_header_t *) */
66 caddr32_t load_end_addr
;
67 caddr32_t bss_end_addr
;
71 /* The section header table for ELF. */
72 typedef struct mb_elf_shtable
{
79 /* The module structure. */
80 typedef struct mb_module
{
83 caddr32_t mod_name
; /* use as (char *) */
88 * Memory map data structure. Walked in a bizarre way - see mutltiboot
89 * documentation for example.
91 typedef struct mb_memory_map
{
93 uint32_t base_addr_low
;
94 uint32_t base_addr_high
;
97 uint32_t type
; /* only value of 1 is RAM */
101 /* Drive Info structure. */
102 typedef struct mb_drive_info
{
103 uint32_t size
; /* The size of this structure */
104 uint8_t drive_number
; /* The BIOS drive number */
105 uint8_t drive_mode
; /* The access mode (see below) */
106 uint16_t drive_cylinders
; /* The BIOS geometry */
108 uint8_t drive_sectors
;
109 /* The array of I/O ports used for the drive. */
110 uint16_t drive_ports
[1];
114 #define MB_DI_CHS_MODE 0
115 #define MB_DI_LBA_MODE 1
119 * The Multiboot information. This is supplied by the multiboot loader
122 * The flag bit fields defined what multiboot info the boot
123 * loader (see struct multiboot_info below) supplied:
125 /* flag[0] mem_upper, mem_loader */
126 #define MB_INFO_MEMORY 0x00000001
127 /* flag[1] boot_device */
128 #define MB_INFO_BOOTDEV 0x00000002
129 /* flag[2] cmdline (for launching kernel) */
130 #define MB_INFO_CMDLINE 0x00000004
131 /* flag[3] mods_count, mods_addr */
132 #define MB_INFO_MODS 0x00000008
133 /* flag[4] symbol table for a.out */
134 #define MB_INFO_AOUT_SYMS 0x00000010
135 /* flag[5] symbol table for elf */
136 #define MB_INFO_ELF_SHDR 0x00000020
137 /* flag[6] mmap_length, mmap_addr */
138 #define MB_INFO_MEM_MAP 0x00000040
139 /* flag[7] drives_length, drivers_addr */
140 #define MB_INFO_DRIVE_INFO 0x00000080
141 /* flag[8] config_table */
142 #define MB_INFO_CONFIG_TABLE 0x00000100
143 /* flag[9] boot_loader_name */
144 #define MB_INFO_BOOT_LOADER_NAME 0x00000200
145 /* flag[10] apm_table */
146 #define MB_INFO_APM_TABLE 0x00000400
148 * flag[11] vbe_control_info
155 #define MB_INFO_VIDEO_INFO 0x00000800
157 typedef struct multiboot_info
{
159 uint32_t mem_lower
; /* # of pages below 1Meg */
160 uint32_t mem_upper
; /* # of pages above 1Meg */
161 uint32_t boot_device
;
162 caddr32_t cmdline
; /* use as (char *) */
164 caddr32_t mods_addr
; /* use as (mb_module_t *) */
165 mb_elf_shtable_t elf_sec
;
166 uint32_t mmap_length
;
167 caddr32_t mmap_addr
; /* use as (mb_memory_map_t *) */
168 uint32_t drives_length
;
169 caddr32_t drives_addr
;
170 caddr32_t config_table
;
171 caddr32_t boot_loader_name
;
173 uint32_t vbe_control_info
;
174 uint32_t vbe_mode_info
;
176 uint16_t vbe_interface_seg
;
177 uint16_t vbe_interface_off
;
178 uint16_t vbe_interface_len
;
182 * netinfo for Solaris diskless booting
183 * XXX - not part of multiboot spec
194 uint8_t sn_macaddr
[1];
197 /* identify bootp/dhcp reply or rarp/ifconfig */
198 #define SN_TYPE_BOOTP 2
199 #define SN_TYPE_RARP 0xf0
209 #endif /* _MULTIBOOT_H */