From 525c69f0c1de532650d0a7cab0877ef6ec8a04a7 Mon Sep 17 00:00:00 2001 From: ReactOS Portable Systems Group Date: Tue, 5 Feb 2008 03:06:20 +0000 Subject: [PATCH] Build FreeLDR for ARM. We merely provide a _start entrypoint stub and two stub architecture files with no functions implemented. We also supply the proper ARM configuration settings in the .rbuild files, and add the necessary headers. FreeLDR can now be compiled (along with rossym, libcntptr, rtl and cmlib) but it will not link until the actual ARM code is implemented. svn path=/trunk/; revision=32132 --- reactos/boot/freeldr/freeldr/arch/arm/boot.s | 23 +++++++ .../boot/freeldr/freeldr/arch/arm/macharm.c | 23 +++++++ reactos/boot/freeldr/freeldr/arch/arm/stubs.c | 15 +++++ reactos/boot/freeldr/freeldr/freeldr.rbuild | 15 +++++ .../boot/freeldr/freeldr/freeldr_arch.rbuild | 23 ++++++- reactos/boot/freeldr/freeldr/include/arch.h | 2 +- .../freeldr/include/arch/arm/hardware.h | 66 +++++++++++++++++++ .../boot/freeldr/freeldr/include/freeldr.h | 2 + reactos/boot/freeldr/freeldr/include/mm.h | 2 +- 9 files changed, 167 insertions(+), 4 deletions(-) create mode 100644 reactos/boot/freeldr/freeldr/arch/arm/boot.s create mode 100644 reactos/boot/freeldr/freeldr/arch/arm/macharm.c create mode 100644 reactos/boot/freeldr/freeldr/arch/arm/stubs.c create mode 100644 reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h diff --git a/reactos/boot/freeldr/freeldr/arch/arm/boot.s b/reactos/boot/freeldr/freeldr/arch/arm/boot.s new file mode 100644 index 00000000000..9df5730a283 --- /dev/null +++ b/reactos/boot/freeldr/freeldr/arch/arm/boot.s @@ -0,0 +1,23 @@ +/* + * PROJECT: ReactOS Boot Loader + * LICENSE: GPL - See COPYING in the top level directory + * FILE: boot/freeldr/arch/arm/boot.s + * PURPOSE: Implements the entry point for ARM machines + * PROGRAMMERS: alex@winsiderss.com + */ + +/* INCLUDES *******************************************************************/ + +//#include +//#include + +/* GLOBALS ********************************************************************/ + +.globl _start +.globl _bss + +/* BOOT CODE ******************************************************************/ + +.extern ArmInit +_start: + b . diff --git a/reactos/boot/freeldr/freeldr/arch/arm/macharm.c b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c new file mode 100644 index 00000000000..99e427885d7 --- /dev/null +++ b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c @@ -0,0 +1,23 @@ +/* + * PROJECT: ReactOS Boot Loader + * LICENSE: GPL - See COPYING in the top level directory + * FILE: boot/freeldr/arch/arm/marcharm.c + * PURPOSE: Implements ARM-specific machine initialization + * PROGRAMMERS: alex@winsiderss.com + */ + +/* INCLUDES *******************************************************************/ + +#include + +/* GLOBALS ********************************************************************/ + +/* FUNCTIONS ******************************************************************/ + +VOID +ArmMachInit(const char *CmdLine) +{ + // + // Setup ARM routines + // +} diff --git a/reactos/boot/freeldr/freeldr/arch/arm/stubs.c b/reactos/boot/freeldr/freeldr/arch/arm/stubs.c new file mode 100644 index 00000000000..c72a5ce5fef --- /dev/null +++ b/reactos/boot/freeldr/freeldr/arch/arm/stubs.c @@ -0,0 +1,15 @@ +/* + * PROJECT: ReactOS Boot Loader + * LICENSE: GPL - See COPYING in the top level directory + * FILE: boot/freeldr/arch/arm/stubs.c + * PURPOSE: Non-completed ARM hardware-specific routines + * PROGRAMMERS: alex@winsiderss.com + */ + +/* INCLUDES *******************************************************************/ + +#include + +/* GLOBALS ********************************************************************/ + +/* FUNCTIONS ******************************************************************/ diff --git a/reactos/boot/freeldr/freeldr/freeldr.rbuild b/reactos/boot/freeldr/freeldr/freeldr.rbuild index 9255277187e..7521086863f 100644 --- a/reactos/boot/freeldr/freeldr/freeldr.rbuild +++ b/reactos/boot/freeldr/freeldr/freeldr.rbuild @@ -18,6 +18,21 @@ -lgcc + + + + freeldr_startup + freeldr_base64k + freeldr_base + freeldr_arch + freeldr_main + rossym + cmlib + rtl + libcntpr + -lgcc + + freeldr_startup diff --git a/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild b/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild index 07ba521e418..177ec04436b 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild +++ b/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild @@ -59,8 +59,8 @@ ofw.c ofw_util.s ofw_calls.s - ofwdisk.c - ofw_method.c + ofwdisk.c + ofw_method.c prep.c prep_ide.c prep_pci.c @@ -87,4 +87,23 @@ + + + + include + cache + include + -ffreestanding + -fno-builtin + -fno-inline + -fno-zero-initialized-in-bss + -Os + + + boot.s + macharm.c + stubs.c + + + diff --git a/reactos/boot/freeldr/freeldr/include/arch.h b/reactos/boot/freeldr/freeldr/include/arch.h index c92c4c91e56..87e1c162adb 100644 --- a/reactos/boot/freeldr/freeldr/include/arch.h +++ b/reactos/boot/freeldr/freeldr/include/arch.h @@ -40,7 +40,7 @@ #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 */ -#elif defined(_M_PPC) +#elif defined(_M_PPC) || defined(_M_ARM) extern PVOID FsStaticBufferDisk, FsStaticBufferData; #define DISKREADBUFFER FsStaticBufferDisk #define FILESYSBUFFER FsStaticBufferData diff --git a/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h b/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h new file mode 100644 index 00000000000..bc651d6480e --- /dev/null +++ b/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h @@ -0,0 +1,66 @@ +/* + * PROJECT: ReactOS Boot Loader + * LICENSE: GPL - See COPYING in the top level directory + * FILE: boot/freeldr/include/arch/arm/hardware.h + * PURPOSE: Implements routines to support booting from a RAM Disk + * PROGRAMMERS: alex@winsiderss.com + */ + +#ifndef _ARM_HARDWARE_ +#define __ARM_HARDWARE_ + +#ifndef __REGISTRY_H +#include "../../reactos/registry.h" +#endif + +// +// 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 +FldrSetComponentInformation( + IN PCONFIGURATION_COMPONENT_DATA ComponentKey, + IN IDENTIFIER_FLAG Flags, + IN ULONG Key, + IN ULONG Affinity +); + +VOID +NTAPI +FldrSetIdentifier( + IN PCONFIGURATION_COMPONENT_DATA ComponentKey, + IN PCHAR Identifier +); + +VOID +NTAPI +FldrCreateSystemKey( + OUT PCONFIGURATION_COMPONENT_DATA *SystemKey +); + +VOID +NTAPI +FldrCreateComponentKey( + IN PCONFIGURATION_COMPONENT_DATA SystemKey, + IN PWCHAR BusName, + IN ULONG BusNumber, + IN CONFIGURATION_CLASS Class, + IN CONFIGURATION_TYPE Type, + OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey +); + +VOID +NTAPI +FldrSetConfigurationData( + IN PCONFIGURATION_COMPONENT_DATA ComponentKey, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, + IN ULONG Size +); + +#endif diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h index 3461355e97f..4b891514aa2 100644 --- a/reactos/boot/freeldr/freeldr/include/freeldr.h +++ b/reactos/boot/freeldr/freeldr/include/freeldr.h @@ -73,6 +73,8 @@ #include #elif defined(_M_PPC) #include +#elif defined(_M_ARM) +#include #elif defined(_M_MIPS) #include #endif diff --git a/reactos/boot/freeldr/freeldr/include/mm.h b/reactos/boot/freeldr/freeldr/include/mm.h index 7199c0597e8..ab6b7bf8f83 100644 --- a/reactos/boot/freeldr/freeldr/include/mm.h +++ b/reactos/boot/freeldr/freeldr/include/mm.h @@ -37,7 +37,7 @@ typedef struct ULONG Reserved; } PACKED BIOS_MEMORY_MAP, *PBIOS_MEMORY_MAP; -#if defined(__i386__) || defined(_PPC_) || defined(_MIPS_) +#if defined(__i386__) || defined(_PPC_) || defined(_MIPS_) || defined(_ARM_) #define MM_PAGE_SIZE 4096 #define MM_PAGE_MASK 0xFFF -- 2.17.1