Added new 'bootcd' target.

Removed/disabled debugging code.
SetupLdr must not call BiosInt13ExtensionsSupported() to check extended int13 capabilities because they are already used to boot a CD and some BIOSes return incorrect results when a CD-ROM drive is checked.

svn path=/trunk/; revision=3465
This commit is contained in:
Eric Kohl 2002-09-06 22:38:10 +00:00
parent 81a79af1eb
commit fb29fa8a10
12 changed files with 93 additions and 51 deletions

View file

@ -18,14 +18,18 @@
# #
RM = cmd /C del RM = cmd /C del
CP = copy /Y
MKDIR = md
NASM_CMD = nasm NASM_CMD = nasm
BIN2C = ../tools/bin2c BIN2C = ../tools/bin2c
TOOLSDIR = ../tools TOOLSDIR = ../tools
BOOTCD_DIR = ..\..\bootcd
.PHONY : clean .PHONY : clean bootcd
all: $(BIN2C) fat.bin fat32.bin isoboot.bin ext2.bin all: $(BIN2C) fat.bin fat32.bin isoboot.bin ext2.bin
$(BIN2C) : $(BIN2C) :
@$(MAKE) --no-print-directory -C $(TOOLSDIR) @$(MAKE) --no-print-directory -C $(TOOLSDIR)
@ -49,6 +53,19 @@ ext2.bin : ext2.asm
@$(NASM_CMD) -o ext2.bin -f bin ext2.asm @$(NASM_CMD) -o ext2.bin -f bin ext2.asm
@$(BIN2C) ext2.bin ext2.h ext2_data @$(BIN2C) ext2.bin ext2.h ext2_data
.PHONY : bootcd
bootcd: bootcd_dirs isoboot.bin
$(CP) isoboot.bin $(BOOTCD_DIR)
.PHONY : bootcd_dirs
bootcd_dirs:
$(MKDIR) $(BOOTCD_DIR)
$(MKDIR) $(BOOTCD_DIR)\disk
$(MKDIR) $(BOOTCD_DIR)\disk\reactos
$(MKDIR) $(BOOTCD_DIR)\disk\install
$(MKDIR) $(BOOTCD_DIR)\disk\bootdisk
clean: clean:
@-$(RM) *.bin @-$(RM) *.bin
@-$(RM) *.h @-$(RM) *.h

View file

@ -31,7 +31,7 @@
; **************************************************************************** ; ****************************************************************************
; Note: The Makefile builds one version with DEBUG_MESSAGES automatically. ; Note: The Makefile builds one version with DEBUG_MESSAGES automatically.
%define DEBUG_MESSAGES ; Uncomment to get debugging messages ;%define DEBUG_MESSAGES ; Uncomment to get debugging messages
@ -342,14 +342,6 @@ get_fs_structures:
call crlf call crlf
%endif %endif
mov eax, [di+file_sector]
call writehex8
call crlf
mov eax, [di+file_left]
call writehex8
call crlf
mov bx, 0x8000 ; bx = load address mov bx, 0x8000 ; bx = load address
mov si, di ; restore file pointer mov si, di ; restore file pointer
mov cx, 0xFFFF ; load the whole file mov cx, 0xFFFF ; load the whole file

View file

@ -1,3 +1,12 @@
Changes in v1.7.8 (9/7/2002) (ekohl)
- Added new 'bootcd' target.
- Removed/disabled debugging code.
- SetupLdr must not call BiosInt13ExtensionsSupported to check
extended int13 capabilities because they are already used to
boot a CD and some BIOSes return incorrect results when a CD-ROM
drive is checked.
Changes in v1.7.7 (9/5/2002) (ekohl) Changes in v1.7.7 (9/5/2002) (ekohl)
- fs/iso.c: Got iso-fs working again. - fs/iso.c: Got iso-fs working again.

View file

@ -30,6 +30,8 @@ DEBUG = yes
OBJDIR = obj OBJDIR = obj
OUTPUT_DIR = $(OBJDIR)/$(TARGET) OUTPUT_DIR = $(OBJDIR)/$(TARGET)
BOOTCD_DIR = ../../bootcd
############################################# #############################################
# COMPILER AND LINKER PROGRAMS # COMPILER AND LINKER PROGRAMS
# #
@ -104,6 +106,22 @@ clean:
############################################# #############################################
.PHONY : bootcd
bootcd : bootcd_dirs $(OBJDIR)/$(TARGET)/setupldr.sys
$(CP) $(OBJDIR)/$(TARGET)/setupldr.sys $(BOOTCD_DIR)/disk/reactos/setupldr.sys
.PHONY : bootcd_dirs
bootcd_dirs:
$(MKDIR) $(BOOTCD_DIR)
$(MKDIR) $(BOOTCD_DIR)/disk
$(MKDIR) $(BOOTCD_DIR)/disk/reactos
$(MKDIR) $(BOOTCD_DIR)/disk/install
$(MKDIR) $(BOOTCD_DIR)/disk/bootdisk
#############################################
#----------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------
# END MAGIC TARGET DIRECTORY CHANGE STUFF # END MAGIC TARGET DIRECTORY CHANGE STUFF
#----------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------

View file

@ -33,6 +33,8 @@
#include <bootmgr.h> #include <bootmgr.h>
#include <drivemap.h> #include <drivemap.h>
BOOL IsSetupLdr = FALSE;
VOID RunLoader(VOID) VOID RunLoader(VOID)
{ {
UCHAR SettingName[80]; UCHAR SettingName[80];

View file

@ -27,8 +27,8 @@
//#define DEBUG_ULTRA //#define DEBUG_ULTRA
//#define DEBUG_INIFILE //#define DEBUG_INIFILE
//#define DEBUG_REACTOS //#define DEBUG_REACTOS
#define DEBUG_CUSTOM //#define DEBUG_CUSTOM
//#define DEBUG_NONE #define DEBUG_NONE
#if defined (DEBUG_ULTRA) #if defined (DEBUG_ULTRA)
U32 DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM | U32 DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM |
@ -56,8 +56,8 @@ U32 DebugPrintMask = 0;
#define BOCHS_OUTPUT_PORT 0xe9 #define BOCHS_OUTPUT_PORT 0xe9
//U32 DebugPort = RS232; //U32 DebugPort = RS232;
//U32 DebugPort = SCREEN; U32 DebugPort = SCREEN;
U32 DebugPort = BOCHS; //U32 DebugPort = BOCHS;
U32 ComPort = COM1; U32 ComPort = COM1;
//U32 BaudRate = 19200; //U32 BaudRate = 19200;
U32 BaudRate = 115200; U32 BaudRate = 115200;

View file

@ -56,7 +56,7 @@ BOOL DiskReadLogicalSectors(U32 DriveNumber, U32 SectorNumber, U32 SectorCount,
// If so then check to see if Int13 extensions work // If so then check to see if Int13 extensions work
// If they do then use them, otherwise default back to BIOS calls // If they do then use them, otherwise default back to BIOS calls
// //
if ((DriveNumber >= 0x80) && (BiosInt13ExtensionsSupported(DriveNumber))) if ((DriveNumber >= 0x80) && (IsSetupLdr || BiosInt13ExtensionsSupported(DriveNumber)))
{ {
DbgPrint((DPRINT_DISK, "Using Int 13 Extensions for read. BiosInt13ExtensionsSupported(%d) = %s\n", DriveNumber, BiosInt13ExtensionsSupported(DriveNumber) ? "TRUE" : "FALSE")); DbgPrint((DPRINT_DISK, "Using Int 13 Extensions for read. BiosInt13ExtensionsSupported(%d) = %s\n", DriveNumber, BiosInt13ExtensionsSupported(DriveNumber) ? "TRUE" : "FALSE"));

View file

@ -44,29 +44,25 @@ BOOL DiskIsDriveRemovable(U32 DriveNumber)
BOOL DiskIsDriveCdRom(U32 DriveNumber) BOOL DiskIsDriveCdRom(U32 DriveNumber)
{ {
PUCHAR Sector = (PUCHAR)DISKREADBUFFER; PUCHAR Sector = (PUCHAR)DISKREADBUFFER;
BOOL Result;
// Hard disks use drive numbers >= 0x80 // Hard disks use drive numbers >= 0x80
// So if the drive number indicates a hard disk // So if the drive number indicates a hard disk
// then return FALSE // then return FALSE
if ((DriveNumber >= 0x80) && (BiosInt13ExtensionsSupported(DriveNumber))) if ((DriveNumber >= 0x80) && (IsSetupLdr || BiosInt13ExtensionsSupported(DriveNumber)))
{ {
if (!BiosInt13ReadExtended(DriveNumber, 16, 1, Sector)) if (!BiosInt13ReadExtended(DriveNumber, 16, 1, Sector))
{ {
DiskError("Disk read error."); DiskError("Disk read error.");
MmFreeMemory(Sector);
return FALSE; return FALSE;
} }
Result = (Sector[0] == 1 && return (Sector[0] == 1 &&
Sector[1] == 'C' && Sector[1] == 'C' &&
Sector[2] == 'D' && Sector[2] == 'D' &&
Sector[3] == '0' && Sector[3] == '0' &&
Sector[4] == '0' && Sector[4] == '0' &&
Sector[5] == '1'); Sector[5] == '1');
return Result;
} }
// Drive is not CdRom so return FALSE // Drive is not CdRom so return FALSE

View file

@ -68,6 +68,7 @@ typedef S64 __s64;
extern U32 BootDrive; // BIOS boot drive, 0-A:, 1-B:, 0x80-C:, 0x81-D:, etc. extern U32 BootDrive; // BIOS boot drive, 0-A:, 1-B:, 0x80-C:, 0x81-D:, etc.
extern U32 BootPartition; // Boot Partition, 1-4 extern U32 BootPartition; // Boot Partition, 1-4
extern BOOL UserInterfaceUp; // Tells us if the user interface is displayed extern BOOL UserInterfaceUp; // Tells us if the user interface is displayed
extern BOOL IsSetupLdr;
void BootMain(void); void BootMain(void);
VOID RunLoader(VOID); VOID RunLoader(VOID);

View file

@ -22,7 +22,7 @@
/* just some stuff */ /* just some stuff */
#define VERSION "FreeLoader v1.7.7" #define VERSION "FreeLoader v1.7.8"
#define COPYRIGHT "Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>" #define COPYRIGHT "Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>"
#define AUTHOR_EMAIL "<brianp@sginet.com>" #define AUTHOR_EMAIL "<brianp@sginet.com>"
#define BY_AUTHOR "by Brian Palmer" #define BY_AUTHOR "by Brian Palmer"
@ -36,7 +36,7 @@
// //
#define FREELOADER_MAJOR_VERSION 1 #define FREELOADER_MAJOR_VERSION 1
#define FREELOADER_MINOR_VERSION 7 #define FREELOADER_MINOR_VERSION 7
#define FREELOADER_PATCH_VERSION 7 #define FREELOADER_PATCH_VERSION 8
PUCHAR GetFreeLoaderVersionString(VOID); PUCHAR GetFreeLoaderVersionString(VOID);

View file

@ -39,6 +39,7 @@ static HKEY RootKey;
VOID VOID
RegInitializeRegistry(VOID) RegInitializeRegistry(VOID)
{ {
/* Create root key */
RootKey = (HKEY)MmAllocateMemory(sizeof(KEY)); RootKey = (HKEY)MmAllocateMemory(sizeof(KEY));
InitializeListHead(&RootKey->SubKeyList); InitializeListHead(&RootKey->SubKeyList);
@ -52,6 +53,16 @@ RegInitializeRegistry(VOID)
RootKey->DataType = 0; RootKey->DataType = 0;
RootKey->DataSize = 0; RootKey->DataSize = 0;
RootKey->Data = NULL; RootKey->Data = NULL;
/* Create SYSTEM key */
RegCreateKey(RootKey,
"Registry\\Machine\\SYSTEM",
NULL);
/* Create HARDWARE key */
RegCreateKey(RootKey,
"Registry\\Machine\\HARDWARE",
NULL);
} }

View file

@ -30,6 +30,7 @@
#include "registry.h" #include "registry.h"
#include "hwdetect.h" #include "hwdetect.h"
BOOL IsSetupLdr = TRUE;
static BOOL static BOOL
LoadKernel(PCHAR szFileName) LoadKernel(PCHAR szFileName)
@ -98,7 +99,6 @@ LoadDriver(PCHAR szFileName)
VOID RunLoader(VOID) VOID RunLoader(VOID)
{ {
printf("RunLoader() called!\n");
/* Setup multiboot information structure */ /* Setup multiboot information structure */
mb_info.flags = MB_INFO_FLAG_MEM_SIZE | MB_INFO_FLAG_BOOT_DEVICE | MB_INFO_FLAG_COMMAND_LINE | MB_INFO_FLAG_MODULES; mb_info.flags = MB_INFO_FLAG_MEM_SIZE | MB_INFO_FLAG_BOOT_DEVICE | MB_INFO_FLAG_COMMAND_LINE | MB_INFO_FLAG_MODULES;
@ -124,16 +124,16 @@ VOID RunLoader(VOID)
#endif #endif
} }
#if 0 #if 0
//printf("low_mem = %d\n", mb_info.mem_lower); // printf("low_mem = %d\n", mb_info.mem_lower);
//printf("high_mem = %d\n", mb_info.mem_upper); // printf("high_mem = %d\n", mb_info.mem_upper);
//getch(); // getch();
#endif #endif
/* Initialize registry */ /* Initialize registry */
RegInitializeRegistry(); RegInitializeRegistry();
/* Detect hardware */ /* Detect hardware */
printf("Detecting hardware..."); printf("Detecting hardware...\n\n");
DetectHardware(); DetectHardware();
/* set boot drive and partition */ /* set boot drive and partition */
@ -142,7 +142,7 @@ VOID RunLoader(VOID)
/* Copy ARC path into kernel command line */ /* Copy ARC path into kernel command line */
sprintf(multiboot_kernel_cmdline, sprintf(multiboot_kernel_cmdline,
"multi(0)disk(0)cdrom(%u)\\reactos /DEBUGPORT=SCREEN", "multi(0)disk(0)cdrom(%u)\\reactos /DEBUGPORT=COM1",
(unsigned int)BootDrive); (unsigned int)BootDrive);
/* Open boot drive */ /* Open boot drive */
@ -162,29 +162,25 @@ VOID RunLoader(VOID)
return; return;
/* /* Export the system and hardware hives */
* Export the system and hardware hives // Base = MultiBootCreateModule(SYSTEM.HIV);
*/ // RegExportHive("\\Registry\\Machine\\SYSTEM", Base, &Size);
// Base = MultiBootCreateModule(SYSTEM.HIV); // MultiBootCloseModule(Base, Size);
// RegExportHive("\\Registry\\Machine\\SYSTEM", Base, &Size);
// MultiBootCloseModule(Base, Size);
// Base = MultiBootCreateModule(HARDWARE.HIV); // Base = MultiBootCreateModule(HARDWARE.HIV);
// RegExportHive("\\Registry\\Machine\\HARDWARE", Base, &Size); // RegExportHive("\\Registry\\Machine\\HARDWARE", Base, &Size);
// MultiBootCloseModule(Base, Size); // MultiBootCloseModule(Base, Size);
/* /* Load NLS files */
* Load NLS files
*/
#if 0 #if 0
if (!LoadNlsFiles(szBootPath)) if (!LoadNlsFiles(szBootPath))
{ {
MessageBox("Failed to load NLS files\n"); MessageBox("Failed to load NLS files\n");
return; return;
} }
#endif #endif