SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

Diff markup

Differences between /bootstrap/multiboot.h (Article 6) and /bootstrap/multiboot.h (Article 7.5)


001 #ifndef __MULTIBOOT_H__                           001 #ifndef __MULTIBOOT_H__
002 #define __MULTIBOOT_H__                           002 #define __MULTIBOOT_H__
003                                                   003 
004 /* multiboot.h - the header for Multiboot */      004 /* multiboot.h - the header for Multiboot */
005 /* Copyright (C) 1999  Free Software Foundatio    005 /* Copyright (C) 1999  Free Software Foundation, Inc.
006                                                   006    
007    This program is free software; you can redi    007    This program is free software; you can redistribute it and/or modify
008    it under the terms of the GNU General Publi    008    it under the terms of the GNU General Public License as published by
009    the Free Software Foundation; either versio    009    the Free Software Foundation; either version 2 of the License, or
010    (at your option) any later version.            010    (at your option) any later version.
011                                                   011    
012    This program is distributed in the hope tha    012    This program is distributed in the hope that it will be useful,
013    but WITHOUT ANY WARRANTY; without even the     013    but WITHOUT ANY WARRANTY; without even the implied warranty of
014    MERCHANTABILITY or FITNESS FOR A PARTICULAR    014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015    GNU General Public License for more details    015    GNU General Public License for more details.
016                                                   016    
017    You should have received a copy of the GNU     017    You should have received a copy of the GNU General Public License
018    along with this program; if not, write to t    018    along with this program; if not, write to the Free Software
019    Foundation, Inc., 675 Mass Ave, Cambridge,     019    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
020                                                   020 
021 /* Macros.  */                                    021 /* Macros.  */
022                                                   022 
023 /* The magic number for the Multiboot header.     023 /* The magic number for the Multiboot header.  */
024 #define MULTIBOOT_HEADER_MAGIC          0x1BAD    024 #define MULTIBOOT_HEADER_MAGIC          0x1BADB002
025                                                   025 
026 /* The flags for the Multiboot header.  */        026 /* The flags for the Multiboot header.  */
027 #define MULTIBOOT_HEADER_FLAGS          0x0001    027 #define MULTIBOOT_HEADER_FLAGS          0x00010003
028                                                   028 
029 /* The magic number passed by a Multiboot-comp    029 /* The magic number passed by a Multiboot-compliant boot loader.  */
030 #define MULTIBOOT_BOOTLOADER_MAGIC      0x2BAD    030 #define MULTIBOOT_BOOTLOADER_MAGIC      0x2BADB002
031                                                   031 
032 /* The size of our stack (16KB).  */              032 /* The size of our stack (16KB).  */
033 #define MULTIBOOT_STACK_SIZE            0x4000    033 #define MULTIBOOT_STACK_SIZE            0x4000
034                                                   034 
035 #define MULTIBOOT_CMDLINE 4                       035 #define MULTIBOOT_CMDLINE 4
036 #define MULTIBOOT_MODS 8                          036 #define MULTIBOOT_MODS 8
037                                                   037 
038 /* C symbol format. HAVE_ASM_USCORE is defined    038 /* C symbol format. HAVE_ASM_USCORE is defined by configure.  */
039 #ifdef HAVE_ASM_USCORE                            039 #ifdef HAVE_ASM_USCORE
040 # define EXT_C(sym)                     _ ## s    040 # define EXT_C(sym)                     _ ## sym
041 #else                                             041 #else
042 # define EXT_C(sym)                     sym       042 # define EXT_C(sym)                     sym
043 #endif                                            043 #endif
044                                                   044 
045 #ifndef ASM                                       045 #ifndef ASM
046 /* Do not include here in the assembler source    046 /* Do not include here in the assembler sources.  */
047                                                   047 
048 #include <sos/types.h>                            048 #include <sos/types.h>
049                                                   049 
050 /* The address of the stack of the bootstrap t    050 /* The address of the stack of the bootstrap thread */
051 extern sos_vaddr_t bootstrap_stack_bottom;        051 extern sos_vaddr_t bootstrap_stack_bottom;
052 extern sos_size_t bootstrap_stack_size;           052 extern sos_size_t bootstrap_stack_size;
053                                                   053 
054 /* Types.  */                                     054 /* Types.  */
055                                                   055 
056 /* The Multiboot header.  */                      056 /* The Multiboot header.  */
057 typedef struct multiboot_header                   057 typedef struct multiboot_header
058 {                                                 058 {
059   unsigned long magic;                            059   unsigned long magic;
060   unsigned long flags;                            060   unsigned long flags;
061   unsigned long checksum;                         061   unsigned long checksum;
062   unsigned long header_addr;                      062   unsigned long header_addr;
063   unsigned long load_addr;                        063   unsigned long load_addr;
064   unsigned long load_end_addr;                    064   unsigned long load_end_addr;
065   unsigned long bss_end_addr;                     065   unsigned long bss_end_addr;
066   unsigned long entry_addr;                       066   unsigned long entry_addr;
067 } multiboot_header_t;                             067 } multiboot_header_t;
068                                                   068 
069 /* The symbol table for a.out.  */                069 /* The symbol table for a.out.  */
070 typedef struct aout_symbol_table                  070 typedef struct aout_symbol_table
071 {                                                 071 {
072   unsigned long tabsize;                          072   unsigned long tabsize;
073   unsigned long strsize;                          073   unsigned long strsize;
074   unsigned long addr;                             074   unsigned long addr;
075   unsigned long reserved;                         075   unsigned long reserved;
076 } aout_symbol_table_t;                            076 } aout_symbol_table_t;
077                                                   077 
078 /* The section header table for ELF.  */          078 /* The section header table for ELF.  */
079 typedef struct elf_section_header_table           079 typedef struct elf_section_header_table
080 {                                                 080 {
081   unsigned long num;                              081   unsigned long num;
082   unsigned long size;                             082   unsigned long size;
083   unsigned long addr;                             083   unsigned long addr;
084   unsigned long shndx;                            084   unsigned long shndx;
085 } elf_section_header_table_t;                     085 } elf_section_header_table_t;
086                                                   086 
087 /* The Multiboot information.  */                 087 /* The Multiboot information.  */
088 typedef struct multiboot_info                     088 typedef struct multiboot_info
089 {                                                 089 {
090   unsigned long flags;                            090   unsigned long flags;
091   unsigned long mem_lower;                        091   unsigned long mem_lower;
092   unsigned long mem_upper;                        092   unsigned long mem_upper;
093   unsigned long boot_device;                      093   unsigned long boot_device;
094   unsigned long cmdline;                          094   unsigned long cmdline;
095   unsigned long mods_count;                       095   unsigned long mods_count;
096   unsigned long mods_addr;                        096   unsigned long mods_addr;
097   union                                           097   union
098   {                                               098   {
099     aout_symbol_table_t aout_sym;                 099     aout_symbol_table_t aout_sym;
100     elf_section_header_table_t elf_sec;           100     elf_section_header_table_t elf_sec;
101   } u;                                            101   } u;
102   unsigned long mmap_length;                      102   unsigned long mmap_length;
103   unsigned long mmap_addr;                        103   unsigned long mmap_addr;
104   unsigned long drives_length;                    104   unsigned long drives_length;
105   unsigned long drives_addr;                      105   unsigned long drives_addr;
106 } multiboot_info_t;                               106 } multiboot_info_t;
107                                                   107 
108 /* The module structure.  */                      108 /* The module structure.  */
109 typedef struct module                             109 typedef struct module
110 {                                                 110 {
111   unsigned long mod_start;                        111   unsigned long mod_start;
112   unsigned long mod_end;                          112   unsigned long mod_end;
113   unsigned long string;                           113   unsigned long string;
114   unsigned long reserved;                         114   unsigned long reserved;
115 } module_t;                                       115 } module_t;
116                                                   116 
117 /* The memory map. Be careful that the offset     117 /* The memory map. Be careful that the offset 0 is base_addr_low
118    but no size.  */                               118    but no size.  */
119 typedef struct memory_map                         119 typedef struct memory_map
120 {                                                 120 {
121   unsigned long size;                             121   unsigned long size;
122   unsigned long base_addr_low;                    122   unsigned long base_addr_low;
123   unsigned long base_addr_high;                   123   unsigned long base_addr_high;
124   unsigned long length_low;                       124   unsigned long length_low;
125   unsigned long length_high;                      125   unsigned long length_high;
126   unsigned long type;                             126   unsigned long type;
127 } memory_map_t;                                   127 } memory_map_t;
128                                                   128 
129 void dump_multiboot_info(multiboot_info_t *mbi    129 void dump_multiboot_info(multiboot_info_t *mbi);
130                                                   130 
131 #endif /* ! ASM */                                131 #endif /* ! ASM */
132                                                   132 
133 #endif /* __MULTIBOOT_H__ */                      133 #endif /* __MULTIBOOT_H__ */
                                                      

source navigation ] diff markup ] identifier search ] general search ]