mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:03:00 +00:00
Changes in v1.8 (1/18/2003) (brianp)
- Added F8 options menu - Added custom Boot functionality - Moved all OS= settings from [FreeLoader] section to [Operating Systems] section. - Removed MessageLine= setting. MessageBox= now accepts "\n" as an escape character for newlines. - Added descriptions for disk error codes returned by the BIOS. - Device names like "fd0" and "hd0" and "hd1" as well as BIOS drive numbers can now be used as BootDrive= settings. svn path=/trunk/; revision=4038
This commit is contained in:
parent
a26dfde014
commit
59f1842f56
79 changed files with 971 additions and 645 deletions
|
@ -44,3 +44,19 @@ EXTERN(_ChainLoadBiosBootSectorCode)
|
||||||
movw $0x7C00,%sp
|
movw $0x7C00,%sp
|
||||||
|
|
||||||
ljmpl $0x0000,$0x7C00
|
ljmpl $0x0000,$0x7C00
|
||||||
|
|
||||||
|
EXTERN(_SoftReboot)
|
||||||
|
.code32
|
||||||
|
|
||||||
|
call switch_to_real
|
||||||
|
.code16
|
||||||
|
|
||||||
|
movw $0x40,%ax
|
||||||
|
movw %ax,%ds
|
||||||
|
movw $0x72,%si
|
||||||
|
|
||||||
|
// Set the word at location 40:72 to 1234h
|
||||||
|
movw $0x1234,(%si)
|
||||||
|
|
||||||
|
// and jump to location FFFF:0 in ROM
|
||||||
|
ljmpl $0xFFFF,$0x0000
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
#include <rtl.h>
|
#include <rtl.h>
|
||||||
#include <arch.h>
|
#include <arch.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <comm.h>
|
#include <portio.h>
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
#include <mm.h>
|
#include <mm.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <rtl.h>
|
#include <rtl.h>
|
||||||
#include <comm.h>
|
#include <portio.h>
|
||||||
|
|
||||||
|
|
||||||
U32 GetExtendedMemorySize(VOID)
|
U32 GetExtendedMemorySize(VOID)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -19,7 +19,8 @@
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <arch.h>
|
#include <arch.h>
|
||||||
|
#include <rtl.h>
|
||||||
|
#include <portio.h>
|
||||||
|
|
||||||
void putchar(int ch)
|
void putchar(int ch)
|
||||||
{
|
{
|
||||||
|
@ -326,3 +327,70 @@ int getsecond(void)
|
||||||
|
|
||||||
return (Digit1 + Digit2);
|
return (Digit1 + Digit2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void beep(void)
|
||||||
|
{
|
||||||
|
sound(700);
|
||||||
|
delay(200);
|
||||||
|
sound(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void delay(unsigned msec)
|
||||||
|
{
|
||||||
|
REGS Regs;
|
||||||
|
unsigned usec;
|
||||||
|
unsigned msec_this;
|
||||||
|
|
||||||
|
// Int 15h AH=86h
|
||||||
|
// BIOS - WAIT (AT,PS)
|
||||||
|
//
|
||||||
|
// AH = 86h
|
||||||
|
// CX:DX = interval in microseconds
|
||||||
|
// Return:
|
||||||
|
// CF clear if successful (wait interval elapsed)
|
||||||
|
// CF set on error or AH=83h wait already in progress
|
||||||
|
// AH = status (see #00496)
|
||||||
|
|
||||||
|
// Note: The resolution of the wait period is 977 microseconds on
|
||||||
|
// many systems because many BIOSes use the 1/1024 second fast
|
||||||
|
// interrupt from the AT real-time clock chip which is available on INT 70;
|
||||||
|
// because newer BIOSes may have much more precise timers available, it is
|
||||||
|
// not possible to use this function accurately for very short delays unless
|
||||||
|
// the precise behavior of the BIOS is known (or found through testing)
|
||||||
|
|
||||||
|
while (msec)
|
||||||
|
{
|
||||||
|
msec_this = msec;
|
||||||
|
|
||||||
|
if (msec_this > 4000)
|
||||||
|
{
|
||||||
|
msec_this = 4000;
|
||||||
|
}
|
||||||
|
|
||||||
|
usec = msec_this * 1000;
|
||||||
|
|
||||||
|
Regs.b.ah = 0x86;
|
||||||
|
Regs.w.cx = usec >> 16;
|
||||||
|
Regs.w.dx = usec & 0xffff;
|
||||||
|
Int386(0x15, &Regs, &Regs);
|
||||||
|
|
||||||
|
msec -= msec_this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sound(int freq)
|
||||||
|
{
|
||||||
|
int scale;
|
||||||
|
|
||||||
|
if (freq == 0)
|
||||||
|
{
|
||||||
|
WRITE_PORT_UCHAR((PUCHAR)0x61, READ_PORT_UCHAR((PUCHAR)0x61) & ~3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scale = 1193046 / freq;
|
||||||
|
WRITE_PORT_UCHAR((PUCHAR)0x43, 0xb6);
|
||||||
|
WRITE_PORT_UCHAR((PUCHAR)0x42, scale & 0xff);
|
||||||
|
WRITE_PORT_UCHAR((PUCHAR)0x42, scale >> 8);
|
||||||
|
WRITE_PORT_UCHAR((PUCHAR)0x61, READ_PORT_UCHAR((PUCHAR)0x61) | 3);
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
* Portions from Linux video.S - Display adapter & video mode setup, version 2.13 (14-May-99)
|
* Portions from Linux video.S - Display adapter & video mode setup, version 2.13 (14-May-99)
|
||||||
* Copyright (C) 1995 -- 1999 Martin Mares <mj@ucw.cz>
|
* Copyright (C) 1995 -- 1999 Martin Mares <mj@ucw.cz>
|
||||||
* Based on the original setup.S code (C) Linus Torvalds and Mats Anderson
|
* Based on the original setup.S code (C) Linus Torvalds and Mats Anderson
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <arch.h>
|
#include <arch.h>
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
#include <comm.h>
|
#include <portio.h>
|
||||||
#include <rtl.h>
|
#include <rtl.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ VOID VideoSetTextCursorPosition(U32 X, U32 Y)
|
||||||
// DL = column (00h is left)
|
// DL = column (00h is left)
|
||||||
// Return:
|
// Return:
|
||||||
// Nothing
|
// Nothing
|
||||||
Regs.b.ah = 0x01;
|
Regs.b.ah = 0x02;
|
||||||
Regs.b.bh = 0x00;
|
Regs.b.bh = 0x00;
|
||||||
Regs.b.dh = Y;
|
Regs.b.dh = Y;
|
||||||
Regs.b.dl = X;
|
Regs.b.dl = X;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: portio.c,v 1.3 2002/08/07 05:13:15 bpalmer Exp $
|
/* $Id: portio.c,v 1.1 2003/01/19 01:03:58 bpalmer Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
2
freeldr/freeldr/cache/blocklist.c
vendored
2
freeldr/freeldr/cache/blocklist.c
vendored
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
2
freeldr/freeldr/cache/cache.c
vendored
2
freeldr/freeldr/cache/cache.c
vendored
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
2
freeldr/freeldr/cache/cm.h
vendored
2
freeldr/freeldr/cache/cm.h
vendored
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <comm.h>
|
#include <comm.h>
|
||||||
|
#include <portio.h>
|
||||||
|
|
||||||
|
|
||||||
/* MACROS *******************************************************************/
|
/* MACROS *******************************************************************/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -34,15 +34,50 @@
|
||||||
|
|
||||||
VOID DiskError(PUCHAR ErrorString, U32 ErrorCode)
|
VOID DiskError(PUCHAR ErrorString, U32 ErrorCode)
|
||||||
{
|
{
|
||||||
UCHAR ErrorCodeString[80];
|
UCHAR ErrorCodeString[200];
|
||||||
|
|
||||||
sprintf(ErrorCodeString, "%s\n\nError Code: 0x%x", ErrorString, ErrorCode);
|
sprintf(ErrorCodeString, "%s\n\nError Code: 0x%x\nError: %s", ErrorString, ErrorCode, DiskGetErrorCodeString(ErrorCode));
|
||||||
|
|
||||||
DbgPrint((DPRINT_DISK, "%s\n", ErrorCodeString));
|
DbgPrint((DPRINT_DISK, "%s\n", ErrorCodeString));
|
||||||
|
|
||||||
UiMessageBox(ErrorCodeString);
|
UiMessageBox(ErrorCodeString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PUCHAR DiskGetErrorCodeString(U32 ErrorCode)
|
||||||
|
{
|
||||||
|
switch (ErrorCode)
|
||||||
|
{
|
||||||
|
case 0x00: return "no error";
|
||||||
|
case 0x01: return "bad command passed to driver";
|
||||||
|
case 0x02: return "address mark not found or bad sector";
|
||||||
|
case 0x03: return "diskette write protect error";
|
||||||
|
case 0x04: return "sector not found";
|
||||||
|
case 0x05: return "fixed disk reset failed";
|
||||||
|
case 0x06: return "diskette changed or removed";
|
||||||
|
case 0x07: return "bad fixed disk parameter table";
|
||||||
|
case 0x08: return "DMA overrun";
|
||||||
|
case 0x09: return "DMA access across 64k boundary";
|
||||||
|
case 0x0A: return "bad fixed disk sector flag";
|
||||||
|
case 0x0B: return "bad fixed disk cylinder";
|
||||||
|
case 0x0C: return "unsupported track/invalid media";
|
||||||
|
case 0x0D: return "invalid number of sectors on fixed disk format";
|
||||||
|
case 0x0E: return "fixed disk controlled data address mark detected";
|
||||||
|
case 0x0F: return "fixed disk DMA arbitration level out of range";
|
||||||
|
case 0x10: return "ECC/CRC error on disk read";
|
||||||
|
case 0x11: return "recoverable fixed disk data error, data fixed by ECC";
|
||||||
|
case 0x20: return "controller error (NEC for floppies)";
|
||||||
|
case 0x40: return "seek failure";
|
||||||
|
case 0x80: return "time out, drive not ready";
|
||||||
|
case 0xAA: return "fixed disk drive not ready";
|
||||||
|
case 0xBB: return "fixed disk undefined error";
|
||||||
|
case 0xCC: return "fixed disk write fault on selected drive";
|
||||||
|
case 0xE0: return "fixed disk status error/Error reg = 0";
|
||||||
|
case 0xFF: return "sense operation failed";
|
||||||
|
|
||||||
|
default: return "unknown error code";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This function is in arch/i386/i386disk.c
|
// This function is in arch/i386/i386disk.c
|
||||||
//BOOL DiskReadLogicalSectors(U32 DriveNumber, U64 SectorNumber, U32 SectorCount, PVOID Buffer)
|
//BOOL DiskReadLogicalSectors(U32 DriveNumber, U64 SectorNumber, U32 SectorCount, PVOID Buffer)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,8 +16,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//20030118 RJJ added comment to test CVS
|
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <rtl.h>
|
#include <rtl.h>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -160,6 +160,9 @@ int Int386(int ivec, REGS* in, REGS* out);
|
||||||
|
|
||||||
void EnableA20(void);
|
void EnableA20(void);
|
||||||
|
|
||||||
|
VOID ChainLoadBiosBootSectorCode(VOID); // Implemented in boot.S
|
||||||
|
VOID SoftReboot(VOID); // Implemented in boot.S
|
||||||
|
|
||||||
#endif /* ! ASM */
|
#endif /* ! ASM */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
U32 GetDefaultOperatingSystem(PUCHAR OperatingSystemList[], U32 OperatingSystemCount);
|
U32 GetDefaultOperatingSystem(PUCHAR OperatingSystemList[], U32 OperatingSystemCount);
|
||||||
S32 GetTimeOut(VOID);
|
S32 GetTimeOut(VOID);
|
||||||
|
BOOL MainBootMenuKeyPressFilter(U32 KeyPress);
|
||||||
|
|
||||||
|
|
||||||
#endif // #defined __BOOTMGR_H
|
#endif // #defined __BOOTMGR_H
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -29,57 +29,4 @@ VOID Rs232PortPutByte(UCHAR ByteToSend);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Port I/O functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
/*STDCALL*/
|
|
||||||
READ_PORT_BUFFER_UCHAR (PUCHAR Port, PUCHAR Value, U32 Count);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
/*STDCALL*/
|
|
||||||
READ_PORT_BUFFER_ULONG (U32* Port, U32* Value, U32 Count);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
/*STDCALL*/
|
|
||||||
READ_PORT_BUFFER_USHORT (U16* Port, U16* Value, U32 Count);
|
|
||||||
|
|
||||||
UCHAR
|
|
||||||
/*STDCALL*/
|
|
||||||
READ_PORT_UCHAR (PUCHAR Port);
|
|
||||||
|
|
||||||
U32
|
|
||||||
/*STDCALL*/
|
|
||||||
READ_PORT_ULONG (U32* Port);
|
|
||||||
|
|
||||||
U16
|
|
||||||
/*STDCALL*/
|
|
||||||
READ_PORT_USHORT (U16* Port);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
/*STDCALL*/
|
|
||||||
WRITE_PORT_BUFFER_UCHAR (PUCHAR Port, PUCHAR Value, U32 Count);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
/*STDCALL*/
|
|
||||||
WRITE_PORT_BUFFER_ULONG (U32* Port, U32* Value, U32 Count);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
/*STDCALL*/
|
|
||||||
WRITE_PORT_BUFFER_USHORT (U16* Port, U16* Value, U32 Count);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
/*STDCALL*/
|
|
||||||
WRITE_PORT_UCHAR (PUCHAR Port, UCHAR Value);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
/*STDCALL*/
|
|
||||||
WRITE_PORT_ULONG (U32* Port, U32 Value);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
/*STDCALL*/
|
|
||||||
WRITE_PORT_USHORT (U16* Port, U16 Value);
|
|
||||||
|
|
||||||
|
|
||||||
#endif // defined __RS232_H
|
#endif // defined __RS232_H
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -105,6 +105,7 @@ BOOL DiskGetDriveParameters(U32 DriveNumber, PGEOMETRY Geometry);
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
VOID DiskError(PUCHAR ErrorString, U32 ErrorCode);
|
VOID DiskError(PUCHAR ErrorString, U32 ErrorCode);
|
||||||
|
PUCHAR DiskGetErrorCodeString(U32 ErrorCode);
|
||||||
BOOL DiskGetDriveGeometry(U32 DriveNumber, PGEOMETRY DriveGeometry);
|
BOOL DiskGetDriveGeometry(U32 DriveNumber, PGEOMETRY DriveGeometry);
|
||||||
BOOL DiskReadLogicalSectors(U32 DriveNumber, U64 SectorNumber, U32 SectorCount, PVOID Buffer); // Implemented in i386disk.c
|
BOOL DiskReadLogicalSectors(U32 DriveNumber, U64 SectorNumber, U32 SectorCount, PVOID Buffer); // Implemented in i386disk.c
|
||||||
BOOL DiskIsDriveRemovable(U32 DriveNumber);
|
BOOL DiskIsDriveRemovable(U32 DriveNumber);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,8 +24,12 @@ BOOL IniFileInitialize(VOID);
|
||||||
|
|
||||||
BOOL IniOpenSection(PUCHAR SectionName, U32* SectionId);
|
BOOL IniOpenSection(PUCHAR SectionName, U32* SectionId);
|
||||||
U32 IniGetNumSectionItems(U32 SectionId);
|
U32 IniGetNumSectionItems(U32 SectionId);
|
||||||
|
U32 IniGetSectionSettingNameSize(U32 SectionId, U32 SettingIndex);
|
||||||
|
U32 IniGetSectionSettingValueSize(U32 SectionId, U32 SettingIndex);
|
||||||
BOOL IniReadSettingByNumber(U32 SectionId, U32 SettingNumber, PUCHAR SettingName, U32 NameSize, PUCHAR SettingValue, U32 ValueSize);
|
BOOL IniReadSettingByNumber(U32 SectionId, U32 SettingNumber, PUCHAR SettingName, U32 NameSize, PUCHAR SettingValue, U32 ValueSize);
|
||||||
BOOL IniReadSettingByName(U32 SectionId, PUCHAR SettingName, PUCHAR Buffer, U32 BufferSize);
|
BOOL IniReadSettingByName(U32 SectionId, PUCHAR SettingName, PUCHAR Buffer, U32 BufferSize);
|
||||||
|
BOOL IniAddSection(PUCHAR SectionName, U32* SectionId);
|
||||||
|
BOOL IniAddSettingValueToSection(U32 SectionId, PUCHAR SettingName, PUCHAR SettingValue);
|
||||||
|
|
||||||
|
|
||||||
#endif // defined __PARSEINI_H
|
#endif // defined __PARSEINI_H
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,6 +24,7 @@
|
||||||
// Key codes
|
// Key codes
|
||||||
#define KEY_EXTENDED 0x00
|
#define KEY_EXTENDED 0x00
|
||||||
#define KEY_ENTER 0x0D
|
#define KEY_ENTER 0x0D
|
||||||
|
#define KEY_BACKSPACE 0x08
|
||||||
#define KEY_SPACE 0x20
|
#define KEY_SPACE 0x20
|
||||||
#define KEY_UP 0x48
|
#define KEY_UP 0x48
|
||||||
#define KEY_DOWN 0x50
|
#define KEY_DOWN 0x50
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,6 +17,8 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <fs.h>
|
||||||
|
|
||||||
#ifndef __LINUX_H
|
#ifndef __LINUX_H
|
||||||
#define __LINUX_H
|
#define __LINUX_H
|
||||||
|
|
||||||
|
@ -120,7 +122,7 @@ typedef struct
|
||||||
VOID BootNewLinuxKernel(VOID); // Implemented in linux.S
|
VOID BootNewLinuxKernel(VOID); // Implemented in linux.S
|
||||||
VOID BootOldLinuxKernel(U32 KernelSize); // Implemented in linux.S
|
VOID BootOldLinuxKernel(U32 KernelSize); // Implemented in linux.S
|
||||||
|
|
||||||
VOID LoadAndBootLinux(PUCHAR OperatingSystemName);
|
VOID LoadAndBootLinux(PUCHAR OperatingSystemName, PUCHAR Description);
|
||||||
|
|
||||||
BOOL LinuxParseIniSection(PUCHAR OperatingSystemName);
|
BOOL LinuxParseIniSection(PUCHAR OperatingSystemName);
|
||||||
BOOL LinuxReadBootSector(PFILE LinuxKernelFile);
|
BOOL LinuxReadBootSector(PFILE LinuxKernelFile);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,8 +20,6 @@
|
||||||
#ifndef __BOOT_H
|
#ifndef __BOOT_H
|
||||||
#define __BOOT_H
|
#define __BOOT_H
|
||||||
|
|
||||||
VOID ChainLoadBiosBootSectorCode(VOID); // Implemented in boot.S
|
|
||||||
|
|
||||||
VOID LoadAndBootBootSector(PUCHAR OperatingSystemName);
|
VOID LoadAndBootBootSector(PUCHAR OperatingSystemName);
|
||||||
VOID LoadAndBootPartition(PUCHAR OperatingSystemName);
|
VOID LoadAndBootPartition(PUCHAR OperatingSystemName);
|
||||||
VOID LoadAndBootDrive(PUCHAR OperatingSystemName);
|
VOID LoadAndBootDrive(PUCHAR OperatingSystemName);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,12 +20,15 @@
|
||||||
#ifndef __OPTIONS_H
|
#ifndef __OPTIONS_H
|
||||||
#define __OPTIONS_H
|
#define __OPTIONS_H
|
||||||
|
|
||||||
void DoOptionsMenu(void);
|
VOID DoOptionsMenu(VOID);
|
||||||
void DoDiskOptionsMenu(void);
|
|
||||||
void DoBootOptionsMenu(int BootDriveNum, char *BootDriveText);
|
VOID OptionMenuReboot(VOID);
|
||||||
void DoBootPartitionOptionsMenu(int BootDriveNum);
|
|
||||||
int RunOptionsMenu(char OptionsMenuItems[][80], int OptionsMenuItemCount, int nOptionSelected, char *OptionsMenuTitle);
|
VOID OptionMenuCustomBoot(VOID);
|
||||||
void InitOptionsMenu(int *nOptionsMenuBoxLeft, int *nOptionsMenuBoxTop, int *nOptionsMenuBoxRight, int *nOptionsMenuBoxBottom, int OptionsMenuItemCount);
|
VOID OptionMenuCustomBootDisk(VOID);
|
||||||
void DrawOptionsMenu(char OptionsMenuItems[][80], int OptionsMenuItemCount, int nOptionSelected, char *OptionsMenuTitle, int nOptionsMenuBoxLeft, int nOptionsMenuBoxTop, int nOptionsMenuBoxRight, int nOptionsMenuBoxBottom);
|
VOID OptionMenuCustomBootPartition(VOID);
|
||||||
|
VOID OptionMenuCustomBootBootSectorFile(VOID);
|
||||||
|
VOID OptionMenuCustomBootReactOS(VOID);
|
||||||
|
VOID OptionMenuCustomBootLinux(VOID);
|
||||||
|
|
||||||
#endif // #defined __OPTIONS_H
|
#endif // #defined __OPTIONS_H
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
78
freeldr/freeldr/include/portio.h
Normal file
78
freeldr/freeldr/include/portio.h
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
/*
|
||||||
|
* FreeLoader
|
||||||
|
* Copyright (C) 2001 Brian Palmer <brianp@sginet.com>
|
||||||
|
* Copyright (C) 2001 Eric Kohl
|
||||||
|
* Copyright (C) 2001 Emanuele Aliberti
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __PORTIO_H
|
||||||
|
#define __PORTIO_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Port I/O functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
/*STDCALL*/
|
||||||
|
READ_PORT_BUFFER_UCHAR (PUCHAR Port, PUCHAR Value, U32 Count);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
/*STDCALL*/
|
||||||
|
READ_PORT_BUFFER_ULONG (U32* Port, U32* Value, U32 Count);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
/*STDCALL*/
|
||||||
|
READ_PORT_BUFFER_USHORT (U16* Port, U16* Value, U32 Count);
|
||||||
|
|
||||||
|
UCHAR
|
||||||
|
/*STDCALL*/
|
||||||
|
READ_PORT_UCHAR (PUCHAR Port);
|
||||||
|
|
||||||
|
U32
|
||||||
|
/*STDCALL*/
|
||||||
|
READ_PORT_ULONG (U32* Port);
|
||||||
|
|
||||||
|
U16
|
||||||
|
/*STDCALL*/
|
||||||
|
READ_PORT_USHORT (U16* Port);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
/*STDCALL*/
|
||||||
|
WRITE_PORT_BUFFER_UCHAR (PUCHAR Port, PUCHAR Value, U32 Count);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
/*STDCALL*/
|
||||||
|
WRITE_PORT_BUFFER_ULONG (U32* Port, U32* Value, U32 Count);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
/*STDCALL*/
|
||||||
|
WRITE_PORT_BUFFER_USHORT (U16* Port, U16* Value, U32 Count);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
/*STDCALL*/
|
||||||
|
WRITE_PORT_UCHAR (PUCHAR Port, UCHAR Value);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
/*STDCALL*/
|
||||||
|
WRITE_PORT_ULONG (U32* Port, U32 Value);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
/*STDCALL*/
|
||||||
|
WRITE_PORT_USHORT (U16* Port, U16 Value);
|
||||||
|
|
||||||
|
|
||||||
|
#endif // defined __PORTIO_H
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -41,8 +41,8 @@ VOID ReactOSRunSetupLoader(VOID);
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
BOOL DissectArcPath(char *ArcPath, char *BootPath, U32* BootDrive, U32* BootPartition);
|
BOOL DissectArcPath(char *ArcPath, char *BootPath, U32* BootDrive, U32* BootPartition);
|
||||||
//BOOL ConvertBiosDriveToArcName(PUCHAR ArcName, U32 BiosDriveNumber);
|
void ConstructArcPath(PUCHAR ArcPath, PUCHAR SystemFolder, U32 Disk, U32 Partition);
|
||||||
//U32 ConvertArcNameToBiosDrive(PUCHAR ArcName);
|
U32 ConvertArcNameToBiosDriveNumber(PUCHAR ArcPath);
|
||||||
|
|
||||||
|
|
||||||
#endif // defined __REACTOS_H
|
#endif // defined __REACTOS_H
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -79,6 +79,10 @@ int gethour(void); // Implemented in asmcode.S
|
||||||
int getminute(void); // Implemented in asmcode.S
|
int getminute(void); // Implemented in asmcode.S
|
||||||
int getsecond(void); // Implemented in asmcode.S
|
int getsecond(void); // Implemented in asmcode.S
|
||||||
|
|
||||||
|
void beep(void);
|
||||||
|
void delay(unsigned msec);
|
||||||
|
void sound(int freq);
|
||||||
|
|
||||||
#ifndef max
|
#ifndef max
|
||||||
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -38,9 +38,10 @@ extern UCHAR UiMenuBgColor; // Menu background color
|
||||||
extern UCHAR UiTextColor; // Normal text color
|
extern UCHAR UiTextColor; // Normal text color
|
||||||
extern UCHAR UiSelectedTextColor; // Selected text color
|
extern UCHAR UiSelectedTextColor; // Selected text color
|
||||||
extern UCHAR UiSelectedTextBgColor; // Selected text background color
|
extern UCHAR UiSelectedTextBgColor; // Selected text background color
|
||||||
extern UCHAR UiTitleBoxTitleText[260]; // Title box's title text
|
extern UCHAR UiEditBoxTextColor; // Edit box text color
|
||||||
|
extern UCHAR UiEditBoxBgColor; // Edit box text background color
|
||||||
|
|
||||||
extern PUCHAR UiMessageBoxLineText;
|
extern UCHAR UiTitleBoxTitleText[260]; // Title box's title text
|
||||||
|
|
||||||
extern BOOL UserInterfaceUp; // Tells us if the user interface is displayed
|
extern BOOL UserInterfaceUp; // Tells us if the user interface is displayed
|
||||||
|
|
||||||
|
@ -66,10 +67,11 @@ VOID UiUpdateDateTime(VOID); // Updates the date and time
|
||||||
VOID UiInfoBox(PUCHAR MessageText); // Displays a info box on the screen
|
VOID UiInfoBox(PUCHAR MessageText); // Displays a info box on the screen
|
||||||
VOID UiMessageBox(PUCHAR MessageText); // Displays a message box on the screen with an ok button
|
VOID UiMessageBox(PUCHAR MessageText); // Displays a message box on the screen with an ok button
|
||||||
VOID UiMessageBoxCritical(PUCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources
|
VOID UiMessageBoxCritical(PUCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources
|
||||||
VOID UiMessageLine(PUCHAR MessageText); // Adds a line of text to the message box buffer
|
|
||||||
VOID UiDrawProgressBarCenter(U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
|
VOID UiDrawProgressBarCenter(U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
|
||||||
VOID UiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
|
VOID UiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
|
||||||
VOID UiShowMessageBoxesInSection(PUCHAR SectionName); // Displays all the message boxes in a given section
|
VOID UiShowMessageBoxesInSection(PUCHAR SectionName); // Displays all the message boxes in a given section
|
||||||
|
VOID UiEscapeString(PUCHAR String); // Processes a string and changes all occurances of "\n" to '\n'
|
||||||
|
BOOL UiEditBox(PUCHAR MessageText, PUCHAR EditTextBuffer, U32 Length);
|
||||||
|
|
||||||
UCHAR UiTextToColor(PUCHAR ColorText); // Converts the text color into it's equivalent color value
|
UCHAR UiTextToColor(PUCHAR ColorText); // Converts the text color into it's equivalent color value
|
||||||
UCHAR UiTextToFillStyle(PUCHAR FillStyleText); // Converts the text fill into it's equivalent fill value
|
UCHAR UiTextToFillStyle(PUCHAR FillStyleText); // Converts the text fill into it's equivalent fill value
|
||||||
|
@ -84,7 +86,9 @@ VOID UiFadeOut(VOID); // Fades the screen out
|
||||||
// Menu Functions
|
// Menu Functions
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
BOOL UiDisplayMenu(PUCHAR MenuItemList[], U32 MenuItemCount, U32 DefaultMenuItem, S32 MenuTimeOut, U32* SelectedMenuItem);
|
typedef BOOL (*UiMenuKeyPressFilterCallback)(U32 KeyPress);
|
||||||
|
|
||||||
|
BOOL UiDisplayMenu(PUCHAR MenuItemList[], U32 MenuItemCount, U32 DefaultMenuItem, S32 MenuTimeOut, U32* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
|
|
||||||
/* just some stuff */
|
/* just some stuff */
|
||||||
#define VERSION "FreeLoader v1.7.12"
|
#define VERSION "FreeLoader v1.8"
|
||||||
#define COPYRIGHT "Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>"
|
#define COPYRIGHT "Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>"
|
||||||
#define AUTHOR_EMAIL "<brianp@sginet.com>"
|
#define AUTHOR_EMAIL "<brianp@sginet.com>"
|
||||||
#define BY_AUTHOR "by Brian Palmer"
|
#define BY_AUTHOR "by Brian Palmer"
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@
|
||||||
// If you add major functionality then you increment the major version and zero the minor & patch versions
|
// If you add major functionality then you increment the major version and zero the minor & patch versions
|
||||||
//
|
//
|
||||||
#define FREELOADER_MAJOR_VERSION 1
|
#define FREELOADER_MAJOR_VERSION 1
|
||||||
#define FREELOADER_MINOR_VERSION 7
|
#define FREELOADER_MINOR_VERSION 8
|
||||||
#define FREELOADER_PATCH_VERSION 12
|
#define FREELOADER_PATCH_VERSION 0
|
||||||
|
|
||||||
|
|
||||||
PUCHAR GetFreeLoaderVersionString(VOID);
|
PUCHAR GetFreeLoaderVersionString(VOID);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -54,7 +54,8 @@ typedef struct
|
||||||
} INI_SECTION, *PINI_SECTION;
|
} INI_SECTION, *PINI_SECTION;
|
||||||
|
|
||||||
extern PINI_SECTION IniFileSectionListHead;
|
extern PINI_SECTION IniFileSectionListHead;
|
||||||
extern U32 IniFileSectionListCount;
|
extern U32 IniFileSectionCount;
|
||||||
|
extern U32 IniFileSettingCount;
|
||||||
|
|
||||||
PFILE IniOpenIniFile(U8 BootDriveNumber, U8 BootPartitionNumber);
|
PFILE IniOpenIniFile(U8 BootDriveNumber, U8 BootPartitionNumber);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
#include <ui.h>
|
#include <ui.h>
|
||||||
#include <rtl.h>
|
#include <rtl.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <mm.h>
|
||||||
|
|
||||||
BOOL IniOpenSection(PUCHAR SectionName, U32* SectionId)
|
BOOL IniOpenSection(PUCHAR SectionName, U32* SectionId)
|
||||||
{
|
{
|
||||||
|
@ -61,6 +62,22 @@ U32 IniGetNumSectionItems(U32 SectionId)
|
||||||
return Section->SectionItemCount;
|
return Section->SectionItemCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
U32 IniGetSectionSettingNameSize(U32 SectionId, U32 SettingIndex)
|
||||||
|
{
|
||||||
|
PINI_SECTION Section = (PINI_SECTION)SectionId;
|
||||||
|
|
||||||
|
// Return the size of the string plus 1 for the null-terminator
|
||||||
|
return (strlen(Section->SectionItemList[SettingIndex].ItemName) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
U32 IniGetSectionSettingValueSize(U32 SectionId, U32 SettingIndex)
|
||||||
|
{
|
||||||
|
PINI_SECTION Section = (PINI_SECTION)SectionId;
|
||||||
|
|
||||||
|
// Return the size of the string plus 1 for the null-terminator
|
||||||
|
return (strlen(Section->SectionItemList[SettingIndex].ItemValue) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
BOOL IniReadSettingByNumber(U32 SectionId, U32 SettingNumber, PUCHAR SettingName, U32 NameSize, PUCHAR SettingValue, U32 ValueSize)
|
BOOL IniReadSettingByNumber(U32 SectionId, U32 SettingNumber, PUCHAR SettingName, U32 NameSize, PUCHAR SettingValue, U32 ValueSize)
|
||||||
{
|
{
|
||||||
PINI_SECTION Section = (PINI_SECTION)SectionId;
|
PINI_SECTION Section = (PINI_SECTION)SectionId;
|
||||||
|
@ -68,13 +85,16 @@ BOOL IniReadSettingByNumber(U32 SectionId, U32 SettingNumber, PUCHAR SettingName
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
U32 RealSettingNumber = SettingNumber;
|
U32 RealSettingNumber = SettingNumber;
|
||||||
#endif
|
#endif
|
||||||
|
DbgPrint((DPRINT_INIFILE, ".001 NameSize = %d ValueSize = %d\n", NameSize, ValueSize));
|
||||||
|
|
||||||
DbgPrint((DPRINT_INIFILE, "IniReadSettingByNumber() SectionId = 0x%x\n", SectionId));
|
DbgPrint((DPRINT_INIFILE, "IniReadSettingByNumber() SectionId = 0x%x\n", SectionId));
|
||||||
|
|
||||||
// Loop through each section item and find the one they want
|
// Loop through each section item and find the one they want
|
||||||
|
DbgPrint((DPRINT_INIFILE, ".01 NameSize = %d ValueSize = %d\n", NameSize, ValueSize));
|
||||||
SectionItem = (PINI_SECTION_ITEM)RtlListGetHead((PLIST_ITEM)Section->SectionItemList);
|
SectionItem = (PINI_SECTION_ITEM)RtlListGetHead((PLIST_ITEM)Section->SectionItemList);
|
||||||
while (SectionItem != NULL)
|
while (SectionItem != NULL)
|
||||||
{
|
{
|
||||||
|
DbgPrint((DPRINT_INIFILE, ".1 NameSize = %d ValueSize = %d\n", NameSize, ValueSize));
|
||||||
// Check to see if this is the setting they want
|
// Check to see if this is the setting they want
|
||||||
if (SettingNumber == 0)
|
if (SettingNumber == 0)
|
||||||
{
|
{
|
||||||
|
@ -82,8 +102,16 @@ BOOL IniReadSettingByNumber(U32 SectionId, U32 SettingNumber, PUCHAR SettingName
|
||||||
DbgPrint((DPRINT_INIFILE, "IniReadSettingByNumber() Setting name = %s\n", SectionItem->ItemName));
|
DbgPrint((DPRINT_INIFILE, "IniReadSettingByNumber() Setting name = %s\n", SectionItem->ItemName));
|
||||||
DbgPrint((DPRINT_INIFILE, "IniReadSettingByNumber() Setting value = %s\n", SectionItem->ItemValue));
|
DbgPrint((DPRINT_INIFILE, "IniReadSettingByNumber() Setting value = %s\n", SectionItem->ItemValue));
|
||||||
|
|
||||||
|
DbgPrint((DPRINT_INIFILE, "1 NameSize = %d ValueSize = %d\n", NameSize, ValueSize));
|
||||||
|
RtlZeroMemory(SettingName, NameSize);
|
||||||
|
RtlZeroMemory(SettingValue, ValueSize);
|
||||||
|
DbgPrint((DPRINT_INIFILE, "2 NameSize = %d ValueSize = %d\n", NameSize, ValueSize));
|
||||||
strncpy(SettingName, SectionItem->ItemName, NameSize);
|
strncpy(SettingName, SectionItem->ItemName, NameSize);
|
||||||
|
DbgPrint((DPRINT_INIFILE, "3 NameSize = %d ValueSize = %d\n", NameSize, ValueSize));
|
||||||
strncpy(SettingValue, SectionItem->ItemValue, ValueSize);
|
strncpy(SettingValue, SectionItem->ItemValue, ValueSize);
|
||||||
|
DbgPrint((DPRINT_INIFILE, "4 NameSize = %d ValueSize = %d\n", NameSize, ValueSize));
|
||||||
|
DbgDumpBuffer(DPRINT_INIFILE, SettingName, NameSize);
|
||||||
|
DbgDumpBuffer(DPRINT_INIFILE, SettingValue, ValueSize);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -117,6 +145,7 @@ BOOL IniReadSettingByName(U32 SectionId, PUCHAR SettingName, PUCHAR Buffer, U32
|
||||||
DbgPrint((DPRINT_INIFILE, "IniReadSettingByName() Setting \'%s\' found.\n", SettingName));
|
DbgPrint((DPRINT_INIFILE, "IniReadSettingByName() Setting \'%s\' found.\n", SettingName));
|
||||||
DbgPrint((DPRINT_INIFILE, "IniReadSettingByName() Setting value = %s\n", SectionItem->ItemValue));
|
DbgPrint((DPRINT_INIFILE, "IniReadSettingByName() Setting value = %s\n", SectionItem->ItemValue));
|
||||||
|
|
||||||
|
RtlZeroMemory(Buffer, BufferSize);
|
||||||
strncpy(Buffer, SectionItem->ItemValue, BufferSize);
|
strncpy(Buffer, SectionItem->ItemValue, BufferSize);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -130,3 +159,91 @@ BOOL IniReadSettingByName(U32 SectionId, PUCHAR SettingName, PUCHAR Buffer, U32
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL IniAddSection(PUCHAR SectionName, U32* SectionId)
|
||||||
|
{
|
||||||
|
PINI_SECTION Section;
|
||||||
|
|
||||||
|
// Allocate a new section structure
|
||||||
|
Section = MmAllocateMemory(sizeof(INI_SECTION));
|
||||||
|
if (!Section)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlZeroMemory(Section, sizeof(INI_SECTION));
|
||||||
|
|
||||||
|
// Allocate the section name buffer
|
||||||
|
Section->SectionName = MmAllocateMemory(strlen(SectionName));
|
||||||
|
if (!Section->SectionName)
|
||||||
|
{
|
||||||
|
MmFreeMemory(Section);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the section name
|
||||||
|
strcpy(Section->SectionName, SectionName);
|
||||||
|
|
||||||
|
// Add it to the section list head
|
||||||
|
IniFileSectionCount++;
|
||||||
|
if (IniFileSectionListHead == NULL)
|
||||||
|
{
|
||||||
|
IniFileSectionListHead = Section;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RtlListInsertTail((PLIST_ITEM)IniFileSectionListHead, (PLIST_ITEM)Section);
|
||||||
|
}
|
||||||
|
|
||||||
|
*SectionId = (U32)Section;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL IniAddSettingValueToSection(U32 SectionId, PUCHAR SettingName, PUCHAR SettingValue)
|
||||||
|
{
|
||||||
|
PINI_SECTION Section = (PINI_SECTION)SectionId;
|
||||||
|
PINI_SECTION_ITEM SectionItem;
|
||||||
|
|
||||||
|
// Allocate a new item structure
|
||||||
|
SectionItem = MmAllocateMemory(sizeof(INI_SECTION_ITEM));
|
||||||
|
if (!SectionItem)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlZeroMemory(SectionItem, sizeof(INI_SECTION_ITEM));
|
||||||
|
|
||||||
|
// Allocate the setting name buffer
|
||||||
|
SectionItem->ItemName = MmAllocateMemory(strlen(SettingName));
|
||||||
|
if (!SectionItem->ItemName)
|
||||||
|
{
|
||||||
|
MmFreeMemory(SectionItem);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allocate the setting value buffer
|
||||||
|
SectionItem->ItemValue = MmAllocateMemory(strlen(SettingValue));
|
||||||
|
if (!SectionItem->ItemValue)
|
||||||
|
{
|
||||||
|
MmFreeMemory(SectionItem->ItemName);
|
||||||
|
MmFreeMemory(SectionItem);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy(SectionItem->ItemName, SettingName);
|
||||||
|
strcpy(SectionItem->ItemValue, SettingValue);
|
||||||
|
|
||||||
|
// Add it to the current section
|
||||||
|
Section->SectionItemCount++;
|
||||||
|
if (Section->SectionItemList == NULL)
|
||||||
|
{
|
||||||
|
Section->SectionItemList = SectionItem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RtlListInsertTail((PLIST_ITEM)Section->SectionItemList, (PLIST_ITEM)SectionItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -124,6 +124,8 @@ BOOL IniParseFile(PUCHAR IniFileData, U32 IniFileSize)
|
||||||
if (CurrentSection == NULL)
|
if (CurrentSection == NULL)
|
||||||
{
|
{
|
||||||
printf("Error: freeldr.ini:%ld: Setting '%s' found outside of a [section].\n", CurrentLineNumber, IniFileLine);
|
printf("Error: freeldr.ini:%ld: Setting '%s' found outside of a [section].\n", CurrentLineNumber, IniFileLine);
|
||||||
|
printf("Press any key to continue...\n");
|
||||||
|
getch();
|
||||||
CurrentLineNumber++;
|
CurrentLineNumber++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -151,6 +153,7 @@ BOOL IniParseFile(PUCHAR IniFileData, U32 IniFileSize)
|
||||||
CurrentItem->ItemValue = MmAllocateMemory(IniGetSettingValueSize(IniFileLine, LineLength));
|
CurrentItem->ItemValue = MmAllocateMemory(IniGetSettingValueSize(IniFileLine, LineLength));
|
||||||
if (!CurrentItem->ItemValue)
|
if (!CurrentItem->ItemValue)
|
||||||
{
|
{
|
||||||
|
MmFreeMemory(CurrentItem->ItemName);
|
||||||
MmFreeMemory(CurrentItem);
|
MmFreeMemory(CurrentItem);
|
||||||
MmFreeMemory(IniFileLine);
|
MmFreeMemory(IniFileLine);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -31,6 +31,7 @@
|
||||||
#include <inifile.h>
|
#include <inifile.h>
|
||||||
#include <oslist.h> // For RemoveQuotes()
|
#include <oslist.h> // For RemoveQuotes()
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
|
#include <drivemap.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,7 +53,7 @@ PVOID LinuxKernelLoadAddress = NULL;
|
||||||
PVOID LinuxInitrdLoadAddress = NULL;
|
PVOID LinuxInitrdLoadAddress = NULL;
|
||||||
UCHAR LinuxBootDescription[80];
|
UCHAR LinuxBootDescription[80];
|
||||||
|
|
||||||
VOID LoadAndBootLinux(PUCHAR OperatingSystemName)
|
VOID LoadAndBootLinux(PUCHAR OperatingSystemName, PUCHAR Description)
|
||||||
{
|
{
|
||||||
PFILE LinuxKernel = NULL;
|
PFILE LinuxKernel = NULL;
|
||||||
PFILE LinuxInitrdFile = NULL;
|
PFILE LinuxInitrdFile = NULL;
|
||||||
|
@ -60,15 +61,24 @@ VOID LoadAndBootLinux(PUCHAR OperatingSystemName)
|
||||||
|
|
||||||
UiDrawBackdrop();
|
UiDrawBackdrop();
|
||||||
|
|
||||||
|
if (Description)
|
||||||
|
{
|
||||||
|
sprintf(LinuxBootDescription, "Loading %s...", Description);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy(LinuxBootDescription, "Loading Linux...");
|
||||||
|
}
|
||||||
|
|
||||||
|
UiDrawStatusText(LinuxBootDescription);
|
||||||
|
UiDrawProgressBarCenter(0, 100, LinuxBootDescription);
|
||||||
|
|
||||||
// Parse the .ini file section
|
// Parse the .ini file section
|
||||||
if (!LinuxParseIniSection(OperatingSystemName))
|
if (!LinuxParseIniSection(OperatingSystemName))
|
||||||
{
|
{
|
||||||
goto LinuxBootFailed;
|
goto LinuxBootFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
UiDrawStatusText(LinuxBootDescription);
|
|
||||||
UiDrawProgressBarCenter(0, 100, LinuxBootDescription);
|
|
||||||
|
|
||||||
// Open the boot volume
|
// Open the boot volume
|
||||||
if (!FsOpenVolume(BootDrive, BootPartition))
|
if (!FsOpenVolume(BootDrive, BootPartition))
|
||||||
{
|
{
|
||||||
|
@ -148,13 +158,11 @@ VOID LoadAndBootLinux(PUCHAR OperatingSystemName)
|
||||||
LinuxSetupSector->LoadFlags = 0;
|
LinuxSetupSector->LoadFlags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getch();
|
|
||||||
RtlCopyMemory((PVOID)0x90000, LinuxBootSector, 512);
|
RtlCopyMemory((PVOID)0x90000, LinuxBootSector, 512);
|
||||||
RtlCopyMemory((PVOID)0x90200, LinuxSetupSector, SetupSectorSize);
|
RtlCopyMemory((PVOID)0x90200, LinuxSetupSector, SetupSectorSize);
|
||||||
RtlCopyMemory((PVOID)0x99000, LinuxCommandLine, LinuxCommandLineSize);
|
RtlCopyMemory((PVOID)0x99000, LinuxCommandLine, LinuxCommandLineSize);
|
||||||
|
|
||||||
UiUnInitialize("Booting Linux...");
|
UiUnInitialize("Booting Linux...");
|
||||||
getch();
|
|
||||||
|
|
||||||
DiskStopFloppyMotor();
|
DiskStopFloppyMotor();
|
||||||
|
|
||||||
|
@ -231,17 +239,7 @@ BOOL LinuxParseIniSection(PUCHAR OperatingSystemName)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IniReadSettingByName(SectionId, "Name", SettingValue, 260))
|
BootDrive = DriveMapGetBiosDriveNumber(SettingValue);
|
||||||
{
|
|
||||||
RemoveQuotes(SettingValue);
|
|
||||||
sprintf(LinuxBootDescription, "Loading %s...");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
strcpy(LinuxBootDescription, "Loading Linux...");
|
|
||||||
}
|
|
||||||
|
|
||||||
BootDrive = atoi(SettingValue);
|
|
||||||
|
|
||||||
BootPartition = 0;
|
BootPartition = 0;
|
||||||
if (IniReadSettingByName(SectionId, "BootPartition", SettingValue, 260))
|
if (IniReadSettingByName(SectionId, "BootPartition", SettingValue, 260))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
#include <ui.h>
|
#include <ui.h>
|
||||||
#include <inifile.h>
|
#include <inifile.h>
|
||||||
#include <disk.h>
|
#include <disk.h>
|
||||||
|
#include <drivemap.h>
|
||||||
|
|
||||||
VOID LoadAndBootBootSector(PUCHAR OperatingSystemName)
|
VOID LoadAndBootBootSector(PUCHAR OperatingSystemName)
|
||||||
{
|
{
|
||||||
|
@ -53,7 +54,7 @@ VOID LoadAndBootBootSector(PUCHAR OperatingSystemName)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BootDrive = atoi(SettingValue);
|
BootDrive = DriveMapGetBiosDriveNumber(SettingValue);
|
||||||
|
|
||||||
BootPartition = 0;
|
BootPartition = 0;
|
||||||
if (IniReadSettingByName(SectionId, "BootPartition", SettingValue, 80))
|
if (IniReadSettingByName(SectionId, "BootPartition", SettingValue, 80))
|
||||||
|
@ -132,7 +133,7 @@ VOID LoadAndBootPartition(PUCHAR OperatingSystemName)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BootDrive = atoi(SettingValue);
|
BootDrive = DriveMapGetBiosDriveNumber(SettingValue);
|
||||||
|
|
||||||
// Read the boot partition
|
// Read the boot partition
|
||||||
if (!IniReadSettingByName(SectionId, "BootPartition", SettingValue, 80))
|
if (!IniReadSettingByName(SectionId, "BootPartition", SettingValue, 80))
|
||||||
|
@ -199,7 +200,7 @@ VOID LoadAndBootDrive(PUCHAR OperatingSystemName)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BootDrive = atoi(SettingValue);
|
BootDrive = DriveMapGetBiosDriveNumber(SettingValue);
|
||||||
|
|
||||||
// Now try to read the boot sector (or mbr)
|
// Now try to read the boot sector (or mbr)
|
||||||
// If this fails then abort
|
// If this fails then abort
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -53,16 +53,16 @@ PUCHAR MmGetSystemMemoryMapTypeString(U32 Type);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
U32 MmGetPageNumberFromAddress(PVOID Address); // Returns the page number that contains a linear address
|
U32 MmGetPageNumberFromAddress(PVOID Address); // Returns the page number that contains a linear address
|
||||||
PVOID MmGetEndAddressOfAnyMemory(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount); // Returns the last address of memory from the memory map
|
PVOID MmGetEndAddressOfAnyMemory(PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount); // Returns the last address of memory from the memory map
|
||||||
U32 MmGetAddressablePageCountIncludingHoles(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount); // Returns the count of addressable pages from address zero including any memory holes and reserved memory regions
|
U32 MmGetAddressablePageCountIncludingHoles(PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount); // Returns the count of addressable pages from address zero including any memory holes and reserved memory regions
|
||||||
PVOID MmFindLocationForPageLookupTable(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount); // Returns the address for a memory chunk big enough to hold the page lookup table (starts search from end of memory)
|
PVOID MmFindLocationForPageLookupTable(PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount); // Returns the address for a memory chunk big enough to hold the page lookup table (starts search from end of memory)
|
||||||
VOID MmSortBiosMemoryMap(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount); // Sorts the BIOS_MEMORY_MAP array so the first element corresponds to the first address in memory
|
VOID MmSortBiosMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount); // Sorts the BIOS_MEMORY_MAP array so the first element corresponds to the first address in memory
|
||||||
VOID MmInitPageLookupTable(PVOID PageLookupTable, U32 TotalPageCount, BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount); // Inits the page lookup table according to the memory types in the memory map
|
VOID MmInitPageLookupTable(PVOID PageLookupTable, U32 TotalPageCount, PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount); // Inits the page lookup table according to the memory types in the memory map
|
||||||
VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, U32 StartPage, U32 PageCount, U32 PageAllocated); // Marks the specified pages as allocated or free in the lookup table
|
VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, U32 StartPage, U32 PageCount, U32 PageAllocated); // Marks the specified pages as allocated or free in the lookup table
|
||||||
VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, U32 StartPage, U32 PageCount); // Allocates the specified pages in the lookup table
|
VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, U32 StartPage, U32 PageCount); // Allocates the specified pages in the lookup table
|
||||||
U32 MmCountFreePagesInLookupTable(PVOID PageLookupTable, U32 TotalPageCount); // Returns the number of free pages in the lookup table
|
U32 MmCountFreePagesInLookupTable(PVOID PageLookupTable, U32 TotalPageCount); // Returns the number of free pages in the lookup table
|
||||||
U32 MmFindAvailablePagesFromEnd(PVOID PageLookupTable, U32 TotalPageCount, U32 PagesNeeded); // Returns the page number of the first available page range from the end of memory
|
U32 MmFindAvailablePagesFromEnd(PVOID PageLookupTable, U32 TotalPageCount, U32 PagesNeeded); // Returns the page number of the first available page range from the end of memory
|
||||||
VOID MmFixupSystemMemoryMap(BIOS_MEMORY_MAP BiosMemoryMap[32], U32* MapCount); // Removes entries in the memory map that describe memory above 4G
|
VOID MmFixupSystemMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, U32* MapCount); // Removes entries in the memory map that describe memory above 4G
|
||||||
VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, U32 TotalPageCount); // Sets the LastFreePageHint to the last usable page of memory
|
VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, U32 TotalPageCount); // Sets the LastFreePageHint to the last usable page of memory
|
||||||
BOOL MmAreMemoryPagesAvailable(PVOID PageLookupTable, U32 TotalPageCount, PVOID PageAddress, U32 PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE
|
BOOL MmAreMemoryPagesAvailable(PVOID PageLookupTable, U32 TotalPageCount, PVOID PageAddress, U32 PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -149,7 +149,7 @@ U32 MmGetPageNumberFromAddress(PVOID Address)
|
||||||
return ((U32)Address) / MM_PAGE_SIZE;
|
return ((U32)Address) / MM_PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PVOID MmGetEndAddressOfAnyMemory(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount)
|
PVOID MmGetEndAddressOfAnyMemory(PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount)
|
||||||
{
|
{
|
||||||
U64 MaxStartAddressSoFar;
|
U64 MaxStartAddressSoFar;
|
||||||
U64 EndAddressOfMemory;
|
U64 EndAddressOfMemory;
|
||||||
|
@ -175,7 +175,7 @@ PVOID MmGetEndAddressOfAnyMemory(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount
|
||||||
return (PVOID)(U32)EndAddressOfMemory;
|
return (PVOID)(U32)EndAddressOfMemory;
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 MmGetAddressablePageCountIncludingHoles(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount)
|
U32 MmGetAddressablePageCountIncludingHoles(PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount)
|
||||||
{
|
{
|
||||||
U32 PageCount;
|
U32 PageCount;
|
||||||
U64 EndAddress;
|
U64 EndAddress;
|
||||||
|
@ -201,17 +201,17 @@ U32 MmGetAddressablePageCountIncludingHoles(BIOS_MEMORY_MAP BiosMemoryMap[32], U
|
||||||
return PageCount;
|
return PageCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
PVOID MmFindLocationForPageLookupTable(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount)
|
PVOID MmFindLocationForPageLookupTable(PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount)
|
||||||
{
|
{
|
||||||
U32 TotalPageCount;
|
U32 TotalPageCount;
|
||||||
U32 PageLookupTableSize;
|
U32 PageLookupTableSize;
|
||||||
PVOID PageLookupTableAddress;
|
PVOID PageLookupTableMemAddress;
|
||||||
int Index;
|
int Index;
|
||||||
BIOS_MEMORY_MAP TempBiosMemoryMap[32];
|
BIOS_MEMORY_MAP TempBiosMemoryMap[32];
|
||||||
|
|
||||||
TotalPageCount = MmGetAddressablePageCountIncludingHoles(BiosMemoryMap, MapCount);
|
TotalPageCount = MmGetAddressablePageCountIncludingHoles(BiosMemoryMap, MapCount);
|
||||||
PageLookupTableSize = TotalPageCount * sizeof(PAGE_LOOKUP_TABLE_ITEM);
|
PageLookupTableSize = TotalPageCount * sizeof(PAGE_LOOKUP_TABLE_ITEM);
|
||||||
PageLookupTableAddress = 0;
|
PageLookupTableMemAddress = 0;
|
||||||
|
|
||||||
RtlCopyMemory(TempBiosMemoryMap, BiosMemoryMap, sizeof(BIOS_MEMORY_MAP) * 32);
|
RtlCopyMemory(TempBiosMemoryMap, BiosMemoryMap, sizeof(BIOS_MEMORY_MAP) * 32);
|
||||||
MmSortBiosMemoryMap(TempBiosMemoryMap, MapCount);
|
MmSortBiosMemoryMap(TempBiosMemoryMap, MapCount);
|
||||||
|
@ -222,17 +222,17 @@ PVOID MmFindLocationForPageLookupTable(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 Ma
|
||||||
// then we'll put our page lookup table here
|
// then we'll put our page lookup table here
|
||||||
if (TempBiosMemoryMap[Index].Type == MEMTYPE_USABLE && TempBiosMemoryMap[Index].Length >= PageLookupTableSize)
|
if (TempBiosMemoryMap[Index].Type == MEMTYPE_USABLE && TempBiosMemoryMap[Index].Length >= PageLookupTableSize)
|
||||||
{
|
{
|
||||||
PageLookupTableAddress = (PVOID)(U32)(TempBiosMemoryMap[Index].BaseAddress + (TempBiosMemoryMap[Index].Length - PageLookupTableSize));
|
PageLookupTableMemAddress = (PVOID)(U32)(TempBiosMemoryMap[Index].BaseAddress + (TempBiosMemoryMap[Index].Length - PageLookupTableSize));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgPrint((DPRINT_MEMORY, "MmFindLocationForPageLookupTable() returning 0x%x\n", PageLookupTableAddress));
|
DbgPrint((DPRINT_MEMORY, "MmFindLocationForPageLookupTable() returning 0x%x\n", PageLookupTableMemAddress));
|
||||||
|
|
||||||
return PageLookupTableAddress;
|
return PageLookupTableMemAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MmSortBiosMemoryMap(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount)
|
VOID MmSortBiosMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount)
|
||||||
{
|
{
|
||||||
U32 Index;
|
U32 Index;
|
||||||
U32 LoopCount;
|
U32 LoopCount;
|
||||||
|
@ -254,7 +254,7 @@ VOID MmSortBiosMemoryMap(BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MmInitPageLookupTable(PVOID PageLookupTable, U32 TotalPageCount, BIOS_MEMORY_MAP BiosMemoryMap[32], U32 MapCount)
|
VOID MmInitPageLookupTable(PVOID PageLookupTable, U32 TotalPageCount, PBIOS_MEMORY_MAP BiosMemoryMap, U32 MapCount)
|
||||||
{
|
{
|
||||||
U32 MemoryMapStartPage;
|
U32 MemoryMapStartPage;
|
||||||
U32 MemoryMapEndPage;
|
U32 MemoryMapEndPage;
|
||||||
|
@ -353,7 +353,7 @@ U32 MmFindAvailablePagesFromEnd(PVOID PageLookupTable, U32 TotalPageCount, U32 P
|
||||||
|
|
||||||
AvailablePageStart = 0;
|
AvailablePageStart = 0;
|
||||||
AvailablePagesSoFar = 0;
|
AvailablePagesSoFar = 0;
|
||||||
for (Index=LastFreePageHint-1; Index>=0; Index--)
|
for (Index=LastFreePageHint-1; Index>0; Index--)
|
||||||
{
|
{
|
||||||
if (RealPageLookupTable[Index].PageAllocated != 0)
|
if (RealPageLookupTable[Index].PageAllocated != 0)
|
||||||
{
|
{
|
||||||
|
@ -374,7 +374,7 @@ U32 MmFindAvailablePagesFromEnd(PVOID PageLookupTable, U32 TotalPageCount, U32 P
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MmFixupSystemMemoryMap(BIOS_MEMORY_MAP BiosMemoryMap[32], U32* MapCount)
|
VOID MmFixupSystemMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, U32* MapCount)
|
||||||
{
|
{
|
||||||
int Index;
|
int Index;
|
||||||
int Index2;
|
int Index2;
|
||||||
|
@ -403,7 +403,7 @@ VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, U32 TotalPageCount)
|
||||||
PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable;
|
PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTable;
|
||||||
U32 Index;
|
U32 Index;
|
||||||
|
|
||||||
for (Index=TotalPageCount-1; Index>=0; Index--)
|
for (Index=TotalPageCount-1; Index>0; Index--)
|
||||||
{
|
{
|
||||||
if (RealPageLookupTable[Index].PageAllocated == 0)
|
if (RealPageLookupTable[Index].PageAllocated == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,375 +22,105 @@
|
||||||
#include <ui.h>
|
#include <ui.h>
|
||||||
#include <options.h>
|
#include <options.h>
|
||||||
#include <miscboot.h>
|
#include <miscboot.h>
|
||||||
|
#include <debug.h>
|
||||||
|
#include <disk.h>
|
||||||
|
#include <arch.h>
|
||||||
|
|
||||||
#if 0
|
|
||||||
void DoOptionsMenu(void)
|
PUCHAR OptionsMenuList[] =
|
||||||
{
|
{
|
||||||
int OptionsMenuItemCount = 1; // Count is 1 because we don't show the "Set ReactOS Boot Flags" menu item yet
|
"Safe Mode",
|
||||||
char OptionsMenuItems[2][80] = { "Boot Wizard", "Set ReactOS Boot Flags" /* i.e. Safe Mode, Last Known Good Configuration */ };
|
"Safe Mode with Networking",
|
||||||
int OptionsMenuItemSelected = 0;
|
"Safe Mode with Command Prompt",
|
||||||
|
|
||||||
while (OptionsMenuItemSelected != -1)
|
"SEPARATOR",
|
||||||
{
|
|
||||||
OptionsMenuItemSelected = RunOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, OptionsMenuItemSelected, "[Advanced Options]");
|
|
||||||
|
|
||||||
switch (OptionsMenuItemSelected)
|
"Enable Boot Logging",
|
||||||
{
|
"Enable VGA Mode",
|
||||||
case 0:
|
"Last Known Good Configuration",
|
||||||
DoDiskOptionsMenu();
|
"Directory Services Restore Mode",
|
||||||
break;
|
"Debugging Mode",
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoDiskOptionsMenu(void)
|
"SEPARATOR",
|
||||||
|
|
||||||
|
"Custom Boot",
|
||||||
|
"Reboot",
|
||||||
|
};
|
||||||
|
|
||||||
|
enum OptionMenuItems
|
||||||
{
|
{
|
||||||
char DiskMenuItems[25][80];
|
SAFE_MODE = 0,
|
||||||
int DiskMenuItemCount = 0;
|
SAFE_MODE_WITH_NETWORKING = 1,
|
||||||
int FloppyDiskMenuItemCount = 0;
|
SAFE_MODE_WITH_COMMAND_PROMPT = 2,
|
||||||
int HardDiskMenuItemCount = 0;
|
|
||||||
int DiskMenuItemSelected = 0;
|
|
||||||
|
|
||||||
char temp[255];
|
SEPARATOR1 = 3,
|
||||||
int i;
|
|
||||||
|
|
||||||
FloppyDiskMenuItemCount = (int)*((char *)((0x40 * 16) + 0x10)); // Get number of floppy disks from bios data area 40:10
|
ENABLE_BOOT_LOGGING = 4,
|
||||||
if (FloppyDiskMenuItemCount & 1)
|
ENABLE_VGA_MODE = 5,
|
||||||
FloppyDiskMenuItemCount = (FloppyDiskMenuItemCount >> 6) + 1;
|
LAST_KNOWN_GOOD_CONFIGURATION = 6,
|
||||||
else
|
DIRECTORY_SERVICES_RESTORE_MODE = 7,
|
||||||
FloppyDiskMenuItemCount = 0;
|
DEBUGGING_MODE = 8,
|
||||||
HardDiskMenuItemCount = (int)*((char *)((0x40 * 16) + 0x75)); // Get number of hard disks from bios data area 40:75
|
|
||||||
DiskMenuItemCount = FloppyDiskMenuItemCount + HardDiskMenuItemCount;
|
|
||||||
|
|
||||||
for (i=0; i<FloppyDiskMenuItemCount; i++)
|
SEPARATOR2 = 9,
|
||||||
{
|
|
||||||
strcpy(DiskMenuItems[i], "Floppy Disk ");
|
|
||||||
itoa(i + 1, temp, 10);
|
|
||||||
strcat(DiskMenuItems[i], temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i=0; i<HardDiskMenuItemCount; i++)
|
CUSTOM_BOOT = 10,
|
||||||
{
|
REBOOT = 11,
|
||||||
strcpy(DiskMenuItems[i + FloppyDiskMenuItemCount], "Hard Disk ");
|
};
|
||||||
itoa(i + 1, temp, 10);
|
|
||||||
strcat(DiskMenuItems[i + FloppyDiskMenuItemCount], temp);
|
|
||||||
strcat(DiskMenuItems[i + FloppyDiskMenuItemCount], " (");
|
|
||||||
itoa((get_heads(i+0x80) * get_cylinders(i+0x80) * get_sectors(i+0x80)) / 2048, temp, 10);
|
|
||||||
strcat(DiskMenuItems[i + FloppyDiskMenuItemCount], temp);
|
|
||||||
strcat(DiskMenuItems[i + FloppyDiskMenuItemCount], " MB)");
|
|
||||||
}
|
|
||||||
|
|
||||||
DiskMenuItemSelected = 0;
|
U32 OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
|
||||||
while (DiskMenuItemSelected != -1)
|
|
||||||
{
|
|
||||||
DiskMenuItemSelected = RunOptionsMenu(DiskMenuItems, DiskMenuItemCount, DiskMenuItemSelected, "[Boot Wizard]");
|
|
||||||
|
|
||||||
if (DiskMenuItemSelected != -1)
|
VOID DoOptionsMenu(VOID)
|
||||||
{
|
|
||||||
if (DiskMenuItemSelected < FloppyDiskMenuItemCount)
|
|
||||||
DoBootOptionsMenu(DiskMenuItemSelected, DiskMenuItems[DiskMenuItemSelected]);
|
|
||||||
else
|
|
||||||
DoBootOptionsMenu((DiskMenuItemSelected - FloppyDiskMenuItemCount) + 0x80, DiskMenuItems[DiskMenuItemSelected]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoBootOptionsMenu(int BootDriveNum, char *BootDriveText)
|
|
||||||
{
|
{
|
||||||
int BootOptionsMenuItemCount = 2;
|
U32 SelectedMenuItem;
|
||||||
char BootOptionsMenuItems[2][80] = { "Boot To ", "Pick A Boot Partition" };
|
|
||||||
int BootOptionsMenuItemSelected = 0;
|
|
||||||
|
|
||||||
/*strcat(BootOptionsMenuItems[0], BootDriveText);
|
if (!UiDisplayMenu(OptionsMenuList, OptionsMenuItemCount, 0, -1, &SelectedMenuItem, TRUE, NULL))
|
||||||
|
|
||||||
while (BootOptionsMenuItemSelected != -1)
|
|
||||||
{
|
{
|
||||||
BootOptionsMenuItemSelected = RunOptionsMenu(BootOptionsMenuItems, BootOptionsMenuItemCount, BootOptionsMenuItemSelected, "[Boot Options]");
|
// The user pressed ESC
|
||||||
|
|
||||||
switch (BootOptionsMenuItemSelected)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
BootDrive = BootDriveNum;
|
|
||||||
|
|
||||||
if (!biosdisk(_DISK_READ, BootDrive, 0, 0, 1, 1, (void*)0x7c00))
|
|
||||||
{
|
|
||||||
MessageBox("Disk Read Error");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for validity
|
|
||||||
if (*((U16*)(0x7c00 + 0x1fe)) != 0xaa55)
|
|
||||||
{
|
|
||||||
MessageBox("Invalid boot sector magic (0xaa55)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RestoreScreen(ScreenBuffer);
|
|
||||||
VideoShowTextCursor();
|
|
||||||
gotoxy(CursorXPos, CursorYPos);
|
|
||||||
|
|
||||||
StopFloppyMotor();
|
|
||||||
JumpToBootCode();
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if (BootDriveNum < 0x80)
|
|
||||||
{
|
|
||||||
MessageBox("This option is not available for a floppy disk.");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
DoBootPartitionOptionsMenu(BootDriveNum);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoBootPartitionOptionsMenu(int BootDriveNum)
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
int partition_num;
|
|
||||||
int partition_type;
|
|
||||||
int head, sector, cylinder;
|
|
||||||
} BootPartitions[8];
|
|
||||||
int BootOptionsMenuItemCount = 0;
|
|
||||||
char BootOptionsMenuItems[8][80];
|
|
||||||
int BootOptionsMenuItemSelected = 0;
|
|
||||||
int head, sector, cylinder;
|
|
||||||
int offset;
|
|
||||||
int i;
|
|
||||||
char temp[25];
|
|
||||||
|
|
||||||
|
|
||||||
/*BootDrive = BootDriveNum;
|
|
||||||
|
|
||||||
if (!biosdisk(_DISK_READ, BootDrive, 0, 0, 1, 1, SectorBuffer))
|
|
||||||
{
|
|
||||||
MessageBox("Disk Read Error");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for validity
|
// Clear the backdrop
|
||||||
if (*((U16*)(SectorBuffer + 0x1fe)) != 0xaa55)
|
UiDrawBackdrop();
|
||||||
|
|
||||||
|
switch (SelectedMenuItem)
|
||||||
{
|
{
|
||||||
MessageBox("Invalid partition table magic (0xaa55)");
|
case SAFE_MODE:
|
||||||
return;
|
break;
|
||||||
|
case SAFE_MODE_WITH_NETWORKING:
|
||||||
|
break;
|
||||||
|
case SAFE_MODE_WITH_COMMAND_PROMPT:
|
||||||
|
break;
|
||||||
|
//case SEPARATOR1:
|
||||||
|
// break;
|
||||||
|
case ENABLE_BOOT_LOGGING:
|
||||||
|
break;
|
||||||
|
case ENABLE_VGA_MODE:
|
||||||
|
break;
|
||||||
|
case LAST_KNOWN_GOOD_CONFIGURATION:
|
||||||
|
break;
|
||||||
|
case DIRECTORY_SERVICES_RESTORE_MODE:
|
||||||
|
break;
|
||||||
|
case DEBUGGING_MODE:
|
||||||
|
break;
|
||||||
|
//case SEPARATOR2:
|
||||||
|
// break;
|
||||||
|
case CUSTOM_BOOT:
|
||||||
|
OptionMenuCustomBoot();
|
||||||
|
break;
|
||||||
|
case REBOOT:
|
||||||
|
OptionMenuReboot();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = 0x1BE;
|
|
||||||
|
|
||||||
for (i=0; i<4; i++)
|
|
||||||
{
|
|
||||||
// Check for valid partition
|
|
||||||
if (SectorBuffer[offset + 4] != 0)
|
|
||||||
{
|
|
||||||
BootPartitions[BootOptionsMenuItemCount].partition_num = i;
|
|
||||||
BootPartitions[BootOptionsMenuItemCount].partition_type = SectorBuffer[offset + 4];
|
|
||||||
|
|
||||||
BootPartitions[BootOptionsMenuItemCount].head = SectorBuffer[offset + 1];
|
|
||||||
BootPartitions[BootOptionsMenuItemCount].sector = (SectorBuffer[offset + 2] & 0x3F);
|
|
||||||
BootPartitions[BootOptionsMenuItemCount].cylinder = SectorBuffer[offset + 3];
|
|
||||||
if (SectorBuffer[offset + 2] & 0x80)
|
|
||||||
BootPartitions[BootOptionsMenuItemCount].cylinder += 0x200;
|
|
||||||
if (SectorBuffer[offset + 2] & 0x40)
|
|
||||||
BootPartitions[BootOptionsMenuItemCount].cylinder += 0x100;
|
|
||||||
|
|
||||||
strcpy(BootOptionsMenuItems[BootOptionsMenuItemCount], "Boot To Partition ");
|
|
||||||
itoa(i+1, temp, 10);
|
|
||||||
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], temp);
|
|
||||||
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], " (Type: 0x");
|
|
||||||
itoa(BootPartitions[BootOptionsMenuItemCount].partition_type, temp, 16);
|
|
||||||
if (strlen(temp) < 2)
|
|
||||||
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], "0");
|
|
||||||
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], temp);
|
|
||||||
strcat(BootOptionsMenuItems[BootOptionsMenuItemCount], ")");
|
|
||||||
|
|
||||||
BootOptionsMenuItemCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
offset += 0x10;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (BootOptionsMenuItemSelected != -1)
|
|
||||||
{
|
|
||||||
BootOptionsMenuItemSelected = RunOptionsMenu(BootOptionsMenuItems, BootOptionsMenuItemCount, BootOptionsMenuItemSelected, "[Boot Partition Options]");
|
|
||||||
|
|
||||||
if (BootOptionsMenuItemSelected != -1)
|
|
||||||
{
|
|
||||||
head = BootPartitions[BootOptionsMenuItemCount].head;
|
|
||||||
sector = BootPartitions[BootOptionsMenuItemCount].sector;
|
|
||||||
cylinder = BootPartitions[BootOptionsMenuItemCount].cylinder;
|
|
||||||
|
|
||||||
// Read partition boot sector
|
|
||||||
if (!biosdisk(_DISK_READ, BootDrive, head, cylinder, sector, 1, (void*)0x7c00))
|
|
||||||
{
|
|
||||||
MessageBox("Disk Read Error");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for validity
|
|
||||||
if (*((U16*)(0x7c00 + 0x1fe)) != 0xaa55)
|
|
||||||
{
|
|
||||||
MessageBox("Invalid boot sector magic (0xaa55)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RestoreScreen(ScreenBuffer);
|
|
||||||
VideoShowTextCursor();
|
|
||||||
gotoxy(CursorXPos, CursorYPos);
|
|
||||||
|
|
||||||
StopFloppyMotor();
|
|
||||||
JumpToBootCode();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int RunOptionsMenu(char OptionsMenuItems[][80], int OptionsMenuItemCount, int nOptionSelected, char *OptionsMenuTitle)
|
VOID OptionMenuReboot(VOID)
|
||||||
{
|
{
|
||||||
int key;
|
UiMessageBox("The system will now reboot.");
|
||||||
int second;
|
|
||||||
BOOL bDone = FALSE;
|
|
||||||
int nOptionsMenuBoxLeft;
|
|
||||||
int nOptionsMenuBoxRight;
|
|
||||||
int nOptionsMenuBoxTop;
|
|
||||||
int nOptionsMenuBoxBottom;
|
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
// Initialise the menu
|
DiskStopFloppyMotor();
|
||||||
InitOptionsMenu(&nOptionsMenuBoxLeft, &nOptionsMenuBoxTop, &nOptionsMenuBoxRight, &nOptionsMenuBoxBottom, OptionsMenuItemCount);
|
SoftReboot();
|
||||||
|
#else
|
||||||
DrawBackdrop();
|
UNIMPLEMENTED();
|
||||||
|
|
||||||
// Update the menu
|
|
||||||
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
|
|
||||||
|
|
||||||
second = getsecond();
|
|
||||||
|
|
||||||
// Loop
|
|
||||||
do
|
|
||||||
{
|
|
||||||
// Check for a keypress
|
|
||||||
if (kbhit())
|
|
||||||
{
|
|
||||||
// Cancel the timeout
|
|
||||||
if (nTimeOut != -1)
|
|
||||||
{
|
|
||||||
nTimeOut = -1;
|
|
||||||
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the key
|
|
||||||
key = getch();
|
|
||||||
|
|
||||||
// Is it extended?
|
|
||||||
if (key == 0)
|
|
||||||
key = getch(); // Yes - so get the extended key
|
|
||||||
|
|
||||||
// Process the key
|
|
||||||
switch (key)
|
|
||||||
{
|
|
||||||
case KEY_UP:
|
|
||||||
if (nOptionSelected)
|
|
||||||
{
|
|
||||||
nOptionSelected--;
|
|
||||||
|
|
||||||
// Update the menu
|
|
||||||
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case KEY_DOWN:
|
|
||||||
if (nOptionSelected < (OptionsMenuItemCount - 1))
|
|
||||||
{
|
|
||||||
nOptionSelected++;
|
|
||||||
|
|
||||||
// Update the menu
|
|
||||||
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case KEY_ENTER:
|
|
||||||
//MessageBox("The Advanced Options are still being implemented.");
|
|
||||||
bDone = TRUE;
|
|
||||||
break;
|
|
||||||
case KEY_ESC:
|
|
||||||
nOptionSelected = -1;
|
|
||||||
bDone = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the date & time
|
|
||||||
UpdateDateTime();
|
|
||||||
|
|
||||||
if (nTimeOut > 0)
|
|
||||||
{
|
|
||||||
if (getsecond() != second)
|
|
||||||
{
|
|
||||||
second = getsecond();
|
|
||||||
nTimeOut--;
|
|
||||||
|
|
||||||
// Update the menu
|
|
||||||
DrawOptionsMenu(OptionsMenuItems, OptionsMenuItemCount, nOptionSelected, OptionsMenuTitle, nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nTimeOut == 0)
|
|
||||||
bDone = TRUE;
|
|
||||||
}
|
|
||||||
while (!bDone);
|
|
||||||
|
|
||||||
return nOptionSelected;
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitOptionsMenu(int *nOptionsMenuBoxLeft, int *nOptionsMenuBoxTop, int *nOptionsMenuBoxRight, int *nOptionsMenuBoxBottom, int OptionsMenuItemCount)
|
|
||||||
{
|
|
||||||
/*int height = OptionsMenuItemCount;
|
|
||||||
int width = 20;
|
|
||||||
|
|
||||||
height += 1; // Allow room for top & bottom borders
|
|
||||||
width += 18; // Allow room for left & right borders, plus 8 spaces on each side
|
|
||||||
|
|
||||||
// Calculate the OS list box area
|
|
||||||
*nOptionsMenuBoxLeft = (nScreenWidth - width) / 2;
|
|
||||||
*nOptionsMenuBoxRight = *nOptionsMenuBoxLeft + width;
|
|
||||||
*nOptionsMenuBoxTop = (nScreenHeight - height) / 2 + 1;
|
|
||||||
*nOptionsMenuBoxBottom = *nOptionsMenuBoxTop + height;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void DrawOptionsMenu(char OptionsMenuItems[][80], int OptionsMenuItemCount, int nOptionSelected, char *OptionsMenuTitle, int nOptionsMenuBoxLeft, int nOptionsMenuBoxTop, int nOptionsMenuBoxRight, int nOptionsMenuBoxBottom)
|
|
||||||
{
|
|
||||||
int i, j;
|
|
||||||
char text[260];
|
|
||||||
int space, space_left, space_right;
|
|
||||||
|
|
||||||
// Update the status bar
|
|
||||||
/*DrawStatusText("Use \x18\x19 to select, then press ENTER. Press ESC to go back.");
|
|
||||||
|
|
||||||
DrawBox(nOptionsMenuBoxLeft, nOptionsMenuBoxTop, nOptionsMenuBoxRight, nOptionsMenuBoxBottom, D_VERT, D_HORZ, TRUE, TRUE, ATTR(cMenuFgColor, cMenuBgColor));
|
|
||||||
DrawText(nOptionsMenuBoxLeft + (((nOptionsMenuBoxRight - nOptionsMenuBoxLeft) - strlen(OptionsMenuTitle)) / 2) + 1, nOptionsMenuBoxTop, OptionsMenuTitle, ATTR(cMenuFgColor, cMenuBgColor));
|
|
||||||
|
|
||||||
for(i=0; i<OptionsMenuItemCount; i++)
|
|
||||||
{
|
|
||||||
space = (nOptionsMenuBoxRight - nOptionsMenuBoxLeft - 2) - strlen(OptionsMenuItems[i]);
|
|
||||||
space_left = (space / 2) + 1;
|
|
||||||
space_right = (space - space_left) + 1;
|
|
||||||
|
|
||||||
text[0] = '\0';
|
|
||||||
for(j=0; j<space_left; j++)
|
|
||||||
strcat(text, " ");
|
|
||||||
strcat(text, OptionsMenuItems[i]);
|
|
||||||
for(j=0; j<space_right; j++)
|
|
||||||
strcat(text, " ");
|
|
||||||
|
|
||||||
if(i == nOptionSelected)
|
|
||||||
{
|
|
||||||
DrawText(nOptionsMenuBoxLeft+1, nOptionsMenuBoxTop+1+i, text, ATTR(cSelectedTextColor, cSelectedTextBgColor));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DrawText(nOptionsMenuBoxLeft+1, nOptionsMenuBoxTop+1+i, text, ATTR(cTextColor, cMenuBgColor));
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -40,9 +40,9 @@ BOOL InitOperatingSystemList(PUCHAR **SectionNamesPointer, PUCHAR **DisplayNames
|
||||||
//
|
//
|
||||||
// Open the [FreeLoader] section
|
// Open the [FreeLoader] section
|
||||||
//
|
//
|
||||||
if (!IniOpenSection("FreeLoader", &SectionId))
|
if (!IniOpenSection("Operating Systems", &SectionId))
|
||||||
{
|
{
|
||||||
UiMessageBox("Section [FreeLoader] not found in freeldr.ini.");
|
UiMessageBox("Section [Operating Systems] not found in freeldr.ini.");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,44 +58,25 @@ BOOL InitOperatingSystemList(PUCHAR **SectionNamesPointer, PUCHAR **DisplayNames
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Now loop through and read the operating system section names
|
// Now loop through and read the operating system section and display names
|
||||||
//
|
//
|
||||||
CurrentOperatingSystemIndex = 0;
|
CurrentOperatingSystemIndex = 0;
|
||||||
for (Idx=0; Idx<SectionSettingCount; Idx++)
|
for (Idx=0; Idx<SectionSettingCount; Idx++)
|
||||||
{
|
{
|
||||||
IniReadSettingByNumber(SectionId, Idx, SettingName, 260, SettingValue, 260);
|
IniReadSettingByNumber(SectionId, Idx, SettingName, 260, SettingValue, 260);
|
||||||
|
|
||||||
if (stricmp(SettingName, "OS") == 0 && IniOpenSection(SettingValue, &OperatingSystemSectionId))
|
if (IniOpenSection(SettingName, &OperatingSystemSectionId))
|
||||||
{
|
{
|
||||||
strcpy(OperatingSystemSectionNames[CurrentOperatingSystemIndex], SettingValue);
|
// Copy the section name
|
||||||
|
strcpy(OperatingSystemSectionNames[CurrentOperatingSystemIndex], SettingName);
|
||||||
|
|
||||||
|
// Copy the display name
|
||||||
|
RemoveQuotes(SettingValue);
|
||||||
|
strcpy(OperatingSystemDisplayNames[CurrentOperatingSystemIndex], SettingValue);
|
||||||
|
|
||||||
CurrentOperatingSystemIndex++;
|
CurrentOperatingSystemIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Now loop through and read the operating system display names
|
|
||||||
//
|
|
||||||
for (Idx=0; Idx<OperatingSystemCount; Idx++)
|
|
||||||
{
|
|
||||||
if (IniOpenSection(OperatingSystemSectionNames[Idx], &OperatingSystemSectionId))
|
|
||||||
{
|
|
||||||
if (IniReadSettingByName(OperatingSystemSectionId, "Name", SettingValue, 260))
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Remove any quotes around the string
|
|
||||||
//
|
|
||||||
RemoveQuotes(SettingValue);
|
|
||||||
strcpy(OperatingSystemDisplayNames[Idx], SettingValue);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprintf(SettingName, "Operating System '%s' has no\nName= line in it's [section].", OperatingSystemSectionNames[Idx]);
|
|
||||||
UiMessageBox(SettingName);
|
|
||||||
strcpy(OperatingSystemDisplayNames[Idx], "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*OperatingSystemCountPointer = OperatingSystemCount;
|
*OperatingSystemCountPointer = OperatingSystemCount;
|
||||||
*SectionNamesPointer = OperatingSystemSectionNames;
|
*SectionNamesPointer = OperatingSystemSectionNames;
|
||||||
|
@ -120,17 +101,14 @@ U32 CountOperatingSystems(U32 SectionId)
|
||||||
{
|
{
|
||||||
IniReadSettingByNumber(SectionId, Idx, SettingName, 260, SettingValue, 260);
|
IniReadSettingByNumber(SectionId, Idx, SettingName, 260, SettingValue, 260);
|
||||||
|
|
||||||
if (stricmp(SettingName, "OS") == 0)
|
if (IniOpenSection(SettingName, NULL))
|
||||||
{
|
{
|
||||||
if (IniOpenSection(SettingValue, NULL))
|
OperatingSystemCount++;
|
||||||
{
|
}
|
||||||
OperatingSystemCount++;
|
else
|
||||||
}
|
{
|
||||||
else
|
sprintf(SettingName, "Operating System '%s' is listed in\nfreeldr.ini but doesn't have a [section].", SettingValue);
|
||||||
{
|
UiMessageBox(SettingName);
|
||||||
sprintf(SettingName, "Operating System '%s' is listed in\nfreeldr.ini but doesn't have a [section].", SettingValue);
|
|
||||||
UiMessageBox(SettingName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,3 +72,70 @@ BOOL DissectArcPath(char *ArcPath, char *BootPath, U32* BootDrive, U32* BootPart
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConstructArcPath(PUCHAR ArcPath, PUCHAR SystemFolder, U32 Disk, U32 Partition)
|
||||||
|
{
|
||||||
|
char tmp[50];
|
||||||
|
|
||||||
|
strcpy(ArcPath, "multi(0)disk(0)");
|
||||||
|
|
||||||
|
if (Disk < 0x80)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* floppy disk path:
|
||||||
|
* multi(0)disk(0)fdisk(x)\path
|
||||||
|
*/
|
||||||
|
sprintf(tmp, "fdisk(%d)", Disk);
|
||||||
|
strcat(ArcPath, tmp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* hard disk path:
|
||||||
|
* multi(0)disk(0)rdisk(x)partition(y)\path
|
||||||
|
*/
|
||||||
|
sprintf(tmp, "rdisk(%d)partition(%d)", (Disk - 0x80), Partition);
|
||||||
|
strcat(ArcPath, tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SystemFolder[0] == '\\' || SystemFolder[0] == '/')
|
||||||
|
{
|
||||||
|
strcat(ArcPath, SystemFolder);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcat(ArcPath, "\\");
|
||||||
|
strcat(ArcPath, SystemFolder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
U32 ConvertArcNameToBiosDriveNumber(PUCHAR ArcPath)
|
||||||
|
{
|
||||||
|
char * p;
|
||||||
|
U32 DriveNumber = 0;
|
||||||
|
|
||||||
|
if (strnicmp(ArcPath, "multi(0)disk(0)", 15) != 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
p = ArcPath + 15;
|
||||||
|
if (strnicmp(p, "fdisk(", 6) == 0)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* floppy disk path:
|
||||||
|
* multi(0)disk(0)fdisk(x)\path
|
||||||
|
*/
|
||||||
|
p = p + 6;
|
||||||
|
DriveNumber = atoi(p);
|
||||||
|
}
|
||||||
|
else if (strnicmp(p, "rdisk(", 6) == 0)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* hard disk path:
|
||||||
|
* multi(0)disk(0)rdisk(x)partition(y)\path
|
||||||
|
*/
|
||||||
|
p = p + 6;
|
||||||
|
DriveNumber = atoi(p) + 0x80;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DriveNumber;
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -45,7 +45,9 @@ char *strncpy(char *dest, char *src, size_t count)
|
||||||
|
|
||||||
while((*src) && (count--))
|
while((*src) && (count--))
|
||||||
*dest++ = *src++;
|
*dest++ = *src++;
|
||||||
*dest = 0;
|
|
||||||
|
if (count)
|
||||||
|
*dest = 0;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -111,7 +111,7 @@ VOID TuiDrawBackdrop(VOID)
|
||||||
//
|
//
|
||||||
// Draw help text
|
// Draw help text
|
||||||
//
|
//
|
||||||
//TuiDrawText(UiScreenWidth - 16, 3, /*"F1 for Help"*/"F8 for Options", ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
|
TuiDrawText(UiScreenWidth - 16, 3, /*"F1 for Help"*/"F8 for Options", ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw title text
|
// Draw title text
|
||||||
|
@ -477,8 +477,6 @@ VOID TuiUpdateDateTime(VOID)
|
||||||
|
|
||||||
// Draw the time
|
// Draw the time
|
||||||
TuiDrawText(UiScreenWidth-strlen(TimeString)-2, 2, TimeString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
|
TuiDrawText(UiScreenWidth-strlen(TimeString)-2, 2, TimeString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
|
||||||
|
|
||||||
VideoCopyOffScreenBufferToVRAM();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID TuiSaveScreen(PUCHAR Buffer)
|
VOID TuiSaveScreen(PUCHAR Buffer)
|
||||||
|
@ -769,3 +767,167 @@ VOID TuiFadeOut(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL TuiEditBox(PUCHAR MessageText, PUCHAR EditTextBuffer, U32 Length)
|
||||||
|
{
|
||||||
|
int width = 8;
|
||||||
|
int height = 1;
|
||||||
|
int curline = 0;
|
||||||
|
int i , j, k;
|
||||||
|
int x1, x2, y1, y2;
|
||||||
|
char temp[260];
|
||||||
|
char key;
|
||||||
|
int EditBoxLine;
|
||||||
|
int EditBoxStartX, EditBoxEndX;
|
||||||
|
int EditBoxCursorX;
|
||||||
|
int EditBoxTextCount;
|
||||||
|
int EditBoxTextDisplayIndex;
|
||||||
|
BOOL ReturnCode;
|
||||||
|
PVOID ScreenBuffer;
|
||||||
|
|
||||||
|
// Save the screen contents
|
||||||
|
ScreenBuffer = MmAllocateMemory(UiScreenWidth * UiScreenHeight * 2);
|
||||||
|
TuiSaveScreen(ScreenBuffer);
|
||||||
|
|
||||||
|
// Find the height
|
||||||
|
for (i=0; i<strlen(MessageText); i++)
|
||||||
|
{
|
||||||
|
if (MessageText[i] == '\n')
|
||||||
|
height++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find the width
|
||||||
|
for (i=0,j=0,k=0; i<height; i++)
|
||||||
|
{
|
||||||
|
while ((MessageText[j] != '\n') && (MessageText[j] != 0))
|
||||||
|
{
|
||||||
|
j++;
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (k > width)
|
||||||
|
width = k;
|
||||||
|
|
||||||
|
k = 0;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate box area
|
||||||
|
x1 = (UiScreenWidth - (width+2))/2;
|
||||||
|
x2 = x1 + width + 3;
|
||||||
|
y1 = ((UiScreenHeight - height - 2)/2) + 1;
|
||||||
|
y2 = y1 + height + 4;
|
||||||
|
|
||||||
|
// Draw the box
|
||||||
|
TuiDrawBox(x1, y1, x2, y2, D_VERT, D_HORZ, TRUE, TRUE, ATTR(UiMessageBoxFgColor, UiMessageBoxBgColor));
|
||||||
|
|
||||||
|
// Draw the text
|
||||||
|
for (i=0,j=0; i<strlen(MessageText)+1; i++)
|
||||||
|
{
|
||||||
|
if ((MessageText[i] == '\n') || (MessageText[i] == 0))
|
||||||
|
{
|
||||||
|
temp[j] = 0;
|
||||||
|
j = 0;
|
||||||
|
UiDrawText(x1+2, y1+1+curline, temp, ATTR(UiMessageBoxFgColor, UiMessageBoxBgColor));
|
||||||
|
curline++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
temp[j++] = MessageText[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
EditBoxTextCount = 0;
|
||||||
|
EditBoxLine = y2 - 2;
|
||||||
|
EditBoxStartX = x1 + 3;
|
||||||
|
EditBoxEndX = x2 - 3;
|
||||||
|
UiFillArea(EditBoxStartX, EditBoxLine, EditBoxEndX, EditBoxLine, ' ', ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
|
||||||
|
|
||||||
|
// Show the cursor
|
||||||
|
EditBoxCursorX = EditBoxStartX;
|
||||||
|
VideoSetTextCursorPosition(EditBoxCursorX, EditBoxLine);
|
||||||
|
VideoShowTextCursor();
|
||||||
|
|
||||||
|
// Draw status text
|
||||||
|
UiDrawStatusText("Press ENTER to continue, or ESC to cancel");
|
||||||
|
|
||||||
|
VideoCopyOffScreenBufferToVRAM();
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
if (kbhit())
|
||||||
|
{
|
||||||
|
key = getch();
|
||||||
|
if(key == KEY_EXTENDED)
|
||||||
|
{
|
||||||
|
key = getch();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(key == KEY_ENTER)
|
||||||
|
{
|
||||||
|
ReturnCode = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if(key == KEY_ESC)
|
||||||
|
{
|
||||||
|
ReturnCode = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (key == KEY_BACKSPACE) // Remove a character
|
||||||
|
{
|
||||||
|
if (EditBoxTextCount)
|
||||||
|
{
|
||||||
|
EditBoxTextCount--;
|
||||||
|
EditTextBuffer[EditBoxTextCount] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
beep();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Add this key to the buffer
|
||||||
|
{
|
||||||
|
if (EditBoxTextCount < Length - 1)
|
||||||
|
{
|
||||||
|
EditTextBuffer[EditBoxTextCount] = key;
|
||||||
|
EditBoxTextCount++;
|
||||||
|
EditTextBuffer[EditBoxTextCount] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
beep();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw the edit box background
|
||||||
|
UiFillArea(EditBoxStartX, EditBoxLine, EditBoxEndX, EditBoxLine, ' ', ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
|
||||||
|
|
||||||
|
// Fill the text in
|
||||||
|
if (EditBoxTextCount > (EditBoxEndX - EditBoxStartX))
|
||||||
|
{
|
||||||
|
EditBoxTextDisplayIndex = EditBoxTextCount - (EditBoxEndX - EditBoxStartX);
|
||||||
|
EditBoxCursorX = EditBoxEndX;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EditBoxTextDisplayIndex = 0;
|
||||||
|
EditBoxCursorX = EditBoxStartX + EditBoxTextCount;
|
||||||
|
}
|
||||||
|
UiDrawText(EditBoxStartX, EditBoxLine, &EditTextBuffer[EditBoxTextDisplayIndex], ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
|
||||||
|
|
||||||
|
// Move the cursor
|
||||||
|
VideoSetTextCursorPosition(EditBoxCursorX, EditBoxLine);
|
||||||
|
|
||||||
|
TuiUpdateDateTime();
|
||||||
|
|
||||||
|
VideoCopyOffScreenBufferToVRAM();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide the cursor again
|
||||||
|
VideoHideTextCursor();
|
||||||
|
|
||||||
|
// Restore the screen contents
|
||||||
|
TuiRestoreScreen(ScreenBuffer);
|
||||||
|
MmFreeMemory(ScreenBuffer);
|
||||||
|
|
||||||
|
return ReturnCode;
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -45,6 +45,7 @@ VOID TuiMessageBox(PUCHAR MessageText); // Displays a message box on the sc
|
||||||
VOID TuiMessageBoxCritical(PUCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources
|
VOID TuiMessageBoxCritical(PUCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources
|
||||||
VOID TuiDrawProgressBarCenter(U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
|
VOID TuiDrawProgressBarCenter(U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
|
||||||
VOID TuiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
|
VOID TuiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled
|
||||||
|
BOOL TuiEditBox(PUCHAR MessageText, PUCHAR EditTextBuffer, U32 Length);
|
||||||
|
|
||||||
UCHAR TuiTextToColor(PUCHAR ColorText); // Converts the text color into it's equivalent color value
|
UCHAR TuiTextToColor(PUCHAR ColorText); // Converts the text color into it's equivalent color value
|
||||||
UCHAR TuiTextToFillStyle(PUCHAR FillStyleText); // Converts the text fill into it's equivalent fill value
|
UCHAR TuiTextToFillStyle(PUCHAR FillStyleText); // Converts the text fill into it's equivalent fill value
|
||||||
|
@ -76,8 +77,8 @@ VOID TuiCalcMenuBoxSize(PTUI_MENU_INFO MenuInfo);
|
||||||
VOID TuiDrawMenu(PTUI_MENU_INFO MenuInfo);
|
VOID TuiDrawMenu(PTUI_MENU_INFO MenuInfo);
|
||||||
VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo);
|
VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo);
|
||||||
VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, U32 MenuItemNumber);
|
VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, U32 MenuItemNumber);
|
||||||
U32 TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo);
|
U32 TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterCallback KeyPressFilter);
|
||||||
BOOL TuiDisplayMenu(PUCHAR MenuItemList[], U32 MenuItemCount, U32 DefaultMenuItem, S32 MenuTimeOut, U32* SelectedMenuItem);
|
BOOL TuiDisplayMenu(PUCHAR MenuItemList[], U32 MenuItemCount, U32 DefaultMenuItem, S32 MenuTimeOut, U32* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -27,10 +27,11 @@
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
|
|
||||||
|
|
||||||
BOOL TuiDisplayMenu(PUCHAR MenuItemList[], U32 MenuItemCount, U32 DefaultMenuItem, S32 MenuTimeOut, U32* SelectedMenuItem)
|
BOOL TuiDisplayMenu(PUCHAR MenuItemList[], U32 MenuItemCount, U32 DefaultMenuItem, S32 MenuTimeOut, U32* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
|
||||||
{
|
{
|
||||||
TUI_MENU_INFO MenuInformation;
|
TUI_MENU_INFO MenuInformation;
|
||||||
U32 CurrentClockSecond;
|
U32 CurrentClockSecond;
|
||||||
|
U32 KeyPress;
|
||||||
|
|
||||||
//
|
//
|
||||||
// The first thing we need to check is the timeout
|
// The first thing we need to check is the timeout
|
||||||
|
@ -78,13 +79,21 @@ BOOL TuiDisplayMenu(PUCHAR MenuItemList[], U32 MenuItemCount, U32 DefaultMenuIte
|
||||||
//
|
//
|
||||||
// Process key presses
|
// Process key presses
|
||||||
//
|
//
|
||||||
if (TuiProcessMenuKeyboardEvent(&MenuInformation) == KEY_ENTER)
|
KeyPress = TuiProcessMenuKeyboardEvent(&MenuInformation, KeyPressFilter);
|
||||||
|
if (KeyPress == KEY_ENTER)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// If they pressed enter then exit this loop
|
// If they pressed enter then exit this loop
|
||||||
//
|
//
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if (CanEscape && KeyPress == KEY_ESC)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// They pressed escape, so just return FALSE
|
||||||
|
//
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update the date & time
|
// Update the date & time
|
||||||
|
@ -168,7 +177,7 @@ VOID TuiCalcMenuBoxSize(PTUI_MENU_INFO MenuInfo)
|
||||||
//
|
//
|
||||||
MenuInfo->Left = (UiScreenWidth - Width) / 2;
|
MenuInfo->Left = (UiScreenWidth - Width) / 2;
|
||||||
MenuInfo->Right = (MenuInfo->Left) + Width;
|
MenuInfo->Right = (MenuInfo->Left) + Width;
|
||||||
MenuInfo->Top = (( (UiScreenHeight - TUI_TITLE_BOX_CHAR_HEIGHT) - Height) / 2 + 1) + (TUI_TITLE_BOX_CHAR_HEIGHT / 2);
|
MenuInfo->Top = (((UiScreenHeight - TUI_TITLE_BOX_CHAR_HEIGHT) - Height) / 2) + TUI_TITLE_BOX_CHAR_HEIGHT;
|
||||||
MenuInfo->Bottom = (MenuInfo->Top) + Height;
|
MenuInfo->Bottom = (MenuInfo->Top) + Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,6 +185,16 @@ VOID TuiDrawMenu(PTUI_MENU_INFO MenuInfo)
|
||||||
{
|
{
|
||||||
U32 Idx;
|
U32 Idx;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Draw the backdrop
|
||||||
|
//
|
||||||
|
UiDrawBackdrop();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Update the status bar
|
||||||
|
//
|
||||||
|
UiDrawStatusText("Use \x18\x19 to select, then press ENTER.");
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw the menu box
|
// Draw the menu box
|
||||||
//
|
//
|
||||||
|
@ -196,11 +215,7 @@ VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo)
|
||||||
{
|
{
|
||||||
UCHAR MenuLineText[80];
|
UCHAR MenuLineText[80];
|
||||||
UCHAR TempString[80];
|
UCHAR TempString[80];
|
||||||
|
U32 Idx;
|
||||||
//
|
|
||||||
// Update the status bar
|
|
||||||
//
|
|
||||||
UiDrawStatusText("Use \x18\x19 to select, ENTER to boot.");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw the menu box
|
// Draw the menu box
|
||||||
|
@ -230,6 +245,18 @@ VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo)
|
||||||
MenuLineText,
|
MenuLineText,
|
||||||
ATTR(UiMenuFgColor, UiMenuBgColor));
|
ATTR(UiMenuFgColor, UiMenuBgColor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Now draw the separators
|
||||||
|
//
|
||||||
|
for (Idx=0; Idx<MenuInfo->MenuItemCount; Idx++)
|
||||||
|
{
|
||||||
|
if (stricmp(MenuInfo->MenuItemList[Idx], "SEPARATOR") == 0)
|
||||||
|
{
|
||||||
|
UiDrawText(MenuInfo->Left, MenuInfo->Top + Idx + 1, "\xC7", ATTR(UiMenuFgColor, UiMenuBgColor));
|
||||||
|
UiDrawText(MenuInfo->Right, MenuInfo->Top + Idx + 1, "\xB6", ATTR(UiMenuFgColor, UiMenuBgColor));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, U32 MenuItemNumber)
|
VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, U32 MenuItemNumber)
|
||||||
|
@ -239,6 +266,7 @@ VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, U32 MenuItemNumber)
|
||||||
U32 SpaceTotal;
|
U32 SpaceTotal;
|
||||||
U32 SpaceLeft;
|
U32 SpaceLeft;
|
||||||
U32 SpaceRight;
|
U32 SpaceRight;
|
||||||
|
UCHAR Attribute;
|
||||||
|
|
||||||
//
|
//
|
||||||
// We will want the string centered so calculate
|
// We will want the string centered so calculate
|
||||||
|
@ -270,6 +298,20 @@ VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, U32 MenuItemNumber)
|
||||||
strcat(MenuLineText, " ");
|
strcat(MenuLineText, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// If it is a separator then adjust the text accordingly
|
||||||
|
//
|
||||||
|
if (stricmp(MenuInfo->MenuItemList[MenuItemNumber], "SEPARATOR") == 0)
|
||||||
|
{
|
||||||
|
memset(MenuLineText, 0, 80);
|
||||||
|
memset(MenuLineText, 0xC4, (MenuInfo->Right - MenuInfo->Left - 1));
|
||||||
|
Attribute = ATTR(UiMenuFgColor, UiMenuBgColor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Attribute = ATTR(UiTextColor, UiMenuBgColor);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// If this is the selected menu item then draw it as selected
|
// If this is the selected menu item then draw it as selected
|
||||||
// otherwise just draw it using the normal colors
|
// otherwise just draw it using the normal colors
|
||||||
|
@ -286,11 +328,11 @@ VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, U32 MenuItemNumber)
|
||||||
UiDrawText(MenuInfo->Left + 1,
|
UiDrawText(MenuInfo->Left + 1,
|
||||||
MenuInfo->Top + 1 + MenuItemNumber,
|
MenuInfo->Top + 1 + MenuItemNumber,
|
||||||
MenuLineText,
|
MenuLineText,
|
||||||
ATTR(UiTextColor, UiMenuBgColor));
|
Attribute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo)
|
U32 TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterCallback KeyPressFilter)
|
||||||
{
|
{
|
||||||
U32 KeyEvent = 0;
|
U32 KeyEvent = 0;
|
||||||
|
|
||||||
|
@ -319,6 +361,21 @@ U32 TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo)
|
||||||
if (KeyEvent == 0)
|
if (KeyEvent == 0)
|
||||||
KeyEvent = getch(); // Yes - so get the extended key
|
KeyEvent = getch(); // Yes - so get the extended key
|
||||||
|
|
||||||
|
//
|
||||||
|
// Call the supplied key filter callback function to see
|
||||||
|
// if it is going to handle this keypress.
|
||||||
|
//
|
||||||
|
if (KeyPressFilter != NULL)
|
||||||
|
{
|
||||||
|
if (KeyPressFilter(KeyEvent))
|
||||||
|
{
|
||||||
|
// It processed the key character
|
||||||
|
TuiDrawMenu(MenuInfo);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Process the key
|
// Process the key
|
||||||
//
|
//
|
||||||
|
@ -334,6 +391,13 @@ U32 TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo)
|
||||||
// Update the menu
|
// Update the menu
|
||||||
//
|
//
|
||||||
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem + 1); // Deselect previous item
|
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem + 1); // Deselect previous item
|
||||||
|
|
||||||
|
// Skip past any separators
|
||||||
|
if (MenuInfo->SelectedMenuItem > 0 && stricmp(MenuInfo->MenuItemList[MenuInfo->SelectedMenuItem], "SEPARATOR") == 0)
|
||||||
|
{
|
||||||
|
MenuInfo->SelectedMenuItem--;
|
||||||
|
}
|
||||||
|
|
||||||
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem); // Select new item
|
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem); // Select new item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,6 +413,13 @@ U32 TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo)
|
||||||
// Update the menu
|
// Update the menu
|
||||||
//
|
//
|
||||||
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem - 1); // Deselect previous item
|
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem - 1); // Deselect previous item
|
||||||
|
|
||||||
|
// Skip past any separators
|
||||||
|
if (MenuInfo->SelectedMenuItem < (MenuInfo->MenuItemCount - 1) && stricmp(MenuInfo->MenuItemList[MenuInfo->SelectedMenuItem], "SEPARATOR") == 0)
|
||||||
|
{
|
||||||
|
MenuInfo->SelectedMenuItem++;
|
||||||
|
}
|
||||||
|
|
||||||
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem); // Select new item
|
TuiDrawMenuItem(MenuInfo, MenuInfo->SelectedMenuItem); // Select new item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -48,10 +48,10 @@ UCHAR UiMenuBgColor = COLOR_BLUE; // Menu background color
|
||||||
UCHAR UiTextColor = COLOR_YELLOW; // Normal text color
|
UCHAR UiTextColor = COLOR_YELLOW; // Normal text color
|
||||||
UCHAR UiSelectedTextColor = COLOR_BLACK; // Selected text color
|
UCHAR UiSelectedTextColor = COLOR_BLACK; // Selected text color
|
||||||
UCHAR UiSelectedTextBgColor = COLOR_GRAY; // Selected text background color
|
UCHAR UiSelectedTextBgColor = COLOR_GRAY; // Selected text background color
|
||||||
UCHAR UiTitleBoxTitleText[260] = "Boot Menu"; // Title box's title text
|
UCHAR UiEditBoxTextColor = COLOR_WHITE; // Edit box text color
|
||||||
|
UCHAR UiEditBoxBgColor = COLOR_BLACK; // Edit box text background color
|
||||||
|
|
||||||
PUCHAR UiMessageBoxLineText = NULL;
|
UCHAR UiTitleBoxTitleText[260] = "Boot Menu"; // Title box's title text
|
||||||
#define UIMESSAGEBOXLINETEXTSIZE 4096
|
|
||||||
|
|
||||||
BOOL UserInterfaceUp = FALSE; // Tells us if the user interface is displayed
|
BOOL UserInterfaceUp = FALSE; // Tells us if the user interface is displayed
|
||||||
|
|
||||||
|
@ -69,15 +69,6 @@ BOOL UiInitialize(VOID)
|
||||||
U32 VideoMode = VIDEOMODE_NORMAL_TEXT;
|
U32 VideoMode = VIDEOMODE_NORMAL_TEXT;
|
||||||
|
|
||||||
DbgPrint((DPRINT_UI, "Initializing User Interface.\n"));
|
DbgPrint((DPRINT_UI, "Initializing User Interface.\n"));
|
||||||
|
|
||||||
UiMessageBoxLineText = MmAllocateMemory(UIMESSAGEBOXLINETEXTSIZE);
|
|
||||||
|
|
||||||
if (UiMessageBoxLineText == NULL)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
RtlZeroMemory(UiMessageBoxLineText, UIMESSAGEBOXLINETEXTSIZE);
|
|
||||||
|
|
||||||
DbgPrint((DPRINT_UI, "Reading in UI settings from [Display] section.\n"));
|
DbgPrint((DPRINT_UI, "Reading in UI settings from [Display] section.\n"));
|
||||||
|
|
||||||
|
@ -192,6 +183,14 @@ BOOL UiInitialize(VOID)
|
||||||
{
|
{
|
||||||
UiSelectedTextBgColor = UiTextToColor(SettingText);
|
UiSelectedTextBgColor = UiTextToColor(SettingText);
|
||||||
}
|
}
|
||||||
|
if (IniReadSettingByName(SectionId, "EditBoxTextColor", SettingText, 260))
|
||||||
|
{
|
||||||
|
UiEditBoxTextColor = UiTextToColor(SettingText);
|
||||||
|
}
|
||||||
|
if (IniReadSettingByName(SectionId, "EditBoxColor", SettingText, 260))
|
||||||
|
{
|
||||||
|
UiEditBoxBgColor = UiTextToColor(SettingText);
|
||||||
|
}
|
||||||
if (IniReadSettingByName(SectionId, "SpecialEffects", SettingText, 260))
|
if (IniReadSettingByName(SectionId, "SpecialEffects", SettingText, 260))
|
||||||
{
|
{
|
||||||
if (stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
|
if (stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
|
||||||
|
@ -429,19 +428,15 @@ VOID UiMessageBox(PUCHAR MessageText)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat(UiMessageBoxLineText, MessageText);
|
|
||||||
|
|
||||||
if (UiDisplayMode == DISPLAYMODE_TEXT)
|
if (UiDisplayMode == DISPLAYMODE_TEXT)
|
||||||
{
|
{
|
||||||
TuiMessageBox(UiMessageBoxLineText);
|
TuiMessageBox(MessageText);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
//GuiMessageBox(UiMessageBoxLineText);
|
//GuiMessageBox(MessageText);
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlZeroMemory(UiMessageBoxLineText, UIMESSAGEBOXLINETEXTSIZE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID UiMessageBoxCritical(PUCHAR MessageText)
|
VOID UiMessageBoxCritical(PUCHAR MessageText)
|
||||||
|
@ -469,12 +464,6 @@ VOID UiMessageBoxCritical(PUCHAR MessageText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID UiMessageLine(PUCHAR MessageText)
|
|
||||||
{
|
|
||||||
strcat(UiMessageBoxLineText, MessageText);
|
|
||||||
strcat(UiMessageBoxLineText, "\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
UCHAR UiTextToColor(PUCHAR ColorText)
|
UCHAR UiTextToColor(PUCHAR ColorText)
|
||||||
{
|
{
|
||||||
if (UiDisplayMode == DISPLAYMODE_TEXT)
|
if (UiDisplayMode == DISPLAYMODE_TEXT)
|
||||||
|
@ -534,13 +523,10 @@ VOID UiShowMessageBoxesInSection(PUCHAR SectionName)
|
||||||
U32 Idx;
|
U32 Idx;
|
||||||
UCHAR SettingName[80];
|
UCHAR SettingName[80];
|
||||||
UCHAR SettingValue[80];
|
UCHAR SettingValue[80];
|
||||||
|
PUCHAR MessageBoxText;
|
||||||
|
U32 MessageBoxTextSize;
|
||||||
U32 SectionId;
|
U32 SectionId;
|
||||||
|
|
||||||
//
|
|
||||||
// Zero out message line text
|
|
||||||
//
|
|
||||||
strcpy(UiMessageBoxLineText, "");
|
|
||||||
|
|
||||||
if (!IniOpenSection(SectionName, &SectionId))
|
if (!IniOpenSection(SectionName, &SectionId))
|
||||||
{
|
{
|
||||||
sprintf(SettingName, "Section %s not found in freeldr.ini.\n", SectionName);
|
sprintf(SettingName, "Section %s not found in freeldr.ini.\n", SectionName);
|
||||||
|
@ -553,22 +539,53 @@ VOID UiShowMessageBoxesInSection(PUCHAR SectionName)
|
||||||
//
|
//
|
||||||
for (Idx=0; Idx<IniGetNumSectionItems(SectionId); Idx++)
|
for (Idx=0; Idx<IniGetNumSectionItems(SectionId); Idx++)
|
||||||
{
|
{
|
||||||
IniReadSettingByNumber(SectionId, Idx, SettingName, 80, SettingValue, 80);
|
IniReadSettingByNumber(SectionId, Idx, SettingName, 79, SettingValue, 79);
|
||||||
|
|
||||||
if (stricmp(SettingName, "MessageBox") == 0)
|
if (stricmp(SettingName, "MessageBox") == 0)
|
||||||
{
|
{
|
||||||
UiMessageBox(SettingValue);
|
// Get the real length of the MessageBox text
|
||||||
}
|
MessageBoxTextSize = IniGetSectionSettingValueSize(SectionId, Idx);
|
||||||
else if (stricmp(SettingName, "MessageLine") == 0)
|
|
||||||
{
|
//if (MessageBoxTextSize > 0)
|
||||||
UiMessageLine(SettingValue);
|
{
|
||||||
|
// Allocate enough memory to hold the text
|
||||||
|
MessageBoxText = (PUCHAR)MmAllocateMemory(MessageBoxTextSize);
|
||||||
|
|
||||||
|
if (MessageBoxText)
|
||||||
|
{
|
||||||
|
// Get the MessageBox text
|
||||||
|
IniReadSettingByNumber(SectionId, Idx, SettingName, 80, MessageBoxText, MessageBoxTextSize);
|
||||||
|
|
||||||
|
// Fix it up
|
||||||
|
UiEscapeString(MessageBoxText);
|
||||||
|
|
||||||
|
// Display it
|
||||||
|
UiMessageBox(MessageBoxText);
|
||||||
|
|
||||||
|
// Free the memory
|
||||||
|
MmFreeMemory(MessageBoxText);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
VOID UiEscapeString(PUCHAR String)
|
||||||
// Zero out message line text
|
{
|
||||||
//
|
U32 Idx;
|
||||||
strcpy(UiMessageBoxLineText, "");
|
|
||||||
|
for (Idx=0; Idx<strlen(String); Idx++)
|
||||||
|
{
|
||||||
|
// Escape the new line characters
|
||||||
|
if (String[Idx] == '\\' && String[Idx+1] == 'n')
|
||||||
|
{
|
||||||
|
// Escape the character
|
||||||
|
String[Idx] = '\n';
|
||||||
|
|
||||||
|
// Move the rest of the string up
|
||||||
|
strcpy(&String[Idx+1], &String[Idx+2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID UiTruncateStringEllipsis(PUCHAR StringText, U32 MaxChars)
|
VOID UiTruncateStringEllipsis(PUCHAR StringText, U32 MaxChars)
|
||||||
|
@ -579,17 +596,17 @@ VOID UiTruncateStringEllipsis(PUCHAR StringText, U32 MaxChars)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL UiDisplayMenu(PUCHAR MenuItemList[], U32 MenuItemCount, U32 DefaultMenuItem, S32 MenuTimeOut, U32* SelectedMenuItem)
|
BOOL UiDisplayMenu(PUCHAR MenuItemList[], U32 MenuItemCount, U32 DefaultMenuItem, S32 MenuTimeOut, U32* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
|
||||||
{
|
{
|
||||||
if (UiDisplayMode == DISPLAYMODE_TEXT)
|
if (UiDisplayMode == DISPLAYMODE_TEXT)
|
||||||
{
|
{
|
||||||
return TuiDisplayMenu(MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem);
|
return TuiDisplayMenu(MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem, CanEscape, KeyPressFilter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
//return GuiDisplayMenu(MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem);
|
//return GuiDisplayMenu(MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem, CanEscape, KeyPressFilter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,3 +635,17 @@ VOID UiFadeOut(VOID)
|
||||||
//GuiFadeInOut();
|
//GuiFadeInOut();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL UiEditBox(PUCHAR MessageText, PUCHAR EditTextBuffer, U32 Length)
|
||||||
|
{
|
||||||
|
if (UiDisplayMode == DISPLAYMODE_TEXT)
|
||||||
|
{
|
||||||
|
return TuiEditBox(MessageText, EditTextBuffer, Length);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
return FALSE;
|
||||||
|
//return GuiEditBox(MessageText, EditTextBuffer, Length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
#include <comm.h>
|
#include <portio.h>
|
||||||
|
|
||||||
|
|
||||||
#define RGB_MAX 64
|
#define RGB_MAX 64
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
#include <comm.h>
|
#include <portio.h>
|
||||||
|
|
||||||
|
|
||||||
VOID VideoSetPaletteColor(U8 Color, U8 Red, U8 Green, U8 Blue)
|
VOID VideoSetPaletteColor(U8 Color, U8 Red, U8 Green, U8 Blue)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
#include <comm.h>
|
#include <portio.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
#include <comm.h>
|
#include <portio.h>
|
||||||
#include <mm.h>
|
#include <mm.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* FreeLoader
|
||||||
* Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
|
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <video.h>
|
#include <video.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <comm.h>
|
#include <portio.h>
|
||||||
|
|
||||||
U32 CurrentVideoMode = VIDEOMODE_NORMAL_TEXT;
|
U32 CurrentVideoMode = VIDEOMODE_NORMAL_TEXT;
|
||||||
U32 VideoResolutionX = 80;
|
U32 VideoResolutionX = 80;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue