/[hurd]/hurd-l4/laden/loader.c
ViewVC logotype

Diff of /hurd-l4/laden/loader.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by marcus, Sat Jul 26 17:26:09 2003 UTC revision 1.2 by marcus, Thu Sep 4 01:29:35 2003 UTC
# Line 61  mem_check (const char *name, unsigned lo Line 61  mem_check (const char *name, unsigned lo
61          }          }
62      }      }
63    if (conflicts)    if (conflicts)
64      panic ("Error: %s (0x%x - 0x%x) conflicts with memory of "      panic ("%s (0x%x - 0x%x) conflicts with memory of "
65             "type %i/%i (0x%x - 0x%x)", name, start, end,             "type %i/%i (0x%x - 0x%x)", name, start, end,
66             memory_map[nr].type, memory_map[nr].subtype,             memory_map[nr].type, memory_map[nr].subtype,
67             memory_map[nr].low << 10, memory_map[nr].high << 10);             memory_map[nr].low << 10, memory_map[nr].high << 10);
68    if (!fits)    if (!fits)
69      panic ("Error: %s (0x%x - 0x%x) does not fit into memory",      panic ("%s (0x%x - 0x%x) does not fit into memory",
70             name, start, end);             name, start, end);
71  }  }
72    
# Line 98  check_region (char *name, l4_word_t star Line 98  check_region (char *name, l4_word_t star
98      {      {
99        if ((start >= used_regions[i].start && start < used_regions[i].end)        if ((start >= used_regions[i].start && start < used_regions[i].end)
100            || (end >= used_regions[i].start && end < used_regions[i].end))            || (end >= used_regions[i].start && end < used_regions[i].end))
101          panic ("Error: %s (0x%x - 0x%x) conflicts with %s (0x%x - 0x%x)",          panic ("%s (0x%x - 0x%x) conflicts with %s (0x%x - 0x%x)",
102                 name, start, end, used_regions[i].name, used_regions[i].start,                 name, start, end, used_regions[i].name, used_regions[i].start,
103                 used_regions[i].end);                 used_regions[i].end);
104      }      }
# Line 112  static void Line 112  static void
112  add_region (char *name, l4_word_t start, l4_word_t end)  add_region (char *name, l4_word_t start, l4_word_t end)
113  {  {
114    if (nr_regions == MAX_REGIONS)    if (nr_regions == MAX_REGIONS)
115      panic ("Error: Too many memory regions, region %s doesn't fit", name);      panic ("Too many memory regions, region %s doesn't fit", name);
116    
117    check_region (name, start, end);    check_region (name, start, end);
118    
# Line 164  elf_load (char *name, l4_word_t start, l Line 164  elf_load (char *name, l4_word_t start, l
164        || elf->e_ident[EI_MAG1] != ELFMAG1        || elf->e_ident[EI_MAG1] != ELFMAG1
165        || elf->e_ident[EI_MAG2] != ELFMAG2        || elf->e_ident[EI_MAG2] != ELFMAG2
166        || elf->e_ident[EI_MAG3] != ELFMAG3)        || elf->e_ident[EI_MAG3] != ELFMAG3)
167      panic ("Error: %s is not an ELF file", name);      panic ("%s is not an ELF file", name);
168    
169    if (elf->e_type != ET_EXEC)    if (elf->e_type != ET_EXEC)
170      panic ("Error: %s is not an executable file", name);      panic ("%s is not an executable file", name);
171    
172    if (!elf->e_phoff)    if (!elf->e_phoff)
173      panic ("Error: %s has no valid program header offset", name);      panic ("%s has no valid program header offset", name);
174    
175  #ifdef i386  #ifdef i386
176    if (elf->e_ident[EI_CLASS] != ELFCLASS32    if (elf->e_ident[EI_CLASS] != ELFCLASS32
177        || elf->e_ident[EI_DATA] != ELFDATA2LSB        || elf->e_ident[EI_DATA] != ELFDATA2LSB
178        || elf->e_machine != EM_386)        || elf->e_machine != EM_386)
179      panic ("Error: %s is not for this architecture", name);      panic ("%s is not for this architecture", name);
180  #else  #else
181  #error Not ported to this architecture!  #error Not ported to this architecture!
182  #endif  #endif
# Line 223  void Line 223  void
223  load_components (void)  load_components (void)
224  {  {
225    if (!kernel.low)    if (!kernel.low)
226      panic ("Error: No L4 kernel found");      panic ("No L4 kernel found");
227    add_region ("kernel-mod", kernel.low, kernel.high);    add_region ("kernel-mod", kernel.low, kernel.high);
228    
229    if (!sigma0.low)    if (!sigma0.low)
230      panic ("Error: No sigma0 server found");      panic ("No sigma0 server found");
231    add_region ("sigma0-mod", sigma0.low, sigma0.high);    add_region ("sigma0-mod", sigma0.low, sigma0.high);
232    
233    if (sigma1.low)    if (sigma1.low)
234      add_region ("sigma1-mod", sigma1.low, sigma1.high);      add_region ("sigma1-mod", sigma1.low, sigma1.high);
235    
236    if (!rootserver.low)    if (!rootserver.low)
237      panic ("Error: No rootserver server found");      panic ("No rootserver server found");
238    add_region ("rootserver-mod", rootserver.low, rootserver.high);    add_region ("rootserver-mod", rootserver.low, rootserver.high);
239    
240    elf_load ("kernel", kernel.low, kernel.high,    elf_load ("kernel", kernel.low, kernel.high,

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26