[freeldr] Move custom.c, drivemap.c/h, miscboot.c/h to i386 directories

svn path=/trunk/; revision=43854
This commit is contained in:
Hervé Poussineau 2009-10-30 21:48:21 +00:00
parent 3fa52b7b78
commit 36c3408fb1
11 changed files with 66 additions and 46 deletions

View file

@ -34,13 +34,11 @@ const CHAR CustomBootPrompt[] = "Press ENTER to boot your custom boot setup.";
VOID OptionMenuCustomBoot(VOID)
{
PCSTR CustomBootMenuList[] = {
#ifdef __i386__
"Disk",
"Partition",
"Boot Sector File",
"ReactOS",
"Linux"
#endif /* __i386__ */
};
ULONG CustomBootMenuCount = sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]);
ULONG SelectedMenuItem;
@ -53,7 +51,6 @@ VOID OptionMenuCustomBoot(VOID)
switch (SelectedMenuItem)
{
#ifdef __i386__
case 0: // Disk
OptionMenuCustomBootDisk();
break;
@ -69,11 +66,9 @@ VOID OptionMenuCustomBoot(VOID)
case 4: // Linux
OptionMenuCustomBootLinux();
break;
#endif /* __i386__ */
}
}
#ifdef __i386__
VOID OptionMenuCustomBootDisk(VOID)
{
CHAR SectionName[100];
@ -408,4 +403,11 @@ VOID OptionMenuCustomBootLinux(VOID)
LoadAndBootLinux(SectionName, "Custom Linux Setup");
}
#endif /* __i386__ */
VOID OptionMenuReboot(VOID)
{
UiMessageBox("The system will now reboot.");
DiskStopFloppyMotor();
SoftReboot();
}

View file

@ -20,7 +20,6 @@
#include <freeldr.h>
#include <debug.h>
#ifdef __i386__
BOOLEAN DriveMapInstalled = FALSE; // Tells us if we have already installed our drive map int 13h handler code
ULONG OldInt13HandlerAddress = 0; // Address of BIOS int 13h handler
ULONG DriveMapHandlerAddress = 0; // Linear address of our drive map handler
@ -221,4 +220,3 @@ VOID DriveMapRemoveInt13Handler(VOID)
DriveMapInstalled = FALSE;
}
}
#endif /* __i386__ */

View file

@ -19,7 +19,6 @@
#include <freeldr.h>
#ifdef __i386__
VOID LoadAndBootBootSector(PCSTR OperatingSystemName)
{
PFILE FilePointer;
@ -211,4 +210,3 @@ VOID LoadAndBootDrive(PCSTR OperatingSystemName)
//DisableA20();
ChainLoadBiosBootSectorCode();
}
#endif /* __i386__ */

View file

@ -25,6 +25,8 @@
<if property="ARCH" value="i386">
<file>_alloca.S</file>
<file>archmach.c</file>
<file>custom.c</file>
<file>drivemap.c</file>
<file>hardware.c</file>
<file>hwacpi.c</file>
<file>hwapm.c</file>
@ -34,6 +36,7 @@
<file>i386vid.c</file>
<file>loader.c</file>
<file>machpc.c</file>
<file>miscboot.c</file>
<file>pccons.c</file>
<file>pcdisk.c</file>
<file>pcmem.c</file>

View file

@ -85,10 +85,7 @@
<directory name="include">
<pch>freeldr.h</pch>
</directory>
<file>drivemap.c</file>
<file>miscboot.c</file>
<file>options.c</file>
<file>linuxboot.c</file>
<file>oslist.c</file>
<file>custom.c</file>
</module>

View file

@ -0,0 +1,35 @@
/*
* FreeLoader
* Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __I386_OPTIONS_H
#define __I386_OPTIONS_H
#define HAS_OPTION_MENU_CUSTOM_BOOT
#define HAS_OPTION_MENU_REBOOT
VOID OptionMenuReboot(VOID);
VOID OptionMenuCustomBoot(VOID);
VOID OptionMenuCustomBootDisk(VOID);
VOID OptionMenuCustomBootPartition(VOID);
VOID OptionMenuCustomBootBootSectorFile(VOID);
VOID OptionMenuCustomBootReactOS(VOID);
VOID OptionMenuCustomBootLinux(VOID);
#endif // #defined __I386_OPTIONS_H

View file

@ -17,10 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __DRIVEMAP_H
#define __DRIVEMAP_H
#ifndef __I386_DRIVEMAP_H
#define __I386_DRIVEMAP_H
#ifdef __i386__
#include <pshpack1.h>
typedef struct
{
@ -39,6 +38,5 @@ extern PVOID DriveMapInt13HandlerStart;
extern PVOID DriveMapInt13HandlerEnd;
extern ULONG DriveMapOldInt13HandlerAddress;
extern DRIVE_MAP_LIST DriveMapInt13HandlerMapList;
#endif /* __i386__ */
#endif // #defined __DRIVEMAP_H
#endif // #defined __I386_DRIVEMAP_H

View file

@ -17,13 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __BOOT_H
#define __BOOT_H
#ifndef __I386_BOOT_H
#define __I386_BOOT_H
#ifdef __i386__
VOID LoadAndBootBootSector(PCSTR OperatingSystemName);
VOID LoadAndBootPartition(PCSTR OperatingSystemName);
VOID LoadAndBootDrive(PCSTR OperatingSystemName);
#endif /* __i386__ */
#endif // defined __BOOT_H
#endif // defined __I386_BOOT_H

View file

@ -71,10 +71,13 @@
#include <ui/tui.h>
/* arch files */
#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 <internal/i386/intrin_i.h>
#include <internal/i386/ke.h>
#elif defined(_M_PPC)
@ -96,8 +99,6 @@
/* Needed by boot manager */
#include <bootmgr.h>
#include <oslist.h>
#include <drivemap.h>
#include <miscboot.h>
#include <options.h>
#include <linux.h>
/* Externals */

View file

@ -22,15 +22,4 @@
VOID DoOptionsMenu(VOID);
VOID OptionMenuReboot(VOID);
VOID OptionMenuCustomBoot(VOID);
#ifdef __i386__
VOID OptionMenuCustomBootDisk(VOID);
VOID OptionMenuCustomBootPartition(VOID);
VOID OptionMenuCustomBootBootSectorFile(VOID);
VOID OptionMenuCustomBootReactOS(VOID);
VOID OptionMenuCustomBootLinux(VOID);
#endif /* __i386__ */
#endif // #defined __OPTIONS_H

View file

@ -35,8 +35,12 @@ PCSTR OptionsMenuList[] =
"SEPARATOR",
#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
"Custom Boot",
#endif
#ifdef HAS_OPTION_MENU_REBOOT
"Reboot",
#endif
};
enum OptionMenuItems
@ -55,8 +59,12 @@ enum OptionMenuItems
SEPARATOR2 = 9,
#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
CUSTOM_BOOT = 10,
#endif
#ifdef HAS_OPTION_MENU_REBOOT
REBOOT = 11,
#endif
};
ULONG OptionsMenuItemCount = sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]);
@ -96,22 +104,15 @@ VOID DoOptionsMenu(VOID)
break;
//case SEPARATOR2:
// break;
#ifdef HAS_OPTION_MENU_CUSTOM_BOOT
case CUSTOM_BOOT:
OptionMenuCustomBoot();
break;
#endif
#ifdef HAS_OPTION_MENU_REBOOT
case REBOOT:
OptionMenuReboot();
break;
}
}
VOID OptionMenuReboot(VOID)
{
UiMessageBox("The system will now reboot.");
#ifdef __i386__
DiskStopFloppyMotor();
SoftReboot();
#else
#endif
}