Home | History | Annotate | Line # | Download | only in hpcboot
hpcmenu.cpp revision 1.17.2.2
      1  1.17.2.2  uwe /* -*-C++-*-	$NetBSD: hpcmenu.cpp,v 1.17.2.2 2006/03/05 04:05:40 uwe Exp $	*/
      2  1.17.2.2  uwe 
      3  1.17.2.2  uwe /*-
      4  1.17.2.2  uwe  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
      5  1.17.2.2  uwe  * All rights reserved.
      6  1.17.2.2  uwe  *
      7  1.17.2.2  uwe  * This code is derived from software contributed to The NetBSD Foundation
      8  1.17.2.2  uwe  * by UCHIYAMA Yasushi.
      9  1.17.2.2  uwe  *
     10  1.17.2.2  uwe  * Redistribution and use in source and binary forms, with or without
     11  1.17.2.2  uwe  * modification, are permitted provided that the following conditions
     12  1.17.2.2  uwe  * are met:
     13  1.17.2.2  uwe  * 1. Redistributions of source code must retain the above copyright
     14  1.17.2.2  uwe  *    notice, this list of conditions and the following disclaimer.
     15  1.17.2.2  uwe  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.17.2.2  uwe  *    notice, this list of conditions and the following disclaimer in the
     17  1.17.2.2  uwe  *    documentation and/or other materials provided with the distribution.
     18  1.17.2.2  uwe  * 3. All advertising materials mentioning features or use of this software
     19  1.17.2.2  uwe  *    must display the following acknowledgement:
     20  1.17.2.2  uwe  *        This product includes software developed by the NetBSD
     21  1.17.2.2  uwe  *        Foundation, Inc. and its contributors.
     22  1.17.2.2  uwe  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.17.2.2  uwe  *    contributors may be used to endorse or promote products derived
     24  1.17.2.2  uwe  *    from this software without specific prior written permission.
     25  1.17.2.2  uwe  *
     26  1.17.2.2  uwe  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.17.2.2  uwe  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.17.2.2  uwe  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.17.2.2  uwe  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.17.2.2  uwe  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.17.2.2  uwe  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.17.2.2  uwe  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.17.2.2  uwe  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.17.2.2  uwe  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.17.2.2  uwe  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.17.2.2  uwe  * POSSIBILITY OF SUCH DAMAGE.
     37  1.17.2.2  uwe  */
     38  1.17.2.2  uwe 
     39  1.17.2.2  uwe #include <hpcmenu.h>
     40  1.17.2.2  uwe #include <hpcboot.h>
     41  1.17.2.2  uwe #include <res/resource.h>
     42  1.17.2.2  uwe #include <menu/window.h>
     43  1.17.2.2  uwe #include <menu/tabwindow.h>
     44  1.17.2.2  uwe #include <menu/rootwindow.h>
     45  1.17.2.2  uwe #include <menu/menu.h>
     46  1.17.2.2  uwe #include <machine/bootinfo.h>
     47  1.17.2.2  uwe #include <framebuffer.h>
     48  1.17.2.2  uwe #include <console.h>
     49  1.17.2.2  uwe #include <string.h>
     50  1.17.2.2  uwe 
     51  1.17.2.2  uwe HpcMenuInterface *HpcMenuInterface::_instance = 0;
     52  1.17.2.2  uwe 
     53  1.17.2.2  uwe HpcMenuInterface &
     54  1.17.2.2  uwe HpcMenuInterface::Instance()
     55  1.17.2.2  uwe {
     56  1.17.2.2  uwe 
     57  1.17.2.2  uwe 	if (!_instance)
     58  1.17.2.2  uwe 		_instance = new HpcMenuInterface();
     59  1.17.2.2  uwe 	return *_instance;
     60  1.17.2.2  uwe }
     61  1.17.2.2  uwe 
     62  1.17.2.2  uwe void
     63  1.17.2.2  uwe HpcMenuInterface::Destroy()
     64  1.17.2.2  uwe {
     65  1.17.2.2  uwe 
     66  1.17.2.2  uwe 	if (_instance)
     67  1.17.2.2  uwe 		delete _instance;
     68  1.17.2.2  uwe }
     69  1.17.2.2  uwe 
     70  1.17.2.2  uwe HpcMenuInterface::HpcMenuInterface()
     71  1.17.2.2  uwe {
     72  1.17.2.2  uwe 
     73  1.17.2.2  uwe 	if (!load())
     74  1.17.2.2  uwe 		_set_default_pref();
     75  1.17.2.2  uwe 	_pref._version	= HPCBOOT_VERSION;
     76  1.17.2.2  uwe 	_pref._size	= sizeof(HpcMenuPreferences);
     77  1.17.2.2  uwe 
     78  1.17.2.2  uwe 	_cons_parameter = 0;
     79  1.17.2.2  uwe 	memset(_cons_hook, 0, sizeof(struct cons_hook_args) * 4);
     80  1.17.2.2  uwe 	memset(&_boot_hook, 0, sizeof(struct boot_hook_args));
     81  1.17.2.2  uwe }
     82  1.17.2.2  uwe 
     83  1.17.2.2  uwe void
     84  1.17.2.2  uwe HpcMenuInterface::print(TCHAR *buf)
     85  1.17.2.2  uwe {
     86  1.17.2.2  uwe 
     87  1.17.2.2  uwe 	if (_console)
     88  1.17.2.2  uwe 		_console->print(buf);
     89  1.17.2.2  uwe }
     90  1.17.2.2  uwe 
     91  1.17.2.2  uwe void
     92  1.17.2.2  uwe HpcMenuInterface::get_options()
     93  1.17.2.2  uwe {
     94  1.17.2.2  uwe 
     95  1.17.2.2  uwe 	_main->get();
     96  1.17.2.2  uwe 	_option->get();
     97  1.17.2.2  uwe }
     98  1.17.2.2  uwe 
     99  1.17.2.2  uwe TCHAR *
    100  1.17.2.2  uwe HpcMenuInterface::dir(int i)
    101  1.17.2.2  uwe {
    102  1.17.2.2  uwe 	int res = IDS_DIR_RES(i);
    103  1.17.2.2  uwe 
    104  1.17.2.2  uwe 	if (!IDS_DIR_RES_VALID(res))
    105  1.17.2.2  uwe 		return 0;
    106  1.17.2.2  uwe 
    107  1.17.2.2  uwe 	if (_pref.dir_user && res == IDS_DIR_USER_DEFINED) {
    108  1.17.2.2  uwe 		return _pref.dir_user_path;
    109  1.17.2.2  uwe 	}
    110  1.17.2.2  uwe 
    111  1.17.2.2  uwe 	TCHAR *s = reinterpret_cast <TCHAR *>
    112  1.17.2.2  uwe 	    (LoadString(_root->_app._instance, res, 0, 0));
    113  1.17.2.2  uwe 
    114  1.17.2.2  uwe 	return s;
    115  1.17.2.2  uwe }
    116  1.17.2.2  uwe 
    117  1.17.2.2  uwe int
    118  1.17.2.2  uwe HpcMenuInterface::dir_default()
    119  1.17.2.2  uwe {
    120  1.17.2.2  uwe 
    121  1.17.2.2  uwe 	return _pref.dir_user ? IDS_DIR_SEQ(IDS_DIR_USER_DEFINED) : 0;
    122  1.17.2.2  uwe }
    123  1.17.2.2  uwe 
    124  1.17.2.2  uwe void
    125  1.17.2.2  uwe HpcMenuInterface::_set_default_pref()
    126  1.17.2.2  uwe {
    127  1.17.2.2  uwe 
    128  1.17.2.2  uwe 	_pref._magic		= HPCBOOT_MAGIC;
    129  1.17.2.2  uwe 	_pref.dir		= 0;
    130  1.17.2.2  uwe 	_pref.dir_user		= FALSE;
    131  1.17.2.2  uwe 	_pref.kernel_user	= FALSE;
    132  1.17.2.2  uwe 	_pref.platid_hi		= 0;
    133  1.17.2.2  uwe 	_pref.platid_lo		= 0;
    134  1.17.2.2  uwe 	_pref.rootfs		= 0;
    135  1.17.2.2  uwe 	wsprintf(_pref.rootfs_file, TEXT("miniroot.fs"));
    136  1.17.2.2  uwe 	_pref.boot_serial	= FALSE;
    137  1.17.2.2  uwe 	_pref.boot_verbose	= FALSE;
    138  1.17.2.2  uwe 	_pref.boot_single_user	= FALSE;
    139  1.17.2.2  uwe 	_pref.boot_ask_for_name	= FALSE;
    140  1.17.2.2  uwe 	_pref.boot_debugger	= FALSE;
    141  1.17.2.2  uwe 	wsprintf(_pref.boot_extra, TEXT(""));
    142  1.17.2.2  uwe 	_pref.auto_boot		= 0;
    143  1.17.2.2  uwe 	_pref.reverse_video	= FALSE;
    144  1.17.2.2  uwe 	_pref.pause_before_boot	= TRUE;
    145  1.17.2.2  uwe 	_pref.safety_message	= TRUE;
    146  1.17.2.2  uwe #ifdef MIPS
    147  1.17.2.2  uwe 	_pref.serial_speed	= 9600; // historical reason.
    148  1.17.2.2  uwe #else
    149  1.17.2.2  uwe 	_pref.serial_speed	= 19200;
    150  1.17.2.2  uwe #endif
    151  1.17.2.2  uwe }
    152  1.17.2.2  uwe 
    153  1.17.2.2  uwe //
    154  1.17.2.2  uwe // load and save current menu status.
    155  1.17.2.2  uwe //
    156  1.17.2.2  uwe BOOL
    157  1.17.2.2  uwe HpcMenuInterface::load()
    158  1.17.2.2  uwe {
    159  1.17.2.2  uwe 	TCHAR path[MAX_PATH];
    160  1.17.2.2  uwe 
    161  1.17.2.2  uwe 	if (!_find_pref_dir(path))
    162  1.17.2.2  uwe 		return FALSE;
    163  1.17.2.2  uwe 
    164  1.17.2.2  uwe 	TCHAR filename[MAX_PATH];
    165  1.17.2.2  uwe 	wsprintf(filename, TEXT("\\%s\\hpcboot.cnf"), path);
    166  1.17.2.2  uwe 	HANDLE file = CreateFile(filename, GENERIC_READ, 0, 0, OPEN_EXISTING,
    167  1.17.2.2  uwe 	    FILE_ATTRIBUTE_NORMAL, 0);
    168  1.17.2.2  uwe 	if (file == INVALID_HANDLE_VALUE)
    169  1.17.2.2  uwe 		return FALSE;
    170  1.17.2.2  uwe 
    171  1.17.2.2  uwe 	DWORD cnt;
    172  1.17.2.2  uwe 	// read header.
    173  1.17.2.2  uwe 	if (!ReadFile(file, &_pref, 12, &cnt, 0))
    174  1.17.2.2  uwe 		goto bad;
    175  1.17.2.2  uwe 	if (_pref._magic != HPCBOOT_MAGIC)
    176  1.17.2.2  uwe 		goto bad;
    177  1.17.2.2  uwe 	// read all.
    178  1.17.2.2  uwe 	SetFilePointer(file, 0, 0, FILE_BEGIN);
    179  1.17.2.2  uwe 	if (!ReadFile(file, &_pref, _pref._size, &cnt, 0))
    180  1.17.2.2  uwe 		goto bad;
    181  1.17.2.2  uwe 	CloseHandle(file);
    182  1.17.2.2  uwe 
    183  1.17.2.2  uwe 	return TRUE;
    184  1.17.2.2  uwe  bad:
    185  1.17.2.2  uwe 	CloseHandle(file);
    186  1.17.2.2  uwe 	return FALSE;
    187  1.17.2.2  uwe }
    188  1.17.2.2  uwe 
    189  1.17.2.2  uwe BOOL
    190  1.17.2.2  uwe HpcMenuInterface::save()
    191  1.17.2.2  uwe {
    192  1.17.2.2  uwe 	TCHAR path[MAX_PATH];
    193  1.17.2.2  uwe 
    194  1.17.2.2  uwe 	if (_find_pref_dir(path)) {
    195  1.17.2.2  uwe 		TCHAR filename[MAX_PATH];
    196  1.17.2.2  uwe 		wsprintf(filename, TEXT("\\%s\\hpcboot.cnf"), path);
    197  1.17.2.2  uwe 		HANDLE file = CreateFile(filename, GENERIC_WRITE, 0, 0,
    198  1.17.2.2  uwe 		    CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
    199  1.17.2.2  uwe 		DWORD cnt;
    200  1.17.2.2  uwe 		WriteFile(file, &_pref, _pref._size, &cnt, 0);
    201  1.17.2.2  uwe 		CloseHandle(file);
    202  1.17.2.2  uwe 		return cnt == _pref._size;
    203  1.17.2.2  uwe 	}
    204  1.17.2.2  uwe 
    205  1.17.2.2  uwe 	return FALSE;
    206  1.17.2.2  uwe }
    207  1.17.2.2  uwe 
    208  1.17.2.2  uwe // arguments for kernel.
    209  1.17.2.2  uwe int
    210  1.17.2.2  uwe HpcMenuInterface::setup_kernel_args(vaddr_t v, paddr_t p, size_t sz)
    211  1.17.2.2  uwe {
    212  1.17.2.2  uwe 	int argc = 0;
    213  1.17.2.2  uwe 	kaddr_t *argv = reinterpret_cast <kaddr_t *>(v);
    214  1.17.2.2  uwe 	char *loc = reinterpret_cast <char *>
    215  1.17.2.2  uwe 	    (v + sizeof(char **) * MAX_KERNEL_ARGS);
    216  1.17.2.2  uwe 	paddr_t locp = p + sizeof(char **) * MAX_KERNEL_ARGS;
    217  1.17.2.2  uwe 	size_t len;
    218  1.17.2.2  uwe 	TCHAR *w;
    219  1.17.2.2  uwe 	char *ptr;
    220  1.17.2.2  uwe 
    221  1.17.2.2  uwe #define	SETOPT(c)							\
    222  1.17.2.2  uwe __BEGIN_MACRO								\
    223  1.17.2.2  uwe 	argv[argc++] = ptokv(locp);					\
    224  1.17.2.2  uwe 	*loc++ =(c);							\
    225  1.17.2.2  uwe 	*loc++ = '\0';							\
    226  1.17.2.2  uwe 	locp += 2;							\
    227  1.17.2.2  uwe __END_MACRO
    228  1.17.2.2  uwe 	// 1st arg is kernel name.
    229  1.17.2.2  uwe //	DPRINTF_SETUP();  //if you want to use debug print, enable this line.
    230  1.17.2.2  uwe 
    231  1.17.2.2  uwe 	w = _pref.kernel_user_file;
    232  1.17.2.2  uwe 	argv[argc++] = ptokv(locp);
    233  1.17.2.2  uwe 	len = WideCharToMultiByte(CP_ACP, 0, w, wcslen(w), 0, 0, 0, 0);
    234  1.17.2.2  uwe 	WideCharToMultiByte(CP_ACP, 0, w, len, loc, len, 0, 0);
    235  1.17.2.2  uwe 	loc[len] = '\0';
    236  1.17.2.2  uwe 	loc += len + 1;
    237  1.17.2.2  uwe 	locp += len + 1;
    238  1.17.2.2  uwe 
    239  1.17.2.2  uwe 	if (_pref.boot_serial)		// serial console
    240  1.17.2.2  uwe 		SETOPT('h');
    241  1.17.2.2  uwe 	if (_pref.boot_verbose)		// boot verbosely
    242  1.17.2.2  uwe 		SETOPT('v');
    243  1.17.2.2  uwe 	if (_pref.boot_single_user)	// boot to single user
    244  1.17.2.2  uwe 		SETOPT('s');
    245  1.17.2.2  uwe 	if (_pref.boot_ask_for_name)	// ask for file name to boot from
    246  1.17.2.2  uwe 		SETOPT('a');
    247  1.17.2.2  uwe 	if (_pref.boot_debugger)	// break into the kernel debugger
    248  1.17.2.2  uwe 		SETOPT('d');
    249  1.17.2.2  uwe 
    250  1.17.2.2  uwe 	// boot from
    251  1.17.2.2  uwe 	switch(_pref.rootfs) {
    252  1.17.2.2  uwe 	case 0:	// wd0
    253  1.17.2.2  uwe 		break;
    254  1.17.2.2  uwe 	case 1:	// sd0
    255  1.17.2.2  uwe 		argv[argc++] = ptokv(locp);
    256  1.17.2.2  uwe 		strncpy(loc, "b=sd0", 6);
    257  1.17.2.2  uwe 		loc += 6;
    258  1.17.2.2  uwe 		locp += 6;
    259  1.17.2.2  uwe 		break;
    260  1.17.2.2  uwe 	case 2:	// memory disk
    261  1.17.2.2  uwe 		w = _pref.rootfs_file;
    262  1.17.2.2  uwe 		argv[argc++] = ptokv(locp);
    263  1.17.2.2  uwe 		strncpy(loc, "m=", 2);
    264  1.17.2.2  uwe 		loc += 2;
    265  1.17.2.2  uwe 		len = WideCharToMultiByte(CP_ACP, 0, w, wcslen(w), 0, 0, 0, 0);
    266  1.17.2.2  uwe 		WideCharToMultiByte(CP_ACP, 0, w, len, loc, len, 0, 0);
    267  1.17.2.2  uwe 		loc[len] = '\0';
    268  1.17.2.2  uwe 		loc += len + 1;
    269  1.17.2.2  uwe 		locp += 2 + len + 1;
    270  1.17.2.2  uwe 		break;
    271  1.17.2.2  uwe 	case 3:	// nfs
    272  1.17.2.2  uwe 		argv[argc++] = ptokv(locp);
    273  1.17.2.2  uwe 		strncpy(loc, "b=nfs", 6);
    274  1.17.2.2  uwe 		loc += 6;
    275  1.17.2.2  uwe 		locp += 6;
    276  1.17.2.2  uwe 		break;
    277  1.17.2.2  uwe 	}
    278  1.17.2.2  uwe 
    279  1.17.2.2  uwe 	// Extra kernel options. (Option tab window)
    280  1.17.2.2  uwe 	w = _pref.boot_extra;
    281  1.17.2.2  uwe 	len = WideCharToMultiByte(CP_ACP, 0, w, wcslen(w), 0, 0, 0, 0);
    282  1.17.2.2  uwe 
    283  1.17.2.2  uwe 	if ((ptr = (char *)malloc(len)) == NULL) {
    284  1.17.2.2  uwe 		MessageBox(_root->_window,
    285  1.17.2.2  uwe 		    L"Can't allocate memory for extra kernel options.",
    286  1.17.2.2  uwe 		    TEXT("WARNING"),
    287  1.17.2.2  uwe 		    MB_ICONWARNING | MB_OK);
    288  1.17.2.2  uwe 		UpdateWindow(_root->_window);
    289  1.17.2.2  uwe 
    290  1.17.2.2  uwe 		return argc;
    291  1.17.2.2  uwe 	}
    292  1.17.2.2  uwe 	WideCharToMultiByte(CP_ACP, 0, w, len, ptr, len, 0, 0);
    293  1.17.2.2  uwe 	ptr[len]='\0';
    294  1.17.2.2  uwe 
    295  1.17.2.2  uwe 	while (*ptr == ' ' || *ptr == '\t')
    296  1.17.2.2  uwe 		ptr++;
    297  1.17.2.2  uwe 	while (*ptr != '\0') {
    298  1.17.2.2  uwe 		len = strcspn(ptr, " \t");
    299  1.17.2.2  uwe 		if (len == 0)
    300  1.17.2.2  uwe 			len = strlen(ptr);
    301  1.17.2.2  uwe 
    302  1.17.2.2  uwe 		if (argc == MAX_KERNEL_ARGS || locp + len + 1 > p + sz) {
    303  1.17.2.2  uwe 			MessageBox(_root->_window,
    304  1.17.2.2  uwe 			    L"Too many extra kernel options.",
    305  1.17.2.2  uwe 			    TEXT("WARNING"),
    306  1.17.2.2  uwe 			    MB_ICONWARNING | MB_OK);
    307  1.17.2.2  uwe 			UpdateWindow(_root->_window);
    308  1.17.2.2  uwe 			break;
    309  1.17.2.2  uwe 		}
    310  1.17.2.2  uwe 		argv[argc++] = ptokv(locp);
    311  1.17.2.2  uwe 		strncpy(loc, ptr, len);
    312  1.17.2.2  uwe 		loc[len] = '\0';
    313  1.17.2.2  uwe 		loc += len + 1;
    314  1.17.2.2  uwe 		locp += len + 1;
    315  1.17.2.2  uwe 
    316  1.17.2.2  uwe 		ptr += len;
    317  1.17.2.2  uwe 		while (*ptr == ' ' || *ptr == '\t')
    318  1.17.2.2  uwe 			ptr++;
    319  1.17.2.2  uwe 	}
    320  1.17.2.2  uwe 
    321  1.17.2.2  uwe 	return argc;
    322  1.17.2.2  uwe }
    323  1.17.2.2  uwe 
    324  1.17.2.2  uwe // kernel bootinfo.
    325  1.17.2.2  uwe void
    326  1.17.2.2  uwe HpcMenuInterface::setup_bootinfo(struct bootinfo &bi)
    327  1.17.2.2  uwe {
    328  1.17.2.2  uwe 	FrameBufferInfo fb(_pref.platid_hi, _pref.platid_lo);
    329  1.17.2.2  uwe 	TIME_ZONE_INFORMATION tz;
    330  1.17.2.2  uwe 	DWORD tzid = GetTimeZoneInformation(&tz);
    331  1.17.2.2  uwe 
    332  1.17.2.2  uwe 	memset(&bi, 0, sizeof(struct bootinfo));
    333  1.17.2.2  uwe 	bi.length		= sizeof(struct bootinfo);
    334  1.17.2.2  uwe 	bi.reserved		= 0;
    335  1.17.2.2  uwe 	bi.magic		= BOOTINFO_MAGIC;
    336  1.17.2.2  uwe 	bi.fb_addr		= fb.addr();
    337  1.17.2.2  uwe 	bi.fb_type		= fb.type();
    338  1.17.2.2  uwe 	bi.fb_line_bytes	= fb.linebytes();
    339  1.17.2.2  uwe 	bi.fb_width		= fb.width();
    340  1.17.2.2  uwe 	bi.fb_height		= fb.height();
    341  1.17.2.2  uwe 	bi.platid_cpu		= _pref.platid_hi;
    342  1.17.2.2  uwe 	bi.platid_machine	= _pref.platid_lo;
    343  1.17.2.2  uwe 	bi.timezone		= tz.Bias;
    344  1.17.2.2  uwe 	if (tzid == TIME_ZONE_ID_DAYLIGHT)
    345  1.17.2.2  uwe 		bi.timezone    += tz.DaylightBias;
    346  1.17.2.2  uwe }
    347  1.17.2.2  uwe 
    348  1.17.2.2  uwe // Progress bar
    349  1.17.2.2  uwe void
    350  1.17.2.2  uwe HpcMenuInterface::progress(const char *msg)
    351  1.17.2.2  uwe {
    352  1.17.2.2  uwe 
    353  1.17.2.2  uwe 	_root->progress(msg);
    354  1.17.2.2  uwe }
    355  1.17.2.2  uwe 
    356  1.17.2.2  uwe void
    357  1.17.2.2  uwe HpcMenuInterface::unprogress()
    358  1.17.2.2  uwe {
    359  1.17.2.2  uwe 
    360  1.17.2.2  uwe 	_root->unprogress();
    361  1.17.2.2  uwe }
    362  1.17.2.2  uwe 
    363  1.17.2.2  uwe // Boot kernel.
    364  1.17.2.2  uwe void
    365  1.17.2.2  uwe HpcMenuInterface::boot()
    366  1.17.2.2  uwe {
    367  1.17.2.2  uwe 	struct support_status *tab = _unsupported;
    368  1.17.2.2  uwe 	uint32_t cpu = _pref.platid_hi;
    369  1.17.2.2  uwe 	uint32_t machine = _pref.platid_lo;
    370  1.17.2.2  uwe 
    371  1.17.2.2  uwe 	if (_pref.safety_message)
    372  1.17.2.2  uwe 		for (; tab->cpu; tab++) {
    373  1.17.2.2  uwe 			if (tab->cpu == cpu && tab->machine == machine) {
    374  1.17.2.2  uwe 				MessageBox(_root->_window,
    375  1.17.2.2  uwe 				    tab->cause ? tab->cause :
    376  1.17.2.2  uwe 				    L"Not supported yet.",
    377  1.17.2.2  uwe 				    TEXT("BOOT FAILED"),
    378  1.17.2.2  uwe 				    MB_ICONERROR | MB_OK);
    379  1.17.2.2  uwe 				return;
    380  1.17.2.2  uwe 			}
    381  1.17.2.2  uwe 		}
    382  1.17.2.2  uwe 
    383  1.17.2.2  uwe 	if (_boot_hook.func)
    384  1.17.2.2  uwe 		_boot_hook.func(_boot_hook.arg);
    385  1.17.2.2  uwe }
    386