diff --git a/reactos/boot/freeldr/freeldr/arch/i386/archmach.c b/reactos/boot/freeldr/freeldr/arch/i386/archmach.c index d09f1dde2bb..2400029a00c 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/archmach.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/archmach.c @@ -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 VOID MachInit(const char *CmdLine) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c index 32b363b1d1c..5072c5ec798 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c @@ -19,19 +19,9 @@ */ #include -#include -#include + +#define NDEBUG #include -#include -#include -#include -#include -#include - -#include "../../reactos/registry.h" -#include "hardware.h" -#include "machpc.h" - #define MILLISEC (10) #define PRECISION (8) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c b/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c index ce935c082c5..05575b9ea08 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c @@ -19,14 +19,9 @@ */ #include -#include -#include -#include -#include -#include -#include "../../reactos/registry.h" -#include "hardware.h" +#define NDEBUG +#include BOOLEAN AcpiPresent = FALSE; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c b/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c index ccb17bdbd61..3708938786c 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c @@ -19,15 +19,9 @@ */ #include -#include -#include + +#define NDEBUG #include -#include -#include - -#include "../../reactos/registry.h" -#include "hardware.h" - static BOOL FindApmBios(VOID) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hwcpu.c b/reactos/boot/freeldr/freeldr/arch/i386/hwcpu.c index 9f80aefcba4..a3750b171f8 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hwcpu.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hwcpu.c @@ -19,15 +19,9 @@ */ #include -#include -#include + +#define NDEBUG #include -#include -#include - -#include "../../reactos/registry.h" -#include "hardware.h" - #define MP_FP_SIGNATURE 0x5F504D5F /* "_MP_" */ #define MP_CT_SIGNATURE 0x504D4350 /* "PCMP" */ diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c b/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c index 04f3e811c96..cea3a06dce5 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c @@ -19,14 +19,9 @@ */ #include -#include -#include -#include -#include -#include -#include "../../reactos/registry.h" -#include "hardware.h" +#define NDEBUG +#include typedef struct _ROUTING_SLOT { diff --git a/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c b/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c index 29b589f6dfe..d2bc5dec820 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c @@ -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 + +#define NDEBUG +#include ///////////////////////////////////////////////////////////////////////////////////////////// // FUNCTIONS diff --git a/reactos/boot/freeldr/freeldr/arch/i386/i386vid.c b/reactos/boot/freeldr/freeldr/arch/i386/i386vid.c index 0ca3c6dc64d..54edc29216e 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/i386vid.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/i386vid.c @@ -20,12 +20,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - #include -#include -#include -#include -#include + +#define NDEBUG #include typedef struct diff --git a/reactos/boot/freeldr/freeldr/arch/i386/machpc.c b/reactos/boot/freeldr/freeldr/arch/i386/machpc.c index dce27b27f83..c875dfeedd0 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/machpc.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/machpc.c @@ -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 VOID PcMachInit(const char *CmdLine) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c b/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c index bf4df218a75..f7ae6255c3f 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c @@ -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 VOID XboxMachInit(const char *CmdLine) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pccons.c b/reactos/boot/freeldr/freeldr/arch/i386/pccons.c index 45781dd287e..325ba621cb2 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pccons.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pccons.c @@ -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 #define TEXTMODE_BUFFER 0xb8000 #define TEXTMODE_BUFFER_SIZE 0x8000 diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c b/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c index ca65b467666..5473cbf5da8 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c @@ -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 +#define NDEBUG +#include typedef struct { diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c b/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c index e9da602bab6..9a85fee3c48 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c @@ -20,13 +20,10 @@ * was Copyright (C) 1998-2003 Brian Palmer */ -#include "freeldr.h" -#include "arch.h" -#include "debug.h" -#include "machine.h" -#include "machpc.h" -#include "portio.h" -#include "rtl.h" +#include + +#define NDEBUG +#include static ULONG PcMemGetExtendedMemorySize(VOID) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c b/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c index aad76981444..dbfb536c506 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c @@ -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 #define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f)) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c b/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c index 0a6c90fc546..9087472f99f 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c @@ -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 + +#define NDEBUG +#include #define VIDEOPORT_PALETTE_READ 0x03C7 #define VIDEOPORT_PALETTE_WRITE 0x03C8 diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxcons.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxcons.c index 9bcfbc28e17..546ef2c8b8e 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/xboxcons.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxcons.c @@ -17,9 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "freeldr.h" -#include "machine.h" -#include "machxbox.h" +#include static unsigned CurrentCursorX = 0; static unsigned CurrentCursorY = 0; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxdisk.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxdisk.c index 6ac2725e350..7fb4bcffbce 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/xboxdisk.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxdisk.c @@ -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 + +#define NDEBUG +#include #define XBOX_IDE_COMMAND_PORT 0x1f0 #define XBOX_IDE_CONTROL_PORT 0x170 diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxfont.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxfont.c index b07a81b01cc..287097de35e 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/xboxfont.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxfont.c @@ -19,9 +19,7 @@ * Note: Converted from the XFree vga.bdf font */ -#include "freeldr.h" -#include "machine.h" -#include "machxbox.h" +#include UCHAR XboxFont8x16[256 * 16] = { diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c index 38c0630db3a..f310a47febf 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c @@ -17,9 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "freeldr.h" -#include "machine.h" -#include "machxbox.h" +#include VOID XboxHwDetect(VOID) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxmem.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxmem.c index 67e244a9a8f..5c19934ef88 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/xboxmem.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxmem.c @@ -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 static ULONG InstalledMemoryMb = 0; static ULONG AvailableMemoryMb = 0; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxrtc.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxrtc.c index d6000b7cf93..c09c03a0b94 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/xboxrtc.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxrtc.c @@ -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 #define RTC_REGISTER_A 0x0A #define RTC_REG_A_UIP 0x80 /* Update In Progress bit */ diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c index fdcb67aaf0b..7668d4cee82 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxvideo.c @@ -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 #define I2C_IO_BASE 0xc000 diff --git a/reactos/boot/freeldr/freeldr/bootmgr.c b/reactos/boot/freeldr/freeldr/bootmgr.c index 896f7a6fe13..069fb1e9d40 100644 --- a/reactos/boot/freeldr/freeldr/bootmgr.c +++ b/reactos/boot/freeldr/freeldr/bootmgr.c @@ -18,24 +18,6 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include VOID RunLoader(VOID) { diff --git a/reactos/boot/freeldr/freeldr/cache/blocklist.c b/reactos/boot/freeldr/freeldr/cache/blocklist.c index 748606df3fe..213eba4c3fb 100644 --- a/reactos/boot/freeldr/freeldr/cache/blocklist.c +++ b/reactos/boot/freeldr/freeldr/cache/blocklist.c @@ -17,15 +17,10 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - #include -#include "cm.h" -#include -#include -#include + +#define NDEBUG #include -#include -#include // Returns a pointer to a CACHE_BLOCK structure // Adds the block to the cache manager block list diff --git a/reactos/boot/freeldr/freeldr/cache/cache.c b/reactos/boot/freeldr/freeldr/cache/cache.c index f17f19fc70d..26ac85c138c 100644 --- a/reactos/boot/freeldr/freeldr/cache/cache.c +++ b/reactos/boot/freeldr/freeldr/cache/cache.c @@ -17,14 +17,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - #include -#include "cm.h" -#include -#include -#include -#include -#include + +#define NDEBUG #include /////////////////////////////////////////////////////////////////////////////////////// diff --git a/reactos/boot/freeldr/freeldr/cache/cm.h b/reactos/boot/freeldr/freeldr/cache/cm.h deleted file mode 100644 index fd47241e866..00000000000 --- a/reactos/boot/freeldr/freeldr/cache/cm.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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 -#include -#include - -#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 diff --git a/reactos/boot/freeldr/freeldr/cmdline.c b/reactos/boot/freeldr/freeldr/cmdline.c index b6f42937936..791e9196b82 100644 --- a/reactos/boot/freeldr/freeldr/cmdline.c +++ b/reactos/boot/freeldr/freeldr/cmdline.c @@ -19,8 +19,6 @@ */ #include -#include -#include static CMDLINEINFO CmdLineInfo; diff --git a/reactos/boot/freeldr/freeldr/comm/rs232.c b/reactos/boot/freeldr/freeldr/comm/rs232.c index e814b0335ce..364bc0d6b1e 100644 --- a/reactos/boot/freeldr/freeldr/comm/rs232.c +++ b/reactos/boot/freeldr/freeldr/comm/rs232.c @@ -20,9 +20,6 @@ */ #include -#include -#include - /* MACROS *******************************************************************/ diff --git a/reactos/boot/freeldr/freeldr/custom.c b/reactos/boot/freeldr/freeldr/custom.c index 190d2c82ed7..38b61dd0620 100644 --- a/reactos/boot/freeldr/freeldr/custom.c +++ b/reactos/boot/freeldr/freeldr/custom.c @@ -18,18 +18,6 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include 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"; diff --git a/reactos/boot/freeldr/freeldr/debug.c b/reactos/boot/freeldr/freeldr/debug.c index 93193ceaf01..318af72d680 100644 --- a/reactos/boot/freeldr/freeldr/debug.c +++ b/reactos/boot/freeldr/freeldr/debug.c @@ -18,11 +18,6 @@ */ #include -#include -#include -#include -#include -#include #ifdef DEBUG diff --git a/reactos/boot/freeldr/freeldr/disk/disk.c b/reactos/boot/freeldr/freeldr/disk/disk.c index d3e79c38118..79c743ceb00 100644 --- a/reactos/boot/freeldr/freeldr/disk/disk.c +++ b/reactos/boot/freeldr/freeldr/disk/disk.c @@ -18,12 +18,9 @@ */ #include -#include -#include -#include -#include -#include +#define NDEBUG +#include #undef UNIMPLEMENTED #define UNIMPLEMENTED BugCheck((DPRINT_WARNING, "Unimplemented\n")); diff --git a/reactos/boot/freeldr/freeldr/disk/partition.c b/reactos/boot/freeldr/freeldr/disk/partition.c index c353dbaad4c..b4247ca2249 100644 --- a/reactos/boot/freeldr/freeldr/disk/partition.c +++ b/reactos/boot/freeldr/freeldr/disk/partition.c @@ -18,13 +18,9 @@ */ #include -#include -#include -#include -#include -#include -#include +#define NDEBUG +#include BOOL DiskGetActivePartitionEntry(ULONG DriveNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry, diff --git a/reactos/boot/freeldr/freeldr/drivemap.c b/reactos/boot/freeldr/freeldr/drivemap.c index e889024ce03..badc219cb88 100644 --- a/reactos/boot/freeldr/freeldr/drivemap.c +++ b/reactos/boot/freeldr/freeldr/drivemap.c @@ -18,11 +18,8 @@ */ #include -#include -#include -#include -#include -#include + +#define NDEBUG #include BOOL DriveMapInstalled = FALSE; // Tells us if we have already installed our drive map int 13h handler code diff --git a/reactos/boot/freeldr/freeldr/freeldr.c b/reactos/boot/freeldr/freeldr/freeldr.c index 407b709c0f8..3df673960ab 100644 --- a/reactos/boot/freeldr/freeldr/freeldr.c +++ b/reactos/boot/freeldr/freeldr/freeldr.c @@ -18,14 +18,9 @@ */ #include -#include -#include -#include -#include + +#define NDEBUG #include -#include -#include -#include VOID BootMain(LPSTR CmdLine) { diff --git a/reactos/boot/freeldr/freeldr/freeldr_base.xml b/reactos/boot/freeldr/freeldr/freeldr_base.xml index 0fee2e133cb..f20a5a5a63a 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_base.xml +++ b/reactos/boot/freeldr/freeldr/freeldr_base.xml @@ -106,4 +106,5 @@ version.c cmdline.c machine.c + include/freeldr.h diff --git a/reactos/boot/freeldr/freeldr/freeldr_main.xml b/reactos/boot/freeldr/freeldr/freeldr_main.xml index a2703fb6edb..4c8c6f581a6 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_main.xml +++ b/reactos/boot/freeldr/freeldr/freeldr_main.xml @@ -15,4 +15,5 @@ linuxboot.c oslist.c custom.c + include/freeldr.h diff --git a/reactos/boot/freeldr/freeldr/fs/ext2.c b/reactos/boot/freeldr/freeldr/fs/ext2.c index 5473c54ff3a..18c5442f86e 100644 --- a/reactos/boot/freeldr/freeldr/fs/ext2.c +++ b/reactos/boot/freeldr/freeldr/fs/ext2.c @@ -18,17 +18,9 @@ */ #include -#include -#include "ext2.h" -#include -#include -#include -#include -#include -#include -#include -#include +#define NDEBUG +#include GEOMETRY Ext2DiskGeometry; // Ext2 file system disk geometry diff --git a/reactos/boot/freeldr/freeldr/fs/fat.c b/reactos/boot/freeldr/freeldr/fs/fat.c index 714fa8668ef..0b9265c6773 100644 --- a/reactos/boot/freeldr/freeldr/fs/fat.c +++ b/reactos/boot/freeldr/freeldr/fs/fat.c @@ -18,16 +18,9 @@ */ #include -#include -#include "fat.h" -#include -#include -#include -#include -#include + +#define NDEBUG #include -#include -#include ULONG BytesPerSector; /* Number of bytes per sector */ ULONG SectorsPerCluster; /* Number of sectors per cluster */ diff --git a/reactos/boot/freeldr/freeldr/fs/fs.c b/reactos/boot/freeldr/freeldr/fs/fs.c index f2aabe257cd..b6234fae0ac 100644 --- a/reactos/boot/freeldr/freeldr/fs/fs.c +++ b/reactos/boot/freeldr/freeldr/fs/fs.c @@ -18,19 +18,9 @@ */ #include -#include -#include "fat.h" -#include "iso.h" -#include "ext2.h" -#include "ntfs.h" -#include "fsrec.h" -#include -#include -#include -#include -#include -#include +#define NDEBUG +#include ///////////////////////////////////////////////////////////////////////////////////////////// // DATA diff --git a/reactos/boot/freeldr/freeldr/fs/fsrec.c b/reactos/boot/freeldr/freeldr/fs/fsrec.c index 8c0a2e69e3c..e96c3057aef 100644 --- a/reactos/boot/freeldr/freeldr/fs/fsrec.c +++ b/reactos/boot/freeldr/freeldr/fs/fsrec.c @@ -18,20 +18,9 @@ */ #include -#include -#include "fsrec.h" -#include "fat.h" -#include "iso.h" -#include "ext2.h" -#include "ntfs.h" -#include -#include -#include + +#define NDEBUG #include -#include - - - ///////////////////////////////////////////////////////////////////////////////////////////// // FUNCTIONS diff --git a/reactos/boot/freeldr/freeldr/fs/iso.c b/reactos/boot/freeldr/freeldr/fs/iso.c index 157e81f41d5..4eb9478b2a3 100644 --- a/reactos/boot/freeldr/freeldr/fs/iso.c +++ b/reactos/boot/freeldr/freeldr/fs/iso.c @@ -18,17 +18,9 @@ */ #include -#include -#include -#include -#include -#include + +#define NDEBUG #include -#include -#include - -#include "iso.h" - #define SECTORSIZE 2048 diff --git a/reactos/boot/freeldr/freeldr/fs/ntfs.c b/reactos/boot/freeldr/freeldr/fs/ntfs.c index 555738ecea2..1f8e51324fb 100644 --- a/reactos/boot/freeldr/freeldr/fs/ntfs.c +++ b/reactos/boot/freeldr/freeldr/fs/ntfs.c @@ -25,16 +25,9 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ntfs.h" +#define NDEBUG +#include PNTFS_BOOTSECTOR NtfsBootSector; ULONG NtfsClusterSize; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hardware.h b/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h similarity index 100% rename from reactos/boot/freeldr/freeldr/arch/i386/hardware.h rename to reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h diff --git a/reactos/boot/freeldr/freeldr/arch/i386/i386.h b/reactos/boot/freeldr/freeldr/include/arch/i386/i386.h similarity index 100% rename from reactos/boot/freeldr/freeldr/arch/i386/i386.h rename to reactos/boot/freeldr/freeldr/include/arch/i386/i386.h diff --git a/reactos/boot/freeldr/freeldr/arch/i386/machpc.h b/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h similarity index 100% rename from reactos/boot/freeldr/freeldr/arch/i386/machpc.h rename to reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h diff --git a/reactos/boot/freeldr/freeldr/arch/i386/machxbox.h b/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h similarity index 100% rename from reactos/boot/freeldr/freeldr/arch/i386/machxbox.h rename to reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h diff --git a/reactos/boot/freeldr/freeldr/include/cache.h b/reactos/boot/freeldr/freeldr/include/cache.h index f1f7529f2e7..3e96e7db015 100644 --- a/reactos/boot/freeldr/freeldr/include/cache.h +++ b/reactos/boot/freeldr/freeldr/include/cache.h @@ -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); diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h index 8192934a542..203ee7c7edd 100644 --- a/reactos/boot/freeldr/freeldr/include/freeldr.h +++ b/reactos/boot/freeldr/freeldr/include/freeldr.h @@ -29,11 +29,42 @@ #include #include #include +#include #include #include #include #include #include +#include +#include +/* file system headers */ +#include +#include +#include +#include +/* ui support */ +#include +#include +/* arch files */ +#include +#include +#include +#include +#include +/* misc files */ +#include +#include +#include +/* Needed by boot manager */ +#include +#include +#include +#include +#include +#include +/* Externals */ +#include +#include #define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n") diff --git a/reactos/boot/freeldr/freeldr/fs/ext2.h b/reactos/boot/freeldr/freeldr/include/fs/ext2.h similarity index 100% rename from reactos/boot/freeldr/freeldr/fs/ext2.h rename to reactos/boot/freeldr/freeldr/include/fs/ext2.h diff --git a/reactos/boot/freeldr/freeldr/fs/fat.h b/reactos/boot/freeldr/freeldr/include/fs/fat.h similarity index 100% rename from reactos/boot/freeldr/freeldr/fs/fat.h rename to reactos/boot/freeldr/freeldr/include/fs/fat.h diff --git a/reactos/boot/freeldr/freeldr/fs/iso.h b/reactos/boot/freeldr/freeldr/include/fs/iso.h similarity index 100% rename from reactos/boot/freeldr/freeldr/fs/iso.h rename to reactos/boot/freeldr/freeldr/include/fs/iso.h diff --git a/reactos/boot/freeldr/freeldr/fs/ntfs.h b/reactos/boot/freeldr/freeldr/include/fs/ntfs.h similarity index 100% rename from reactos/boot/freeldr/freeldr/fs/ntfs.h rename to reactos/boot/freeldr/freeldr/include/fs/ntfs.h diff --git a/reactos/boot/freeldr/freeldr/include/inifile.h b/reactos/boot/freeldr/freeldr/include/inifile.h index 2fd46235786..ec0a22e549a 100644 --- a/reactos/boot/freeldr/freeldr/include/inifile.h +++ b/reactos/boot/freeldr/freeldr/include/inifile.h @@ -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); diff --git a/reactos/boot/freeldr/freeldr/include/mm.h b/reactos/boot/freeldr/freeldr/include/mm.h index ccd6aaaa933..599f9e17524 100644 --- a/reactos/boot/freeldr/freeldr/include/mm.h +++ b/reactos/boot/freeldr/freeldr/include/mm.h @@ -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 diff --git a/reactos/boot/freeldr/freeldr/reactos/registry.h b/reactos/boot/freeldr/freeldr/include/registry.h similarity index 100% rename from reactos/boot/freeldr/freeldr/reactos/registry.h rename to reactos/boot/freeldr/freeldr/include/registry.h diff --git a/reactos/boot/freeldr/freeldr/ui/gui.h b/reactos/boot/freeldr/freeldr/include/ui/gui.h similarity index 98% rename from reactos/boot/freeldr/freeldr/ui/gui.h rename to reactos/boot/freeldr/freeldr/include/ui/gui.h index 0b431488ebc..87b3ec760f8 100644 --- a/reactos/boot/freeldr/freeldr/ui/gui.h +++ b/reactos/boot/freeldr/freeldr/include/ui/gui.h @@ -1,56 +1,56 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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 + * + * 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 diff --git a/reactos/boot/freeldr/freeldr/ui/tui.h b/reactos/boot/freeldr/freeldr/include/ui/tui.h similarity index 97% rename from reactos/boot/freeldr/freeldr/ui/tui.h rename to reactos/boot/freeldr/freeldr/include/ui/tui.h index c014930100e..cece7b89eff 100644 --- a/reactos/boot/freeldr/freeldr/ui/tui.h +++ b/reactos/boot/freeldr/freeldr/include/ui/tui.h @@ -1,150 +1,150 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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 + * + * 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 diff --git a/reactos/boot/freeldr/freeldr/inffile/inffile.c b/reactos/boot/freeldr/freeldr/inffile/inffile.c index ede74807f9d..2d2f86ba2f8 100644 --- a/reactos/boot/freeldr/freeldr/inffile/inffile.c +++ b/reactos/boot/freeldr/freeldr/inffile/inffile.c @@ -28,12 +28,6 @@ /* INCLUDES *****************************************************************/ #include -#include -#include -#include - -#include - #define CONTROL_Z '\x1a' #define MAX_SECTION_NAME_LEN 255 diff --git a/reactos/boot/freeldr/freeldr/inifile/ini.h b/reactos/boot/freeldr/freeldr/inifile/ini.h deleted file mode 100644 index c80930a337a..00000000000 --- a/reactos/boot/freeldr/freeldr/inifile/ini.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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 -#include - - -#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 diff --git a/reactos/boot/freeldr/freeldr/inifile/ini_init.c b/reactos/boot/freeldr/freeldr/inifile/ini_init.c index 84ba9edf3bd..4efad484177 100644 --- a/reactos/boot/freeldr/freeldr/inifile/ini_init.c +++ b/reactos/boot/freeldr/freeldr/inifile/ini_init.c @@ -18,12 +18,6 @@ */ #include -#include "ini.h" -#include -#include -#include -#include - BOOL IniFileInitialize(VOID) { diff --git a/reactos/boot/freeldr/freeldr/inifile/inifile.c b/reactos/boot/freeldr/freeldr/inifile/inifile.c index ecbb8a08e5e..18adad729aa 100644 --- a/reactos/boot/freeldr/freeldr/inifile/inifile.c +++ b/reactos/boot/freeldr/freeldr/inifile/inifile.c @@ -18,11 +18,9 @@ */ #include -#include "ini.h" -#include -#include + +#define NDEBUG #include -#include BOOL IniOpenSection(PCSTR SectionName, ULONG* SectionId) { diff --git a/reactos/boot/freeldr/freeldr/inifile/parse.c b/reactos/boot/freeldr/freeldr/inifile/parse.c index 9f70905ec07..c8d9c615534 100644 --- a/reactos/boot/freeldr/freeldr/inifile/parse.c +++ b/reactos/boot/freeldr/freeldr/inifile/parse.c @@ -18,12 +18,9 @@ */ #include -#include "ini.h" -#include -#include -#include -#include +#define NDEBUG +#include PINI_SECTION IniFileSectionListHead = NULL; ULONG IniFileSectionCount = 0; diff --git a/reactos/boot/freeldr/freeldr/linuxboot.c b/reactos/boot/freeldr/freeldr/linuxboot.c index d98e9166c58..19c3cd163c9 100644 --- a/reactos/boot/freeldr/freeldr/linuxboot.c +++ b/reactos/boot/freeldr/freeldr/linuxboot.c @@ -19,21 +19,9 @@ #include -#include -#include -#include -#include -#include -#include -#include + +#define NDEBUG #include -#include -#include -#include // For RemoveQuotes() -#include -#include - - #define LINUX_READ_CHUNK_SIZE 0x20000 // Read 128k at a time diff --git a/reactos/boot/freeldr/freeldr/machine.c b/reactos/boot/freeldr/freeldr/machine.c index 4940a92c6cc..c28308a2b91 100644 --- a/reactos/boot/freeldr/freeldr/machine.c +++ b/reactos/boot/freeldr/freeldr/machine.c @@ -17,8 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "freeldr.h" -#include "machine.h" +#include #undef MachConsPutChar #undef MachConsKbHit diff --git a/reactos/boot/freeldr/freeldr/miscboot.c b/reactos/boot/freeldr/freeldr/miscboot.c index 5a45bfa154c..49182954352 100644 --- a/reactos/boot/freeldr/freeldr/miscboot.c +++ b/reactos/boot/freeldr/freeldr/miscboot.c @@ -17,17 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - #include -#include -#include -#include -#include -#include -#include -#include -#include -#include VOID LoadAndBootBootSector(PCSTR OperatingSystemName) { diff --git a/reactos/boot/freeldr/freeldr/mm/mem.h b/reactos/boot/freeldr/freeldr/mm/mem.h deleted file mode 100644 index 89b96cdde98..00000000000 --- a/reactos/boot/freeldr/freeldr/mm/mem.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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 diff --git a/reactos/boot/freeldr/freeldr/mm/meminit.c b/reactos/boot/freeldr/freeldr/mm/meminit.c index 75b73f63046..dbf1dab3817 100644 --- a/reactos/boot/freeldr/freeldr/mm/meminit.c +++ b/reactos/boot/freeldr/freeldr/mm/meminit.c @@ -18,14 +18,9 @@ */ #include -#include -#include -#include "mem.h" -#include -#include -#include -#include +#define NDEBUG +#include #ifdef DEBUG typedef struct diff --git a/reactos/boot/freeldr/freeldr/mm/mm.c b/reactos/boot/freeldr/freeldr/mm/mm.c index 2d44930e9f6..31513936882 100644 --- a/reactos/boot/freeldr/freeldr/mm/mm.c +++ b/reactos/boot/freeldr/freeldr/mm/mm.c @@ -18,13 +18,9 @@ */ #include -#include -#include "mem.h" -#include -#include -#include -#include +#define NDEBUG +#include #ifdef DEBUG ULONG AllocationCount = 0; diff --git a/reactos/boot/freeldr/freeldr/options.c b/reactos/boot/freeldr/freeldr/options.c index 31d9e57ea08..fa9cc89ca35 100644 --- a/reactos/boot/freeldr/freeldr/options.c +++ b/reactos/boot/freeldr/freeldr/options.c @@ -18,14 +18,6 @@ */ #include -#include -#include -#include -#include -#include -#include -#include - PCSTR OptionsMenuList[] = { diff --git a/reactos/boot/freeldr/freeldr/oslist.c b/reactos/boot/freeldr/freeldr/oslist.c index fb001f53c73..0a6459bc522 100644 --- a/reactos/boot/freeldr/freeldr/oslist.c +++ b/reactos/boot/freeldr/freeldr/oslist.c @@ -18,11 +18,6 @@ */ #include -#include -#include -#include -#include -#include BOOL InitOperatingSystemList(PCSTR **SectionNamesPointer, PCSTR **DisplayNamesPointer, ULONG* OperatingSystemCountPointer) { diff --git a/reactos/boot/freeldr/freeldr/reactos/arcname.c b/reactos/boot/freeldr/freeldr/reactos/arcname.c index fd689c5a83c..b81757ef0fb 100644 --- a/reactos/boot/freeldr/freeldr/reactos/arcname.c +++ b/reactos/boot/freeldr/freeldr/reactos/arcname.c @@ -20,8 +20,6 @@ */ #include -#include - BOOL DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* BootPartition) { diff --git a/reactos/boot/freeldr/freeldr/reactos/binhive.c b/reactos/boot/freeldr/freeldr/reactos/binhive.c index 8c3edb61c85..fa948ba3b6f 100644 --- a/reactos/boot/freeldr/freeldr/reactos/binhive.c +++ b/reactos/boot/freeldr/freeldr/reactos/binhive.c @@ -20,13 +20,10 @@ */ #include -#include -#include + +#define NDEBUG #include -#include "registry.h" - - #define REG_HIVE_ID 0x66676572 /* "regf" */ #define REG_BIN_ID 0x6e696268 /* "hbin" */ #define REG_KEY_CELL_ID 0x6b6e diff --git a/reactos/boot/freeldr/freeldr/reactos/loader.c b/reactos/boot/freeldr/freeldr/reactos/loader.c index 9ba450e9eca..2d3fa5a95d3 100644 --- a/reactos/boot/freeldr/freeldr/reactos/loader.c +++ b/reactos/boot/freeldr/freeldr/reactos/loader.c @@ -20,8 +20,6 @@ */ #include -#include <../arch/i386/hardware.h> -#include #define NDEBUG #include diff --git a/reactos/boot/freeldr/freeldr/reactos/reactos.c b/reactos/boot/freeldr/freeldr/reactos/reactos.c index 2ced6268452..5a33f525c94 100644 --- a/reactos/boot/freeldr/freeldr/reactos/reactos.c +++ b/reactos/boot/freeldr/freeldr/reactos/reactos.c @@ -20,9 +20,6 @@ */ #include -#include - -#include "registry.h" #define NDEBUG #include diff --git a/reactos/boot/freeldr/freeldr/reactos/registry.c b/reactos/boot/freeldr/freeldr/reactos/registry.c index c00ae732c5e..151ac7f45e9 100644 --- a/reactos/boot/freeldr/freeldr/reactos/registry.c +++ b/reactos/boot/freeldr/freeldr/reactos/registry.c @@ -19,12 +19,9 @@ */ #include -#include -#include -#include -#include "registry.h" -#include +#define NDEBUG +#include static FRLDRHKEY RootKey; diff --git a/reactos/boot/freeldr/freeldr/reactos/setupldr.c b/reactos/boot/freeldr/freeldr/reactos/setupldr.c index 48204ffde37..dabb0a08808 100644 --- a/reactos/boot/freeldr/freeldr/reactos/setupldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/setupldr.c @@ -19,20 +19,6 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "registry.h" LOADER_PARAMETER_BLOCK LoaderBlock; char reactos_kernel_cmdline[255]; // Command line passed to kernel diff --git a/reactos/boot/freeldr/freeldr/rtl/list.c b/reactos/boot/freeldr/freeldr/rtl/list.c index 30a2d6ea33c..8f1d97cb45c 100644 --- a/reactos/boot/freeldr/freeldr/rtl/list.c +++ b/reactos/boot/freeldr/freeldr/rtl/list.c @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include VOID RtlListInitializeHead(PLIST_ITEM ListHead) { diff --git a/reactos/boot/freeldr/freeldr/rtl/print.c b/reactos/boot/freeldr/freeldr/rtl/print.c index 42c1fd37559..e1674236bd7 100644 --- a/reactos/boot/freeldr/freeldr/rtl/print.c +++ b/reactos/boot/freeldr/freeldr/rtl/print.c @@ -18,9 +18,6 @@ */ #include -#include -#include -#include /* * print() - prints unformatted text to stdout diff --git a/reactos/boot/freeldr/freeldr/rtl/stdlib.c b/reactos/boot/freeldr/freeldr/rtl/stdlib.c index 2c09c8b5b92..0176bdbca10 100644 --- a/reactos/boot/freeldr/freeldr/rtl/stdlib.c +++ b/reactos/boot/freeldr/freeldr/rtl/stdlib.c @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include /* * convert_to_ascii() - converts a number to it's ascii equivalent diff --git a/reactos/boot/freeldr/freeldr/rtl/string.c b/reactos/boot/freeldr/freeldr/rtl/string.c index 7f5c76e639c..741455b94b2 100644 --- a/reactos/boot/freeldr/freeldr/rtl/string.c +++ b/reactos/boot/freeldr/freeldr/rtl/string.c @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include size_t strlen(const char *str) { diff --git a/reactos/boot/freeldr/freeldr/ui/gui.c b/reactos/boot/freeldr/freeldr/ui/gui.c index 2339ce94671..5f4b40c14bf 100644 --- a/reactos/boot/freeldr/freeldr/ui/gui.c +++ b/reactos/boot/freeldr/freeldr/ui/gui.c @@ -18,13 +18,6 @@ */ #include -#include -#include "gui.h" -#include -#include -#include -#include -#include VOID GuiDrawBackdrop(VOID) { diff --git a/reactos/boot/freeldr/freeldr/ui/tui.c b/reactos/boot/freeldr/freeldr/ui/tui.c index 3c0874adb2d..f123685c246 100644 --- a/reactos/boot/freeldr/freeldr/ui/tui.c +++ b/reactos/boot/freeldr/freeldr/ui/tui.c @@ -18,17 +18,6 @@ */ #include -#include -#include "tui.h" -#include "keycodes.h" -#include -#include -#include -#include -#include -#include -#include - PVOID TextVideoBuffer = NULL; diff --git a/reactos/boot/freeldr/freeldr/ui/tuimenu.c b/reactos/boot/freeldr/freeldr/ui/tuimenu.c index 923612da3dd..f0b9c998933 100644 --- a/reactos/boot/freeldr/freeldr/ui/tuimenu.c +++ b/reactos/boot/freeldr/freeldr/ui/tuimenu.c @@ -18,15 +18,6 @@ */ #include -#include -#include -#include "tui.h" -#include "keycodes.h" -#include -#include -#include -#include - BOOL TuiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter) { diff --git a/reactos/boot/freeldr/freeldr/ui/ui.c b/reactos/boot/freeldr/freeldr/ui/ui.c index f2056c6ae0f..945609c515d 100644 --- a/reactos/boot/freeldr/freeldr/ui/ui.c +++ b/reactos/boot/freeldr/freeldr/ui/ui.c @@ -18,16 +18,10 @@ */ #include -#include -#include "tui.h" -#include -#include -#include + +#define NDEBUG #include -#include -#include -#include -#include + ULONG UiScreenWidth = 80; // Screen Width ULONG UiScreenHeight = 25; // Screen Height diff --git a/reactos/boot/freeldr/freeldr/version.c b/reactos/boot/freeldr/freeldr/version.c index c16704d307e..df10e52d362 100644 --- a/reactos/boot/freeldr/freeldr/version.c +++ b/reactos/boot/freeldr/freeldr/version.c @@ -18,8 +18,6 @@ */ #include -#include -#include CHAR FreeLoaderVersionString[80]; diff --git a/reactos/boot/freeldr/freeldr/video/bank.c b/reactos/boot/freeldr/freeldr/video/bank.c index 6139befc20f..6b835d0d392 100644 --- a/reactos/boot/freeldr/freeldr/video/bank.c +++ b/reactos/boot/freeldr/freeldr/video/bank.c @@ -18,12 +18,6 @@ */ #include -#include -#include -#include -#include -#include - #if 0 /* This stuff isn't used and as far as I'm concerned it can go - GvG */ U32 CurrentMemoryBank = 0; diff --git a/reactos/boot/freeldr/freeldr/video/fade.c b/reactos/boot/freeldr/freeldr/video/fade.c index 65b019c5eb8..14cedf980e1 100644 --- a/reactos/boot/freeldr/freeldr/video/fade.c +++ b/reactos/boot/freeldr/freeldr/video/fade.c @@ -18,9 +18,6 @@ */ #include -#include -#include - #define RGB_MAX 64 #define RGB_MAX_PER_ITERATION 64 diff --git a/reactos/boot/freeldr/freeldr/video/palette.c b/reactos/boot/freeldr/freeldr/video/palette.c index 102012139ae..b1a8e737307 100644 --- a/reactos/boot/freeldr/freeldr/video/palette.c +++ b/reactos/boot/freeldr/freeldr/video/palette.c @@ -18,8 +18,6 @@ */ #include -#include -#include VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount) { diff --git a/reactos/boot/freeldr/freeldr/video/pixel.c b/reactos/boot/freeldr/freeldr/video/pixel.c index 71aa0e50c6e..4b798feb0d9 100644 --- a/reactos/boot/freeldr/freeldr/video/pixel.c +++ b/reactos/boot/freeldr/freeldr/video/pixel.c @@ -18,12 +18,6 @@ */ #include -#include -#include -#include -#include - - #if 0 /* This stuff isn't used and as far as I'm concerned it can go - GvG */ // diff --git a/reactos/boot/freeldr/freeldr/video/video.c b/reactos/boot/freeldr/freeldr/video/video.c index 2b69d5f7598..80f94cea7cc 100644 --- a/reactos/boot/freeldr/freeldr/video/video.c +++ b/reactos/boot/freeldr/freeldr/video/video.c @@ -18,11 +18,6 @@ */ #include -#include -#include -#include -#include - PVOID VideoOffScreenBuffer = NULL;