- PCHify freeldr and cleanup some headers (just a start).

Freeldr now compiles about 2-4 times faster.

svn path=/trunk/; revision=19190
This commit is contained in:
Alex Ionescu 2005-11-13 04:50:55 +00:00
parent 2fda11708c
commit 527ce70dc2
90 changed files with 483 additions and 891 deletions

View file

@ -17,14 +17,7 @@
* 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)

View file

@ -19,19 +19,9 @@
*/
#include <freeldr.h>
#include <arch.h>
#include <rtl.h>
#define NDEBUG
#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 MILLISEC (10)
#define PRECISION (8)

View file

@ -19,14 +19,9 @@
*/
#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;

View file

@ -19,15 +19,9 @@
*/
#include <freeldr.h>
#include <arch.h>
#include <rtl.h>
#define NDEBUG
#include <debug.h>
#include <mm.h>
#include <portio.h>
#include "../../reactos/registry.h"
#include "hardware.h"
static BOOL
FindApmBios(VOID)

View file

@ -19,15 +19,9 @@
*/
#include <freeldr.h>
#include <arch.h>
#include <rtl.h>
#define NDEBUG
#include <debug.h>
#include <mm.h>
#include <portio.h>
#include "../../reactos/registry.h"
#include "hardware.h"
#define MP_FP_SIGNATURE 0x5F504D5F /* "_MP_" */
#define MP_CT_SIGNATURE 0x504D4350 /* "PCMP" */

View file

@ -19,14 +19,9 @@
*/
#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
{

View file

@ -17,10 +17,10 @@
* 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

View file

@ -20,12 +20,9 @@
* 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

View file

@ -17,13 +17,7 @@
* 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)

View file

@ -17,11 +17,7 @@
* 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)

View file

@ -17,12 +17,7 @@
* 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

View file

@ -17,15 +17,10 @@
* 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
{

View file

@ -20,13 +20,10 @@
* 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)

View file

@ -17,10 +17,7 @@
* 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))

View file

@ -17,13 +17,10 @@
* 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

View file

@ -17,9 +17,7 @@
* 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;

View file

@ -22,13 +22,10 @@
*
*/
#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

View file

@ -19,9 +19,7 @@
* Note: Converted from the XFree vga.bdf font
*/
#include "freeldr.h"
#include "machine.h"
#include "machxbox.h"
#include <freeldr.h>
UCHAR XboxFont8x16[256 * 16] =
{

View file

@ -17,9 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "machine.h"
#include "machxbox.h"
#include <freeldr.h>
VOID
XboxHwDetect(VOID)

View file

@ -20,14 +20,7 @@
* 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;

View file

@ -17,10 +17,7 @@
* 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 */

View file

@ -20,12 +20,7 @@
* 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

View file

@ -18,24 +18,6 @@
*/
#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)
{

View file

@ -17,15 +17,10 @@
* 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

View file

@ -17,14 +17,9 @@
* 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>
///////////////////////////////////////////////////////////////////////////////////////

View file

@ -1,92 +0,0 @@
/*
* 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

View file

@ -19,8 +19,6 @@
*/
#include <freeldr.h>
#include <cmdline.h>
#include <rtl.h>
static CMDLINEINFO CmdLineInfo;

View file

@ -20,9 +20,6 @@
*/
#include <freeldr.h>
#include <comm.h>
#include <portio.h>
/* MACROS *******************************************************************/

View file

@ -18,18 +18,6 @@
*/
#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";

View file

@ -18,11 +18,6 @@
*/
#include <freeldr.h>
#include <debug.h>
#include <rtl.h>
#include <comm.h>
#include <portio.h>
#include <machine.h>
#ifdef DEBUG

View file

@ -18,12 +18,9 @@
*/
#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"));

View file

@ -18,13 +18,9 @@
*/
#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,

View file

@ -18,11 +18,8 @@
*/
#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

View file

@ -18,14 +18,9 @@
*/
#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)
{

View file

@ -106,4 +106,5 @@
<file>version.c</file>
<file>cmdline.c</file>
<file>machine.c</file>
<pch>include/freeldr.h</pch>
</module>

View file

@ -15,4 +15,5 @@
<file>linuxboot.c</file>
<file>oslist.c</file>
<file>custom.c</file>
<pch>include/freeldr.h</pch>
</module>

View file

@ -18,17 +18,9 @@
*/
#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

View file

@ -18,16 +18,9 @@
*/
#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 */

View file

@ -18,19 +18,9 @@
*/
#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

View file

@ -18,20 +18,9 @@
*/
#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>
#define NDEBUG
#include <debug.h>
#include <machine.h>
/////////////////////////////////////////////////////////////////////////////////////////////
// FUNCTIONS

View file

@ -18,17 +18,9 @@
*/
#include <freeldr.h>
#include <fs.h>
#include <disk.h>
#include <rtl.h>
#include <arch.h>
#include <mm.h>
#define NDEBUG
#include <debug.h>
#include <cache.h>
#include <machine.h>
#include "iso.h"
#define SECTORSIZE 2048

View file

@ -25,16 +25,9 @@
*/
#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;

View file

@ -21,6 +21,70 @@
#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);

View file

@ -29,11 +29,42 @@
#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")

View file

@ -20,6 +20,55 @@
#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);

View file

@ -35,6 +35,50 @@ typedef struct
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

View file

@ -1,56 +1,56 @@
/*
* 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
/*
* 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

View file

@ -1,150 +1,150 @@
/*
* 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
/*
* 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

View file

@ -28,12 +28,6 @@
/* 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

View file

@ -1,76 +0,0 @@
/*
* 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

View file

@ -18,12 +18,6 @@
*/
#include <freeldr.h>
#include "ini.h"
#include <fs.h>
#include <rtl.h>
#include <mm.h>
#include <debug.h>
BOOL IniFileInitialize(VOID)
{

View file

@ -18,11 +18,9 @@
*/
#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)
{

View file

@ -18,12 +18,9 @@
*/
#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;

View file

@ -19,21 +19,9 @@
#include <freeldr.h>
#include <arch.h>
#include <disk.h>
#include <miscboot.h>
#include <rtl.h>
#include <fs.h>
#include <ui.h>
#include <linux.h>
#define NDEBUG
#include <debug.h>
#include <mm.h>
#include <inifile.h>
#include <oslist.h> // For RemoveQuotes()
#include <video.h>
#include <drivemap.h>
#define LINUX_READ_CHUNK_SIZE 0x20000 // Read 128k at a time

View file

@ -17,8 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "freeldr.h"
#include "machine.h"
#include <freeldr.h>
#undef MachConsPutChar
#undef MachConsKbHit

View file

@ -17,17 +17,7 @@
* 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)
{

View file

@ -1,70 +0,0 @@
/*
* 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

View file

@ -18,14 +18,9 @@
*/
#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

View file

@ -18,13 +18,9 @@
*/
#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;

View file

@ -18,14 +18,6 @@
*/
#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[] =
{

View file

@ -18,11 +18,6 @@
*/
#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)
{

View file

@ -20,8 +20,6 @@
*/
#include <freeldr.h>
#include <rtl.h>
BOOL DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* BootPartition)
{

View file

@ -20,13 +20,10 @@
*/
#include <freeldr.h>
#include <rtl.h>
#include <mm.h>
#define NDEBUG
#include <debug.h>
#include "registry.h"
#define REG_HIVE_ID 0x66676572 /* "regf" */
#define REG_BIN_ID 0x6e696268 /* "hbin" */
#define REG_KEY_CELL_ID 0x6b6e

View file

@ -20,8 +20,6 @@
*/
#include <freeldr.h>
#include <../arch/i386/hardware.h>
#include <internal/i386/ke.h>
#define NDEBUG
#include <debug.h>

View file

@ -20,9 +20,6 @@
*/
#include <freeldr.h>
#include <reactos/rossym.h>
#include "registry.h"
#define NDEBUG
#include <debug.h>

View file

@ -19,12 +19,9 @@
*/
#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;

View file

@ -19,20 +19,6 @@
*/
#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

View file

@ -17,7 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <rtl.h>
#include <freeldr.h>
VOID RtlListInitializeHead(PLIST_ITEM ListHead)
{

View file

@ -18,9 +18,6 @@
*/
#include <freeldr.h>
#include <machine.h>
#include <rtl.h>
#include <stdarg.h>
/*
* print() - prints unformatted text to stdout

View file

@ -17,7 +17,7 @@
* 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

View file

@ -17,7 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <rtl.h>
#include <freeldr.h>
size_t strlen(const char *str)
{

View file

@ -18,13 +18,6 @@
*/
#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)
{

View file

@ -18,17 +18,6 @@
*/
#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;

View file

@ -18,15 +18,6 @@
*/
#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)
{

View file

@ -18,16 +18,10 @@
*/
#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

View file

@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#include <version.h>
#include <rtl.h>
CHAR FreeLoaderVersionString[80];

View file

@ -18,12 +18,6 @@
*/
#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;

View file

@ -18,9 +18,6 @@
*/
#include <freeldr.h>
#include <video.h>
#include <machine.h>
#define RGB_MAX 64
#define RGB_MAX_PER_ITERATION 64

View file

@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#include <video.h>
#include <machine.h>
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
{

View file

@ -18,12 +18,6 @@
*/
#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 */
//

View file

@ -18,11 +18,6 @@
*/
#include <freeldr.h>
#include <video.h>
#include <portio.h>
#include <mm.h>
#include <machine.h>
PVOID VideoOffScreenBuffer = NULL;