commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hurd-l4/laden ia32-cmain.c laden.c laden.h load...


From: Marcus Brinkmann
Subject: hurd-l4/laden ia32-cmain.c laden.c laden.h load...
Date: Sun, 07 Sep 2003 21:39:14 -0400

CVSROOT:        /cvsroot/hurd
Module name:    hurd-l4
Branch:         
Changes by:     Marcus Brinkmann <address@hidden>       03/09/07 21:39:14

Modified files:
        laden          : ia32-cmain.c laden.c laden.h loader.c 

Log message:
        Fix help output.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/ia32-cmain.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/laden.c.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/laden.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/loader.c.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: hurd-l4/laden/ia32-cmain.c
diff -u hurd-l4/laden/ia32-cmain.c:1.5 hurd-l4/laden/ia32-cmain.c:1.6
--- hurd-l4/laden/ia32-cmain.c:1.5      Sun Sep  7 20:00:22 2003
+++ hurd-l4/laden/ia32-cmain.c  Sun Sep  7 21:39:14 2003
@@ -53,9 +53,6 @@
 {
   int argc = 0;
   char **argv = 0;
-  l4_word_t start;
-  l4_word_t end;
-
 
   /* Verify that we are booted by a Multiboot-compliant boot loader.  */
   if (magic != MULTIBOOT_BOOTLOADER_MAGIC)
@@ -121,42 +118,6 @@
      a later time.  */
   boot_info = (uint32_t) mbi;
 
-  /* Now protect ourselves and the mulitboot info (at least the module
-     configuration.  */
-  loader_add_region ("laden", (l4_word_t) &_start, (l4_word_t) &_end, 1);
-
-  start = (l4_word_t) mbi;
-  end = start + sizeof (*mbi) - 1;
-  loader_add_region ("grub-mbi", start, end, 1);
-  
-  if (CHECK_FLAG (mbi->flags, 3))
-    {
-      module_t *mod = (module_t *) mbi->mods_addr;
-      int nr;
-
-      start = (l4_word_t) mod;
-      end = ((l4_word_t) mod) + mbi->mods_count * sizeof (*mod);
-      loader_add_region ("grub-mods", start, end, 1);
-
-      start = (l4_word_t) mod[0].string;
-      end = start;
-      for (nr = 0; nr < mbi->mods_count; nr++)
-       {
-         char *str = (char *) mod[nr].string;
-
-         if (str)
-           {
-             if (((l4_word_t) str) < start)
-               start = (l4_word_t) str;
-             while (*str)
-               str++;
-             if (((l4_word_t) str) > end)
-               end = (l4_word_t) str;
-           }
-       }
-      loader_add_region ("grub-mods-cmdlines", start, end, 1);
-    }
-
   /* Now invoke the main function.  */
   main (argc, argv);
 
@@ -207,6 +168,8 @@
 find_components (void)
 {
   multiboot_info_t *mbi = (multiboot_info_t *) boot_info;
+  l4_word_t start;
+  l4_word_t end;
 
   debug_dump ();
 
@@ -217,18 +180,27 @@
 
       if (mbi->mods_count > 0)
        {
-         kernel.low = mod[0].mod_start;
-         kernel.high = mod[0].mod_end;
+         kernel.low = mod->mod_start;
+         kernel.high = mod->mod_end;
+         mod++;
+         mbi->mods_count--;
        }
-      if (mbi->mods_count > 1)
+      if (mbi->mods_count > 0)
        {
-         sigma0.low = mod[1].mod_start;
-         sigma0.high = mod[1].mod_end;
+         sigma0.low = mod->mod_start;
+         sigma0.high = mod->mod_end;
+         mod++;
+         mbi->mods_count--;
        }
-      if (mbi->mods_count > 1)
+      /* Swallow the modules we used so far.  This makes the
+        rootserver the first module in the list, irregardless if
+        sigma1 is used or not.  FIXME: The rootserver might need the
+        information about the other modules, though.  */
+      mbi->mods_addr = (l4_word_t) mod;
+      if (mbi->mods_count > 0)
        {
-         rootserver.low = mod[2].mod_start;
-         rootserver.high = mod[2].mod_end;
+         rootserver.low = mod->mod_start;
+         rootserver.high = mod->mod_end;
        }
     }
 
@@ -350,5 +322,42 @@
 
          add_memory_map (low, high, L4_MEMDESC_RESERVED, 0);
        }
+    }
+
+
+  /* Now protect ourselves and the mulitboot info (at least the module
+     configuration.  */
+  loader_add_region ("laden", (l4_word_t) &_start, (l4_word_t) &_end);
+
+  start = (l4_word_t) mbi;
+  end = start + sizeof (*mbi) - 1;
+  loader_add_region ("grub-mbi", start, end);
+  
+  if (CHECK_FLAG (mbi->flags, 3) && mbi->mods_count)
+    {
+      module_t *mod = (module_t *) mbi->mods_addr;
+      int nr;
+
+      start = (l4_word_t) mod;
+      end = ((l4_word_t) mod) + mbi->mods_count * sizeof (*mod);
+      loader_add_region ("grub-mods", start, end);
+
+      start = (l4_word_t) mod[0].string;
+      end = start;
+      for (nr = 0; nr < mbi->mods_count; nr++)
+       {
+         char *str = (char *) mod[nr].string;
+
+         if (str)
+           {
+             if (((l4_word_t) str) < start)
+               start = (l4_word_t) str;
+             while (*str)
+               str++;
+             if (((l4_word_t) str) > end)
+               end = (l4_word_t) str;
+           }
+       }
+      loader_add_region ("grub-mods-cmdlines", start, end);
     }
 }
Index: hurd-l4/laden/laden.c
diff -u hurd-l4/laden/laden.c:1.4 hurd-l4/laden/laden.c:1.5
--- hurd-l4/laden/laden.c:1.4   Sun Sep  7 18:13:04 2003
+++ hurd-l4/laden/laden.c       Sun Sep  7 21:39:14 2003
@@ -67,6 +67,8 @@
                  "\n"
                  "  -o, --output DRV  use output driver DRV\n"
                  "  -D, --debug       enable debug output\n"
+                 "  -h, --halt        halt the system at error (default)\n"
+                 "  -r, --reboot      reboot the system at error\n"
                  "\n"
                  "      --usage       print out some usage information and "
                  "exit\n"
Index: hurd-l4/laden/laden.h
diff -u hurd-l4/laden/laden.h:1.5 hurd-l4/laden/laden.h:1.6
--- hurd-l4/laden/laden.h:1.5   Sun Sep  7 19:35:44 2003
+++ hurd-l4/laden/laden.h       Sun Sep  7 21:39:14 2003
@@ -94,8 +94,8 @@
 
 /* Add the region with the name NAME from START to END to the table of
    regions to check against.  Before doing that, check for overlaps
-   with existing regions, unless FORCE is true.  */
-void loader_add_region (char *name, l4_word_t start, l4_word_t end, int force);
+   with existing regions.  */
+void loader_add_region (char *name, l4_word_t start, l4_word_t end);
 
 
 /* Load the ELF images of the kernel and the initial servers into
Index: hurd-l4/laden/loader.c
diff -u hurd-l4/laden/loader.c:1.4 hurd-l4/laden/loader.c:1.5
--- hurd-l4/laden/loader.c:1.4  Sun Sep  7 20:00:23 2003
+++ hurd-l4/laden/loader.c      Sun Sep  7 21:39:14 2003
@@ -108,15 +108,16 @@
 
 /* Add the region with the name NAME from START to END to the table of
    regions to check against.  Before doing that, check for overlaps
-   with existing regions, unless FORCE is true.  */
+   with existing regions.  */
 void
-loader_add_region (char *name, l4_word_t start, l4_word_t end, int force)
+loader_add_region (char *name, l4_word_t start, l4_word_t end)
 {
+  debug ("Protected Region: %s (0x%x - 0x%x)\n", name, start, end);
+
   if (nr_regions == MAX_REGIONS)
     panic ("Too many memory regions, region %s doesn't fit", name);
 
-  if (!force)
-    check_region (name, start, end);
+  check_region (name, start, end);
 
   used_regions[nr_regions].name = name;
   used_regions[nr_regions].start = start;
@@ -206,7 +207,7 @@
 
   /* FIXME: Add this as a bootloader specific memory type to L4's
      memdesc list instead.  */
-  loader_add_region (name, new_start, new_end, 0);
+  loader_add_region (name, new_start, new_end);
 
   if (new_start_p)
     *new_start_p = new_start;
@@ -226,18 +227,18 @@
 {
   if (!kernel.low)
     panic ("No L4 kernel found");
-  loader_add_region ("kernel-mod", kernel.low, kernel.high, 0);
+  loader_add_region ("kernel-mod", kernel.low, kernel.high);
 
   if (!sigma0.low)
     panic ("No sigma0 server found");
-  loader_add_region ("sigma0-mod", sigma0.low, sigma0.high, 0);
+  loader_add_region ("sigma0-mod", sigma0.low, sigma0.high);
 
   if (sigma1.low)
-    loader_add_region ("sigma1-mod", sigma1.low, sigma1.high, 0);
+    loader_add_region ("sigma1-mod", sigma1.low, sigma1.high);
 
   if (!rootserver.low)
     panic ("No rootserver server found");
-  loader_add_region ("rootserver-mod", rootserver.low, rootserver.high, 0);
+  loader_add_region ("rootserver-mod", rootserver.low, rootserver.high);
 
   elf_load ("kernel", kernel.low, kernel.high,
            &kernel.low, &kernel.high, &kernel.ip);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]