mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[FREELDR] Move files where they are only used.
- Merge fade.c/palette.c/video.c into video.c and move it into UI. - Move inffile.c into NTLDR.
This commit is contained in:
parent
e125297f7f
commit
fba4ad4ceb
|
@ -40,6 +40,8 @@ list(APPEND FREELDR_BOOTLIB_SOURCE
|
||||||
lib/arcsupp.c
|
lib/arcsupp.c
|
||||||
lib/debug.c
|
lib/debug.c
|
||||||
lib/peloader.c
|
lib/peloader.c
|
||||||
|
lib/cache/blocklist.c
|
||||||
|
lib/cache/cache.c
|
||||||
lib/comm/rs232.c
|
lib/comm/rs232.c
|
||||||
## add KD support
|
## add KD support
|
||||||
lib/fs/btrfs.c
|
lib/fs/btrfs.c
|
||||||
|
@ -64,10 +66,8 @@ list(APPEND FREELDR_NTLDR_SOURCE
|
||||||
|
|
||||||
list(APPEND FREELDR_ARC_SOURCE
|
list(APPEND FREELDR_ARC_SOURCE
|
||||||
arcname.c
|
arcname.c
|
||||||
machine.c
|
arch/arcemul.c
|
||||||
arch/archwsup.c
|
arch/archwsup.c
|
||||||
cache/blocklist.c
|
|
||||||
cache/cache.c
|
|
||||||
disk/disk.c
|
disk/disk.c
|
||||||
disk/partition.c
|
disk/partition.c
|
||||||
disk/ramdisk.c)
|
disk/ramdisk.c)
|
||||||
|
@ -89,9 +89,7 @@ list(APPEND FREELDR_BOOTMGR_SOURCE
|
||||||
ui/tui.c
|
ui/tui.c
|
||||||
ui/tuimenu.c
|
ui/tuimenu.c
|
||||||
ui/ui.c
|
ui/ui.c
|
||||||
video/fade.c
|
ui/video.c)
|
||||||
video/palette.c
|
|
||||||
video/video.c)
|
|
||||||
|
|
||||||
list(APPEND FREELDR_BASE_ASM_SOURCE)
|
list(APPEND FREELDR_BASE_ASM_SOURCE)
|
||||||
|
|
||||||
|
@ -226,7 +224,7 @@ list(APPEND FREELDR_BASE_SOURCE
|
||||||
## even if ${FREELDR_NTLDR_SOURCE} is not added,
|
## even if ${FREELDR_NTLDR_SOURCE} is not added,
|
||||||
## otherwise we get linking errors with Rtl**Bitmap** APIs.
|
## otherwise we get linking errors with Rtl**Bitmap** APIs.
|
||||||
## Do not happen on MSVC builds however...
|
## Do not happen on MSVC builds however...
|
||||||
lib/inffile/inffile.c
|
ntldr/inffile.c
|
||||||
lib/rtl/libsupp.c)
|
lib/rtl/libsupp.c)
|
||||||
|
|
||||||
if(ARCH STREQUAL "i386")
|
if(ARCH STREQUAL "i386")
|
||||||
|
|
|
@ -1215,6 +1215,12 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Implemented in i386vid.c, returns the VESA version
|
||||||
|
USHORT BiosIsVesaSupported(VOID);
|
||||||
|
BOOLEAN BiosIsVesaDdcSupported(VOID);
|
||||||
|
BOOLEAN BiosVesaReadEdid(VOID);
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
|
DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,7 +65,6 @@
|
||||||
#include <comm.h>
|
#include <comm.h>
|
||||||
#include <disk.h>
|
#include <disk.h>
|
||||||
#include <fs.h>
|
#include <fs.h>
|
||||||
#include <inffile.h>
|
|
||||||
#include <inifile.h>
|
#include <inifile.h>
|
||||||
#include <keycodes.h>
|
#include <keycodes.h>
|
||||||
#include <linux.h>
|
#include <linux.h>
|
||||||
|
@ -79,11 +78,11 @@
|
||||||
#include <ramdisk.h>
|
#include <ramdisk.h>
|
||||||
#include <ui.h>
|
#include <ui.h>
|
||||||
#include <ver.h>
|
#include <ver.h>
|
||||||
#include <video.h>
|
|
||||||
|
|
||||||
/* NTOS loader */
|
/* NTOS loader */
|
||||||
#include <winldr.h>
|
#include <include/ntldr/winldr.h>
|
||||||
#include <conversion.h> // More-or-less related to MM also...
|
#include <conversion.h> // More-or-less related to MM also...
|
||||||
|
#include <peloader.h>
|
||||||
|
|
||||||
/* File system headers */
|
/* File system headers */
|
||||||
#include <fs/ext2.h>
|
#include <fs/ext2.h>
|
||||||
|
@ -98,6 +97,7 @@
|
||||||
#include <ui/minitui.h>
|
#include <ui/minitui.h>
|
||||||
#include <ui/noui.h>
|
#include <ui/noui.h>
|
||||||
#include <ui/tui.h>
|
#include <ui/tui.h>
|
||||||
|
#include <ui/video.h>
|
||||||
|
|
||||||
/* Arch specific includes */
|
/* Arch specific includes */
|
||||||
#include <arch/archwsup.h>
|
#include <arch/archwsup.h>
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// FIXME: This one has nothing to do here!!
|
||||||
|
#define SECTOR_SIZE 512
|
||||||
|
|
||||||
typedef struct tagDEVVTBL
|
typedef struct tagDEVVTBL
|
||||||
{
|
{
|
||||||
ARC_CLOSE Close;
|
ARC_CLOSE Close;
|
||||||
|
|
62
boot/freeldr/freeldr/include/ntldr/winldr.h
Normal file
62
boot/freeldr/freeldr/include/ntldr/winldr.h
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: FreeLoader
|
||||||
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
|
* PURPOSE: Windows-compatible NT OS Loader.
|
||||||
|
* COPYRIGHT: Copyright 2006-2019 Aleksey Bragin <aleksey@reactos.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <arc/setupblk.h>
|
||||||
|
|
||||||
|
// See freeldr/ntldr/winldr.h
|
||||||
|
#define TAG_WLDR_DTE 'eDlW'
|
||||||
|
#define TAG_WLDR_BDE 'dBlW'
|
||||||
|
#define TAG_WLDR_NAME 'mNlW'
|
||||||
|
|
||||||
|
// Some definitions
|
||||||
|
|
||||||
|
#include <pshpack1.h>
|
||||||
|
typedef struct /* Root System Descriptor Pointer */
|
||||||
|
{
|
||||||
|
CHAR signature [8]; /* contains "RSD PTR " */
|
||||||
|
UCHAR checksum; /* to make sum of struct == 0 */
|
||||||
|
CHAR oem_id [6]; /* OEM identification */
|
||||||
|
UCHAR revision; /* Must be 0 for 1.0, 2 for 2.0 */
|
||||||
|
ULONG rsdt_physical_address; /* 32-bit physical address of RSDT */
|
||||||
|
ULONG length; /* XSDT Length in bytes including hdr */
|
||||||
|
ULONGLONG xsdt_physical_address; /* 64-bit physical address of XSDT */
|
||||||
|
UCHAR extended_checksum; /* Checksum of entire table */
|
||||||
|
CHAR reserved [3]; /* reserved field must be 0 */
|
||||||
|
} RSDP_DESCRIPTOR, *PRSDP_DESCRIPTOR;
|
||||||
|
#include <poppack.h>
|
||||||
|
|
||||||
|
typedef struct _ARC_DISK_SIGNATURE_EX
|
||||||
|
{
|
||||||
|
ARC_DISK_SIGNATURE DiskSignature;
|
||||||
|
CHAR ArcName[MAX_PATH];
|
||||||
|
} ARC_DISK_SIGNATURE_EX, *PARC_DISK_SIGNATURE_EX;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// ReactOS Loading Functions
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ARC_STATUS
|
||||||
|
LoadAndBootWindows(
|
||||||
|
IN ULONG Argc,
|
||||||
|
IN PCHAR Argv[],
|
||||||
|
IN PCHAR Envp[]);
|
||||||
|
|
||||||
|
ARC_STATUS
|
||||||
|
LoadReactOSSetup(
|
||||||
|
IN ULONG Argc,
|
||||||
|
IN PCHAR Argv[],
|
||||||
|
IN PCHAR Envp[]);
|
||||||
|
|
||||||
|
|
||||||
|
// conversion.c and conversion.h
|
||||||
|
PVOID VaToPa(PVOID Va);
|
||||||
|
PVOID PaToVa(PVOID Pa);
|
||||||
|
VOID List_PaToVa(_In_ LIST_ENTRY *ListEntry);
|
41
boot/freeldr/freeldr/include/peloader.h
Normal file
41
boot/freeldr/freeldr/include/peloader.h
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: FreeLoader
|
||||||
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
|
* PURPOSE: Provides routines for loading PE files.
|
||||||
|
* (Deprecated remark) To be merged with arch/i386/loader.c in future.
|
||||||
|
*
|
||||||
|
* COPYRIGHT: Copyright 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
|
* Copyright 2006-2019 Aleksey Bragin <aleksey@reactos.org>
|
||||||
|
*
|
||||||
|
* NOTES: The source code in this file is based on the work of respective
|
||||||
|
* authors of PE loading code in ReactOS and Brian Palmer and
|
||||||
|
* Alex Ionescu's arch/i386/loader.c, and my research project
|
||||||
|
* (creating a native EFI loader for Windows).
|
||||||
|
*
|
||||||
|
* This article was very handy during development:
|
||||||
|
* http://msdn.microsoft.com/msdnmag/issues/02/03/PE2/
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
WinLdrLoadImage(IN PCHAR FileName,
|
||||||
|
TYPE_OF_MEMORY MemoryType,
|
||||||
|
OUT PVOID *ImageBasePA);
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
WinLdrAllocateDataTableEntry(IN OUT PLIST_ENTRY ModuleListHead,
|
||||||
|
IN PCCH BaseDllName,
|
||||||
|
IN PCCH FullDllName,
|
||||||
|
IN PVOID BasePA,
|
||||||
|
OUT PLDR_DATA_TABLE_ENTRY *NewEntry);
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
WinLdrScanImportDescriptorTable(IN OUT PLIST_ENTRY ModuleListHead,
|
||||||
|
IN PCCH DirectoryPath,
|
||||||
|
IN PLDR_DATA_TABLE_ENTRY ScanDTE);
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
WinLdrCheckForLoadedDll(IN OUT PLIST_ENTRY ModuleListHead,
|
||||||
|
IN PCH DllName,
|
||||||
|
OUT PLDR_DATA_TABLE_ENTRY *LoadedEntry);
|
29
boot/freeldr/freeldr/include/ui/video.h
Normal file
29
boot/freeldr/freeldr/include/ui/video.h
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: FreeLoader
|
||||||
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
|
* PURPOSE: UI Video helpers for special effects.
|
||||||
|
* COPYRIGHT: Copyright 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <pshpack1.h>
|
||||||
|
typedef struct _PALETTE_ENTRY
|
||||||
|
{
|
||||||
|
UCHAR Red;
|
||||||
|
UCHAR Green;
|
||||||
|
UCHAR Blue;
|
||||||
|
} PALETTE_ENTRY, *PPALETTE_ENTRY;
|
||||||
|
#include <poppack.h>
|
||||||
|
|
||||||
|
// extern PVOID VideoOffScreenBuffer;
|
||||||
|
|
||||||
|
PVOID VideoAllocateOffScreenBuffer(VOID); // Returns a pointer to an off-screen buffer sufficient for the current video mode
|
||||||
|
VOID VideoCopyOffScreenBufferToVRAM(VOID);
|
||||||
|
|
||||||
|
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
||||||
|
VOID VideoRestorePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
||||||
|
|
||||||
|
VOID VideoSetAllColorsToBlack(ULONG ColorCount);
|
||||||
|
VOID VideoFadeIn(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
||||||
|
VOID VideoFadeOut(ULONG ColorCount);
|
|
@ -1,46 +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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <pshpack1.h>
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
UCHAR Red;
|
|
||||||
UCHAR Green;
|
|
||||||
UCHAR Blue;
|
|
||||||
} PALETTE_ENTRY, *PPALETTE_ENTRY;
|
|
||||||
#include <poppack.h>
|
|
||||||
|
|
||||||
extern PVOID VideoOffScreenBuffer;
|
|
||||||
|
|
||||||
USHORT BiosIsVesaSupported(VOID); // Implemented in i386vid.c, returns the VESA version
|
|
||||||
BOOLEAN BiosIsVesaDdcSupported(VOID);
|
|
||||||
BOOLEAN BiosVesaReadEdid(VOID);
|
|
||||||
|
|
||||||
PVOID VideoAllocateOffScreenBuffer(VOID); // Returns a pointer to an off-screen buffer sufficient for the current video mode
|
|
||||||
|
|
||||||
VOID VideoCopyOffScreenBufferToVRAM(VOID);
|
|
||||||
|
|
||||||
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
|
||||||
VOID VideoRestorePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
|
||||||
|
|
||||||
VOID VideoSetAllColorsToBlack(ULONG ColorCount);
|
|
||||||
VOID VideoFadeIn(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
|
||||||
VOID VideoFadeOut(ULONG ColorCount);
|
|
|
@ -1,126 +0,0 @@
|
||||||
/*
|
|
||||||
* FreeLoader
|
|
||||||
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
|
||||||
* Copyright (C) 2006 Aleksey Bragin <aleksey@reactos.org>
|
|
||||||
*
|
|
||||||
* 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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <arc/setupblk.h>
|
|
||||||
|
|
||||||
// See freeldr/ntldr/winldr.h
|
|
||||||
#define TAG_WLDR_DTE 'eDlW'
|
|
||||||
#define TAG_WLDR_BDE 'dBlW'
|
|
||||||
#define TAG_WLDR_NAME 'mNlW'
|
|
||||||
|
|
||||||
|
|
||||||
// Some definitions
|
|
||||||
|
|
||||||
// FIXME: This one has nothing to do here!!
|
|
||||||
#define SECTOR_SIZE 512
|
|
||||||
|
|
||||||
// Descriptors
|
|
||||||
#define NUM_GDT 128 // Must be 128
|
|
||||||
#define NUM_IDT 0x100 // Only 16 are used though. Must be 0x100
|
|
||||||
|
|
||||||
#include <pshpack1.h>
|
|
||||||
typedef struct /* Root System Descriptor Pointer */
|
|
||||||
{
|
|
||||||
CHAR signature [8]; /* contains "RSD PTR " */
|
|
||||||
UCHAR checksum; /* to make sum of struct == 0 */
|
|
||||||
CHAR oem_id [6]; /* OEM identification */
|
|
||||||
UCHAR revision; /* Must be 0 for 1.0, 2 for 2.0 */
|
|
||||||
ULONG rsdt_physical_address; /* 32-bit physical address of RSDT */
|
|
||||||
ULONG length; /* XSDT Length in bytes including hdr */
|
|
||||||
ULONGLONG xsdt_physical_address; /* 64-bit physical address of XSDT */
|
|
||||||
UCHAR extended_checksum; /* Checksum of entire table */
|
|
||||||
CHAR reserved [3]; /* reserved field must be 0 */
|
|
||||||
} RSDP_DESCRIPTOR, *PRSDP_DESCRIPTOR;
|
|
||||||
#include <poppack.h>
|
|
||||||
|
|
||||||
typedef struct _ARC_DISK_SIGNATURE_EX
|
|
||||||
{
|
|
||||||
ARC_DISK_SIGNATURE DiskSignature;
|
|
||||||
CHAR ArcName[MAX_PATH];
|
|
||||||
} ARC_DISK_SIGNATURE_EX, *PARC_DISK_SIGNATURE_EX;
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// ReactOS Loading Functions
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ARC_STATUS
|
|
||||||
LoadAndBootWindows(
|
|
||||||
IN ULONG Argc,
|
|
||||||
IN PCHAR Argv[],
|
|
||||||
IN PCHAR Envp[]);
|
|
||||||
|
|
||||||
ARC_STATUS
|
|
||||||
LoadReactOSSetup(
|
|
||||||
IN ULONG Argc,
|
|
||||||
IN PCHAR Argv[],
|
|
||||||
IN PCHAR Envp[]);
|
|
||||||
|
|
||||||
|
|
||||||
// conversion.c and conversion.h
|
|
||||||
PVOID VaToPa(PVOID Va);
|
|
||||||
PVOID PaToVa(PVOID Pa);
|
|
||||||
VOID List_PaToVa(_In_ LIST_ENTRY *ListEntry);
|
|
||||||
|
|
||||||
|
|
||||||
// peloader.c
|
|
||||||
BOOLEAN
|
|
||||||
WinLdrLoadImage(IN PCHAR FileName,
|
|
||||||
TYPE_OF_MEMORY MemoryType,
|
|
||||||
OUT PVOID *ImageBasePA);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
WinLdrAllocateDataTableEntry(IN OUT PLIST_ENTRY ModuleListHead,
|
|
||||||
IN PCCH BaseDllName,
|
|
||||||
IN PCCH FullDllName,
|
|
||||||
IN PVOID BasePA,
|
|
||||||
OUT PLDR_DATA_TABLE_ENTRY *NewEntry);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
WinLdrScanImportDescriptorTable(IN OUT PLIST_ENTRY ModuleListHead,
|
|
||||||
IN PCCH DirectoryPath,
|
|
||||||
IN PLDR_DATA_TABLE_ENTRY ScanDTE);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
WinLdrCheckForLoadedDll(IN OUT PLIST_ENTRY ModuleListHead,
|
|
||||||
IN PCH DllName,
|
|
||||||
OUT PLDR_DATA_TABLE_ENTRY *LoadedEntry);
|
|
||||||
|
|
||||||
|
|
||||||
// arch/xxx/winldr.c
|
|
||||||
BOOLEAN
|
|
||||||
MempSetupPaging(IN PFN_NUMBER StartPage,
|
|
||||||
IN PFN_NUMBER NumberOfPages,
|
|
||||||
IN BOOLEAN KernelMapping);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
MempUnmapPage(PFN_NUMBER Page);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
MempDump(VOID);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
WinLdrSetupMachineDependent(PLOADER_PARAMETER_BLOCK LoaderBlock);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
WinLdrSetProcessorContext(VOID);
|
|
|
@ -1,27 +1,30 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: FreeLoader
|
* PROJECT: FreeLoader
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
* FILE: boot/freeldr/freeldr/windows/peloader.c
|
* PURPOSE: Provides routines for loading PE files.
|
||||||
* PURPOSE: Provides routines for loading PE files.
|
* (Deprecated remark) To be merged with arch/i386/loader.c in future.
|
||||||
* (Deprecated remark) To be merged with arch/i386/loader.c in future.
|
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org)
|
* COPYRIGHT: Copyright 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
|
* Copyright 2006-2019 Aleksey Bragin <aleksey@reactos.org>
|
||||||
*
|
*
|
||||||
* The source code in this file is based on the work of respective
|
* NOTES: The source code in this file is based on the work of respective
|
||||||
* authors of PE loading code in ReactOS and Brian Palmer and
|
* authors of PE loading code in ReactOS and Brian Palmer and
|
||||||
* Alex Ionescu's arch/i386/loader.c, and my research project
|
* Alex Ionescu's arch/i386/loader.c, and my research project
|
||||||
* (creating a native EFI loader for Windows).
|
* (creating a native EFI loader for Windows).
|
||||||
*
|
*
|
||||||
* NOTE: This article was very handy during development:
|
* This article was very handy during development:
|
||||||
* http://msdn.microsoft.com/msdnmag/issues/02/03/PE2/
|
* http://msdn.microsoft.com/msdnmag/issues/02/03/PE2/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES ***************************************************************/
|
/* INCLUDES ***************************************************************/
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
DBG_DEFAULT_CHANNEL(PELOADER);
|
DBG_DEFAULT_CHANNEL(PELOADER);
|
||||||
|
|
||||||
|
/* FUNCTIONS **************************************************************/
|
||||||
|
|
||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
WinLdrpCompareDllName(IN PCH DllName,
|
WinLdrpCompareDllName(IN PCH DllName,
|
||||||
IN PUNICODE_STRING UnicodeName);
|
IN PUNICODE_STRING UnicodeName);
|
||||||
|
@ -50,9 +53,6 @@ WinLdrpScanImportAddressTable(IN OUT PLIST_ENTRY ModuleListHead,
|
||||||
IN PCSTR DirectoryPath);
|
IN PCSTR DirectoryPath);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS **************************************************************/
|
|
||||||
|
|
||||||
/* Returns TRUE if DLL has already been loaded - looks in LoadOrderList in LPB */
|
/* Returns TRUE if DLL has already been loaded - looks in LoadOrderList in LPB */
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
WinLdrCheckForLoadedDll(IN OUT PLIST_ENTRY ModuleListHead,
|
WinLdrCheckForLoadedDll(IN OUT PLIST_ENTRY ModuleListHead,
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
/* INCLUDES ***************************************************************/
|
/* INCLUDES ***************************************************************/
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
|
|
||||||
#include <ndk/asm.h>
|
#include <ndk/asm.h>
|
||||||
|
#include "../../winldr.h"
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
DBG_DEFAULT_CHANNEL(WINDOWS);
|
||||||
|
|
||||||
//extern ULONG LoaderPagesSpanned;
|
//extern ULONG LoaderPagesSpanned;
|
||||||
|
|
||||||
DBG_DEFAULT_CHANNEL(WINDOWS);
|
|
||||||
|
|
||||||
/* GLOBALS ***************************************************************/
|
/* GLOBALS ***************************************************************/
|
||||||
|
|
||||||
PHARDWARE_PTE PxeBase;
|
PHARDWARE_PTE PxeBase;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <internal/arm/mm.h>
|
#include <internal/arm/mm.h>
|
||||||
#include <internal/arm/intrin_i.h>
|
#include <internal/arm/intrin_i.h>
|
||||||
|
#include "../../winldr.h"
|
||||||
|
|
||||||
#define PFN_SHIFT 12
|
#define PFN_SHIFT 12
|
||||||
#define LARGE_PFN_SHIFT 20
|
#define LARGE_PFN_SHIFT 20
|
||||||
|
|
|
@ -9,9 +9,11 @@
|
||||||
/* INCLUDES ***************************************************************/
|
/* INCLUDES ***************************************************************/
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
|
|
||||||
#include <ndk/asm.h>
|
#include <ndk/asm.h>
|
||||||
|
#include "../../winldr.h"
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
DBG_DEFAULT_CHANNEL(WINDOWS);
|
||||||
|
|
||||||
// This is needed because headers define wrong one for ReactOS
|
// This is needed because headers define wrong one for ReactOS
|
||||||
#undef KIP0PCRADDRESS
|
#undef KIP0PCRADDRESS
|
||||||
|
@ -28,8 +30,6 @@
|
||||||
} GDTIDT;
|
} GDTIDT;
|
||||||
#pragma pack(4)
|
#pragma pack(4)
|
||||||
|
|
||||||
DBG_DEFAULT_CHANNEL(WINDOWS);
|
|
||||||
|
|
||||||
/* GLOBALS ***************************************************************/
|
/* GLOBALS ***************************************************************/
|
||||||
|
|
||||||
PHARDWARE_PTE PDE;
|
PHARDWARE_PTE PDE;
|
||||||
|
|
|
@ -1,33 +1,15 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS kernel
|
* PROJECT: FreeLoader
|
||||||
* Copyright (C) 2002,2003 ReactOS Team
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
*
|
* PURPOSE: INF file parser that caches contents of INF file in memory.
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* COPYRIGHT: Copyright 2002-2006 Royce Mitchell III
|
||||||
* it under the terms of the GNU General Public License as published by
|
* Copyright 2003-2019 Eric Kohl
|
||||||
* 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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS text-mode setup
|
|
||||||
* FILE: boot/freeldr/freeldr/lib/inffile/inffile.c
|
|
||||||
* PURPOSE: INF file parser that caches contents of INF file in memory
|
|
||||||
* PROGRAMMER: Royce Mitchell III
|
|
||||||
* Eric Kohl
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
|
#include "inffile.h"
|
||||||
|
|
||||||
#define CONTROL_Z '\x1a'
|
#define CONTROL_Z '\x1a'
|
||||||
#define MAX_SECTION_NAME_LEN 255
|
#define MAX_SECTION_NAME_LEN 255
|
|
@ -1,28 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS kernel
|
* PROJECT: FreeLoader
|
||||||
* Copyright (C) 2002, 2003 ReactOS Team
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
*
|
* PURPOSE: INF file parser that caches contents of INF file in memory.
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* COPYRIGHT: Copyright 2002-2006 Royce Mitchell III
|
||||||
* it under the terms of the GNU General Public License as published by
|
* Copyright 2003-2019 Eric Kohl
|
||||||
* 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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS text-mode setup
|
|
||||||
* FILE: boot/freeldr/freeldr/include/inffile.h
|
|
||||||
* PURPOSE: INF file parser that caches contents of INF file in memory
|
|
||||||
* PROGRAMMER: Royce Mitchell III
|
|
||||||
* Eric Kohl
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
|
@ -1,32 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* PROJECT: FreeLoader
|
||||||
*
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
* Copyright (C) 2009 Aleksey Bragin <aleksey@reactos.org>
|
* PURPOSE: Windows-compatible NT OS Setup Loader.
|
||||||
*
|
* COPYRIGHT: Copyright 2009-2019 Aleksey Bragin <aleksey@reactos.org>
|
||||||
* 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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
#include "winldr.h"
|
|
||||||
|
|
||||||
#include <ndk/ldrtypes.h>
|
#include <ndk/ldrtypes.h>
|
||||||
#include <arc/setupblk.h>
|
#include <arc/setupblk.h>
|
||||||
|
#include "winldr.h"
|
||||||
|
#include "inffile.h"
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
DBG_DEFAULT_CHANNEL(WINDOWS);
|
DBG_DEFAULT_CHANNEL(WINDOWS);
|
||||||
|
|
||||||
#define TAG_BOOT_OPTIONS 'pOtB'
|
#define TAG_BOOT_OPTIONS 'pOtB'
|
||||||
|
|
||||||
// TODO: Move to .h
|
// TODO: Move to .h
|
||||||
|
|
|
@ -1,30 +1,15 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* PROJECT: FreeLoader
|
||||||
*
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
* PURPOSE: Windows-compatible NT OS Loader.
|
||||||
* Copyright (C) 2006 Aleksey Bragin <aleksey@reactos.org>
|
* COPYRIGHT: Copyright 2006-2019 Aleksey Bragin <aleksey@reactos.org>
|
||||||
*
|
|
||||||
* 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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
|
#include <ndk/ldrtypes.h>
|
||||||
#include "winldr.h"
|
#include "winldr.h"
|
||||||
#include "registry.h"
|
#include "registry.h"
|
||||||
|
|
||||||
#include <ndk/ldrtypes.h>
|
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
DBG_DEFAULT_CHANNEL(WINDOWS);
|
DBG_DEFAULT_CHANNEL(WINDOWS);
|
||||||
|
|
||||||
|
|
|
@ -1,47 +1,23 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* PROJECT: FreeLoader
|
||||||
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
* Copyright (C) 2006 Aleksey Bragin <aleksey@reactos.org>
|
* PURPOSE: Windows-compatible NT OS Loader.
|
||||||
*
|
* COPYRIGHT: Copyright 2006-2019 Aleksey Bragin <aleksey@reactos.org>
|
||||||
* 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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <arc/setupblk.h>
|
#include <arc/setupblk.h>
|
||||||
|
|
||||||
#if 0
|
|
||||||
// See freeldr/include/winldr.h
|
|
||||||
#define TAG_WLDR_DTE 'eDlW'
|
|
||||||
#define TAG_WLDR_BDE 'dBlW'
|
|
||||||
#define TAG_WLDR_NAME 'mNlW'
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Entry-point to kernel */
|
/* Entry-point to kernel */
|
||||||
typedef VOID (NTAPI *KERNEL_ENTRY_POINT) (PLOADER_PARAMETER_BLOCK LoaderBlock);
|
typedef VOID (NTAPI *KERNEL_ENTRY_POINT) (PLOADER_PARAMETER_BLOCK LoaderBlock);
|
||||||
|
|
||||||
|
/* Descriptors */
|
||||||
// Some definitions
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
// Descriptors
|
|
||||||
#define NUM_GDT 128 // Must be 128
|
#define NUM_GDT 128 // Must be 128
|
||||||
#define NUM_IDT 0x100 // Only 16 are used though. Must be 0x100
|
#define NUM_IDT 0x100 // Only 16 are used though. Must be 0x100
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
#include <pshpack1.h>
|
#include <pshpack1.h>
|
||||||
typedef struct /* Root System Descriptor Pointer */
|
typedef struct /* Root System Descriptor Pointer */
|
||||||
{
|
{
|
||||||
|
@ -149,3 +125,21 @@ LoadAndBootWindowsCommon(
|
||||||
PCSTR BootOptions,
|
PCSTR BootOptions,
|
||||||
PCSTR BootPath,
|
PCSTR BootPath,
|
||||||
BOOLEAN Setup);
|
BOOLEAN Setup);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
WinLdrSetupMachineDependent(PLOADER_PARAMETER_BLOCK LoaderBlock);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
WinLdrSetProcessorContext(VOID);
|
||||||
|
|
||||||
|
// arch/xxx/winldr.c
|
||||||
|
BOOLEAN
|
||||||
|
MempSetupPaging(IN PFN_NUMBER StartPage,
|
||||||
|
IN PFN_NUMBER NumberOfPages,
|
||||||
|
IN BOOLEAN KernelMapping);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
MempUnmapPage(PFN_NUMBER Page);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
MempDump(VOID);
|
||||||
|
|
|
@ -1,35 +1,72 @@
|
||||||
/*
|
/*
|
||||||
* FreeLoader
|
* PROJECT: FreeLoader
|
||||||
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
*
|
* PURPOSE: UI Video helpers for special effects.
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* COPYRIGHT: Copyright 1998-2003 Brian Palmer <brianp@sginet.com>
|
||||||
* 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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _M_ARM
|
#ifndef _M_ARM
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
|
|
||||||
#define RGB_MAX 64
|
#define RGB_MAX 64
|
||||||
#define RGB_MAX_PER_ITERATION 64
|
#define RGB_MAX_PER_ITERATION 64
|
||||||
#define TAG_PALETTE_COLORS 'claP'
|
#define TAG_PALETTE_COLORS 'claP'
|
||||||
|
|
||||||
VOID VideoSetAllColorsToBlack(ULONG ColorCount)
|
static PVOID VideoOffScreenBuffer = NULL;
|
||||||
|
|
||||||
|
PVOID VideoAllocateOffScreenBuffer(VOID)
|
||||||
{
|
{
|
||||||
UCHAR Color;
|
ULONG BufferSize;
|
||||||
|
|
||||||
|
if (VideoOffScreenBuffer != NULL)
|
||||||
|
{
|
||||||
|
MmFreeMemory(VideoOffScreenBuffer);
|
||||||
|
VideoOffScreenBuffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
BufferSize = MachVideoGetBufferSize();
|
||||||
|
|
||||||
|
VideoOffScreenBuffer = MmAllocateMemoryWithType(BufferSize, LoaderFirmwareTemporary);
|
||||||
|
|
||||||
|
return VideoOffScreenBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID VideoCopyOffScreenBufferToVRAM(VOID)
|
||||||
|
{
|
||||||
|
MachVideoCopyOffScreenBufferToVRAM(VideoOffScreenBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
|
||||||
|
{
|
||||||
|
ULONG Color;
|
||||||
|
|
||||||
|
for (Color = 0; Color < ColorCount; Color++)
|
||||||
|
{
|
||||||
|
MachVideoGetPaletteColor((UCHAR)Color, &Palette[Color].Red, &Palette[Color].Green, &Palette[Color].Blue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID VideoRestorePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
|
||||||
|
{
|
||||||
|
ULONG Color;
|
||||||
|
|
||||||
MachVideoSync();
|
MachVideoSync();
|
||||||
|
|
||||||
for (Color=0; Color<ColorCount; Color++)
|
for (Color = 0; Color < ColorCount; Color++)
|
||||||
|
{
|
||||||
|
MachVideoSetPaletteColor((UCHAR)Color, Palette[Color].Red, Palette[Color].Green, Palette[Color].Blue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID VideoSetAllColorsToBlack(ULONG ColorCount)
|
||||||
|
{
|
||||||
|
UCHAR Color;
|
||||||
|
|
||||||
|
MachVideoSync();
|
||||||
|
|
||||||
|
for (Color = 0; Color < ColorCount; Color++)
|
||||||
{
|
{
|
||||||
MachVideoSetPaletteColor(Color, 0, 0, 0);
|
MachVideoSetPaletteColor(Color, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -37,17 +74,16 @@ VOID VideoSetAllColorsToBlack(ULONG ColorCount)
|
||||||
|
|
||||||
VOID VideoFadeIn(PPALETTE_ENTRY Palette, ULONG ColorCount)
|
VOID VideoFadeIn(PPALETTE_ENTRY Palette, ULONG ColorCount)
|
||||||
{
|
{
|
||||||
ULONG Index;
|
ULONG Index;
|
||||||
UCHAR Color;
|
UCHAR Color;
|
||||||
PPALETTE_ENTRY PaletteColors;
|
PPALETTE_ENTRY PaletteColors;
|
||||||
|
|
||||||
PaletteColors = FrLdrTempAlloc(sizeof(PALETTE_ENTRY) * ColorCount, TAG_PALETTE_COLORS);
|
PaletteColors = FrLdrTempAlloc(sizeof(PALETTE_ENTRY) * ColorCount, TAG_PALETTE_COLORS);
|
||||||
if (!PaletteColors) return;
|
if (!PaletteColors) return;
|
||||||
|
|
||||||
for (Index=0; Index<RGB_MAX; Index++)
|
for (Index = 0; Index < RGB_MAX; Index++)
|
||||||
{
|
{
|
||||||
|
for (Color = 0; Color < ColorCount; Color++)
|
||||||
for (Color=0; Color<ColorCount; Color++)
|
|
||||||
{
|
{
|
||||||
MachVideoGetPaletteColor(Color, &PaletteColors[Color].Red, &PaletteColors[Color].Green, &PaletteColors[Color].Blue);
|
MachVideoGetPaletteColor(Color, &PaletteColors[Color].Red, &PaletteColors[Color].Green, &PaletteColors[Color].Blue);
|
||||||
|
|
||||||
|
@ -81,7 +117,7 @@ VOID VideoFadeIn(PPALETTE_ENTRY Palette, ULONG ColorCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the colors
|
// Set the colors
|
||||||
for (Color=0; Color<ColorCount; Color++)
|
for (Color = 0; Color < ColorCount; Color++)
|
||||||
{
|
{
|
||||||
if ((Color % RGB_MAX_PER_ITERATION) == 0)
|
if ((Color % RGB_MAX_PER_ITERATION) == 0)
|
||||||
{
|
{
|
||||||
|
@ -97,15 +133,15 @@ VOID VideoFadeIn(PPALETTE_ENTRY Palette, ULONG ColorCount)
|
||||||
|
|
||||||
VOID VideoFadeOut(ULONG ColorCount)
|
VOID VideoFadeOut(ULONG ColorCount)
|
||||||
{
|
{
|
||||||
ULONG Index;
|
ULONG Index;
|
||||||
UCHAR Color;
|
UCHAR Color;
|
||||||
UCHAR Red;
|
UCHAR Red;
|
||||||
UCHAR Green;
|
UCHAR Green;
|
||||||
UCHAR Blue;
|
UCHAR Blue;
|
||||||
|
|
||||||
for (Index=0; Index<RGB_MAX; Index++)
|
for (Index = 0; Index < RGB_MAX; Index++)
|
||||||
{
|
{
|
||||||
for (Color=0; Color<ColorCount; Color++)
|
for (Color = 0; Color < ColorCount; Color++)
|
||||||
{
|
{
|
||||||
if ((Color % RGB_MAX_PER_ITERATION) == 0)
|
if ((Color % RGB_MAX_PER_ITERATION) == 0)
|
||||||
{
|
{
|
||||||
|
@ -131,4 +167,5 @@ VOID VideoFadeOut(ULONG ColorCount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -1,42 +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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
|
||||||
#ifndef _M_ARM
|
|
||||||
#include <freeldr.h>
|
|
||||||
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
|
|
||||||
{
|
|
||||||
ULONG Color;
|
|
||||||
|
|
||||||
for (Color=0; Color<ColorCount; Color++)
|
|
||||||
{
|
|
||||||
MachVideoGetPaletteColor((UCHAR)Color, &Palette[Color].Red, &Palette[Color].Green, &Palette[Color].Blue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID VideoRestorePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
|
|
||||||
{
|
|
||||||
ULONG Color;
|
|
||||||
|
|
||||||
MachVideoSync();
|
|
||||||
|
|
||||||
for (Color=0; Color<ColorCount; Color++)
|
|
||||||
{
|
|
||||||
MachVideoSetPaletteColor((UCHAR)Color, Palette[Color].Red, Palette[Color].Green, Palette[Color].Blue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
|
@ -1,45 +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.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
|
||||||
#ifndef _M_ARM
|
|
||||||
#include <freeldr.h>
|
|
||||||
|
|
||||||
PVOID VideoOffScreenBuffer = NULL;
|
|
||||||
|
|
||||||
PVOID VideoAllocateOffScreenBuffer(VOID)
|
|
||||||
{
|
|
||||||
ULONG BufferSize;
|
|
||||||
|
|
||||||
if (VideoOffScreenBuffer != NULL)
|
|
||||||
{
|
|
||||||
MmFreeMemory(VideoOffScreenBuffer);
|
|
||||||
VideoOffScreenBuffer = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
BufferSize = MachVideoGetBufferSize();
|
|
||||||
|
|
||||||
VideoOffScreenBuffer = MmAllocateMemoryWithType(BufferSize, LoaderFirmwareTemporary);
|
|
||||||
|
|
||||||
return VideoOffScreenBuffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID VideoCopyOffScreenBufferToVRAM(VOID)
|
|
||||||
{
|
|
||||||
MachVideoCopyOffScreenBufferToVRAM(VideoOffScreenBuffer);
|
|
||||||
}
|
|
||||||
#endif
|
|
Loading…
Reference in a new issue