1/*	$NetBSD: menus.md,v 1.13 2011/04/04 08:30:32 mbalmer Exp $	*/
2
3/*
4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved.
6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 *    notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 *    notice, this list of conditions and the following disclaimer in the
16 *    documentation and/or other materials provided with the distribution.
17 * 3. The name of Piermont Information Systems Inc. may not be used to endorse
18 *    or promote products derived from this software without specific prior
19 *    written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 */
34
35/* Menu definitions for sysinst. i386 version, machine dependent. */
36
37menu getboottype, title MSG_Bootblocks_selection, y=10, exit, no clear;
38	display action { msg_display(MSG_getboottype);
39		switch (((struct x86_boot_params *)arg)->bp_consdev) {
40		default:
41		case 0:
42			msg_display_add(MSG_console_PC);
43			break;
44		case 1: case 2: case 3: case 4:
45			if (menu->cursel == 0)
46			    menu->cursel = ((struct x86_boot_params *)arg)->bp_consdev;
47			msg_display_add(MSG_console_com,
48			    ((struct x86_boot_params *)arg)->bp_consdev - 1,
49			    ((struct x86_boot_params *)arg)->bp_conspeed);
50			break;
51		case ~0:
52			msg_display_add(MSG_console_unchanged);
53			break;
54		}};
55	option MSG_Use_normal_bootblocks, action
56	    {((struct x86_boot_params *)arg)->bp_consdev = 0; m->cursel = 7;};
57	option MSG_Use_serial_com0, action
58	    {((struct x86_boot_params *)arg)->bp_consdev = 1; m->cursel = 5;};
59	option MSG_Use_serial_com1, action
60	    {((struct x86_boot_params *)arg)->bp_consdev = 2; m->cursel = 5;};
61	option MSG_Use_serial_com2, action
62	    {((struct x86_boot_params *)arg)->bp_consdev = 3; m->cursel = 5;};
63	option MSG_Use_serial_com3, action
64	    {((struct x86_boot_params *)arg)->bp_consdev = 4; m->cursel = 5;};
65	option MSG_serial_baud_rate, sub menu consolebaud;
66	option MSG_Use_existing_bootblocks, action
67	    {((struct x86_boot_params *)arg)->bp_consdev = ~0; m->cursel = 7;};
68
69menu consolebaud, title MSG_serial_baud_rate, x=40, y=13;
70	display action {
71		switch (((struct x86_boot_params *)arg)->bp_conspeed) {
72		default:
73		case   9600: menu->cursel = 0; break;
74		case  19200: menu->cursel = 1; break;
75		case  38400: menu->cursel = 2; break;
76		case  57600: menu->cursel = 3; break;
77		case 115200: menu->cursel = 4; break;
78		case      0: menu->cursel = 5; break;
79		}};
80	option "9600", exit, action
81	    {((struct x86_boot_params *)arg)->bp_conspeed = 9600;};
82	option "19200", exit, action
83	    {((struct x86_boot_params *)arg)->bp_conspeed = 19200;};
84	option "38400", exit, action
85	    {((struct x86_boot_params *)arg)->bp_conspeed = 38400;};
86	option "57600", exit, action
87	    {((struct x86_boot_params *)arg)->bp_conspeed = 57600;};
88	option "115200", exit, action
89	    {((struct x86_boot_params *)arg)->bp_conspeed = 115200;};
90	option "BIOS", exit, action
91	    {((struct x86_boot_params *)arg)->bp_conspeed = 0;};
92
93menu biosonematch, y=-1;
94	option MSG_This_is_the_correct_geometry, exit, action { };
95	option MSG_Set_the_geometry_by_hand, exit, action
96	    {*(void **)arg = NULL;};
97
98menu biosmultmatch;
99	option MSG_Use_one_of_these_disks, exit, action {
100		int sel;
101		char res[4];
102
103		do {
104			strcpy(res, "0");
105			msg_prompt_win(MSG_pickdisk, -1, -1, 0, 0,
106					res, res, sizeof res);
107			sel = atoi(res);
108		} while (sel < 0 || sel >= *(int *)arg);
109		*(int *)arg = sel;
110	};
111	option MSG_Set_the_geometry_by_hand, exit, action {
112		*(int *)arg = -1;
113	};
114