Author: tkreuzer Date: Fri Jun 10 17:18:26 2011 New Revision: 52175
URL: http://svn.reactos.org/svn/reactos?rev=52175&view=rev Log: [FREELDR] Major header cleanup
Added: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/ (with props) trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h - copied, changed from r52171, trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h trunk/reactos/boot/freeldr/freeldr/include/arch/pc/machpc.h - copied unchanged from r52171, trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h (with props) trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pxe.h - copied unchanged from r52171, trunk/reactos/boot/freeldr/freeldr/include/arch/i386/pxe.h trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h (with props) Removed: trunk/reactos/boot/freeldr/freeldr/include/arch.h trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h trunk/reactos/boot/freeldr/freeldr/include/arch/i386/pxe.h trunk/reactos/boot/freeldr/freeldr/include/arch/i386/realmode.h Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S trunk/reactos/boot/freeldr/freeldr/arch/i386/int386.S trunk/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h trunk/reactos/boot/freeldr/freeldr/include/freeldr.h
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S [iso-8859-1] Fri Jun 10 17:18:26 2011 @@ -20,8 +20,7 @@ .intel_syntax noprefix #define HEX(y) 0x##y
-#define ASM -#include <arch.h> +#include <arch/pc/x86common.h> #include <multiboot.h>
.code16
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/int386.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/int386.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/int386.S [iso-8859-1] Fri Jun 10 17:18:26 2011 @@ -20,8 +20,7 @@ .text .code16
-#define ASM -#include <arch.h> +#include <arch/pc/x86common.h>
/* Only these flags are propagated into Int386() */ #define FLAGS_PROP (I386FLAG_CF | \ @@ -172,9 +171,9 @@ movsb
/* Restore segment and all other registers */ - - - popal + + + popal popw %gs popw %fs popw %es
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c [iso-8859-1] Fri Jun 10 17:18:26 2011 @@ -1,6 +1,9 @@ #include <ntoskrnl.h> -#define NDEBUG -#include <arch.h> + +/* For KeStallExecutionProcessor */ +#if defined(_M_IX86) || defined(_M_AMD64) +#include <arch/pc/pcbios.h> +#endif
VOID NTAPI @@ -75,6 +78,7 @@ KeStallExecutionProcessor( IN ULONG MicroSeconds) { +#if defined(_M_IX86) || defined(_M_AMD64) REGS Regs; ULONG usec_this;
@@ -111,4 +115,7 @@
MicroSeconds -= usec_this; } +#else + #error unimplemented +#endif }
Removed: trunk/reactos/boot/freeldr/freeldr/include/arch.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch.h (removed) @@ -1,181 +1,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 __ASM__ -#pragma once -#endif - -#ifndef HEX -#define HEX(y) 0x##y -#endif - -#ifdef _M_AMD64 -#include <arch/amd64/amd64.h> -#endif - -#if defined (_M_IX86) -/* Defines needed for switching between real and protected mode */ -#define NULL_DESC HEX(00) /* NULL descriptor */ -#define PMODE_CS HEX(08) /* PMode code selector, base 0 limit 4g */ -#define PMODE_DS HEX(10) /* PMode data selector, base 0 limit 4g */ -#define RMODE_CS HEX(18) /* RMode code selector, base 0 limit 64k */ -#define RMODE_DS HEX(20) /* RMode data selector, base 0 limit 64k */ -#endif - -#define CR0_PE_SET HEX(00000001) /* OR this value with CR0 to enable pmode */ -#define CR0_PE_CLR HEX(FFFFFFFE) /* AND this value with CR0 to disable pmode */ - -#define STACK16ADDR HEX(7000) /* The 16-bit stack top will be at 0000:7000 */ -#define STACK32ADDR HEX(78000) /* The 32-bit stack top will be at 7000:8000, or 0x78000 */ - -#if defined (_M_IX86) || defined (_M_AMD64) -#define BIOSCALLBUFFER 0x78000 /* Buffer to store temporary data for any Int386() call */ -#define BIOSCALLBUFSEGMENT 0x7800 /* Buffer to store temporary data for any Int386() call */ -#define BIOSCALLBUFOFFSET 0x0000 /* Buffer to store temporary data for any Int386() call */ -#define FILESYSBUFFER 0x80000 /* Buffer to store file system data (e.g. cluster buffer for FAT) */ -#define DISKREADBUFFER 0x90000 /* Buffer to store data read in from the disk via the BIOS */ -#define DISKREADBUFFER_SIZE 512 -#elif defined(_M_PPC) || defined(_M_MIPS) -#define DISKREADBUFFER 0x80000000 -#define FILESYSBUFFER 0x80000000 -#elif defined(_M_ARM) -extern ULONG gDiskReadBuffer, gFileSysBuffer; -#define DISKREADBUFFER gDiskReadBuffer -#define FILESYSBUFFER gFileSysBuffer -#endif - -/* Makes "x" a global variable or label */ -#define EXTERN(x) .global x; x: - - -// Flag Masks -#define I386FLAG_CF HEX(0001) // Carry Flag -#define I386FLAG_RESV1 HEX(0002) // Reserved - Must be 1 -#define I386FLAG_PF HEX(0004) // Parity Flag -#define I386FLAG_RESV2 HEX(0008) // Reserved - Must be 0 -#define I386FLAG_AF HEX(0010) // Auxiliary Flag -#define I386FLAG_RESV3 HEX(0020) // Reserved - Must be 0 -#define I386FLAG_ZF HEX(0040) // Zero Flag -#define I386FLAG_SF HEX(0080) // Sign Flag -#define I386FLAG_TF HEX(0100) // Trap Flag (Single Step) -#define I386FLAG_IF HEX(0200) // Interrupt Flag -#define I386FLAG_DF HEX(0400) // Direction Flag -#define I386FLAG_OF HEX(0800) // Overflow Flag - - -#ifndef __ASM__ - -#include <pshpack1.h> -typedef struct -{ - unsigned long eax; - unsigned long ebx; - unsigned long ecx; - unsigned long edx; - - unsigned long esi; - unsigned long edi; - - unsigned short ds; - unsigned short es; - unsigned short fs; - unsigned short gs; - - unsigned long eflags; - -} DWORDREGS; - -typedef struct -{ - unsigned short ax, _upper_ax; - unsigned short bx, _upper_bx; - unsigned short cx, _upper_cx; - unsigned short dx, _upper_dx; - - unsigned short si, _upper_si; - unsigned short di, _upper_di; - - unsigned short ds; - unsigned short es; - unsigned short fs; - unsigned short gs; - - unsigned short flags, _upper_flags; - -} WORDREGS; - -typedef struct -{ - unsigned char al; - unsigned char ah; - unsigned short _upper_ax; - unsigned char bl; - unsigned char bh; - unsigned short _upper_bx; - unsigned char cl; - unsigned char ch; - unsigned short _upper_cx; - unsigned char dl; - unsigned char dh; - unsigned short _upper_dx; - - unsigned short si, _upper_si; - unsigned short di, _upper_di; - - unsigned short ds; - unsigned short es; - unsigned short fs; - unsigned short gs; - - unsigned short flags, _upper_flags; - -} BYTEREGS; - - -typedef union -{ - DWORDREGS x; - DWORDREGS d; - WORDREGS w; - BYTEREGS b; -} REGS; -#include <poppack.h> - -// Int386() -// -// Real mode interrupt vector interface -// -// (E)FLAGS can *only* be returned by this function, not set. -// Make sure all memory pointers are in SEG:OFFS format and -// not linear addresses, unless the interrupt handler -// specifically handles linear addresses. -int Int386(int ivec, REGS* in, REGS* out); - -// This macro tests the Carry Flag -// If CF is set then the call failed (usually) -#define INT386_SUCCESS(regs) ((regs.x.eflags & I386FLAG_CF) == 0) - -void EnableA20(void); - -VOID ChainLoadBiosBootSectorCode(VOID); // Implemented in boot.S -VOID SoftReboot(VOID); // Implemented in boot.S - -VOID DetectHardware(VOID); // Implemented in hardware.c - -#endif /* ! __ASM__ */
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h [iso-8859-1] Fri Jun 10 17:18:26 2011 @@ -56,11 +56,7 @@ #ifndef ASM
VOID FrLdrSetupGdtIdt(VOID); - -#include <arch/i386/realmode.h> -#define FrldrBootDrive *((PULONG)BSS_BootDrive) -#define FrldrBootPartition *((PULONG)BSS_BootPartition) - +#define MachInit PcMachInit #endif
/* EOF */
Removed: trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h (removed) @@ -1,94 +1,0 @@ -/* - * FreeLoader - * - * Copyright (C) 2003 Eric Kohl - * - * 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 - -#ifndef __REGISTRY_H -#include "../../reactos/registry.h" -#endif - -#define CONFIG_CMD(bus, dev_fn, where) \ - (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3)) - - -// -// Static heap for ARC Hardware Component Tree -// 16KB oughta be enough for anyone. -// -#define HW_MAX_ARC_HEAP_SIZE 16 * 1024 - -// -// ARC Component Configuration Routines -// -VOID -NTAPI -FldrCreateSystemKey( - OUT PCONFIGURATION_COMPONENT_DATA *SystemKey -); - -VOID -NTAPI -FldrCreateComponentKey( - IN PCONFIGURATION_COMPONENT_DATA SystemKey, - IN CONFIGURATION_CLASS Class, - IN CONFIGURATION_TYPE Type, - IN IDENTIFIER_FLAG Flags, - IN ULONG Key, - IN ULONG Affinity, - IN PCHAR IdentifierString, - IN PCM_PARTIAL_RESOURCE_LIST ResourceList, - IN ULONG Size, - OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey -); - -/* PROTOTYPES ***************************************************************/ - -/* hardware.c */ - -VOID StallExecutionProcessor(ULONG Microseconds); - -VOID HalpCalibrateStallExecution(VOID); - -/* hwacpi.c */ -VOID DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber); - -/* hwapm.c */ -VOID DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber); - -/* hwpci.c */ -VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber); - -/* i386cpu.S */ -ULONG CpuidSupported(VOID); -VOID GetCpuid(ULONG Level, - ULONG *eax, - ULONG *ebx, - ULONG *ecx, - ULONG *edx); -ULONGLONG RDTSC(VOID); - -/* i386pnp.S */ -ULONG_PTR PnpBiosSupported(VOID); -ULONG PnpBiosGetDeviceNodeCount(ULONG *NodeSize, - ULONG *NodeCount); -ULONG PnpBiosGetDeviceNode(UCHAR *NodeId, - UCHAR *NodeBuffer); - -/* EOF */
Removed: trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h (removed) @@ -1,62 +1,0 @@ -/* $Id: machpc.h 32135 2008-02-05 11:13:17Z ros-arm-bringup $ - * - * FreeLoader - * - * Copyright (C) 2003 Eric Kohl - * - * 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 - -#ifndef __MEMORY_H -#include "mm.h" -#endif - -#define MachInit PcMachInit -VOID PcMachInit(const char *CmdLine); - -VOID PcConsPutChar(int Ch); -BOOLEAN PcConsKbHit(VOID); -int PcConsGetCh(VOID); - -VOID PcVideoClearScreen(UCHAR Attr); -VIDEODISPLAYMODE PcVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init); -VOID PcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth); -ULONG PcVideoGetBufferSize(VOID); -VOID PcVideoSetTextCursorPosition(ULONG X, ULONG Y); -VOID PcVideoHideShowTextCursor(BOOLEAN Show); -VOID PcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y); -VOID PcVideoCopyOffScreenBufferToVRAM(PVOID Buffer); -BOOLEAN PcVideoIsPaletteFixed(VOID); -VOID PcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue); -VOID PcVideoGetPaletteColor(UCHAR Color, UCHAR* Red, UCHAR* Green, UCHAR* Blue); -VOID PcVideoSync(VOID); -VOID PcVideoPrepareForReactOS(IN BOOLEAN Setup); -VOID PcPrepareForReactOS(IN BOOLEAN Setup); - -ULONG PcMemGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize); - -BOOLEAN PcDiskGetBootPath(char *BootPath, unsigned Size); -BOOLEAN PcDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); -BOOLEAN PcDiskGetPartitionEntry(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry); -BOOLEAN PcDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry); -ULONG PcDiskGetCacheableBlockCount(ULONG DriveNumber); - -TIMEINFO* PcGetTime(VOID); - -PCONFIGURATION_COMPONENT_DATA PcHwDetect(VOID); - -/* EOF */
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h [iso-8859-1] Fri Jun 10 17:18:26 2011 @@ -35,3 +35,7 @@ extern ULONG SecondLevelDcacheFillSize; extern ULONG SecondLevelIcacheSize; extern ULONG SecondLevelIcacheFillSize; + +extern ULONG gDiskReadBuffer, gFileSysBuffer; +#define DISKREADBUFFER gDiskReadBuffer +#define FILESYSBUFFER gFileSysBuffer
Removed: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h (removed) @@ -1,97 +1,0 @@ -/* - * FreeLoader - * - * Copyright (C) 2003 Eric Kohl - * - * 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 - -#ifndef __REGISTRY_H -#include "../../reactos/registry.h" -#endif - -#define CONFIG_CMD(bus, dev_fn, where) \ - (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3)) - - -// -// Static heap for ARC Hardware Component Tree -// 16KB oughta be enough for anyone. -// -#define HW_MAX_ARC_HEAP_SIZE 16 * 1024 - -// -// ARC Component Configuration Routines -// -VOID -NTAPI -FldrCreateSystemKey( - OUT PCONFIGURATION_COMPONENT_DATA *SystemKey -); - -VOID -NTAPI -FldrCreateComponentKey( - IN PCONFIGURATION_COMPONENT_DATA SystemKey, - IN CONFIGURATION_CLASS Class, - IN CONFIGURATION_TYPE Type, - IN IDENTIFIER_FLAG Flags, - IN ULONG Key, - IN ULONG Affinity, - IN PCHAR IdentifierString, - IN PCM_PARTIAL_RESOURCE_LIST ResourceList, - IN ULONG Size, - OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey -); - -/* PROTOTYPES ***************************************************************/ - -/* hardware.c */ - -VOID StallExecutionProcessor(ULONG Microseconds); - -VOID HalpCalibrateStallExecution(VOID); - -/* hwacpi.c */ -VOID DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber); - -/* hwapm.c */ -VOID DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber); - -/* hwpci.c */ -VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber); - -/* i386cpu.S */ -ULONG CpuidSupported(VOID); -VOID GetCpuid(ULONG Level, - ULONG *eax, - ULONG *ebx, - ULONG *ecx, - ULONG *edx); -ULONGLONG RDTSC(VOID); - -/* i386pnp.S */ -ULONG PnpBiosSupported(VOID); -ULONG PnpBiosGetDeviceNodeCount(ULONG *NodeSize, - ULONG *NodeCount); -ULONG PnpBiosGetDeviceNode(UCHAR *NodeId, - UCHAR *NodeBuffer); - -/* i386pxe.S */ -USHORT PxeCallApi(USHORT Segment, USHORT Offset, USHORT Service, VOID* Parameter); - -/* EOF */
Removed: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h (removed) @@ -1,61 +1,0 @@ -/* $Id$ - * - * FreeLoader - * - * Copyright (C) 2003 Eric Kohl - * - * 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 - -#ifndef __MEMORY_H -#include "mm.h" -#endif - -VOID PcMachInit(const char *CmdLine); - -VOID PcConsPutChar(int Ch); -BOOLEAN PcConsKbHit(VOID); -int PcConsGetCh(VOID); - -VOID PcVideoClearScreen(UCHAR Attr); -VIDEODISPLAYMODE PcVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init); -VOID PcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth); -ULONG PcVideoGetBufferSize(VOID); -VOID PcVideoSetTextCursorPosition(ULONG X, ULONG Y); -VOID PcVideoHideShowTextCursor(BOOLEAN Show); -VOID PcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y); -VOID PcVideoCopyOffScreenBufferToVRAM(PVOID Buffer); -BOOLEAN PcVideoIsPaletteFixed(VOID); -VOID PcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue); -VOID PcVideoGetPaletteColor(UCHAR Color, UCHAR* Red, UCHAR* Green, UCHAR* Blue); -VOID PcVideoSync(VOID); -VOID PcVideoPrepareForReactOS(IN BOOLEAN Setup); -VOID PcPrepareForReactOS(IN BOOLEAN Setup); - -ULONG PcMemGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize); - -BOOLEAN PcDiskGetBootPath(char *BootPath, unsigned Size); -BOOLEAN PcDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); -BOOLEAN PcDiskGetPartitionEntry(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry); -BOOLEAN PcDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry); -ULONG PcDiskGetCacheableBlockCount(ULONG DriveNumber); - -TIMEINFO* PcGetTime(VOID); - -PCONFIGURATION_COMPONENT_DATA PcHwDetect(VOID); - -/* EOF */
Removed: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/pxe.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/pxe.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/pxe.h (removed) @@ -1,602 +1,0 @@ -#ifndef _PXE_ -#define _PXE_ - -/* Basic types */ - -typedef UINT16 OFF16; -typedef UINT16 PXENV_EXIT; -typedef UINT16 PXENV_STATUS; -typedef UINT16 SEGSEL; -typedef UINT16 UDP_PORT; -typedef UINT32 ADDR32; - -#include <pshpack1.h> - -#define IP_ADDR_LEN 4 -typedef union -{ - UINT32 num; - UINT8 array[IP_ADDR_LEN]; -} IP4; - -#define MAC_ADDR_LEN 16 -typedef UINT8 MAC_ADDR[MAC_ADDR_LEN]; - -typedef struct s_SEGDESC -{ - UINT16 segment_address; - UINT32 physical_address; - UINT16 seg_size; -} SEGDESC; - -typedef struct s_SEGOFF16 -{ - OFF16 offset; - SEGSEL segment; -} SEGOFF16; - -typedef struct s_PXE -{ - UINT8 Signature[4]; - UINT8 StructLength; - UINT8 StructCksum; - UINT8 StructRev; - UINT8 reserved1; - SEGOFF16 UNDIROMID; - SEGOFF16 BaseROMID; - SEGOFF16 EntryPointSP; - SEGOFF16 EntryPointESP; - SEGOFF16 StatusCallout; - UINT8 reserved2; - UINT8 SegDescCnt; - SEGSEL FirstSelector; - SEGDESC Stack; - SEGDESC UNDIData; - SEGDESC UNDICode; - SEGDESC UNDICodeWrite; - SEGDESC BC_Data; - SEGDESC BC_Code; - SEGDESC BC_CodeWrite; -} PXE, *PPXE; - -/* PXENV structures */ - -typedef struct s_PXENV_START_UNDI -{ - PXENV_STATUS Status; - UINT16 AX; - UINT16 BX; - UINT16 DX; - UINT16 DI; - UINT16 ES; -} t_PXENV_START_UNDI; - -typedef struct s_PXENV_UNDI_STARTUP -{ - PXENV_STATUS Status; -} t_PXENV_UNDI_STARTUP; - -typedef struct s_PXENV_UNDI_CLEANUP -{ - PXENV_STATUS Status; -} t_PXENV_UNDI_CLEANUP; - -typedef struct s_PXENV_UNDI_INITIALIZE -{ - PXENV_STATUS Status; - ADDR32 ProtocolIni; - UINT8 reserved[8]; -} t_PXENV_UNDI_INITIALIZE; - -#define MAXNUM_MCADDR 8 -typedef struct s_PXENV_UNDI_MCAST_ADDRESS -{ - UINT16 MCastAddrCount; - MAC_ADDR McastAddr[MAXNUM_MCADDR]; -} t_PXENV_UNDI_MCAST_ADDRESS; - -typedef struct s_PXENV_UNDI_RESET -{ - PXENV_STATUS Status; - t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; -} t_PXENV_UNDI_RESET; - -typedef struct s_PXENV_UNDI_SHUTDOWN -{ - PXENV_STATUS Status; -} t_PXENV_UNDI_SHUTDOWN; - -typedef struct s_PXENV_UNDI_OPEN -{ - PXENV_STATUS Status; - UINT16 OpenFlag; - UINT16 PktFilter; -#define FLTR_DIRECTED 0x01 -#define FLTR_BRDCST 0x02 -#define FLTR_PRMSCS 0x04 -#define FLTR_SRC_RTG 0x08 - - t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; -} t_PXENV_UNDI_OPEN; - -typedef struct s_PXENV_UNDI_CLOSE -{ - PXENV_STATUS Status; -} t_PXENV_UNDI_CLOSE; - -typedef struct s_PXENV_UNDI_TRANSMIT -{ - PXENV_STATUS Status; - UINT8 Protocol; -#define P_UNKNOWN 0 -#define P_IP 1 -#define P_ARP 2 -#define P_RARP 3 - - UINT8 XmitFlag; -#define XMT_DESTADDR 0x00 -#define XMT_BROADCAST 0x01 - - SEGOFF16 DestAddr; - SEGOFF16 TBD; - UINT32 Reserved[2]; -} t_PXENV_UNDI_TRANSMIT; - -#define MAX_DATA_BLKS 8 -typedef struct s_PXENV_UNDI_TBD -{ - UINT16 ImmedLength; - SEGOFF16 Xmit; - UINT16 DataBlkCount; - struct DataBlk - { - UINT8 TDPtrType; - UINT8 TDRsvdByte; - UINT8 TDDataLen; - SEGOFF16 TDDataPtr; - } DataBlock[MAX_DATA_BLKS]; -} t_PXENV_UNDI_TBD; - -typedef struct s_PXENV_UNDI_SET_MCAST_ADDRESS -{ - PXENV_STATUS Status; - t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; -} t_PXENV_UNDI_SET_MCAST_ADDRESS; - -typedef struct s_PXENV_UNDI_SET_STATION_ADDRESS -{ - PXENV_STATUS Status; - MAC_ADDR StationAddress; -} t_PXENV_UNDI_SET_STATION_ADDRESS; - -typedef struct s_PXENV_UNDI_SET_PACKET_FILTER -{ - PXENV_STATUS Status; - UINT8 filter; -} t_PXENV_UNDI_SET_PACKET_FILTER; - -typedef struct s_PXENV_UNDI_GET_INFORMATION -{ - PXENV_STATUS Status; - UINT16 BaseIo; - UINT16 IntNumber; - UINT16 MaxTranUnit; - UINT16 HwType; -#define ETHER_TYPE 1 -#define EXP_ETHER_TYPE 2 -#define IEEE_TYPE 3 -#define ARCNET_TYPE 4 - - UINT16 HwAddrLen; - MAC_ADDR CurrentNodeAddress; - MAC_ADDR PermNodeAddress; - SEGSEL ROMAddress; - UINT16 RxBufCt; - UINT16 TxBufCt; -} t_PXENV_UNDI_GET_INFORMATION; - -typedef struct s_PXENV_UNDI_GET_STATISTICS -{ - PXENV_STATUS Status; - UINT32 XmtGoodFrames; - UINT32 RcvGoodFrames; - UINT32 RcvCRCErrors; - UINT32 RcvResourceErrors; -} t_PXENV_UNDI_GET_STATISTICS; - -typedef struct s_PXENV_UNDI_CLEAR_STATISTICS -{ - PXENV_STATUS Status; -} t_PXENV_UNDI_CLEAR_STATISTICS; - -typedef struct s_PXENV_UNDI_INITIATE_DIAGS -{ - PXENV_STATUS Status; -} t_PXENV_UNDI_INITIATE_DIAGS; - -typedef struct s_PXENV_UNDI_FORCE_INTERRUPT -{ - PXENV_STATUS Status; -} t_PXENV_UNDI_FORCE_INTERRUPT; - -typedef struct s_PXENV_UNDI_GET_MCAST_ADDRESS -{ - PXENV_STATUS Status; - IP4 InetAddr; - MAC_ADDR MediaAddr; -} t_PXENV_UNDI_GET_MCAST_ADDRESS; - -typedef struct s_PXENV_UNDI_GET_NIC_TYPE -{ - PXENV_STATUS Status; - UINT8 NicType; -#define PCI_NIC 2 -#define PnP_NIC 3 -#define CardBus_NIC 4 - - union - { - struct - { - UINT16 Vendor_ID; - UINT16 Dev_ID; - UINT8 Base_Class; - UINT8 Sub_Class; - UINT8 Prog_Intf; - UINT8 Rev; - UINT16 BusDevFunc; - UINT16 SubVendor_ID; - UINT16 SubDevice_ID; - } pci, cardbus; - struct - { - UINT32 EISA_Dev_ID; - UINT8 Base_Class; - UINT8 Sub_Class; - UINT8 Prog_Intf; - UINT16 CardSelNum; - } pnp; - } info; -} t_PXENV_UNDI_GET_NIC_TYPE; - -typedef struct s_PXENV_UNDI_GET_IFACE_INFO -{ - PXENV_STATUS Status; - UINT8 IfaceType[16]; - UINT32 LinkSpeed; - UINT32 ServiceFlags; - UINT32 Reserved[4]; -} t_PXENV_UNDI_GET_IFACE_INFO; - -typedef struct s_PXENV_UNDI_ISR -{ - PXENV_STATUS Status; - UINT16 FuncFlag; - UINT16 BufferLength; - UINT16 FrameLength; - UINT16 FrameHeaderLength; - SEGOFF16 Frame; - UINT8 ProtType; - UINT8 PktType; -} t_PXENV_UNDI_ISR; - -#define PXENV_UNDI_ISR_IN_START 1 -#define PXENV_UNDI_ISR_IN_PROCESS 2 -#define PXENV_UNDI_ISR_IN_GET_NEXT 3 - -/* One of these will be returned for PXENV_UNDI_ISR_IN_START */ -#define PXENV_UNDI_ISR_OUT_OURS 0 -#define PXENV_UNDI_ISR_OUT_NOT_OURS 1 - -/* One of these will be returned for PXENV_UNDI_ISR_IN_PROCESS and PXENV_UNDI_ISR_IN_GET_NEXT */ -#define PXENV_UNDI_ISR_OUT_DONE 0 -#define PXENV_UNDI_ISR_OUT_TRANSMIT 2 -#define PXENV_UNDI_ISR_OUT_RECEIVE 3 -#define PXENV_UNDI_ISR_OUT_BUSY 4 - -typedef struct s_PXENV_UNDI_GET_STATE -{ - PXENV_STATUS Status; -#define PXE_UNDI_GET_STATE_STARTED 1 -#define PXE_UNDI_GET_STATE_INITIALIZED 2 -#define PXE_UNDI_GET_STATE_OPENED 3 - UINT8 UNDIState; -} t_PXENV_UNDI_GET_STATE; - -typedef struct s_PXENV_STOP_UNDI -{ - PXENV_STATUS Status; -} t_PXENV_STOP_UNDI; - -typedef struct s_PXENV_TFTP_OPEN -{ - PXENV_STATUS Status; - IP4 ServerIPAddress; - IP4 GatewayIPAddress; - UINT8 FileName[128]; - UDP_PORT TFTPPort; - UINT16 PacketSize; -} t_PXENV_TFTP_OPEN; - -typedef struct s_PXENV_TFTP_CLOSE -{ - PXENV_STATUS Status; -} t_PXENV_TFTP_CLOSE; - -typedef struct s_PXENV_TFTP_READ -{ - PXENV_STATUS Status; - UINT16 PacketNumber; - UINT16 BufferSize; - SEGOFF16 Buffer; -} t_PXENV_TFTP_READ; - -typedef struct s_PXENV_TFTP_READ_FILE -{ - PXENV_STATUS Status; - UINT8 FileName[128]; - UINT32 BufferSize; - ADDR32 Buffer; - IP4 ServerIPAddress; - IP4 GatewayIPAddress; - IP4 McastIPAddress; - UDP_PORT TFTPClntPort; - UDP_PORT TFTPSvrPort; - UINT16 TFTPOpenTimeOut; - UINT16 TFTPReopenDelay; -} t_PXENV_TFTP_READ_FILE; - -typedef struct s_PXENV_TFTP_GET_FSIZE -{ - PXENV_STATUS Status; - IP4 ServerIPAddress; - IP4 GatewayIPAddress; - UINT8 FileName[128]; - UINT32 FileSize; -} t_PXENV_TFTP_GET_FSIZE; - -typedef struct s_PXENV_UDP_OPEN -{ - PXENV_STATUS Status; - IP4 src_ip; -} t_PXENV_UDP_OPEN; - -typedef struct s_PXENV_UDP_CLOSE -{ - PXENV_STATUS Status; -} t_PXENV_UDP_CLOSE; - -typedef struct s_PXENV_UDP_READ -{ - PXENV_STATUS Status; - IP4 ip; - IP4 dest_ip; - UDP_PORT s_port; - UDP_PORT d_port; - UINT16 buffer_size; - SEGOFF16 buffer; -} t_PXENV_UDP_READ; - -typedef struct s_PXENV_UDP_WRITE -{ - PXENV_STATUS Status; - IP4 ip; - IP4 gw; - UDP_PORT src_port; - UDP_PORT dst_port; - UINT16 buffer_size; - SEGOFF16 buffer; -} t_PXENV_UDP_WRITE; - -typedef struct s_PXENV_UNLOAD_STACK -{ - PXENV_STATUS Status; - UINT8 reserved[10]; -} t_PXENV_UNLOAD_STACK; - -typedef struct s_PXENV_GET_CACHED_INFO -{ - PXENV_STATUS Status; - UINT16 PacketType; -#define PXENV_PACKET_TYPE_DHCP_DISCOVER 1 -#define PXENV_PACKET_TYPE_DHCP_ACK 2 -#define PXENV_PACKET_TYPE_CACHED_REPLY 3 - UINT16 BufferSize; - SEGOFF16 Buffer; - UINT16 BufferLimit; -} t_PXENV_GET_CACHED_INFO; - -typedef struct s_PXENV_START_BASE -{ - PXENV_STATUS Status; -} t_PXENV_START_BASE; - -typedef struct s_PXENV_STOP_BASE -{ - PXENV_STATUS Status; -} t_PXENV_STOP_BASE; - -typedef struct bootph -{ - UINT8 opcode; -#define BOOTP_REQ 1 -#define BOOTP_REP 2 - - UINT8 Hardware; - UINT8 Hardlen; - UINT8 Gatehops; - UINT32 ident; - UINT16 seconds; - UINT16 Flags; -#define BOOTP_BCAST 0x8000 - - IP4 cip; - IP4 yip; - IP4 sip; - IP4 gip; - MAC_ADDR CAddr; - UINT8 Sname[64]; - UINT8 bootfile[128]; - union - { -#define BOOTP_DHCPVEND 1024 /* DHCP extended vendor field size */ - UINT8 d[BOOTP_DHCPVEND]; - struct - { - UINT8 magic[4]; -#define VM_RFC1048 0x63825363 - UINT32 flags; - UINT8 pad[56]; - } v; - } vendor; -} BOOTPLAYER; - -#include <poppack.h> - -/* Exit codes returned in AX by a PXENV API service */ -#define PXENV_EXIT_SUCCESS 0x0000 -#define PXENV_EXIT_FAILURE 0x0001 - -/* Generic API status & error codes that are reported by the loader */ -#define PXENV_STATUS_SUCCESS 0x00 -#define PXENV_STATUS_FAILURE 0x01 /* General failure */ -#define PXENV_STATUS_BAD_FUNC 0x02 /* Invalid function number */ -#define PXENV_STATUS_UNSUPPORTED 0x03 /* Function is not yet supported */ -#define PXENV_STATUS_KEEP_UNDI 0x04 /* UNDI must not be unloaded from base memory */ -#define PXENV_STATUS_KEEP_ALL 0x05 -#define PXENV_STATUS_OUT_OF_RESOURCES 0x06 /* Base code and UNDI must not be unloaded from base memory */ - -/* ARP errors (0x10 to 0x1f) */ -#define PXENV_STATUS_ARP_TIMEOUT 0x11 - -/* Base code state errors */ -#define PXENV_STATUS_UDP_CLOSED 0x18 -#define PXENV_STATUS_UDP_OPEN 0x19 -#define PXENV_STATUS_TFTP_CLOSED 0x1a -#define PXENV_STATUS_TFTP_OPEN 0x1b - -/* BIOS/system errors (0x20 to 0x2f) */ -#define PXENV_STATUS_MCOPY_PROBLEM 0x20 -#define PXENV_STATUS_BIS_INTEGRITY_FAILURE 0x21 -#define PXENV_STATUS_BIS_VALIDATE_FAILURE 0x22 -#define PXENV_STATUS_BIS_INIT_FAILURE 0x23 -#define PXENV_STATUS_BIS_SHUTDOWN_FAILURE 0x24 -#define PXENV_STATUS_BIS_GBOA_FAILURE 0x25 -#define PXENV_STATUS_BIS_FREE_FAILURE 0x26 -#define PXENV_STATUS_BIS_GSI_FAILURE 0x27 -#define PXENV_STATUS_BIS_BAD_CKSUM 0x28 - -/* TFTP/MTFTP errors (0x30 to 0x3f) */ -#define PXENV_STATUS_TFTP_CANNOT_ARP_ADDRESS 0x30 -#define PXENV_STATUS_TFTP_OPEN_TIMEOUT 0x32 -#define PXENV_STATUS_TFTP_UNKNOWN_OPCODE 0x33 -#define PXENV_STATUS_TFTP_READ_TIMEOUT 0x35 -#define PXENV_STATUS_TFTP_ERROR_OPCODE 0x36 -#define PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION 0x38 -#define PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION 0x39 -#define PXENV_STATUS_TFTP_TOO_MANY_PACKAGES 0x3a -#define PXENV_STATUS_TFTP_FILE_NOT_FOUND 0x3b -#define PXENV_STATUS_TFTP_ACCESS_VIOLATION 0x3c -#define PXENV_STATUS_TFTP_NO_MCAST_ADDRESS 0x3d -#define PXENV_STATUS_TFTP_NO_FILESIZE 0x3e -#define PXENV_STATUS_TFTP_INVALID_PACKET_SIZE 0x3f - -/* Reserved errors (0x40 to 0x4f) */ - -/* DHCP/BOOTP errors (0x50 to 0x5f) */ -#define PXENV_STATUS_DHCP_TIMEOUT 0x51 -#define PXENV_STATUS_DHCP_NO_IP_ADDRESS 0x52 -#define PXENV_STATUS_DHCP_NO_BOOTFILE_NAME 0x53 -#define PXENV_STATUS_DHCP_BAD_IP_ADDRESS 0x54 - -/* Driver errors (0x60 to 0x6f) */ -/* These errors are for UNDI compatible NIC drivers */ -#define PXENV_STATUS_UNDI_INVALID_FUNCTION 0x60 -#define PXENV_STATUS_UNDI_MEDIATEST_FAILED 0x61 -#define PXENV_STATUS_UNDI_CANNOT_INIT_NIC_FOR_MCAST 0x62 -#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC 0x63 -#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_PHY 0x64 -#define PXENV_STATUS_UNDI_CANNOT_READ_CONFIG_DATA 0x65 -#define PXENV_STATUS_UNDI_CANNOT_READ_INIT_DATA 0x66 -#define PXENV_STATUS_UNDI_BAD_MAC_ADDRESS 0x67 -#define PXENV_STATUS_UNDI_BAD_EEPROM_CHECKSUM 0x68 -#define PXENV_STATUS_UNDI_ERROR_SETTING_ISR 0x69 -#define PXENV_STATUS_UNDI_INVALID_STATE 0x6a -#define PXENV_STATUS_UNDI_TRANSMIT_ERROR 0x6b -#define PXENV_STATUS_UNDI_INVALID_PARAMETER 0x6c - -/* ROM and NBP bootstrap errors (0x70 to 0x7f) */ -#define PXENV_STATUS_BSTRAP_PROMPT_MENU 0x74 -#define PXENV_STATUS_BSTRAP_MCAST_ADDR 0x76 -#define PXENV_STATUS_BSTRAP_MISSING_LIST 0x77 -#define PXENV_STATUS_BSTRAP_NO_RESPONSE 0x78 -#define PXENV_STATUS_BSTRAP_FILE_TOO_BIG 0x79 - -/* Environment NBP errors (0x80 to 0x8f) */ - -/* Reserved errors (0x90 to 0x9f) */ - -/* Misc. errors (0xa0 to 0xaf) */ -#define PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE 0xa0 -#define PXENV_STATUS_BINL_NO_PXE_SERVER 0xa1 -#define PXENV_STATUS_NOT_AVAILABLE_IN_PMODE 0xa2 -#define PXENV_STATUS_NOT_AVAILABLE_IN_RMODE 0xa3 - -/* BUSD errors (0xb0 to 0xbf) */ -#define PXENV_STATUS_BUSD_DEVICE_NOT_SUPPORTED 0xb0 - -/* Loader errors (0xc0 to 0xcf) */ -#define PXENV_STATUS_LOADER_NO_FREE_BASE_MEMORY 0xc0 -#define PXENV_STATUS_LOADER_NO_BC_ROMID 0xc1 -#define PXENV_STATUS_LOADER_BAD_BC_ROMID 0xc2 -#define PXENV_STATUS_LOADER_BAD_BC_RUNTIME_IMAGE 0xc3 -#define PXENV_STATUS_LOADER_NO_UNDI_ROMID 0xc4 -#define PXENV_STATUS_LOADER_BAD_UNDI_ROMID 0xc5 -#define PXENV_STATUS_LOADER_BAD_UNDI_DRIVER_IMAGE 0xc6 -#define PXENV_STATUS_LOADER_NO_PXE_STRUCT 0xc8 -#define PXENV_STATUS_LOADER_NO_PXENV_STRUCT 0xc9 -#define PXENV_STATUS_LOADER_UNDI_START 0xca -#define PXENV_STATUS_LOADER_BC_START 0xcb - -/* Vendor errors (0xd0 to 0xff) */ - -/* PXENV API services */ -#define PXENV_START_UNDI 0x00 -#define PXENV_UNDI_STARTUP 0x01 -#define PXENV_UNDI_CLEANUP 0x02 -#define PXENV_UNDI_INITIALIZE 0x03 -#define PXENV_UNDI_RESET_ADAPTER 0x04 -#define PXENV_UNDI_SHUTDOWN 0x05 -#define PXENV_UNDI_OPEN 0x06 -#define PXENV_UNDI_CLOSE 0x07 -#define PXENV_UNDI_TRANSMIT 0x08 -#define PXENV_UNDI_SET_MCAST_ADDRESS 0x09 -#define PXENV_UNDI_SET_STATION_ADDRESS 0x0a -#define PXENV_UNDI_SET_PACKET_FILTER 0x0b -#define PXENV_UNDI_GET_INFORMATION 0x0c -#define PXENV_UNDI_GET_STATISTICS 0x0d -#define PXENV_UNDI_CLEAR_STATISTICS 0x0e -#define PXENV_UNDI_INITIATE_DIAGS 0x0f -#define PXENV_UNDI_FORCE_INTERRUPT 0x10 -#define PXENV_UNDI_GET_MCAST_ADDRESS 0x11 -#define PXENV_UNDI_GET_NIC_TYPE 0x12 -#define PXENV_UNDI_GET_IFACE_INFO 0x13 -#define PXENV_UNDI_ISR 0x14 -#define PXENV_UNDI_GET_STATE 0x15 -#define PXENV_STOP_UNDI 0x15 -#define PXENV_TFTP_OPEN 0x20 -#define PXENV_TFTP_CLOSE 0x21 -#define PXENV_TFTP_READ 0x22 -#define PXENV_TFTP_READ_FILE 0x23 -#define PXENV_TFTP_GET_FSIZE 0x25 -#define PXENV_UDP_OPEN 0x30 -#define PXENV_UDP_CLOSE 0x31 -#define PXENV_UDP_READ 0x32 -#define PXENV_UDP_WRITE 0x33 -#define PXENV_UNLOAD_STACK 0x70 -#define PXENV_GET_CACHED_INFO 0x71 -#define PXENV_RESTART_TFTP 0x73 -#define PXENV_START_BASE 0x75 -#define PXENV_STOP_BASE 0x76 - -#endif
Removed: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/realmode.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/realmode.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/realmode.h (removed) @@ -1,13 +1,0 @@ - - -/* These addresses specify the realmode "BSS section" */ -#define BSS_START HEX(7000) -#define BSS_CallbackAddress BSS_START + 0 -#define BSS_CallbackReturn BSS_START + 8 -#define BSS_BootDrive BSS_START + 16 -#define BSS_BootPartition BSS_START + 20 - -#define PE_LOAD_BASE HEX(9000) -#define IMAGE_DOS_HEADER_e_lfanew 36 -#define IMAGE_FILE_HEADER_SIZE 20 -#define IMAGE_OPTIONAL_HEADER_AddressOfEntryPoint 16
Propchange: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Fri Jun 10 17:18:26 2011 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+)
Propchange: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/ ------------------------------------------------------------------------------ bugtraq:url = http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/ ------------------------------------------------------------------------------ tsvn:logminsize = 10
Copied: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h (from r52171, trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h) URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h [iso-8859-1] Fri Jun 10 17:18:26 2011 @@ -19,10 +19,6 @@ */
#pragma once - -#ifndef __REGISTRY_H -#include "../../reactos/registry.h" -#endif
#define CONFIG_CMD(bus, dev_fn, where) \ (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3)) @@ -85,7 +81,7 @@ ULONGLONG RDTSC(VOID);
/* i386pnp.S */ -ULONG PnpBiosSupported(VOID); +ULONG_PTR PnpBiosSupported(VOID); ULONG PnpBiosGetDeviceNodeCount(ULONG *NodeSize, ULONG *NodeCount); ULONG PnpBiosGetDeviceNode(UCHAR *NodeId,
Added: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h (added) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h [iso-8859-1] Fri Jun 10 17:18:26 2011 @@ -1,0 +1,98 @@ +#ifndef __ASM__ + +#include <pshpack1.h> +typedef struct +{ + unsigned long eax; + unsigned long ebx; + unsigned long ecx; + unsigned long edx; + + unsigned long esi; + unsigned long edi; + + unsigned short ds; + unsigned short es; + unsigned short fs; + unsigned short gs; + + unsigned long eflags; + +} DWORDREGS; + +typedef struct +{ + unsigned short ax, _upper_ax; + unsigned short bx, _upper_bx; + unsigned short cx, _upper_cx; + unsigned short dx, _upper_dx; + + unsigned short si, _upper_si; + unsigned short di, _upper_di; + + unsigned short ds; + unsigned short es; + unsigned short fs; + unsigned short gs; + + unsigned short flags, _upper_flags; + +} WORDREGS; + +typedef struct +{ + unsigned char al; + unsigned char ah; + unsigned short _upper_ax; + unsigned char bl; + unsigned char bh; + unsigned short _upper_bx; + unsigned char cl; + unsigned char ch; + unsigned short _upper_cx; + unsigned char dl; + unsigned char dh; + unsigned short _upper_dx; + + unsigned short si, _upper_si; + unsigned short di, _upper_di; + + unsigned short ds; + unsigned short es; + unsigned short fs; + unsigned short gs; + + unsigned short flags, _upper_flags; + +} BYTEREGS; + + +typedef union +{ + DWORDREGS x; + DWORDREGS d; + WORDREGS w; + BYTEREGS b; +} REGS; +#include <poppack.h> + +// Int386() +// +// Real mode interrupt vector interface +// +// (E)FLAGS can *only* be returned by this function, not set. +// Make sure all memory pointers are in SEG:OFFS format and +// not linear addresses, unless the interrupt handler +// specifically handles linear addresses. +int Int386(int ivec, REGS* in, REGS* out); + +// This macro tests the Carry Flag +// If CF is set then the call failed (usually) +#define INT386_SUCCESS(regs) ((regs.x.eflags & I386FLAG_CF) == 0) + +void EnableA20(void); +VOID ChainLoadBiosBootSectorCode(VOID); // Implemented in boot.S +VOID SoftReboot(VOID); // Implemented in boot.S +VOID DetectHardware(VOID); // Implemented in hardware.c + +#endif /* ! __ASM__ */
Propchange: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h (added) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h [iso-8859-1] Fri Jun 10 17:18:26 2011 @@ -1,0 +1,57 @@ + +#ifndef HEX +#define HEX(y) 0x##y +#endif + +/* Memory layout */ +#define STACK16ADDR HEX(7000) /* The 16-bit stack top will be at 0000:7000 */ +#define BSS_START HEX(7000) +#define FREELDR_BASE HEX(8000) +#define FREELDR_PE_BASE HEX(9000) +#define STACK32ADDR HEX(78000) /* The 32-bit stack top will be at 7000:8000, or 0x78000 */ +#define BIOSCALLBUFFER HEX(78000) /* Buffer to store temporary data for any Int386() call */ +#define BIOSCALLBUFSEGMENT HEX(7800) /* Buffer to store temporary data for any Int386() call */ +#define BIOSCALLBUFOFFSET HEX(0000) /* Buffer to store temporary data for any Int386() call */ +#define FILESYSBUFFER HEX(80000) /* Buffer to store file system data (e.g. cluster buffer for FAT) */ +#define DISKREADBUFFER HEX(90000) /* Buffer to store data read in from the disk via the BIOS */ +#define DISKREADBUFFER_SIZE 512 + +/* These addresses specify the realmode "BSS section" layout */ +#define BSS_CallbackAddress BSS_START + 0 +#define BSS_CallbackReturn BSS_START + 8 +#define BSS_BootDrive BSS_START + 16 +#define BSS_BootPartition BSS_START + 20 + +#ifdef _M_AMD64 +#define FrldrBootDrive *((PULONG)BSS_BootDrive) +#define FrldrBootPartition *((PULONG)BSS_BootPartition) +#endif + +// Flag Masks +#define I386FLAG_CF HEX(0001) // Carry Flag +#define I386FLAG_RESV1 HEX(0002) // Reserved - Must be 1 +#define I386FLAG_PF HEX(0004) // Parity Flag +#define I386FLAG_RESV2 HEX(0008) // Reserved - Must be 0 +#define I386FLAG_AF HEX(0010) // Auxiliary Flag +#define I386FLAG_RESV3 HEX(0020) // Reserved - Must be 0 +#define I386FLAG_ZF HEX(0040) // Zero Flag +#define I386FLAG_SF HEX(0080) // Sign Flag +#define I386FLAG_TF HEX(0100) // Trap Flag (Single Step) +#define I386FLAG_IF HEX(0200) // Interrupt Flag +#define I386FLAG_DF HEX(0400) // Direction Flag +#define I386FLAG_OF HEX(0800) // Overflow Flag + +#define CR0_PE_SET HEX(00000001) /* OR this value with CR0 to enable pmode */ +#define CR0_PE_CLR HEX(FFFFFFFE) /* AND this value with CR0 to disable pmode */ + +/* Defines needed for switching between real and protected mode */ +#ifdef _M_IX86 +#define NULL_DESC HEX(00) /* NULL descriptor */ +#define PMODE_CS HEX(08) /* PMode code selector, base 0 limit 4g */ +#define PMODE_DS HEX(10) /* PMode data selector, base 0 limit 4g */ +#define RMODE_CS HEX(18) /* RMode code selector, base 0 limit 64k */ +#define RMODE_DS HEX(20) /* RMode data selector, base 0 limit 64k */ +#endif + +/* Makes "x" a global variable or label */ +#define EXTERN(x) .global x; x:
Propchange: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Fri Jun 10 17:18:26 2011 @@ -29,6 +29,7 @@ #define ROUND_UP(n, align) \ ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
+/* public headers */ #define NTOSAPI #define printf TuiPrintf #include <ntddk.h> @@ -45,78 +46,80 @@ #include <stdio.h> #include <ctype.h> #include <rosldr.h> +#include <rtl.h> +#include <ntdddisk.h> +#include <internal/hal.h> +#include <drivers/pci/pci.h> +#include <reactos/buildno.h> +#include <winerror.h> + +/* internal headers */ #include <arcemul.h> -#include <arch.h> -#include <rtl.h> +#include <bytesex.h> +#include <bget.h> +#include <cache.h> +#include <cmdline.h> +#include <comm.h> #include <disk.h> #include <fs.h> -#include <ui.h> +#include <inffile.h> +#include <inifile.h> +#include <keycodes.h> +#include <linux.h> +#include <machine.h> +#include <mm.h> #include <multiboot.h> -#include <mm.h> -#include <cache.h> -#include <machine.h> -#include <inifile.h> -#include <inffile.h> -#include <video.h> +#include <options.h> +#include <oslist.h> #include <ramdisk.h> #include <reactos.h> #include <registry.h> +#include <ui.h> +#include <ver.h> +#include <video.h> #include <winldr.h> -#include <ntdddisk.h> -#include <internal/hal.h> + /* file system headers */ #include <fs/ext2.h> #include <fs/fat.h> #include <fs/ntfs.h> #include <fs/iso.h> #include <fs/pxe.h> + /* ui support */ #include <ui/gui.h> #include <ui/minitui.h> #include <ui/noui.h> #include <ui/tui.h> -/* arch files */ + +/* arch specific includes */ #if defined(_M_IX86) #include <arch/i386/custom.h> #include <arch/i386/drivemap.h> -#include <arch/i386/hardware.h> #include <arch/i386/i386.h> -#include <arch/i386/machpc.h> #include <arch/i386/machxbox.h> #include <arch/i386/miscboot.h> -#include <arch/i386/pxe.h> +#include <arch/pc/hardware.h> +#include <arch/pc/machpc.h> +#include <arch/pc/x86common.h> +#include <arch/pc/pcbios.h> +#include <arch/pc/pxe.h> #include <internal/i386/intrin_i.h> +#elif defined(_M_AMD64) +#include <arch/amd64/amd64.h> +#include <arch/pc/hardware.h> +#include <arch/pc/machpc.h> +#include <arch/pc/x86common.h> +#include <arch/pc/pcbios.h> +#include <arch/pc/pxe.h> +#include <internal/amd64/intrin_i.h> #elif defined(_M_PPC) #include <arch/powerpc/hardware.h> #elif defined(_M_ARM) #include <arch/arm/hardware.h> #elif defined(_M_MIPS) #include <arch/mips/arcbios.h> -#elif defined(_M_AMD64) -#include <arch/amd64/hardware.h> -#include <arch/amd64/machpc.h> -#include <arch/i386/pxe.h> -#include <internal/amd64/intrin_i.h> #endif -/* misc files */ -#include <keycodes.h> -#include <ver.h> -#include <cmdline.h> -#include <bget.h> -#include <winerror.h> -/* Needed by boot manager */ -#include <oslist.h> -#include <options.h> -#include <linux.h> -/* Externals */ -#include <reactos/rossym.h> -#include <reactos/buildno.h> -/* Needed if debuging is enabled */ -#include <comm.h> -/* Swap */ -#include <bytesex.h> -/* Internal shared PCI header */ -#include <drivers/pci/pci.h>
VOID BootMain(LPSTR CmdLine); VOID RunLoader(VOID);