2 * Creation Date: <1999/11/16 00:49:26 samuel>
3 * Time-stamp: <2004/04/12 16:26:50 samuel>
9 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Samuel & David Rydh
10 # (samuel@ibrium.se, dary@lindesign.se)
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation
19 #include "libopenbios/openbios.h"
20 #include "libopenbios/bindings.h"
21 #include "arch/common/nvram.h"
23 #include "libopenbios/ofmem.h"
25 #include "openbios-version.h"
26 #include "osi_calls.h"
27 #include "boothelper_sh.h"
29 extern void unexpected_excep( int vector );
32 get_bool_res( const char *res )
36 p = BootHGetStrRes( res, buf, sizeof(buf) );
39 if( !strcasecmp(p,"true") || !strcasecmp(p,"yes") || !strcasecmp(p,"1") )
45 unexpected_excep( int vector )
47 printk("MOL panic: Unexpected exception %x\n", vector );
52 unsigned long isa_io_base;
57 isa_io_base = 0x80000000;
60 printk("=============================================================\n");
61 printk(PROGRAM_NAME " " OPENBIOS_VERSION_STR " [%s]\n",
68 printk("of_startup returned!\n");
74 setenv( char *env, char *value )
89 nvram_init("/pci/mac-io/nvram");
97 if( (ph=prom_find_device("/rtas")) == -1 )
98 printk("Warning: No /rtas node\n");
100 unsigned long size = 0x1000;
101 while( size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start )
103 prom_set_prop( ph, "rtas-size", (char*)&size, sizeof(size) );
106 /* tweak boot settings */
107 autoboot = !!get_bool_res("autoboot");
109 printk("Autobooting disabled - dropping into OpenFirmware\n");
110 setenv("auto-boot?", autoboot ? "true" : "false" );
111 setenv("boot-command", "molboot");
113 if( get_bool_res("tty-interface") == 1 )
114 fword("activate-tty-interface");
118 bind_func("molboot", boot );