/[pupa]/pupa/kern/main.c
ViewVC logotype

Diff of /pupa/kern/main.c

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

revision 1.4 by okuji, Fri Jan 17 02:52:05 2003 UTC revision 1.5 by okuji, Mon Jan 20 04:13:46 2003 UTC
# Line 84  pupa_set_root_dev (void) Line 84  pupa_set_root_dev (void)
84  static void  static void
85  pupa_load_normal_mode (void)  pupa_load_normal_mode (void)
86  {  {
87    if (pupa_dl_load ("normal"))    /* Load the module.  */
88      {    pupa_dl_load ("normal");
       void (*normal_func) (const char *config);  
         
       /* If the function pupa_enter_normal_mode is present, call it.  */  
       normal_func = pupa_dl_resolve_symbol ("pupa_enter_normal_mode");  
       if (normal_func)  
         {  
           char *config;  
           char *prefix;  
   
           prefix = pupa_dl_get_prefix ();  
           if (! prefix)  
             pupa_fatal ("The dl prefix is not set!");  
             
           config = pupa_malloc (pupa_strlen (prefix) + sizeof ("/pupa.cfg"));  
           if (! config)  
             pupa_fatal ("out of memory");  
   
           pupa_sprintf (config, "%s/pupa.cfg", prefix);  
           (*normal_func) (config);  
           pupa_free (config);  
         }  
       else  
         pupa_printf ("No entrance routine in the normal mode!\n");  
     }  
   else  
     pupa_printf ("Failed to load the normal mode.\n");  
89        
90    /* Ignore any error, because we have the rescue mode anyway.  */    /* Ignore any error, because we have the rescue mode anyway.  */
91    pupa_errno = PUPA_ERR_NONE;    pupa_errno = PUPA_ERR_NONE;
# Line 138  pupa_main (void) Line 112  pupa_main (void)
112    pupa_load_modules ();    pupa_load_modules ();
113    pupa_add_unused_region ();    pupa_add_unused_region ();
114    
115    /* Go to the real world.  */    /* Load the normal mode module.  */
116    pupa_load_normal_mode ();    pupa_load_normal_mode ();
117        
118    /* If pupa_enter_normal_mode fails or doesn't exist, enter rescue mode.  */    /* Enter the rescue mode.  */
   pupa_printf ("Entering into rescue mode...\n");  
119    pupa_enter_rescue_mode ();    pupa_enter_rescue_mode ();
120  }  }

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

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