home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (c) 1995 Mark Brinicombe.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * RiscBSD kernel project
- *
- * config.c
- *
- * Bootloader configuration window management routines
- *
- * Created : 26/04/95
- * Last updated : 12/07/96
- */
-
- /* Include standard header files */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- #include "wimp.h"
- #include "Event.h" /* Event despatcher */
- #include "Error.h" /* Error despatcher */
- #include "Window.h" /* Window handling automation */
- #include "Icon.h" /* Icon handling automation */
- #include "WimpSWIs.h" /* Default event handlers */
- #include "IconExt.h" /* Icon handling automation */
- #include "Screen.h" /* Getting screen size info, etc */
- #include "Msgs.h"
- #include "Menu.h"
- #include "SWI.h"
- #include "dlswis.h"
- #include "swiv.h"
-
- #include "icons.h"
- #include "prototypes.h"
- #include "config.h"
-
- /* Declare global variables */
-
- window_handle config_window = NULL;
- window_handle config_backing = NULL;
- window_handle egowindow = NULL;
- menu_ptr rootdevpopup_menu = NULL;
- menu_ptr swapdevpopup_menu = NULL;
- menu_ptr ramdiscpopup_menu = NULL;
- Config config = {
- "<BtRiscBSD$Dir>.^.NetBSD",
- "/dev/wd0a",
- "/dev/wd0b",
- "X1024 Y768 C256 F60",
- "",
- 32,
- 0,
- 0,
- 0,
- 0,
- 0,
- };
-
- /* Declare external variables */
-
- /* Local function prototypes */
-
- BOOL Config_PaneHandler(event_pollblock *event, void *reference);
- BOOL Config_Close(event_pollblock *event, void *reference);
- BOOL Config_Click(event_pollblock *event, void *reference);
-
- /* Now for the main code */
-
-
- /*
- * Initialise the configuration module. This just loads the saved config file.
- */
-
- void Config_Initialise(void)
- {
- Config_Load(CONFIG_FILENAME);
-
- /* Create device popup menus */
-
- rootdevpopup_menu = Menu_CreateMenu("Root Devices",
- "/dev/wd0a,/dev/wd1a,/dev/fd0a,/dev/fd1a,/dev/rd0a,/dev/rd1a,/dev/sd0a,/dev/sd1a,/dev/cd0a,/dev/cd1a,/dev/acd0");
- if (!rootdevpopup_menu)
- Msgs_ReportFatal(0x00000000, "err.0", "RootDevPopup");
-
- swapdevpopup_menu = Menu_CreateMenu("Swap Devices",
- "/dev/wd0b,/dev/wd1b,/dev/sd0b,/dev/sd1b");
- if (!swapdevpopup_menu)
- Msgs_ReportFatal(0x00000000, "err.0", "SwapDevPopup");
-
- ramdiscpopup_menu = Menu_CreateMenu("Ramdisc",
- "0K,1440K");
- if (!ramdiscpopup_menu)
- Msgs_ReportFatal(0x00000000, "err.0", "RamdiscPopup");
-
- }
-
-
- /*
- * Load a new configuration file.
- */
-
- int Config_Load(char *filename)
- {
- FILE *filehandle;
- char string[300];
- char tag[40];
- char value[256];
-
- filehandle = fopen(filename, "r");
- if (!filehandle) return(1);
-
- fread(string, 12, 1, filehandle);
- string[12] = 0;
- if (strcmp(string, "#!BtRiscBSD\n") != 0)
- {
- fclose(filehandle);
- return(2);
- }
-
- while (!feof(filehandle))
- {
- if (fgets(string, 300, filehandle) == NULL)
- continue;
-
- if (sscanf(string, "%[^:]: %[^\n]", tag, value) == 2)
- {
- if (strcmp(tag, "kernel") == 0)
- strcpy(config.kernel, value);
- if (strcmp(tag, "rootdev") == 0)
- strcpy(config.root_dev, value);
- if (strcmp(tag, "swapdev") == 0)
- strcpy(config.swap_dev, value);
- if (strcmp(tag, "screenmode") == 0)
- strcpy(config.screenmode, value);
- if (strcmp(tag, "other") == 0)
- strcpy(config.other, value);
- if (strcmp(tag, "ramdisc") == 0)
- config.ramdisc = atoi(value);
- if (strcmp(tag, "maxproc") == 0)
- config.max_proc = atoi(value);
- if (strcmp(tag, "flags") == 0)
- sscanf(value, "%x", &config.flags);
- if (strcmp(tag, "cpuflags") == 0)
- sscanf(value, "%x", &config.cpu_flags);
- if (strcmp(tag, "pmapdebug") == 0)
- config.pmap_debug_level = atoi(value);
- if (strcmp(tag, "videodram") == 0)
- config.video_dram = atoi(value);
- }
- }
-
- fclose(filehandle);
- return(0);
- }
-
-
- /*
- * Save a configuration file
- */
-
- int Config_Save(char *filename)
- {
- FILE *filehandle;
-
- filehandle = fopen(filename, "w");
- if (filehandle)
- {
- fprintf(filehandle, "#!BtRiscBSD\n");
- fprintf(filehandle, "kernel: %s\n", config.kernel);
- fprintf(filehandle, "rootdev: %s\n", config.root_dev);
- fprintf(filehandle, "swapdev: %s\n", config.swap_dev);
- fprintf(filehandle, "screenmode: %s\n", config.screenmode);
- fprintf(filehandle, "other: %s\n", config.other);
- fprintf(filehandle, "ramdisc: %dK\n", config.ramdisc);
- fprintf(filehandle, "maxproc: %d\n", config.max_proc);
- fprintf(filehandle, "flags: %08x\n", config.flags);
- fprintf(filehandle, "cpuflags: %08x\n", config.cpu_flags);
- fprintf(filehandle, "pmapdebug: %d\n", config.pmap_debug_level);
- fprintf(filehandle, "videodram: %dK\n", config.video_dram);
- fclose(filehandle);
- swi(OS_File, IN(R0|R1|R2), 18, CONFIG_FILENAME, FILETYPE_UNIX);
- }
- else
- return(1);
-
- return(0);
- }
-
-
- /*
- * Open the configuration window (the backing and the pane)
- */
-
- void Config_OpenWindow(void)
- {
- window_state wstate;
- event_pollblock event;
- attached_menu *at_menu;
- icon_block istate;
- FILE *filehandle;
-
- /* Are we already open ? */
-
- if (config_backing)
- {
- Wimp_GetWindowState(config_backing, &wstate);
- wstate.openblock.behind = -1;
- event.data.openblock = wstate.openblock;
- event.data.openblock.behind = -1;
- Config_PaneHandler(&event, NULL);
- return;
- }
-
- /* Create and open our main windows from the template "control". */
-
- config_window = Window_Create("configpane", 0);
- config_backing = Window_CreateAndShow("config", 0, open_CENTERED);
-
- if (!config_backing || !config_window) Msgs_ReportFatal(0x00000000,
- "err.1", "config");
-
- Wimp_GetIconState(config_backing, CONFIG_WINDOW_ICON_LOGO, &istate);
- if (screen_bpp == 8)
- strcpy(istate.data.indirectsprite.name, "riscbsd256");
- else
- strcpy(istate.data.indirectsprite.name, "riscbsd16");
-
- Icon_ForceRedraw(config_backing, CONFIG_WINDOW_ICON_LOGO);
-
- /* Claim window-close events for the config window */
-
- Event_Claim(event_CLOSE, config_backing, event_ANY, Config_Close, NULL);
-
- /* Claim the window open events to handle the pane */
-
- Event_Claim(event_OPEN, config_backing, event_ANY, Config_PaneHandler,
- (void *)1);
-
- /* Set the correct state for all the icons */
-
- Config_SetIcons();
-
- /* Add mouse click handlers */
-
- Event_Claim(event_CLICK, config_backing, CONFIG_WINDOW_ICON_LOGO,
- Config_Click, NULL);
- Event_Claim(event_CLICK, config_backing, CONFIG_WINDOW_ICON_BOOT,
- Config_Confirm, (void *)0x01);
- Event_Claim(event_CLICK, config_backing, CONFIG_WINDOW_ICON_SAVE,
- Config_Confirm, (void *)0x02);
- Event_Claim(event_CLICK, config_backing, CONFIG_WINDOW_ICON_CANCEL,
- Config_Confirm, (void *)0x03);
-
- at_menu = Menu_AttachMenu(rootdevpopup_menu, config_window,
- CONFIG_PANE_ICON_ROOTDEV_POPUP, Config_RootDevPopup, NULL, NULL, NULL);
- at_menu->flags |= MENU_FLAG_POPUP;
-
- at_menu = Menu_AttachMenu(rootdevpopup_menu, config_window,
- CONFIG_PANE_ICON_ROOTDEV, Config_RootDevPopup, NULL, NULL, NULL);
- at_menu->flags |= MENU_FLAG_POPUP;
-
- at_menu = Menu_AttachMenu(swapdevpopup_menu, config_window,
- CONFIG_PANE_ICON_SWAPDEV_POPUP, Config_SwapDevPopup, NULL, NULL, NULL);
- at_menu->flags |= MENU_FLAG_POPUP;
-
- at_menu = Menu_AttachMenu(swapdevpopup_menu, config_window,
- CONFIG_PANE_ICON_SWAPDEV, Config_SwapDevPopup, NULL, NULL, NULL);
- at_menu->flags |= MENU_FLAG_POPUP;
-
- at_menu = Menu_AttachMenu(ramdiscpopup_menu, config_window,
- CONFIG_PANE_ICON_RAMDISC_POPUP, Config_RamdiscPopup, NULL, NULL, NULL);
- at_menu->flags |= MENU_FLAG_POPUP;
-
- at_menu = Menu_AttachMenu(ramdiscpopup_menu, config_window,
- CONFIG_PANE_ICON_RAMDISC, Config_RamdiscPopup, NULL, NULL, NULL);
- at_menu->flags |= MENU_FLAG_POPUP;
-
- /* Check for support for native booting */
-
- filehandle = fopen(NATIVE_SUPPORT, "r");
- if (filehandle)
- {
- Icon_SetShade(config_window, CONFIG_PANE_ICON_NATIVE, 0);
- fclose(filehandle);
- }
-
- /* Set the correct state for opening */
-
- Wimp_GetWindowState(config_backing, &wstate);
- event.data.openblock = wstate.openblock;
- event.data.openblock.behind = -1;
- Config_PaneHandler(&event, NULL);
- }
-
-
- /*
- * Handle a open window request on the configuration window.
- * We have to open both the backing window and the pane at the appropriate
- * position.
- */
-
- BOOL Config_PaneHandler(event_pollblock *event, void *reference)
- {
- int x, y, w, h;
- window_state wstate;
-
- /* Are we on screen ? - Only check is this a forced refresh */
-
- if (reference == NULL)
- {
- Screen_CacheModeInfo();
- if (event->data.openblock.screenrect.max.x > screen_size.x)
- {
- event->data.openblock.screenrect.min.x -=
- (event->data.openblock.screenrect.max.x - screen_size.x);
- event->data.openblock.screenrect.max.x = screen_size.x;
- }
-
- if (event->data.openblock.screenrect.max.y > screen_size.y)
- {
- event->data.openblock.screenrect.min.y -=
- (event->data.openblock.screenrect.max.y - (screen_size.y - 44));
- event->data.openblock.screenrect.max.y = (screen_size.y - 44);
- }
- }
-
- /* Calculate the dimensions of the config pane */
-
- x = event->data.openblock.screenrect.min.x + CONFIG_PANE_LEFT_OFFSET;
- w = CONFIG_PANE_WIDTH;
- y = event->data.openblock.screenrect.max.y - CONFIG_PANE_VERTICAL_OFFSET;
-
- Wimp_GetWindowState(config_backing, &wstate);
- h = wstate.openblock.screenrect.max.y - wstate.openblock.screenrect.min.y
- - 2 * CONFIG_PANE_VERTICAL_OFFSET;
-
- Wimp_GetWindowState(config_window, &wstate);
- /* h = wstate.openblock.screenrect.max.y - wstate.openblock.screenrect.min.y;*/
-
- /* If pane has changed reopen it */
-
- if (wstate.openblock.screenrect.min.x != x
- || wstate.openblock.screenrect.max.x != x+w
- || wstate.openblock.screenrect.max.y != y
- || wstate.openblock.screenrect.min.y != y - h
- || wstate.openblock.behind != event->data.openblock.behind)
- {
- wstate.openblock.screenrect.min.x = x;
- wstate.openblock.screenrect.max.x = x + w;
- wstate.openblock.screenrect.max.y = y;
- wstate.openblock.screenrect.min.y = y - h;
- wstate.openblock.behind = event->data.openblock.behind;
- Wimp_OpenWindow(&wstate.openblock);
- }
-
- /* Now open the config window underneath the config pane */
-
- event->data.openblock.behind = config_window;
- Wimp_OpenWindow(&(event->data.openblock));
- return(TRUE);
- }
-
-
- /*
- * Close the configuration window.
- */
-
- BOOL Config_Close(event_pollblock *event, void *reference)
- {
- Config_GetIcons();
-
- Window_Delete(config_window);
- Window_Delete(config_backing);
- config_window = NULL;
- config_backing = NULL;
- return(1);
- }
-
-
- /*
- * Build the first line of the boot obey file.
- */
-
- void Config_BuildLine0(char *string)
- {
- char *ptr;
-
- ptr = strrchr(config.root_dev, '/');
- if (ptr == NULL)
- ptr = config.root_dev;
- else
- ++ptr;
-
- /* Are we loading the kernel from the RiscBSD partition ? */
-
- if (config.flags & FLAG_NATIVE)
- sprintf(string, "Run %s.%s", NATIVE_DIRECTORY, ptr);
- else
- strcpy(string, "|Not using native kernel");
- }
-
-
- /*
- * Build the second line of the boot obey file.
- */
-
- void Config_BuildLine1(char *command)
- {
- char temp[256];
-
- /* Build the command string */
-
- sprintf(command, "Run %s ", BOOTLOADER_FILENAME);
- strcat(command, config.kernel);
- strcat(command, " ");
- if (config.root_dev[0])
- {
- sprintf(temp, "root=%s ", config.root_dev);
- strcat(command, temp);
- }
- if (config.swap_dev[0])
- {
- sprintf(temp, "swap=%s ", config.swap_dev);
- strcat(command, temp);
- }
- if (config.screenmode[0])
- {
- sprintf(temp, "screenmode=%s ", config.screenmode);
- strcat(command, temp);
- }
- if (config.ramdisc > 0)
- {
- sprintf(temp, "ramdisc=%dK ", config.ramdisc);
- strcat(command, temp);
- }
- sprintf(temp, "maxproc=%d ", config.max_proc);
- strcat(command, temp);
- if (config.flags & FLAG_SINGLE)
- strcat(command, "single ");
- if (config.flags & FLAG_KGDB)
- strcat(command, "kgdb ");
- if (config.cpu_flags & CPU_FLAG_NOCACHE)
- strcat(command, "nocache ");
- if (config.cpu_flags & CPU_FLAG_NOWRTBUF)
- strcat(command, "nowritebuf ");
- if (config.cpu_flags & CPU_FLAG_NOFPA)
- strcat(command, "nofpa ");
- if (config.cpu_flags & CPU_FLAG_FPA_CLK2)
- strcat(command, "fpaclk2 ");
-
- if (config.flags & FLAG_PMAP_DEBUG)
- {
- sprintf(temp, "pmapdebug=%d ", config.pmap_debug_level);
- strcat(command, temp);
- }
-
- if (config.flags & FLAG_TERMDEBUG)
- strcat(command, "termdebug ");
-
-
- if (config.flags & FLAG_SYMTAB)
- strcat(command, "symtab ");
-
- if (config.flags & FLAG_DDBBOOT)
- strcat(command, "kdb ");
-
- if (config.video_dram > 0)
- {
- sprintf(temp, "videodram=%dK ", config.video_dram);
- strcat(command, temp);
- }
-
- strcat(command, config.other);
- }
-
-
- /*
- * On of the main confirmation icons has been pressed
- */
-
- BOOL Config_Confirm(event_pollblock *event, void *reference)
- {
- int action = (int)reference;
- FILE *filehandle;
- char command[1024];
- message_block message;
-
- /*
- * Update the config structure to reflect the current states of the
- * icons.
- */
-
- if (event)
- Config_GetIcons();
-
- /* Was it a save config request ? */
-
- if (action == 0x02)
- {
- if (Config_Save(CONFIG_FILENAME))
- Msgs_Report(0x00000000, "err.4", CONFIG_FILENAME);
-
- /* Open the fastboot file */
-
- filehandle = fopen(FASTBOOT_FILENAME, "w");
- if (filehandle)
- {
- /* Write the first command line to the fast boot file */
- Config_BuildLine0(command);
- fputs(command, filehandle);
- fputc('\n', filehandle);
-
- /* Write the second command line to the fast boot file */
-
- Config_BuildLine1(command);
-
- fputs(command, filehandle);
- fputc('\n', filehandle);
- fclose(filehandle);
-
- /* Set the file type to obey */
-
- swi(OS_File, IN(R0|R1|R2), 18, FASTBOOT_FILENAME, FILETYPE_OBEY);
- }
- }
-
- /* Was it a boot request ? */
-
- if (action == 0x01)
- {
-
- /* Ok we should do something about unsaved data in applications... */
-
- /* Instead of just booting we send a PREQUIT message to everybody.
- * The we wait for the message to be returned as an acknowledgement
- * before booting/
- */
-
- message.header.size = sizeof(message_header);
- message.header.yourref = 0;
- message.header.action = message_PREQUIT;
- message.header.sender = event_taskhandle;
-
- Wimp_SendMessage(event_SENDWANTACK, &message,
- 0, 0);
-
- /*
- * Build the first command line. This mounts a RiscBSD partition of booting
- * with native kernel.
- */
-
- /* Config_BuildLine0(command);
- Wimp_StartTask(command);*/
-
- /*
- * Build the second command line. This actually runs the boot loader
- */
-
- /* Config_BuildLine1(command);
- Wimp_StartTask(command); */
- }
-
- /* Junk the window if necessary */
-
-
- if (action == 0x03 /*event && !event->data.mouse.button.data.adjust*/)
- {
- Config_Close(NULL, NULL);
- }
-
- return(1);
- }
-
-
- BOOL Message_Ack(event_pollblock *event, void *reference)
- {
- char command[1024];
-
- if (event->data.message.header.action == 8
- && event->data.message.header.sender == event_taskhandle)
- {
- /*
- * Build the first command line. This mounts a RiscBSD partition of booting
- * with native kernel.
- */
-
- Config_BuildLine0(command);
- Wimp_StartTask(command);
-
- /*
- * Build the second command line. This actually runs the boot loader
- */
-
- Config_BuildLine1(command);
- Wimp_StartTask(command);
- }
- return(1);
- }
-
-
- /* We need a keypress handler to pick up the restart PREQUIT key code
- * (Closedown sequence)
- */
-
- BOOL Config_Keypress(event_pollblock *event, void *reference)
- {
- message_block message;
-
- if (event->data.key.code == 0x1fc)
- {
- message.header.size = sizeof(message_header);
- message.header.yourref = 0;
- message.header.action = message_PREQUIT;
- message.header.sender = event_taskhandle;
-
- Wimp_SendMessage(event_SENDWANTACK, &message,
- 0, 0);
-
- }
- else
- Wimp_ProcessKey(event->data.key.code);
- return(1);
- }
-
-
-
- /*
- * Set the configuration pane icons to the correct states so that
- * they match the config structure.
- */
-
- void Config_SetIcons(void)
- {
- Icon_SetText(config_window, CONFIG_PANE_ICON_KERNEL, config.kernel);
- Icon_SetText(config_window, CONFIG_PANE_ICON_ROOTDEV, config.root_dev);
- Icon_SetText(config_window, CONFIG_PANE_ICON_SWAPDEV, config.swap_dev);
- Icon_SetText(config_window, CONFIG_PANE_ICON_SCREENMODE, config.screenmode);
- Icon_SetText(config_window, CONFIG_PANE_ICON_OTHER, config.other);
-
- Icon_SetInteger(config_window, CONFIG_PANE_ICON_MAXPROC, config.max_proc);
- Icon_printf(config_window, CONFIG_PANE_ICON_RAMDISC, "%dK", config.ramdisc);
-
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_SINGLE,
- (config.flags & FLAG_SINGLE));
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_NATIVE,
- (config.flags & FLAG_NATIVE));
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_KGDB,
- (config.flags & FLAG_KGDB));
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_NOCACHE,
- (config.cpu_flags & CPU_FLAG_NOCACHE));
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_NOWRTBUF,
- (config.cpu_flags & CPU_FLAG_NOWRTBUF));
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_NOFPA,
- (config.cpu_flags & CPU_FLAG_NOFPA));
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_FPA_CLK_2,
- (config.cpu_flags & CPU_FLAG_FPA_CLK2));
-
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_PMAP_DEBUG,
- (config.flags & FLAG_PMAP_DEBUG));
- Icon_SetInteger(config_window, CONFIG_PANE_ICON_PMAP_DEBUG_VAL,
- config.pmap_debug_level);
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_TERMDEBUG,
- (config.flags & FLAG_TERMDEBUG));
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_SYMBOL_TABLE,
- (config.flags & FLAG_SYMTAB));
- Icon_SetSelect(config_window, CONFIG_PANE_ICON_DDB_BOOT,
- (config.flags & FLAG_DDBBOOT));
-
- Icon_printf(config_window, CONFIG_PANE_ICON_VIDEO_DRAM, "%dK",
- config.video_dram);
- }
-
-
- /*
- * Set the config structure to the correct states so that
- * they match the configuration pane icons.
- */
-
-
- void Config_GetIcons(void)
- {
- Icon_GetText(config_window, CONFIG_PANE_ICON_KERNEL, config.kernel);
- Icon_GetText(config_window, CONFIG_PANE_ICON_ROOTDEV, config.root_dev);
- Icon_GetText(config_window, CONFIG_PANE_ICON_SWAPDEV, config.swap_dev);
- Icon_GetText(config_window, CONFIG_PANE_ICON_SCREENMODE, config.screenmode);
- Icon_GetText(config_window, CONFIG_PANE_ICON_OTHER, config.other);
-
- config.max_proc = Icon_GetInteger(config_window, CONFIG_PANE_ICON_MAXPROC);
- config.ramdisc = Icon_GetInteger(config_window, CONFIG_PANE_ICON_RAMDISC);
-
- config.flags = 0;
-
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_SINGLE))
- config.flags |= FLAG_SINGLE;
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_NATIVE))
- config.flags |= FLAG_NATIVE;
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_KGDB))
- config.flags |= FLAG_KGDB;
-
- config.cpu_flags = 0;
-
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_NOCACHE))
- config.cpu_flags |= CPU_FLAG_NOCACHE;
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_NOWRTBUF))
- config.cpu_flags |= CPU_FLAG_NOWRTBUF;
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_NOFPA))
- config.cpu_flags |= CPU_FLAG_NOFPA;
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_FPA_CLK_2))
- config.cpu_flags |= CPU_FLAG_FPA_CLK2;
-
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_PMAP_DEBUG))
- config.flags |= FLAG_PMAP_DEBUG;
- config.pmap_debug_level = Icon_GetInteger(config_window,
- CONFIG_PANE_ICON_PMAP_DEBUG_VAL);
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_TERMDEBUG))
- config.flags |= FLAG_TERMDEBUG;
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_SYMBOL_TABLE))
- config.flags |= FLAG_SYMTAB;
- if (Icon_GetSelect(config_window, CONFIG_PANE_ICON_DDB_BOOT))
- config.flags |= FLAG_DDBBOOT;
-
- config.video_dram = Icon_GetInteger(config_window,
- CONFIG_PANE_ICON_VIDEO_DRAM);
-
- }
-
-
- BOOL Config_Click(event_pollblock *event, void *reference)
- {
- if (egowindow) return(1);
-
- egowindow = Window_CreateAndShow("egotrip", 0, open_UNDERPOINTER);
- if (egowindow)
- {
- Menu_HandleDbox(egowindow);
- Window_Delete(egowindow);
- egowindow = NULL;
- }
- else
- Msgs_Report(0x00000000, "err.1", "egotrip");
- return(1);
- }
-
-
- /*
- * Root device menu selection
- */
-
- BOOL Config_RootDevPopup(event_pollblock *event, void *reference)
- {
- int item = event->data.words[0];
- menu_item *entry_ptr;
-
- entry_ptr = (menu_item *) (rootdevpopup_menu + 1);
-
- Icon_SetText(config_window, CONFIG_PANE_ICON_ROOTDEV,
- entry_ptr[item].icondata.text);
-
- /* Ok don't have a nice way to do this yet... */
-
- /* Update the ramdisc as required */
-
- if (item != 4 && item != 5 && item != 8 && item != 9 && item != 10)
- Icon_SetText(config_window, CONFIG_PANE_ICON_RAMDISC, "0K");
- else
- Icon_SetText(config_window, CONFIG_PANE_ICON_RAMDISC, "1440K");
-
- /* Update the swap dev as required */
-
- if (item == 0 || item == 1)
- Icon_printf(config_window, CONFIG_PANE_ICON_SWAPDEV, "/dev/wd%db", item);
- if (item == 6 || item == 7)
- Icon_printf(config_window, CONFIG_PANE_ICON_SWAPDEV, "/dev/sd%db", item & 1);
-
- return(1);
- }
-
-
- /*
- * Swap device menu selection
- */
-
- BOOL Config_SwapDevPopup(event_pollblock *event, void *reference)
- {
- int item = event->data.words[0];
- menu_item *entry_ptr;
-
- entry_ptr = (menu_item *) (swapdevpopup_menu + 1);
-
- Icon_SetText(config_window, CONFIG_PANE_ICON_SWAPDEV,
- entry_ptr[item].icondata.text);
-
- return(1);
- }
-
-
- /*
- * Ramdisc menu selection
- */
-
- BOOL Config_RamdiscPopup(event_pollblock *event, void *reference)
- {
- int item = event->data.words[0];
- menu_item *entry_ptr;
-
- entry_ptr = (menu_item *) (ramdiscpopup_menu + 1);
-
- Icon_SetText(config_window, CONFIG_PANE_ICON_RAMDISC,
- entry_ptr[item].icondata.text);
-
- return(1);
- }
-
-
- /* End of config.c */
-