/[hurd]/hurd-l4/laden/ia32-cmain.c
ViewVC logotype

Diff of /hurd-l4/laden/ia32-cmain.c

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

revision 1.11 by marcus, Fri Sep 26 13:46:53 2003 UTC revision 1.12 by marcus, Sat Oct 4 17:42:22 2003 UTC
# Line 36  help_arch (void) Line 36  help_arch (void)
36      "through to the rootserver\n"      "through to the rootserver\n"
37      "and handled by it.\n";      "and handled by it.\n";
38  }  }
39    
40    
41  /* Start kernel by simply jumping to the entry point.  */  /* Start kernel by simply jumping to the entry point.  */
42  void  void
# Line 215  find_components (void) Line 216  find_components (void)
216      }      }
217    
218    /* Now create the memory map.  */    /* Now create the memory map.  */
219    
220      /* First, add the whole address space as shared memory by default to
221         allow arbitrary device access.  */
222      add_memory_map (0, -1, L4_MEMDESC_SHARED, 0);
223    
224      /* Now add what GRUB tells us.  */
225    if (CHECK_FLAG (mbi->flags, 6))    if (CHECK_FLAG (mbi->flags, 6))
226      {      {
227        /* mmap_* are valid.  */        /* mmap_* are valid.  */
# Line 230  find_components (void) Line 237  find_components (void)
237            if (mmap->base_addr >> 32)            if (mmap->base_addr >> 32)
238              panic ("L4 does not support more than 4 GB on ia32");              panic ("L4 does not support more than 4 GB on ia32");
239    
240            end = mmap->base_addr + mmap->length;            end = mmap->base_addr + mmap->length - 1;
241    
242            if (end == (1ULL << 32))            if (end >> 32)
             {  
 #if 0  
             panic ("L4 does not support exactly 4 GB on ia32");  
 #elif 1  
               /* The L4 specification does not seem to allow this  
                  configuration.  Truncate the region by dropping the  
                  last page.  FIXME: kickstart overflows and sets the  
                  high address to 0.  This is unambiguous, but needs to  
                  be supported by sigma0 and the operating system.  
                  Clarification of the specification is required.  */  
               end = (1ULL << 32) - (1 << 10);  
 #else  
               /* This is effectively what kickstart does.  */  
               end = 0;  
 #endif  
             }  
           else if (end >> 32)  
243              panic ("L4 does not support more than 4 GB on ia32");              panic ("L4 does not support more than 4 GB on ia32");
244    
245            if (mmap->base_addr & ((1 << 10) - 1)            if (mmap->base_addr & ((1 << 10) - 1)
# Line 266  find_components (void) Line 256  find_components (void)
256    else if (CHECK_FLAG (mbi->flags, 0))    else if (CHECK_FLAG (mbi->flags, 0))
257      {      {
258        /* mem_* are valid.  */        /* mem_* are valid.  */
       if (mbi->mem_lower & 0x2ff)  
         panic ("Lower memory end address 0x%x is unaligned",  
                mbi->mem_lower);  
       if (mbi->mem_upper & 0x2ff)  
         panic ("Upper memory end address 0x%x is unaligned",  
                mbi->mem_upper);  
259    
260        add_memory_map (0, mbi->mem_lower << 10, L4_MEMDESC_CONVENTIONAL, 0);        add_memory_map (0, (mbi->mem_lower << 10) - 1,
261        add_memory_map (0x100000, 0x100000 + (mbi->mem_upper << 10),                        L4_MEMDESC_CONVENTIONAL, 0);
262          add_memory_map (0x100000, (0x100000 + (mbi->mem_upper << 10)) - 1,
263                        L4_MEMDESC_CONVENTIONAL, 0);                        L4_MEMDESC_CONVENTIONAL, 0);
264      }      }
265    
266    /* The VGA memory is usually not included in the BIOS map.  */    /* The VGA memory, and ROM extension, is usually not included in the
267    add_memory_map (0xa0000, 0xc0000, L4_MEMDESC_SHARED, 0);       BIOS map.  We add it here.  */
268      add_memory_map (0xa0000, 0xf0000 - 1, L4_MEMDESC_SHARED, 0);
269    
270    /* The amount of conventional memory to be reserved for the kernel.  */    /* The amount of conventional memory to be reserved for the kernel.  */
271  #define KMEM_SIZE       (16 * 0x100000)  #define KMEM_SIZE       (16 * 0x100000)

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

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