added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / x86_64-pc / bootstrap / multiboot.h
blobd990de51b08d2dda6c646d215d67eaf8416751c3
1 #ifndef _MB_H
2 #define _MB_H
4 /*
5 Copyright © 2002, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Multiboot information structures
9 Lang: english
13 /* Structure passed from bootloader */
14 struct multiboot {
15 unsigned int flags;
16 #define MB_FLAGS_MEM 1
17 #define MB_FLAGS_BOOTDEV 2
18 #define MB_FLAGS_CMDLINE 4
19 #define MB_FLAGS_MODS 8
20 #define MB_FLAGS_AOUT 16
21 #define MB_FLAGS_ELF 32
22 #define MB_FLAGS_MMAP 64
23 #define MB_FLAGS_DRIVES 128
24 #define MB_FLAGS_CFGTBL 256
25 #define MB_FLAGS_LDRNAME 512
26 #define MB_FLAGS_APMTBL 1024
27 #define MB_FLAGS_GFX 2048
28 unsigned int mem_lower;
29 unsigned int mem_upper;
30 unsigned int bootdev;
31 char * cmdline;
32 unsigned int mods_count;
33 unsigned int mods_addr;
34 unsigned int elf_num;
35 unsigned int elf_size;
36 unsigned int elf_addr;
37 unsigned int elf_shndx;
38 unsigned int mmap_length;
39 unsigned int mmap_addr;
40 unsigned int drives_length;
41 unsigned int drives_addr;
42 unsigned int config_table;
43 char *loader_name;
44 unsigned int apm_table;
45 unsigned int vbe_control_info;
46 unsigned int vbe_mode_info;
47 unsigned short vbe_mode;
48 unsigned short vbe_if_seg;
49 unsigned short vbe_if_off;
50 unsigned short vbe_if_len;
53 struct mb_module {
54 unsigned int mod_start;
55 unsigned int mod_end;
56 unsigned int string;
57 unsigned int reserved;
60 struct mb_mmap {
61 unsigned int size;
62 unsigned int addr_low;
63 unsigned int addr_high;
64 unsigned int len_low;
65 unsigned int len_high;
66 unsigned int type;
67 #define MMAP_TYPE_RAM 1
68 #define MMAP_TYPE_RESERVED 2
69 #define MMAP_TYPE_ACPIDATA 3
70 #define MMAP_TYPE_ACPINVS 4
73 /* VBE controller information */
74 struct vbe_controller
76 unsigned char signature[4];
77 unsigned short version;
78 unsigned int oem_string;
79 unsigned int capabilities;
80 unsigned int video_mode;
81 unsigned short total_memory;
82 unsigned short oem_software_rev;
83 unsigned int oem_vendor_name;
84 unsigned int oem_product_name;
85 unsigned int oem_product_rev;
86 unsigned char reserved[222];
87 unsigned char oem_data[256];
88 } __attribute__ ((packed));
90 /* VBE mode information. */
91 struct vbe_mode
93 unsigned short mode_attributes;
94 unsigned char win_a_attributes;
95 unsigned char win_b_attributes;
96 unsigned short win_granularity;
97 unsigned short win_size;
98 unsigned short win_a_segment;
99 unsigned short win_b_segment;
100 unsigned int win_func;
101 unsigned short bytes_per_scanline;
103 /* >=1.2 */
104 unsigned short x_resolution;
105 unsigned short y_resolution;
106 unsigned char x_char_size;
107 unsigned char y_char_size;
108 unsigned char number_of_planes;
109 unsigned char bits_per_pixel;
110 unsigned char number_of_banks;
111 unsigned char memory_model;
112 unsigned char bank_size;
113 unsigned char number_of_image_pages;
114 unsigned char reserved0;
116 /* direct color */
117 unsigned char red_mask_size;
118 unsigned char red_field_position;
119 unsigned char green_mask_size;
120 unsigned char green_field_position;
121 unsigned char blue_mask_size;
122 unsigned char blue_field_position;
123 unsigned char reserved_mask_size;
124 unsigned char reserved_field_position;
125 unsigned char direct_color_mode_info;
127 /* >=2.0 */
128 unsigned int phys_base;
129 unsigned int reserved1;
130 unsigned short reversed2;
132 /* >=3.0 */
133 unsigned short linear_bytes_per_scanline;
134 unsigned char banked_number_of_image_pages;
135 unsigned char linear_number_of_image_pages;
136 unsigned char linear_red_mask_size;
137 unsigned char linear_red_field_position;
138 unsigned char linear_green_mask_size;
139 unsigned char linear_green_field_position;
140 unsigned char linear_blue_mask_size;
141 unsigned char linear_blue_field_position;
142 unsigned char linear_reserved_mask_size;
143 unsigned char linear_reserved_field_position;
144 unsigned int max_pixel_clock;
146 unsigned char reserved3[189];
147 } __attribute__ ((packed));
150 /* Structure in RAM at 0x1000 */
151 struct arosmb {
152 unsigned int magic; /* Indicates if information is valid */
153 #define MBRAM_VALID 0x1337BABE
154 unsigned int flags; /* Copy of the multiboot flags */
155 unsigned int mem_lower; /* Amount of lowmem (Sub 1Mb) */
156 unsigned int mem_upper; /* Amount of upper memory */
157 unsigned int mmap_addr; /* Pointer to memory map */
158 unsigned int mmap_len; /* size of memory map */
159 unsigned int drives_addr; /* Pointer to drive information */
160 unsigned int drives_len; /* Size of drive information */
161 char ldrname[30]; /* String of loadername */
162 char cmdline[200]; /* Commandline */
163 unsigned short vbe_mode; /* VBE mode */
164 struct vbe_mode vmi; /* VBE mode information */
165 struct vbe_controller vci; /* VBE controller information */
168 struct mb_drive {
169 unsigned int size;
170 unsigned char number;
171 unsigned char mode;
172 #define MB_MODE_CHS 0
173 #define MB_MODE_LBA 1
174 unsigned short cyls;
175 unsigned char heads;
176 unsigned char secs;
177 unsigned short ports[10]; /* Ugly, needs to be fixed */
180 #endif /* _MB_H */