Freeldr now compiles about 2-4 times faster.
svn path=/trunk/; revision=19190
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "mm.h"
-#include "machine.h"
-#include "machpc.h"
-#include "machxbox.h"
-#include "portio.h"
-#include "hardware.h"
-#include "rtl.h"
+#include <freeldr.h>
VOID
MachInit(const char *CmdLine)
*/
#include <freeldr.h>
-#include <arch.h>
-#include <rtl.h>
-#include <debug.h>
-#include <disk.h>
-#include <mm.h>
-#include <machine.h>
-#include <portio.h>
-#include <video.h>
-
-#include "../../reactos/registry.h"
-#include "hardware.h"
-#include "machpc.h"
+#define NDEBUG
+#include <debug.h>
#define MILLISEC (10)
#define PRECISION (8)
*/
#include <freeldr.h>
-#include <arch.h>
-#include <rtl.h>
-#include <debug.h>
-#include <mm.h>
-#include <portio.h>
-#include "../../reactos/registry.h"
-#include "hardware.h"
+#define NDEBUG
+#include <debug.h>
BOOLEAN AcpiPresent = FALSE;
*/
#include <freeldr.h>
-#include <arch.h>
-#include <rtl.h>
-#include <debug.h>
-#include <mm.h>
-#include <portio.h>
-
-#include "../../reactos/registry.h"
-#include "hardware.h"
+#define NDEBUG
+#include <debug.h>
static BOOL
FindApmBios(VOID)
*/
#include <freeldr.h>
-#include <arch.h>
-#include <rtl.h>
-#include <debug.h>
-#include <mm.h>
-#include <portio.h>
-
-#include "../../reactos/registry.h"
-#include "hardware.h"
+#define NDEBUG
+#include <debug.h>
#define MP_FP_SIGNATURE 0x5F504D5F /* "_MP_" */
#define MP_CT_SIGNATURE 0x504D4350 /* "PCMP" */
*/
#include <freeldr.h>
-#include <arch.h>
-#include <rtl.h>
-#include <debug.h>
-#include <mm.h>
-#include <portio.h>
-#include "../../reactos/registry.h"
-#include "hardware.h"
+#define NDEBUG
+#include <debug.h>
typedef struct _ROUTING_SLOT
{
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "debug.h"
-#include "i386.h"
-#include "fsrec.h"
+#include <freeldr.h>
+
+#define NDEBUG
+#include <debug.h>
/////////////////////////////////////////////////////////////////////////////////////////////
// FUNCTIONS
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
#include <freeldr.h>
-#include <arch.h>
-#include <video.h>
-#include <portio.h>
-#include <rtl.h>
+
+#define NDEBUG
#include <debug.h>
typedef struct
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "mm.h"
-#include "arch.h"
-#include "machine.h"
-#include "machpc.h"
-#include "rtl.h"
-#include "i386.h"
+#include <freeldr.h>
VOID
PcMachInit(const char *CmdLine)
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "mm.h"
-#include "machine.h"
-#include "machxbox.h"
-#include "i386.h"
+#include <freeldr.h>
VOID
XboxMachInit(const char *CmdLine)
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "machine.h"
-#include "arch.h"
-#include "debug.h"
-#include "machpc.h"
-#include "rtl.h"
+#include <freeldr.h>
#define TEXTMODE_BUFFER 0xb8000
#define TEXTMODE_BUFFER_SIZE 0x8000
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "disk.h"
-#include "rtl.h"
-#include "arch.h"
-#include "debug.h"
-#include "portio.h"
-#include "machine.h"
-#include "machpc.h"
+#include <freeldr.h>
+#define NDEBUG
+#include <debug.h>
typedef struct
{
* was Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
*/
-#include "freeldr.h"
-#include "arch.h"
-#include "debug.h"
-#include "machine.h"
-#include "machpc.h"
-#include "portio.h"
-#include "rtl.h"
+#include <freeldr.h>
+
+#define NDEBUG
+#include <debug.h>
static ULONG
PcMemGetExtendedMemorySize(VOID)
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "arch.h"
-#include "machine.h"
-#include "machpc.h"
+#include <freeldr.h>
#define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f))
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "machine.h"
-#include "arch.h"
-#include "debug.h"
-#include "machpc.h"
-#include "rtl.h"
-#include "portio.h"
+#include <freeldr.h>
+
+#define NDEBUG
+#include <debug.h>
#define VIDEOPORT_PALETTE_READ 0x03C7
#define VIDEOPORT_PALETTE_WRITE 0x03C8
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "machine.h"
-#include "machxbox.h"
+#include <freeldr.h>
static unsigned CurrentCursorX = 0;
static unsigned CurrentCursorY = 0;
*
*/
-#include "freeldr.h"
-#include "debug.h"
-#include "hardware.h"
-#include "machine.h"
-#include "machxbox.h"
-#include "portio.h"
-#include "rtl.h"
+#include <freeldr.h>
+
+#define NDEBUG
+#include <debug.h>
#define XBOX_IDE_COMMAND_PORT 0x1f0
#define XBOX_IDE_CONTROL_PORT 0x170
* Note: Converted from the XFree vga.bdf font
*/
-#include "freeldr.h"
-#include "machine.h"
-#include "machxbox.h"
+#include <freeldr.h>
UCHAR XboxFont8x16[256 * 16] =
{
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "machine.h"
-#include "machxbox.h"
+#include <freeldr.h>
VOID
XboxHwDetect(VOID)
* by the Xbox Linux group: http://www.xbox-linux.org
*/
-#include "freeldr.h"
-#include "debug.h"
-#include "mm.h"
-#include "rtl.h"
-#include "hardware.h"
-#include "machine.h"
-#include "machxbox.h"
-#include "portio.h"
+#include <freeldr.h>
static ULONG InstalledMemoryMb = 0;
static ULONG AvailableMemoryMb = 0;
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "machine.h"
-#include "machxbox.h"
-#include "portio.h"
+#include <freeldr.h>
#define RTC_REGISTER_A 0x0A
#define RTC_REG_A_UIP 0x80 /* Update In Progress bit */
* by the Xbox Linux group: http://www.xbox-linux.org
*/
-#include "freeldr.h"
-#include "debug.h"
-#include "rtl.h"
-#include "machine.h"
-#include "machxbox.h"
-#include "portio.h"
+#include <freeldr.h>
#define I2C_IO_BASE 0xc000
*/
#include <freeldr.h>
-#include <rtl.h>
-#include <fs.h>
-#include <reactos.h>
-#include <ui.h>
-#include <arch.h>
-#include <miscboot.h>
-#include <linux.h>
-#include <mm.h>
-#include <inifile.h>
-#include <debug.h>
-#include <options.h>
-#include <oslist.h>
-#include <video.h>
-#include <bootmgr.h>
-#include <drivemap.h>
-#include <keycodes.h>
-#include <cmdline.h>
-#include <machine.h>
VOID RunLoader(VOID)
{
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
#include <freeldr.h>
-#include "cm.h"
-#include <mm.h>
-#include <disk.h>
-#include <rtl.h>
+
+#define NDEBUG
#include <debug.h>
-#include <arch.h>
-#include <machine.h>
// Returns a pointer to a CACHE_BLOCK structure
// Adds the block to the cache manager block list
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
#include <freeldr.h>
-#include "cm.h"
-#include <mm.h>
-#include <disk.h>
-#include <machine.h>
-#include <cache.h>
-#include <rtl.h>
+
+#define NDEBUG
#include <debug.h>
///////////////////////////////////////////////////////////////////////////////////////
+++ /dev/null
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
- *
- * 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.
- */
-
-
-#include <freeldr.h>
-#include <rtl.h>
-#include <disk.h>
-
-#ifndef __CM_H
-#define __CM_H
-
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// This structure describes a cached block element. The disk is divided up into
-// cache blocks. For disks which LBA is not supported each block is the size of
-// one track. This will force the cache manager to make track sized reads, and
-// therefore maximizes throughput. For disks which support LBA the block size
-// is 64k because they have no cylinder, head, or sector boundaries.
-//
-///////////////////////////////////////////////////////////////////////////////////////
-typedef struct
-{
- LIST_ITEM ListEntry; // Doubly linked list synchronization member
-
- ULONG BlockNumber; // Track index for CHS, 64k block index for LBA
- BOOL LockedInCache; // Indicates that this block is locked in cache memory
- ULONG AccessCount; // Access count for this block
-
- PVOID BlockData; // Pointer to block data
-
-} CACHE_BLOCK, *PCACHE_BLOCK;
-
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// This structure describes a cached drive. It contains the BIOS drive number
-// and indicates whether or not LBA is supported. If LBA is not supported then
-// the drive's geometry is described here.
-//
-///////////////////////////////////////////////////////////////////////////////////////
-typedef struct
-{
- ULONG DriveNumber;
- ULONG BytesPerSector;
-
- ULONG BlockSize; // Block size (in sectors)
- PCACHE_BLOCK CacheBlockHead;
-
-} CACHE_DRIVE, *PCACHE_DRIVE;
-
-
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// Internal data
-//
-///////////////////////////////////////////////////////////////////////////////////////
-extern CACHE_DRIVE CacheManagerDrive;
-extern BOOL CacheManagerInitialized;
-extern ULONG CacheBlockCount;
-extern ULONG CacheSizeLimit;
-extern ULONG CacheSizeCurrent;
-
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// Internal functions
-//
-///////////////////////////////////////////////////////////////////////////////////////
-PCACHE_BLOCK CacheInternalGetBlockPointer(PCACHE_DRIVE CacheDrive, ULONG BlockNumber); // Returns a pointer to a CACHE_BLOCK structure given a block number
-PCACHE_BLOCK CacheInternalFindBlock(PCACHE_DRIVE CacheDrive, ULONG BlockNumber); // Searches the block list for a particular block
-PCACHE_BLOCK CacheInternalAddBlockToCache(PCACHE_DRIVE CacheDrive, ULONG BlockNumber); // Adds a block to the cache's block list
-BOOL CacheInternalFreeBlock(PCACHE_DRIVE CacheDrive); // Removes a block from the cache's block list & frees the memory
-VOID CacheInternalCheckCacheSizeLimits(PCACHE_DRIVE CacheDrive); // Checks the cache size limits to see if we can add a new block, if not calls CacheInternalFreeBlock()
-VOID CacheInternalDumpBlockList(PCACHE_DRIVE CacheDrive); // Dumps the list of cached blocks to the debug output port
-VOID CacheInternalOptimizeBlockList(PCACHE_DRIVE CacheDrive, PCACHE_BLOCK CacheBlock); // Moves the specified block to the head of the list
-
-
-#endif // defined __CM_H
*/
#include <freeldr.h>
-#include <cmdline.h>
-#include <rtl.h>
static CMDLINEINFO CmdLineInfo;
*/
#include <freeldr.h>
-#include <comm.h>
-#include <portio.h>
-
/* MACROS *******************************************************************/
*/
#include <freeldr.h>
-#include <rtl.h>
-#include <ui.h>
-#include <options.h>
-#include <miscboot.h>
-#include <debug.h>
-#include <disk.h>
-#include <arch.h>
-#include <inifile.h>
-#include <linux.h>
-#include <reactos.h>
-#include <drivemap.h>
-#include <machine.h>
const CHAR BootDrivePrompt[] = "Enter the boot drive.\n\nExamples:\nfd0 - first floppy drive\nhd0 - first hard drive\nhd1 - second hard drive\ncd0 - first CD-ROM drive.\n\nBIOS drive numbers may also be used:\n0 - first floppy drive\n0x80 - first hard drive\n0x81 - second hard drive";
*/
#include <freeldr.h>
-#include <debug.h>
-#include <rtl.h>
-#include <comm.h>
-#include <portio.h>
-#include <machine.h>
#ifdef DEBUG
*/
#include <freeldr.h>
-#include <disk.h>
-#include <arch.h>
-#include <rtl.h>
-#include <ui.h>
-#include <debug.h>
+#define NDEBUG
+#include <debug.h>
#undef UNIMPLEMENTED
#define UNIMPLEMENTED BugCheck((DPRINT_WARNING, "Unimplemented\n"));
*/
#include <freeldr.h>
-#include <disk.h>
-#include <rtl.h>
-#include <mm.h>
-#include <debug.h>
-#include <arch.h>
-#include <machine.h>
+#define NDEBUG
+#include <debug.h>
BOOL DiskGetActivePartitionEntry(ULONG DriveNumber,
PPARTITION_TABLE_ENTRY PartitionTableEntry,
*/
#include <freeldr.h>
-#include <drivemap.h>
-#include <rtl.h>
-#include <inifile.h>
-#include <cache.h>
-#include <ui.h>
+
+#define NDEBUG
#include <debug.h>
BOOL DriveMapInstalled = FALSE; // Tells us if we have already installed our drive map int 13h handler code
*/
#include <freeldr.h>
-#include <rtl.h>
-#include <arch.h>
-#include <machine.h>
-#include <mm.h>
+
+#define NDEBUG
#include <debug.h>
-#include <bootmgr.h>
-#include <fs.h>
-#include <cmdline.h>
VOID BootMain(LPSTR CmdLine)
{
<file>version.c</file>
<file>cmdline.c</file>
<file>machine.c</file>
+ <pch>include/freeldr.h</pch>
</module>
<file>linuxboot.c</file>
<file>oslist.c</file>
<file>custom.c</file>
+ <pch>include/freeldr.h</pch>
</module>
*/
#include <freeldr.h>
-#include <fs.h>
-#include "ext2.h"
-#include <disk.h>
-#include <rtl.h>
-#include <ui.h>
-#include <arch.h>
-#include <mm.h>
-#include <debug.h>
-#include <cache.h>
-#include <machine.h>
+#define NDEBUG
+#include <debug.h>
GEOMETRY Ext2DiskGeometry; // Ext2 file system disk geometry
*/
#include <freeldr.h>
-#include <fs.h>
-#include "fat.h"
-#include <disk.h>
-#include <rtl.h>
-#include <ui.h>
-#include <arch.h>
-#include <mm.h>
+
+#define NDEBUG
#include <debug.h>
-#include <cache.h>
-#include <machine.h>
ULONG BytesPerSector; /* Number of bytes per sector */
ULONG SectorsPerCluster; /* Number of sectors per cluster */
*/
#include <freeldr.h>
-#include <fs.h>
-#include "fat.h"
-#include "iso.h"
-#include "ext2.h"
-#include "ntfs.h"
-#include "fsrec.h"
-#include <disk.h>
-#include <rtl.h>
-#include <ui.h>
-#include <arch.h>
-#include <debug.h>
-#include <machine.h>
+#define NDEBUG
+#include <debug.h>
/////////////////////////////////////////////////////////////////////////////////////////////
// DATA
*/
#include <freeldr.h>
-#include <fs.h>
-#include "fsrec.h"
-#include "fat.h"
-#include "iso.h"
-#include "ext2.h"
-#include "ntfs.h"
-#include <disk.h>
-#include <rtl.h>
-#include <arch.h>
-#include <debug.h>
-#include <machine.h>
-
-
+#define NDEBUG
+#include <debug.h>
/////////////////////////////////////////////////////////////////////////////////////////////
// FUNCTIONS
*/
#include <freeldr.h>
-#include <fs.h>
-#include <disk.h>
-#include <rtl.h>
-#include <arch.h>
-#include <mm.h>
-#include <debug.h>
-#include <cache.h>
-#include <machine.h>
-
-#include "iso.h"
+#define NDEBUG
+#include <debug.h>
#define SECTORSIZE 2048
*/
#include <freeldr.h>
-#include <fs.h>
-#include <disk.h>
-#include <rtl.h>
-#include <arch.h>
-#include <mm.h>
-#include <debug.h>
-#include <cache.h>
-#include <machine.h>
-#include "ntfs.h"
+#define NDEBUG
+#include <debug.h>
PNTFS_BOOTSECTOR NtfsBootSector;
ULONG NtfsClusterSize;
#ifndef __CACHE_H
#define __CACHE_H
+///////////////////////////////////////////////////////////////////////////////////////
+//
+// This structure describes a cached block element. The disk is divided up into
+// cache blocks. For disks which LBA is not supported each block is the size of
+// one track. This will force the cache manager to make track sized reads, and
+// therefore maximizes throughput. For disks which support LBA the block size
+// is 64k because they have no cylinder, head, or sector boundaries.
+//
+///////////////////////////////////////////////////////////////////////////////////////
+typedef struct
+{
+ LIST_ITEM ListEntry; // Doubly linked list synchronization member
+
+ ULONG BlockNumber; // Track index for CHS, 64k block index for LBA
+ BOOL LockedInCache; // Indicates that this block is locked in cache memory
+ ULONG AccessCount; // Access count for this block
+
+ PVOID BlockData; // Pointer to block data
+
+} CACHE_BLOCK, *PCACHE_BLOCK;
+
+///////////////////////////////////////////////////////////////////////////////////////
+//
+// This structure describes a cached drive. It contains the BIOS drive number
+// and indicates whether or not LBA is supported. If LBA is not supported then
+// the drive's geometry is described here.
+//
+///////////////////////////////////////////////////////////////////////////////////////
+typedef struct
+{
+ ULONG DriveNumber;
+ ULONG BytesPerSector;
+
+ ULONG BlockSize; // Block size (in sectors)
+ PCACHE_BLOCK CacheBlockHead;
+
+} CACHE_DRIVE, *PCACHE_DRIVE;
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+//
+// Internal data
+//
+///////////////////////////////////////////////////////////////////////////////////////
+extern CACHE_DRIVE CacheManagerDrive;
+extern BOOL CacheManagerInitialized;
+extern ULONG CacheBlockCount;
+extern ULONG CacheSizeLimit;
+extern ULONG CacheSizeCurrent;
+
+///////////////////////////////////////////////////////////////////////////////////////
+//
+// Internal functions
+//
+///////////////////////////////////////////////////////////////////////////////////////
+PCACHE_BLOCK CacheInternalGetBlockPointer(PCACHE_DRIVE CacheDrive, ULONG BlockNumber); // Returns a pointer to a CACHE_BLOCK structure given a block number
+PCACHE_BLOCK CacheInternalFindBlock(PCACHE_DRIVE CacheDrive, ULONG BlockNumber); // Searches the block list for a particular block
+PCACHE_BLOCK CacheInternalAddBlockToCache(PCACHE_DRIVE CacheDrive, ULONG BlockNumber); // Adds a block to the cache's block list
+BOOL CacheInternalFreeBlock(PCACHE_DRIVE CacheDrive); // Removes a block from the cache's block list & frees the memory
+VOID CacheInternalCheckCacheSizeLimits(PCACHE_DRIVE CacheDrive); // Checks the cache size limits to see if we can add a new block, if not calls CacheInternalFreeBlock()
+VOID CacheInternalDumpBlockList(PCACHE_DRIVE CacheDrive); // Dumps the list of cached blocks to the debug output port
+VOID CacheInternalOptimizeBlockList(PCACHE_DRIVE CacheDrive, PCACHE_BLOCK CacheBlock); // Moves the specified block to the head of the list
+
+
BOOL CacheInitializeDrive(ULONG DriveNumber);
VOID CacheInvalidateCacheData(VOID);
BOOL CacheReadDiskSectors(ULONG DiskNumber, ULONG StartSector, ULONG SectorCount, PVOID Buffer);
#include <ui.h>
#include <multiboot.h>
#include <mm.h>
+#include <cache.h>
#include <machine.h>
#include <inifile.h>
#include <video.h>
#include <portio.h>
#include <reactos.h>
+#include <registry.h>
+#include <fsrec.h>
+/* file system headers */
+#include <fs\ext2.h>
+#include <fs\fat.h>
+#include <fs\ntfs.h>
+#include <fs\iso.h>
+/* ui support */
+#include <ui\tui.h>
+#include <ui\gui.h>
+/* arch files */
+#include <arch\i386\hardware.h>
+#include <arch\i386\i386.h>
+#include <arch\i386\machpc.h>
+#include <arch\i386\machxbox.h>
+#include <internal/i386/ke.h>
+/* misc files */
+#include <keycodes.h>
+#include <version.h>
+#include <cmdline.h>
+/* Needed by boot manager */
+#include <bootmgr.h>
+#include <oslist.h>
+#include <drivemap.h>
+#include <miscboot.h>
+#include <options.h>
+#include <linux.h>
+/* Externals */
+#include <reactos/rossym.h>
+#include <reactos/buildno.h>
#define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n")
#ifndef __PARSEINI_H
#define __PARSEINI_H
+#define INI_FILE_COMMENT_CHAR ';'
+
+
+
+// This structure describes a single .ini file item
+// The item format in the .ini file is:
+// Name=Value
+typedef struct
+{
+ LIST_ITEM ListEntry;
+ PCHAR ItemName;
+ PCHAR ItemValue;
+
+} INI_SECTION_ITEM, *PINI_SECTION_ITEM;
+
+// This structure describes a .ini file section
+// The section format in the .ini file is:
+// [Section Name]
+// This structure has a list of section items with
+// one INI_SECTION_ITEM for each line in the section
+typedef struct
+{
+ LIST_ITEM ListEntry;
+ PCHAR SectionName;
+ ULONG SectionItemCount;
+ PINI_SECTION_ITEM SectionItemList;
+
+} INI_SECTION, *PINI_SECTION;
+
+extern PINI_SECTION IniFileSectionListHead;
+extern ULONG IniFileSectionCount;
+extern ULONG IniFileSettingCount;
+
+PFILE IniOpenIniFile();
+
+BOOL IniParseFile(PCHAR IniFileData, ULONG IniFileSize);
+ULONG IniGetNextLineSize(PCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset);
+ULONG IniGetNextLine(PCHAR IniFileData, ULONG IniFileSize, PCHAR Buffer, ULONG BufferSize, ULONG CurrentOffset);
+BOOL IniIsLineEmpty(PCHAR LineOfText, ULONG TextLength);
+BOOL IniIsCommentLine(PCHAR LineOfText, ULONG TextLength);
+BOOL IniIsSectionName(PCHAR LineOfText, ULONG TextLength);
+ULONG IniGetSectionNameSize(PCHAR SectionNameLine, ULONG LineLength);
+VOID IniExtractSectionName(PCHAR SectionName, PCHAR SectionNameLine, ULONG LineLength);
+BOOL IniIsSetting(PCHAR LineOfText, ULONG TextLength);
+ULONG IniGetSettingNameSize(PCHAR SettingNameLine, ULONG LineLength);
+ULONG IniGetSettingValueSize(PCHAR SettingValueLine, ULONG LineLength);
+VOID IniExtractSettingName(PCHAR SettingName, PCHAR SettingNameLine, ULONG LineLength);
+VOID IniExtractSettingValue(PCHAR SettingValue, PCHAR SettingValueLine, ULONG LineLength);
+
BOOL IniFileInitialize(VOID);
BOOL IniOpenSection(PCSTR SectionName, ULONG* SectionId);
ULONG Reserved;
} PACKED BIOS_MEMORY_MAP, *PBIOS_MEMORY_MAP;
+#if defined(__i386__) || defined(_PPC_)
+
+#define MM_PAGE_SIZE 4096
+
+#endif // defined __i386__ or _PPC_
+
+typedef struct
+{
+ ULONG PageAllocated; // Zero = free, non-zero = allocated
+ ULONG PageAllocationLength; // Number of pages allocated (or zero if this isn't the first page in the chain)
+} PACKED PAGE_LOOKUP_TABLE_ITEM, *PPAGE_LOOKUP_TABLE_ITEM;
+
+//
+// Define this to 1 if you want the entire contents
+// of the memory allocation bitmap displayed
+// when a chunk is allocated or freed
+//
+#define DUMP_MEM_MAP_ON_VERIFY 0
+
+
+
+extern PVOID PageLookupTableAddress;
+extern ULONG TotalPagesInLookupTable;
+extern ULONG FreePagesInLookupTable;
+extern ULONG LastFreePageHint;
+
+#ifdef DEBUG
+PUCHAR MmGetSystemMemoryMapTypeString(ULONG Type);
+#endif
+
+ULONG MmGetPageNumberFromAddress(PVOID Address); // Returns the page number that contains a linear address
+PVOID MmGetEndAddressOfAnyMemory(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Returns the last address of memory from the memory map
+ULONG MmGetAddressablePageCountIncludingHoles(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Returns the count of addressable pages from address zero including any memory holes and reserved memory regions
+PVOID MmFindLocationForPageLookupTable(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Returns the address for a memory chunk big enough to hold the page lookup table (starts search from end of memory)
+VOID MmSortBiosMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Sorts the BIOS_MEMORY_MAP array so the first element corresponds to the first address in memory
+VOID MmInitPageLookupTable(PVOID PageLookupTable, ULONG TotalPageCount, PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Inits the page lookup table according to the memory types in the memory map
+VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, ULONG PageAllocated); // Marks the specified pages as allocated or free in the lookup table
+VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount); // Allocates the specified pages in the lookup table
+ULONG MmCountFreePagesInLookupTable(PVOID PageLookupTable, ULONG TotalPageCount); // Returns the number of free pages in the lookup table
+ULONG MmFindAvailablePagesFromEnd(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded); // Returns the page number of the first available page range from the end of memory
+ULONG MmFindAvailablePagesBeforePage(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, ULONG LastPage); // Returns the page number of the first available page range before the specified page
+VOID MmFixupSystemMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG* MapCount); // Removes entries in the memory map that describe memory above 4G
+VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, ULONG TotalPageCount); // Sets the LastFreePageHint to the last usable page of memory
+BOOL MmAreMemoryPagesAvailable(PVOID PageLookupTable, ULONG TotalPageCount, PVOID PageAddress, ULONG PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE
ULONG GetSystemMemorySize(VOID); // Returns the amount of total memory in the system
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
- *
- * 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 __GUI_H
-#define __GUI_H
-
-#define TUI_SCREEN_MEM 0xB8000
-#define TITLE_BOX_CHAR_HEIGHT 5
-
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// Graphical User Interface Functions
-//
-///////////////////////////////////////////////////////////////////////////////////////
-VOID GuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
-VOID GuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
-VOID GuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
-VOID GuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOL Fill, BOOL Shadow, UCHAR Attr); // Draws a box around the area specified
-VOID GuiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr); // Draws text at coordinates specified
-VOID GuiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen
-VOID GuiUpdateDateTime(VOID); // Updates the date and time
-VOID GuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later
-VOID GuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save
-VOID GuiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button
-VOID GuiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources
-VOID GuiDrawProgressBar(ULONG Position, ULONG Range); // Draws the progress bar showing nPos percent filled
-
-UCHAR GuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value
-UCHAR GuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value
-
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// Menu Functions
-//
-///////////////////////////////////////////////////////////////////////////////////////
-BOOL GuiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem);
-
-
-
-#endif // #defined __GUI_H
+/*\r
+ * FreeLoader\r
+ * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ */\r
+\r
+#ifndef __GUI_H\r
+#define __GUI_H\r
+\r
+#define TUI_SCREEN_MEM 0xB8000\r
+#define TITLE_BOX_CHAR_HEIGHT 5\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Graphical User Interface Functions\r
+//\r
+///////////////////////////////////////////////////////////////////////////////////////\r
+VOID GuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop\r
+VOID GuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr\r
+VOID GuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified\r
+VOID GuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOL Fill, BOOL Shadow, UCHAR Attr); // Draws a box around the area specified\r
+VOID GuiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr); // Draws text at coordinates specified\r
+VOID GuiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen\r
+VOID GuiUpdateDateTime(VOID); // Updates the date and time\r
+VOID GuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later\r
+VOID GuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save\r
+VOID GuiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button\r
+VOID GuiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources\r
+VOID GuiDrawProgressBar(ULONG Position, ULONG Range); // Draws the progress bar showing nPos percent filled\r
+\r
+UCHAR GuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value\r
+UCHAR GuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Menu Functions\r
+//\r
+///////////////////////////////////////////////////////////////////////////////////////\r
+BOOL GuiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem);\r
+\r
+\r
+\r
+#endif // #defined __GUI_H\r
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
- *
- * 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 __TUI_H
-#define __TUI_H
-
-#define TUI_SCREEN_MEM 0xB8000
-#define TUI_TITLE_BOX_CHAR_HEIGHT 5
-
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// Textual User Interface Functions
-//
-///////////////////////////////////////////////////////////////////////////////////////
-BOOL TuiInitialize(VOID); // Initialize User-Interface
-VOID TuiUnInitialize(VOID); // Un-initialize User-Interface
-
-VOID TuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
-VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
-VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
-VOID TuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOL Fill, BOOL Shadow, UCHAR Attr); // Draws a box around the area specified
-VOID TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr); // Draws text at coordinates specified
-VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges
-VOID TuiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen
-VOID TuiUpdateDateTime(VOID); // Updates the date and time
-VOID TuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later
-VOID TuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save
-VOID TuiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button
-VOID TuiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources
-VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
-VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
-BOOL TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);
-
-UCHAR TuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value
-UCHAR TuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value
-
-VOID TuiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
-VOID TuiFadeOut(VOID); // Fades the screen out
-
-///////////////////////////////////////////////////////////////////////////////////////
-//
-// Menu Functions
-//
-///////////////////////////////////////////////////////////////////////////////////////
-
-typedef struct
-{
- PCSTR *MenuItemList;
- ULONG MenuItemCount;
- LONG MenuTimeRemaining;
- ULONG SelectedMenuItem;
-
- ULONG Left;
- ULONG Top;
- ULONG Right;
- ULONG Bottom;
-
-} TUI_MENU_INFO, *PTUI_MENU_INFO;
-
-VOID TuiCalcMenuBoxSize(PTUI_MENU_INFO MenuInfo);
-VOID TuiDrawMenu(PTUI_MENU_INFO MenuInfo);
-VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo);
-VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, ULONG MenuItemNumber);
-ULONG TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterCallback KeyPressFilter);
-BOOL TuiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
-
-
-/*
- * Combines the foreground and background colors into a single attribute byte
- */
-#define ATTR(cFore, cBack) ((cBack << 4)|cFore)
-
-/*
- * Fill styles for DrawBackdrop()
- */
-#define LIGHT_FILL 0xB0
-#define MEDIUM_FILL 0xB1
-#define DARK_FILL 0xB2
-
-/*
- * Screen colors
- */
-#define COLOR_BLACK 0
-#define COLOR_BLUE 1
-#define COLOR_GREEN 2
-#define COLOR_CYAN 3
-#define COLOR_RED 4
-#define COLOR_MAGENTA 5
-#define COLOR_BROWN 6
-#define COLOR_GRAY 7
-
-#define COLOR_DARKGRAY 8
-#define COLOR_LIGHTBLUE 9
-#define COLOR_LIGHTGREEN 10
-#define COLOR_LIGHTCYAN 11
-#define COLOR_LIGHTRED 12
-#define COLOR_LIGHTMAGENTA 13
-#define COLOR_YELLOW 14
-#define COLOR_WHITE 15
-
-/* Add COLOR_BLINK to a background to cause blinking */
-#define COLOR_BLINK 8
-
-/*
- * Defines for IBM box drawing characters
- */
-#define HORZ (0xc4) /* Single horizontal line */
-#define D_HORZ (0xcd) /* Double horizontal line.*/
-#define VERT (0xb3) /* Single vertical line */
-#define D_VERT (0xba) /* Double vertical line. */
-
-/* Definitions for corners, depending on HORIZ and VERT */
-#define UL (0xda)
-#define UR (0xbf) /* HORZ and VERT */
-#define LL (0xc0)
-#define LR (0xd9)
-
-#define D_UL (0xc9)
-#define D_UR (0xbb) /* D_HORZ and D_VERT */
-#define D_LL (0xc8)
-#define D_LR (0xbc)
-
-#define HD_UL (0xd5)
-#define HD_UR (0xb8) /* D_HORZ and VERT */
-#define HD_LL (0xd4)
-#define HD_LR (0xbe)
-
-#define VD_UL (0xd6)
-#define VD_UR (0xb7) /* HORZ and D_VERT */
-#define VD_LL (0xd3)
-#define VD_LR (0xbd)
-
-
-#endif // #defined __TUI_H
+/*\r
+ * FreeLoader\r
+ * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ */\r
+\r
+#ifndef __TUI_H\r
+#define __TUI_H\r
+\r
+#define TUI_SCREEN_MEM 0xB8000\r
+#define TUI_TITLE_BOX_CHAR_HEIGHT 5\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Textual User Interface Functions\r
+//\r
+///////////////////////////////////////////////////////////////////////////////////////\r
+BOOL TuiInitialize(VOID); // Initialize User-Interface\r
+VOID TuiUnInitialize(VOID); // Un-initialize User-Interface\r
+\r
+VOID TuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop\r
+VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr\r
+VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified\r
+VOID TuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOL Fill, BOOL Shadow, UCHAR Attr); // Draws a box around the area specified\r
+VOID TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr); // Draws text at coordinates specified\r
+VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges\r
+VOID TuiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen\r
+VOID TuiUpdateDateTime(VOID); // Updates the date and time\r
+VOID TuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later\r
+VOID TuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save\r
+VOID TuiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button\r
+VOID TuiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources\r
+VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled\r
+VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled\r
+BOOL TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);\r
+\r
+UCHAR TuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value\r
+UCHAR TuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value\r
+\r
+VOID TuiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in\r
+VOID TuiFadeOut(VOID); // Fades the screen out\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Menu Functions\r
+//\r
+///////////////////////////////////////////////////////////////////////////////////////\r
+\r
+typedef struct\r
+{\r
+ PCSTR *MenuItemList;\r
+ ULONG MenuItemCount;\r
+ LONG MenuTimeRemaining;\r
+ ULONG SelectedMenuItem;\r
+\r
+ ULONG Left;\r
+ ULONG Top;\r
+ ULONG Right;\r
+ ULONG Bottom;\r
+\r
+} TUI_MENU_INFO, *PTUI_MENU_INFO;\r
+\r
+VOID TuiCalcMenuBoxSize(PTUI_MENU_INFO MenuInfo);\r
+VOID TuiDrawMenu(PTUI_MENU_INFO MenuInfo);\r
+VOID TuiDrawMenuBox(PTUI_MENU_INFO MenuInfo);\r
+VOID TuiDrawMenuItem(PTUI_MENU_INFO MenuInfo, ULONG MenuItemNumber);\r
+ULONG TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterCallback KeyPressFilter);\r
+BOOL TuiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);\r
+\r
+\r
+/*\r
+ * Combines the foreground and background colors into a single attribute byte\r
+ */\r
+#define ATTR(cFore, cBack) ((cBack << 4)|cFore)\r
+\r
+/*\r
+ * Fill styles for DrawBackdrop()\r
+ */\r
+#define LIGHT_FILL 0xB0\r
+#define MEDIUM_FILL 0xB1\r
+#define DARK_FILL 0xB2\r
+\r
+/*\r
+ * Screen colors\r
+ */\r
+#define COLOR_BLACK 0\r
+#define COLOR_BLUE 1\r
+#define COLOR_GREEN 2\r
+#define COLOR_CYAN 3\r
+#define COLOR_RED 4\r
+#define COLOR_MAGENTA 5\r
+#define COLOR_BROWN 6\r
+#define COLOR_GRAY 7\r
+\r
+#define COLOR_DARKGRAY 8\r
+#define COLOR_LIGHTBLUE 9\r
+#define COLOR_LIGHTGREEN 10\r
+#define COLOR_LIGHTCYAN 11\r
+#define COLOR_LIGHTRED 12\r
+#define COLOR_LIGHTMAGENTA 13\r
+#define COLOR_YELLOW 14\r
+#define COLOR_WHITE 15\r
+\r
+/* Add COLOR_BLINK to a background to cause blinking */\r
+#define COLOR_BLINK 8\r
+\r
+/*\r
+ * Defines for IBM box drawing characters\r
+ */\r
+#define HORZ (0xc4) /* Single horizontal line */\r
+#define D_HORZ (0xcd) /* Double horizontal line.*/\r
+#define VERT (0xb3) /* Single vertical line */\r
+#define D_VERT (0xba) /* Double vertical line. */\r
+\r
+/* Definitions for corners, depending on HORIZ and VERT */\r
+#define UL (0xda)\r
+#define UR (0xbf) /* HORZ and VERT */\r
+#define LL (0xc0)\r
+#define LR (0xd9)\r
+\r
+#define D_UL (0xc9)\r
+#define D_UR (0xbb) /* D_HORZ and D_VERT */\r
+#define D_LL (0xc8)\r
+#define D_LR (0xbc)\r
+\r
+#define HD_UL (0xd5)\r
+#define HD_UR (0xb8) /* D_HORZ and VERT */\r
+#define HD_LL (0xd4)\r
+#define HD_LR (0xbe)\r
+\r
+#define VD_UL (0xd6)\r
+#define VD_UR (0xb7) /* HORZ and D_VERT */\r
+#define VD_LL (0xd3)\r
+#define VD_LR (0xbd)\r
+\r
+\r
+#endif // #defined __TUI_H\r
/* INCLUDES *****************************************************************/
#include <freeldr.h>
-#include <mm.h>
-#include <rtl.h>
-#include <fs.h>
-
-#include <inffile.h>
-
#define CONTROL_Z '\x1a'
#define MAX_SECTION_NAME_LEN 255
+++ /dev/null
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
- *
- * 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 __INI_H
-#define __INI_H
-
-#include <rtl.h>
-#include <fs.h>
-
-
-#define INI_FILE_COMMENT_CHAR ';'
-
-
-
-// This structure describes a single .ini file item
-// The item format in the .ini file is:
-// Name=Value
-typedef struct
-{
- LIST_ITEM ListEntry;
- PCHAR ItemName;
- PCHAR ItemValue;
-
-} INI_SECTION_ITEM, *PINI_SECTION_ITEM;
-
-// This structure describes a .ini file section
-// The section format in the .ini file is:
-// [Section Name]
-// This structure has a list of section items with
-// one INI_SECTION_ITEM for each line in the section
-typedef struct
-{
- LIST_ITEM ListEntry;
- PCHAR SectionName;
- ULONG SectionItemCount;
- PINI_SECTION_ITEM SectionItemList;
-
-} INI_SECTION, *PINI_SECTION;
-
-extern PINI_SECTION IniFileSectionListHead;
-extern ULONG IniFileSectionCount;
-extern ULONG IniFileSettingCount;
-
-PFILE IniOpenIniFile();
-
-BOOL IniParseFile(PCHAR IniFileData, ULONG IniFileSize);
-ULONG IniGetNextLineSize(PCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset);
-ULONG IniGetNextLine(PCHAR IniFileData, ULONG IniFileSize, PCHAR Buffer, ULONG BufferSize, ULONG CurrentOffset);
-BOOL IniIsLineEmpty(PCHAR LineOfText, ULONG TextLength);
-BOOL IniIsCommentLine(PCHAR LineOfText, ULONG TextLength);
-BOOL IniIsSectionName(PCHAR LineOfText, ULONG TextLength);
-ULONG IniGetSectionNameSize(PCHAR SectionNameLine, ULONG LineLength);
-VOID IniExtractSectionName(PCHAR SectionName, PCHAR SectionNameLine, ULONG LineLength);
-BOOL IniIsSetting(PCHAR LineOfText, ULONG TextLength);
-ULONG IniGetSettingNameSize(PCHAR SettingNameLine, ULONG LineLength);
-ULONG IniGetSettingValueSize(PCHAR SettingValueLine, ULONG LineLength);
-VOID IniExtractSettingName(PCHAR SettingName, PCHAR SettingNameLine, ULONG LineLength);
-VOID IniExtractSettingValue(PCHAR SettingValue, PCHAR SettingValueLine, ULONG LineLength);
-
-#endif // defined __INI_H
*/
#include <freeldr.h>
-#include "ini.h"
-#include <fs.h>
-#include <rtl.h>
-#include <mm.h>
-#include <debug.h>
-
BOOL IniFileInitialize(VOID)
{
*/
#include <freeldr.h>
-#include "ini.h"
-#include <ui.h>
-#include <rtl.h>
+
+#define NDEBUG
#include <debug.h>
-#include <mm.h>
BOOL IniOpenSection(PCSTR SectionName, ULONG* SectionId)
{
*/
#include <freeldr.h>
-#include "ini.h"
-#include <rtl.h>
-#include <mm.h>
-#include <debug.h>
-#include <machine.h>
+#define NDEBUG
+#include <debug.h>
PINI_SECTION IniFileSectionListHead = NULL;
ULONG IniFileSectionCount = 0;
#include <freeldr.h>
-#include <arch.h>
-#include <disk.h>
-#include <miscboot.h>
-#include <rtl.h>
-#include <fs.h>
-#include <ui.h>
-#include <linux.h>
-#include <debug.h>
-#include <mm.h>
-#include <inifile.h>
-#include <oslist.h> // For RemoveQuotes()
-#include <video.h>
-#include <drivemap.h>
-
+#define NDEBUG
+#include <debug.h>
#define LINUX_READ_CHUNK_SIZE 0x20000 // Read 128k at a time
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "freeldr.h"
-#include "machine.h"
+#include <freeldr.h>
#undef MachConsPutChar
#undef MachConsKbHit
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
#include <freeldr.h>
-#include <arch.h>
-#include <miscboot.h>
-#include <rtl.h>
-#include <fs.h>
-#include <ui.h>
-#include <inifile.h>
-#include <disk.h>
-#include <drivemap.h>
-#include <machine.h>
VOID LoadAndBootBootSector(PCSTR OperatingSystemName)
{
+++ /dev/null
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
- *
- * 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 __MEM_H
-#define __MEM_H
-
-
-#if defined(__i386__) || defined(_PPC_)
-
-#define MM_PAGE_SIZE 4096
-
-#endif // defined __i386__ or _PPC_
-
-typedef struct
-{
- ULONG PageAllocated; // Zero = free, non-zero = allocated
- ULONG PageAllocationLength; // Number of pages allocated (or zero if this isn't the first page in the chain)
-} PACKED PAGE_LOOKUP_TABLE_ITEM, *PPAGE_LOOKUP_TABLE_ITEM;
-
-//
-// Define this to 1 if you want the entire contents
-// of the memory allocation bitmap displayed
-// when a chunk is allocated or freed
-//
-#define DUMP_MEM_MAP_ON_VERIFY 0
-
-
-
-extern PVOID PageLookupTableAddress;
-extern ULONG TotalPagesInLookupTable;
-extern ULONG FreePagesInLookupTable;
-extern ULONG LastFreePageHint;
-
-#ifdef DEBUG
-PUCHAR MmGetSystemMemoryMapTypeString(ULONG Type);
-#endif
-
-ULONG MmGetPageNumberFromAddress(PVOID Address); // Returns the page number that contains a linear address
-PVOID MmGetEndAddressOfAnyMemory(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Returns the last address of memory from the memory map
-ULONG MmGetAddressablePageCountIncludingHoles(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Returns the count of addressable pages from address zero including any memory holes and reserved memory regions
-PVOID MmFindLocationForPageLookupTable(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Returns the address for a memory chunk big enough to hold the page lookup table (starts search from end of memory)
-VOID MmSortBiosMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Sorts the BIOS_MEMORY_MAP array so the first element corresponds to the first address in memory
-VOID MmInitPageLookupTable(PVOID PageLookupTable, ULONG TotalPageCount, PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount); // Inits the page lookup table according to the memory types in the memory map
-VOID MmMarkPagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount, ULONG PageAllocated); // Marks the specified pages as allocated or free in the lookup table
-VOID MmAllocatePagesInLookupTable(PVOID PageLookupTable, ULONG StartPage, ULONG PageCount); // Allocates the specified pages in the lookup table
-ULONG MmCountFreePagesInLookupTable(PVOID PageLookupTable, ULONG TotalPageCount); // Returns the number of free pages in the lookup table
-ULONG MmFindAvailablePagesFromEnd(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded); // Returns the page number of the first available page range from the end of memory
-ULONG MmFindAvailablePagesBeforePage(PVOID PageLookupTable, ULONG TotalPageCount, ULONG PagesNeeded, ULONG LastPage); // Returns the page number of the first available page range before the specified page
-VOID MmFixupSystemMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG* MapCount); // Removes entries in the memory map that describe memory above 4G
-VOID MmUpdateLastFreePageHint(PVOID PageLookupTable, ULONG TotalPageCount); // Sets the LastFreePageHint to the last usable page of memory
-BOOL MmAreMemoryPagesAvailable(PVOID PageLookupTable, ULONG TotalPageCount, PVOID PageAddress, ULONG PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE
-
-#endif // defined __MEM_H
*/
#include <freeldr.h>
-#include <arch.h>
-#include <mm.h>
-#include "mem.h"
-#include <rtl.h>
-#include <debug.h>
-#include <ui.h>
-#include <machine.h>
+#define NDEBUG
+#include <debug.h>
#ifdef DEBUG
typedef struct
*/
#include <freeldr.h>
-#include <mm.h>
-#include "mem.h"
-#include <rtl.h>
-#include <debug.h>
-#include <ui.h>
-#include <machine.h>
+#define NDEBUG
+#include <debug.h>
#ifdef DEBUG
ULONG AllocationCount = 0;
*/
#include <freeldr.h>
-#include <rtl.h>
-#include <ui.h>
-#include <options.h>
-#include <miscboot.h>
-#include <debug.h>
-#include <disk.h>
-#include <arch.h>
-
PCSTR OptionsMenuList[] =
{
*/
#include <freeldr.h>
-#include <inifile.h>
-#include <oslist.h>
-#include <rtl.h>
-#include <mm.h>
-#include <ui.h>
BOOL InitOperatingSystemList(PCSTR **SectionNamesPointer, PCSTR **DisplayNamesPointer, ULONG* OperatingSystemCountPointer)
{
*/
#include <freeldr.h>
-#include <rtl.h>
-
BOOL DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* BootPartition)
{
*/
#include <freeldr.h>
-#include <rtl.h>
-#include <mm.h>
-#include <debug.h>
-
-#include "registry.h"
+#define NDEBUG
+#include <debug.h>
#define REG_HIVE_ID 0x66676572 /* "regf" */
#define REG_BIN_ID 0x6e696268 /* "hbin" */
*/
#include <freeldr.h>
-#include <../arch/i386/hardware.h>
-#include <internal/i386/ke.h>
#define NDEBUG
#include <debug.h>
*/
#include <freeldr.h>
-#include <reactos/rossym.h>
-
-#include "registry.h"
#define NDEBUG
#include <debug.h>
*/
#include <freeldr.h>
-#include <mm.h>
-#include <rtl.h>
-#include <debug.h>
-#include "registry.h"
-#include <ui.h>
+#define NDEBUG
+#include <debug.h>
static FRLDRHKEY RootKey;
*/
#include <freeldr.h>
-#include <reactos/rossym.h>
-#include <debug.h>
-#include <arch.h>
-#include <disk.h>
-#include <reactos.h>
-#include <rtl.h>
-#include <fs.h>
-#include <multiboot.h>
-#include <mm.h>
-#include <machine.h>
-#include <ui.h>
-#include <inffile.h>
-
-#include "registry.h"
LOADER_PARAMETER_BLOCK LoaderBlock;
char reactos_kernel_cmdline[255]; // Command line passed to kernel
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <rtl.h>
+#include <freeldr.h>
VOID RtlListInitializeHead(PLIST_ITEM ListHead)
{
*/
#include <freeldr.h>
-#include <machine.h>
-#include <rtl.h>
-#include <stdarg.h>
/*
* print() - prints unformatted text to stdout
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <rtl.h>
+#include <freeldr.h>
/*
* convert_to_ascii() - converts a number to it's ascii equivalent
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <rtl.h>
+#include <freeldr.h>
size_t strlen(const char *str)
{
*/
#include <freeldr.h>
-#include <ui.h>
-#include "gui.h"
-#include <rtl.h>
-#include <mm.h>
-#include <debug.h>
-#include <inifile.h>
-#include <version.h>
VOID GuiDrawBackdrop(VOID)
{
*/
#include <freeldr.h>
-#include <ui.h>
-#include "tui.h"
-#include "keycodes.h"
-#include <rtl.h>
-#include <mm.h>
-#include <debug.h>
-#include <inifile.h>
-#include <version.h>
-#include <video.h>
-#include <machine.h>
-
PVOID TextVideoBuffer = NULL;
*/
#include <freeldr.h>
-#include <rtl.h>
-#include <ui.h>
-#include "tui.h"
-#include "keycodes.h"
-#include <options.h>
-#include <mm.h>
-#include <machine.h>
-#include <video.h>
-
BOOL TuiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
{
*/
#include <freeldr.h>
-#include <ui.h>
-#include "tui.h"
-#include <rtl.h>
-#include <mm.h>
-#include <machine.h>
+
+#define NDEBUG
#include <debug.h>
-#include <inifile.h>
-#include <version.h>
-#include <video.h>
-#include <reactos/buildno.h>
+
ULONG UiScreenWidth = 80; // Screen Width
ULONG UiScreenHeight = 25; // Screen Height
*/
#include <freeldr.h>
-#include <version.h>
-#include <rtl.h>
CHAR FreeLoaderVersionString[80];
*/
#include <freeldr.h>
-#include <video.h>
-#include <comm.h>
-#include <rtl.h>
-#include <debug.h>
-#include <machine.h>
-
#if 0 /* This stuff isn't used and as far as I'm concerned it can go - GvG */
U32 CurrentMemoryBank = 0;
*/
#include <freeldr.h>
-#include <video.h>
-#include <machine.h>
-
#define RGB_MAX 64
#define RGB_MAX_PER_ITERATION 64
*/
#include <freeldr.h>
-#include <video.h>
-#include <machine.h>
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
{
*/
#include <freeldr.h>
-#include <video.h>
-#include <portio.h>
-#include <debug.h>
-#include <machine.h>
-
-
#if 0 /* This stuff isn't used and as far as I'm concerned it can go - GvG */
//
*/
#include <freeldr.h>
-#include <video.h>
-#include <portio.h>
-#include <mm.h>
-#include <machine.h>
-
PVOID VideoOffScreenBuffer = NULL;