[freeldr] Move custom.c, drivemap.c/h, miscboot.c/h to i386 directories
authorHervé Poussineau <hpoussin@reactos.org>
Fri, 30 Oct 2009 21:48:21 +0000 (21:48 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Fri, 30 Oct 2009 21:48:21 +0000 (21:48 +0000)
svn path=/trunk/; revision=43854

reactos/boot/freeldr/freeldr/arch/i386/custom.c [moved from reactos/boot/freeldr/freeldr/custom.c with 98% similarity]
reactos/boot/freeldr/freeldr/arch/i386/drivemap.c [moved from reactos/boot/freeldr/freeldr/drivemap.c with 99% similarity]
reactos/boot/freeldr/freeldr/arch/i386/miscboot.c [moved from reactos/boot/freeldr/freeldr/miscboot.c with 99% similarity]
reactos/boot/freeldr/freeldr/freeldr_arch.rbuild
reactos/boot/freeldr/freeldr/freeldr_base.rbuild
reactos/boot/freeldr/freeldr/include/arch/i386/custom.h [new file with mode: 0644]
reactos/boot/freeldr/freeldr/include/arch/i386/drivemap.h [moved from reactos/boot/freeldr/freeldr/include/drivemap.h with 93% similarity]
reactos/boot/freeldr/freeldr/include/arch/i386/miscboot.h [moved from reactos/boot/freeldr/freeldr/include/miscboot.h with 90% similarity]
reactos/boot/freeldr/freeldr/include/freeldr.h
reactos/boot/freeldr/freeldr/include/options.h
reactos/boot/freeldr/freeldr/options.c

similarity index 98%
rename from reactos/boot/freeldr/freeldr/custom.c
rename to reactos/boot/freeldr/freeldr/arch/i386/custom.c
index b838de9..14e651d 100644 (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();
+}
similarity index 99%
rename from reactos/boot/freeldr/freeldr/drivemap.c
rename to reactos/boot/freeldr/freeldr/arch/i386/drivemap.c
index 6f4b916..53da896 100644 (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__ */
similarity index 99%
rename from reactos/boot/freeldr/freeldr/miscboot.c
rename to reactos/boot/freeldr/freeldr/arch/i386/miscboot.c
index 65ee52c..e0aa98c 100644 (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__ */
index 805f59f..3eaee52 100644 (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>
index c13ad44..2607147 100644 (file)
        <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>
diff --git a/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h b/reactos/boot/freeldr/freeldr/include/arch/i386/custom.h
new file mode 100644 (file)
index 0000000..3594c4a
--- /dev/null
@@ -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
  *  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
  *  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
index ffdf7da..406e117 100644 (file)
 #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 */
index c95705a..bfa6479 100644 (file)
 
 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
index ad32798..2c1f6c6 100644 (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
 }