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

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

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

revision 1.5 by marcus, Mon Sep 15 18:45:16 2003 UTC revision 1.6 by marcus, Mon Sep 15 19:24:01 2003 UTC
# Line 113  cmain (void) Line 113  cmain (void)
113    
114    
115  /* The following must be defined and are used to calculate the extents  /* The following must be defined and are used to calculate the extents
116     of the laden binary itself.  */     of the laden binary itself.  _END is one more than the address of
117       the last byte.  */
118  extern char _start;  extern char _start;
119  extern char _end;  extern char _end;
120    
# Line 123  extern char _end; Line 124  extern char _end;
124  void  void
125  find_components (void)  find_components (void)
126  {  {
127      l4_word_t min_page_size = getpagesize ();
128    multiboot_info_t *mbi = (multiboot_info_t *) l4_boot_info ();    multiboot_info_t *mbi = (multiboot_info_t *) l4_boot_info ();
129    l4_word_t start;    l4_word_t start;
130    l4_word_t end;    l4_word_t end;
# Line 143  find_components (void) Line 145  find_components (void)
145          {          {
146            mods[i].name = mod_names[i];            mods[i].name = mod_names[i];
147            mods[i].start = mod[i].mod_start;            mods[i].start = mod[i].mod_start;
148            mods[i].end = mod[i].mod_end;            if (mods[i].start & (min_page_size - 1))
149                panic ("Module %s does not start on a page boundary.\n");
150              mods[i].end = (mod[i].mod_end + min_page_size - 1)
151                & ~(min_page_size - 1);
152            mods[i].args = (char *) mod[i].string;            mods[i].args = (char *) mod[i].string;
           mod++;  
153          }          }
154      }      }
155    
# Line 154  find_components (void) Line 158  find_components (void)
158    loader_add_region (program_name, (l4_word_t) &_start, (l4_word_t) &_end);    loader_add_region (program_name, (l4_word_t) &_start, (l4_word_t) &_end);
159    
160    start = (l4_word_t) mbi;    start = (l4_word_t) mbi;
161    end = start + sizeof (*mbi) - 1;    end = start + sizeof (*mbi);
162    loader_add_region ("grub-mbi", start, end);    loader_add_region ("grub-mbi", start, end);
163        
164    if (CHECK_FLAG (mbi->flags, 3) && mbi->mods_count)    if (CHECK_FLAG (mbi->flags, 3) && mbi->mods_count)
# Line 167  find_components (void) Line 171  find_components (void)
171        loader_add_region ("grub-mods", start, end);        loader_add_region ("grub-mods", start, end);
172    
173        start = (l4_word_t) mod[0].string;        start = (l4_word_t) mod[0].string;
174        end = start;        end = start + 1;
175        for (nr = 0; nr < mbi->mods_count; nr++)        for (nr = 0; nr < mbi->mods_count; nr++)
176          {          {
177            char *str = (char *) mod[nr].string;            char *str = (char *) mod[nr].string;
# Line 178  find_components (void) Line 182  find_components (void)
182                  start = (l4_word_t) str;                  start = (l4_word_t) str;
183                while (*str)                while (*str)
184                  str++;                  str++;
185                if (((l4_word_t) str) > end)                if (((l4_word_t) str) + 1> end)
186                  end = (l4_word_t) str;                  end = (l4_word_t) str + 1;
187              }              }
188          }          }
189        loader_add_region ("grub-mods-cmdlines", start, end);        loader_add_region ("grub-mods-cmdlines", start, end + 1);
190      }      }
191  }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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