mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 17:14:41 +00:00
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:
parent
81a79af1eb
commit
fb29fa8a10
12 changed files with 93 additions and 51 deletions
|
@ -18,14 +18,18 @@
|
|||
#
|
||||
|
||||
RM = cmd /C del
|
||||
CP = copy /Y
|
||||
MKDIR = md
|
||||
NASM_CMD = nasm
|
||||
BIN2C = ../tools/bin2c
|
||||
TOOLSDIR = ../tools
|
||||
BOOTCD_DIR = ..\..\bootcd
|
||||
|
||||
.PHONY : clean
|
||||
.PHONY : clean bootcd
|
||||
|
||||
all: $(BIN2C) fat.bin fat32.bin isoboot.bin ext2.bin
|
||||
|
||||
|
||||
$(BIN2C) :
|
||||
@$(MAKE) --no-print-directory -C $(TOOLSDIR)
|
||||
|
||||
|
@ -49,6 +53,19 @@ ext2.bin : ext2.asm
|
|||
@$(NASM_CMD) -o ext2.bin -f bin ext2.asm
|
||||
@$(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:
|
||||
@-$(RM) *.bin
|
||||
@-$(RM) *.h
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
; ****************************************************************************
|
||||
|
||||
; 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
|
||||
%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 si, di ; restore file pointer
|
||||
mov cx, 0xFFFF ; load the whole 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)
|
||||
|
||||
- fs/iso.c: Got iso-fs working again.
|
||||
|
|
|
@ -30,6 +30,8 @@ DEBUG = yes
|
|||
OBJDIR = obj
|
||||
OUTPUT_DIR = $(OBJDIR)/$(TARGET)
|
||||
|
||||
BOOTCD_DIR = ../../bootcd
|
||||
|
||||
#############################################
|
||||
# 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
|
||||
#-----------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include <bootmgr.h>
|
||||
#include <drivemap.h>
|
||||
|
||||
BOOL IsSetupLdr = FALSE;
|
||||
|
||||
VOID RunLoader(VOID)
|
||||
{
|
||||
UCHAR SettingName[80];
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
//#define DEBUG_ULTRA
|
||||
//#define DEBUG_INIFILE
|
||||
//#define DEBUG_REACTOS
|
||||
#define DEBUG_CUSTOM
|
||||
//#define DEBUG_NONE
|
||||
//#define DEBUG_CUSTOM
|
||||
#define DEBUG_NONE
|
||||
|
||||
#if defined (DEBUG_ULTRA)
|
||||
U32 DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM |
|
||||
|
@ -56,8 +56,8 @@ U32 DebugPrintMask = 0;
|
|||
#define BOCHS_OUTPUT_PORT 0xe9
|
||||
|
||||
//U32 DebugPort = RS232;
|
||||
//U32 DebugPort = SCREEN;
|
||||
U32 DebugPort = BOCHS;
|
||||
U32 DebugPort = SCREEN;
|
||||
//U32 DebugPort = BOCHS;
|
||||
U32 ComPort = COM1;
|
||||
//U32 BaudRate = 19200;
|
||||
U32 BaudRate = 115200;
|
||||
|
|
|
@ -56,7 +56,7 @@ BOOL DiskReadLogicalSectors(U32 DriveNumber, U32 SectorNumber, U32 SectorCount,
|
|||
// If so then check to see if Int13 extensions work
|
||||
// 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"));
|
||||
|
||||
|
|
|
@ -44,29 +44,25 @@ BOOL DiskIsDriveRemovable(U32 DriveNumber)
|
|||
BOOL DiskIsDriveCdRom(U32 DriveNumber)
|
||||
{
|
||||
PUCHAR Sector = (PUCHAR)DISKREADBUFFER;
|
||||
BOOL Result;
|
||||
|
||||
// Hard disks use drive numbers >= 0x80
|
||||
// So if the drive number indicates a hard disk
|
||||
// then return FALSE
|
||||
if ((DriveNumber >= 0x80) && (BiosInt13ExtensionsSupported(DriveNumber)))
|
||||
if ((DriveNumber >= 0x80) && (IsSetupLdr || BiosInt13ExtensionsSupported(DriveNumber)))
|
||||
{
|
||||
|
||||
if (!BiosInt13ReadExtended(DriveNumber, 16, 1, Sector))
|
||||
{
|
||||
DiskError("Disk read error.");
|
||||
MmFreeMemory(Sector);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Result = (Sector[0] == 1 &&
|
||||
Sector[1] == 'C' &&
|
||||
Sector[2] == 'D' &&
|
||||
Sector[3] == '0' &&
|
||||
Sector[4] == '0' &&
|
||||
Sector[5] == '1');
|
||||
|
||||
return Result;
|
||||
return (Sector[0] == 1 &&
|
||||
Sector[1] == 'C' &&
|
||||
Sector[2] == 'D' &&
|
||||
Sector[3] == '0' &&
|
||||
Sector[4] == '0' &&
|
||||
Sector[5] == '1');
|
||||
}
|
||||
|
||||
// Drive is not CdRom so return FALSE
|
||||
|
|
|
@ -68,6 +68,7 @@ typedef S64 __s64;
|
|||
extern U32 BootDrive; // BIOS boot drive, 0-A:, 1-B:, 0x80-C:, 0x81-D:, etc.
|
||||
extern U32 BootPartition; // Boot Partition, 1-4
|
||||
extern BOOL UserInterfaceUp; // Tells us if the user interface is displayed
|
||||
extern BOOL IsSetupLdr;
|
||||
|
||||
void BootMain(void);
|
||||
VOID RunLoader(VOID);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
/* 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 AUTHOR_EMAIL "<brianp@sginet.com>"
|
||||
#define BY_AUTHOR "by Brian Palmer"
|
||||
|
@ -36,7 +36,7 @@
|
|||
//
|
||||
#define FREELOADER_MAJOR_VERSION 1
|
||||
#define FREELOADER_MINOR_VERSION 7
|
||||
#define FREELOADER_PATCH_VERSION 7
|
||||
#define FREELOADER_PATCH_VERSION 8
|
||||
|
||||
|
||||
PUCHAR GetFreeLoaderVersionString(VOID);
|
||||
|
|
|
@ -39,6 +39,7 @@ static HKEY RootKey;
|
|||
VOID
|
||||
RegInitializeRegistry(VOID)
|
||||
{
|
||||
/* Create root key */
|
||||
RootKey = (HKEY)MmAllocateMemory(sizeof(KEY));
|
||||
|
||||
InitializeListHead(&RootKey->SubKeyList);
|
||||
|
@ -52,6 +53,16 @@ RegInitializeRegistry(VOID)
|
|||
RootKey->DataType = 0;
|
||||
RootKey->DataSize = 0;
|
||||
RootKey->Data = NULL;
|
||||
|
||||
/* Create SYSTEM key */
|
||||
RegCreateKey(RootKey,
|
||||
"Registry\\Machine\\SYSTEM",
|
||||
NULL);
|
||||
|
||||
/* Create HARDWARE key */
|
||||
RegCreateKey(RootKey,
|
||||
"Registry\\Machine\\HARDWARE",
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "registry.h"
|
||||
#include "hwdetect.h"
|
||||
|
||||
BOOL IsSetupLdr = TRUE;
|
||||
|
||||
static BOOL
|
||||
LoadKernel(PCHAR szFileName)
|
||||
|
@ -98,7 +99,6 @@ LoadDriver(PCHAR szFileName)
|
|||
|
||||
VOID RunLoader(VOID)
|
||||
{
|
||||
printf("RunLoader() called!\n");
|
||||
|
||||
/* 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;
|
||||
|
@ -124,16 +124,16 @@ VOID RunLoader(VOID)
|
|||
#endif
|
||||
}
|
||||
#if 0
|
||||
//printf("low_mem = %d\n", mb_info.mem_lower);
|
||||
//printf("high_mem = %d\n", mb_info.mem_upper);
|
||||
//getch();
|
||||
// printf("low_mem = %d\n", mb_info.mem_lower);
|
||||
// printf("high_mem = %d\n", mb_info.mem_upper);
|
||||
// getch();
|
||||
#endif
|
||||
|
||||
/* Initialize registry */
|
||||
RegInitializeRegistry();
|
||||
|
||||
/* Detect hardware */
|
||||
printf("Detecting hardware...");
|
||||
printf("Detecting hardware...\n\n");
|
||||
DetectHardware();
|
||||
|
||||
/* set boot drive and partition */
|
||||
|
@ -142,7 +142,7 @@ VOID RunLoader(VOID)
|
|||
|
||||
/* Copy ARC path into kernel command line */
|
||||
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);
|
||||
|
||||
/* Open boot drive */
|
||||
|
@ -162,29 +162,25 @@ VOID RunLoader(VOID)
|
|||
return;
|
||||
|
||||
|
||||
/*
|
||||
* Export the system and hardware hives
|
||||
*/
|
||||
// Base = MultiBootCreateModule(SYSTEM.HIV);
|
||||
// RegExportHive("\\Registry\\Machine\\SYSTEM", Base, &Size);
|
||||
// MultiBootCloseModule(Base, Size);
|
||||
/* Export the system and hardware hives */
|
||||
// Base = MultiBootCreateModule(SYSTEM.HIV);
|
||||
// RegExportHive("\\Registry\\Machine\\SYSTEM", Base, &Size);
|
||||
// MultiBootCloseModule(Base, Size);
|
||||
|
||||
// Base = MultiBootCreateModule(HARDWARE.HIV);
|
||||
// RegExportHive("\\Registry\\Machine\\HARDWARE", Base, &Size);
|
||||
// MultiBootCloseModule(Base, Size);
|
||||
// Base = MultiBootCreateModule(HARDWARE.HIV);
|
||||
// RegExportHive("\\Registry\\Machine\\HARDWARE", Base, &Size);
|
||||
// MultiBootCloseModule(Base, Size);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Load NLS files
|
||||
*/
|
||||
/* Load NLS files */
|
||||
#if 0
|
||||
if (!LoadNlsFiles(szBootPath))
|
||||
{
|
||||
MessageBox("Failed to load NLS files\n");
|
||||
return;
|
||||
}
|
||||
if (!LoadNlsFiles(szBootPath))
|
||||
{
|
||||
MessageBox("Failed to load NLS files\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue