mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
- Enabled the 'Press any key to boot from CD' message in the ISO
boot code and show it only when some hard disk is present. - Adjusted detection timeouts for PS/2 and RS232 to the minimum allowed by the specifications so we don't spend ages in hardware detection. - Experimental NTFS reading support. (No boot code, no attribute lists, no decompression) svn path=/trunk/; revision=9493
This commit is contained in:
parent
5a22e5bcf0
commit
470210fb06
9 changed files with 81 additions and 21 deletions
|
@ -33,7 +33,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
|
||||||
|
|
||||||
|
%define WAIT_FOR_KEY
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
|
@ -139,6 +139,14 @@ relocate:
|
||||||
jmp .kbd_buffer_test
|
jmp .kbd_buffer_test
|
||||||
.kbd_buffer_empty:
|
.kbd_buffer_empty:
|
||||||
|
|
||||||
|
; Check if there is harddisk
|
||||||
|
pusha
|
||||||
|
mov ax, 0800h
|
||||||
|
mov dx, 0080h
|
||||||
|
int 13h
|
||||||
|
popa
|
||||||
|
jc .boot_cdrom
|
||||||
|
|
||||||
; Display the 'Press key' message and wait for a maximum of 5 seconds
|
; Display the 'Press key' message and wait for a maximum of 5 seconds
|
||||||
call crlf
|
call crlf
|
||||||
mov si, presskey_msg ; si points to 'Press key' message
|
mov si, presskey_msg ; si points to 'Press key' message
|
||||||
|
@ -164,6 +172,8 @@ relocate:
|
||||||
jmp .next_second
|
jmp .next_second
|
||||||
|
|
||||||
.boot_harddisk:
|
.boot_harddisk:
|
||||||
|
call crlf
|
||||||
|
|
||||||
; Boot first harddisk (drive 0x80)
|
; Boot first harddisk (drive 0x80)
|
||||||
mov ax, 0201h
|
mov ax, 0201h
|
||||||
mov dx, 0080h
|
mov dx, 0080h
|
||||||
|
@ -998,12 +1008,3 @@ MaxTransfer dw 2 ;32 ; Max sectors per transfer
|
||||||
|
|
||||||
times 2046-($-$$) db 0 ; Pad to file offset 2046
|
times 2046-($-$$) db 0 ; Pad to file offset 2046
|
||||||
dw 0aa55h ; BootSector signature
|
dw 0aa55h ; BootSector signature
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
Changes in v1.8.21 (21/05/2004) (navaraf)
|
||||||
|
|
||||||
|
- Experimental NTFS reading support with no boot code yet.
|
||||||
|
- Adjusted detection timeouts for PS/2 and RS232 to the minimum
|
||||||
|
allowed by the specifications.
|
||||||
|
- Enabled the 'Press any key to boot from CD' message in the ISO
|
||||||
|
boot code and show it only when some hard disk is present.
|
||||||
|
|
||||||
Changes in v1.8.20 (21/05/2004) (navaraf)
|
Changes in v1.8.20 (21/05/2004) (navaraf)
|
||||||
|
|
||||||
- Added support for special value "LiveCD" of SystemPath option
|
- Added support for special value "LiveCD" of SystemPath option
|
||||||
|
|
|
@ -249,6 +249,7 @@ FS_OBJS = fs.o \
|
||||||
fat.o \
|
fat.o \
|
||||||
iso.o \
|
iso.o \
|
||||||
ext2.o \
|
ext2.o \
|
||||||
|
ntfs.o \
|
||||||
fsrec.o
|
fsrec.o
|
||||||
|
|
||||||
UI_OBJS = tui.o \
|
UI_OBJS = tui.o \
|
||||||
|
|
|
@ -719,13 +719,13 @@ DetectMicrosoftMouse(U32 Port)
|
||||||
{
|
{
|
||||||
CHAR Buffer[4];
|
CHAR Buffer[4];
|
||||||
U32 i;
|
U32 i;
|
||||||
U32 TimeOut = 250;
|
U32 TimeOut = 200;
|
||||||
U8 LineControl;
|
U8 LineControl;
|
||||||
|
|
||||||
/* Shutdown mouse or something like that */
|
/* Shutdown mouse or something like that */
|
||||||
LineControl = READ_PORT_UCHAR((PUCHAR)Port + 4);
|
LineControl = READ_PORT_UCHAR((PUCHAR)Port + 4);
|
||||||
WRITE_PORT_UCHAR((PUCHAR)Port + 4, (LineControl & ~0x02) | 0x01);
|
WRITE_PORT_UCHAR((PUCHAR)Port + 4, (LineControl & ~0x02) | 0x01);
|
||||||
KeStallExecutionProcessor(500000);
|
KeStallExecutionProcessor(100000);
|
||||||
|
|
||||||
/* Clear buffer */
|
/* Clear buffer */
|
||||||
while (READ_PORT_UCHAR((PUCHAR)Port + 5) & 0x01)
|
while (READ_PORT_UCHAR((PUCHAR)Port + 5) & 0x01)
|
||||||
|
@ -812,15 +812,15 @@ GetMousePnpId(U32 Port, char *Buffer)
|
||||||
WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x09);
|
WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x09);
|
||||||
|
|
||||||
/* Wait 10 milliseconds for the mouse getting ready */
|
/* Wait 10 milliseconds for the mouse getting ready */
|
||||||
KeStallExecutionProcessor(200000);
|
KeStallExecutionProcessor(10000);
|
||||||
|
|
||||||
WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x0b);
|
WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x0b);
|
||||||
|
|
||||||
KeStallExecutionProcessor(200000);
|
KeStallExecutionProcessor(10000);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
TimeOut = 250;
|
TimeOut = 200;
|
||||||
while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut > 0))
|
while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut > 0))
|
||||||
{
|
{
|
||||||
KeStallExecutionProcessor(1000);
|
KeStallExecutionProcessor(1000);
|
||||||
|
@ -841,7 +841,7 @@ GetMousePnpId(U32 Port, char *Buffer)
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
TimeOut = 250;
|
TimeOut = 200;
|
||||||
while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut > 0))
|
while (((READ_PORT_UCHAR((PUCHAR)Port + 5) & 1) == 0) && (TimeOut > 0))
|
||||||
{
|
{
|
||||||
KeStallExecutionProcessor(1000);
|
KeStallExecutionProcessor(1000);
|
||||||
|
@ -1244,7 +1244,7 @@ DetectPS2AuxPort(VOID)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
KeStallExecutionProcessor(10000);
|
KeStallExecutionProcessor(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1266,7 +1266,7 @@ DetectPS2AuxDevice(VOID)
|
||||||
WRITE_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA,
|
WRITE_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_DATA,
|
||||||
0xF2);
|
0xF2);
|
||||||
|
|
||||||
KeStallExecutionProcessor(10000);
|
KeStallExecutionProcessor(1000);
|
||||||
|
|
||||||
Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS);
|
Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS);
|
||||||
if ((Status & CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL) == 0)
|
if ((Status & CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL) == 0)
|
||||||
|
@ -1278,7 +1278,7 @@ DetectPS2AuxDevice(VOID)
|
||||||
if (Scancode != 0xFA)
|
if (Scancode != 0xFA)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
KeStallExecutionProcessor(10000);
|
KeStallExecutionProcessor(1000);
|
||||||
|
|
||||||
Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS);
|
Status = READ_PORT_UCHAR((PUCHAR)CONTROLLER_REGISTER_STATUS);
|
||||||
if ((Status & CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL) == 0)
|
if ((Status & CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL) == 0)
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "fat.h"
|
#include "fat.h"
|
||||||
#include "iso.h"
|
#include "iso.h"
|
||||||
#include "ext2.h"
|
#include "ext2.h"
|
||||||
|
#include "ntfs.h"
|
||||||
#include "fsrec.h"
|
#include "fsrec.h"
|
||||||
#include <disk.h>
|
#include <disk.h>
|
||||||
#include <rtl.h>
|
#include <rtl.h>
|
||||||
|
@ -140,6 +141,9 @@ BOOL FsOpenVolume(U32 DriveNumber, U32 PartitionNumber)
|
||||||
case PARTITION_EXT2:
|
case PARTITION_EXT2:
|
||||||
FileSystemType = FS_EXT2;
|
FileSystemType = FS_EXT2;
|
||||||
return Ext2OpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition);
|
return Ext2OpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition);
|
||||||
|
case PARTITION_NTFS:
|
||||||
|
FileSystemType = FS_NTFS;
|
||||||
|
return NtfsOpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition);
|
||||||
default:
|
default:
|
||||||
FileSystemType = 0;
|
FileSystemType = 0;
|
||||||
sprintf(ErrorText, "Unsupported file system. Type: 0x%x", VolumeType);
|
sprintf(ErrorText, "Unsupported file system. Type: 0x%x", VolumeType);
|
||||||
|
@ -181,6 +185,9 @@ PFILE FsOpenFile(PUCHAR FileName)
|
||||||
case FS_EXT2:
|
case FS_EXT2:
|
||||||
FileHandle = Ext2OpenFile(FileName);
|
FileHandle = Ext2OpenFile(FileName);
|
||||||
break;
|
break;
|
||||||
|
case FS_NTFS:
|
||||||
|
FileHandle = NtfsOpenFile(FileName);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
FileSystemError("Error: Unknown filesystem.");
|
FileSystemError("Error: Unknown filesystem.");
|
||||||
break;
|
break;
|
||||||
|
@ -241,6 +248,10 @@ BOOL FsReadFile(PFILE FileHandle, U32 BytesToRead, U32* BytesRead, PVOID Buffer)
|
||||||
*BytesRead = (U32)BytesReadBig;
|
*BytesRead = (U32)BytesReadBig;
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
|
case FS_NTFS:
|
||||||
|
|
||||||
|
return NtfsReadFile(FileHandle, BytesToRead, BytesRead, Buffer);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
FileSystemError("Unknown file system.");
|
FileSystemError("Unknown file system.");
|
||||||
|
@ -266,6 +277,10 @@ U32 FsGetFileSize(PFILE FileHandle)
|
||||||
|
|
||||||
return Ext2GetFileSize(FileHandle);
|
return Ext2GetFileSize(FileHandle);
|
||||||
|
|
||||||
|
case FS_NTFS:
|
||||||
|
|
||||||
|
return NtfsGetFileSize(FileHandle);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FileSystemError("Unknown file system.");
|
FileSystemError("Unknown file system.");
|
||||||
break;
|
break;
|
||||||
|
@ -293,6 +308,11 @@ VOID FsSetFilePointer(PFILE FileHandle, U32 NewFilePointer)
|
||||||
Ext2SetFilePointer(FileHandle, NewFilePointer);
|
Ext2SetFilePointer(FileHandle, NewFilePointer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FS_NTFS:
|
||||||
|
|
||||||
|
NtfsSetFilePointer(FileHandle, NewFilePointer);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FileSystemError("Unknown file system.");
|
FileSystemError("Unknown file system.");
|
||||||
break;
|
break;
|
||||||
|
@ -318,6 +338,11 @@ U32 FsGetFilePointer(PFILE FileHandle)
|
||||||
return Ext2GetFilePointer(FileHandle);
|
return Ext2GetFilePointer(FileHandle);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FS_NTFS:
|
||||||
|
|
||||||
|
return NtfsGetFilePointer(FileHandle);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FileSystemError("Unknown file system.");
|
FileSystemError("Unknown file system.");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "fat.h"
|
#include "fat.h"
|
||||||
#include "iso.h"
|
#include "iso.h"
|
||||||
#include "ext2.h"
|
#include "ext2.h"
|
||||||
|
#include "ntfs.h"
|
||||||
#include <disk.h>
|
#include <disk.h>
|
||||||
#include <rtl.h>
|
#include <rtl.h>
|
||||||
#include <arch.h>
|
#include <arch.h>
|
||||||
|
@ -55,6 +56,11 @@ BOOL FsRecognizeVolume(U32 DriveNumber, U32 VolumeStartSector, U8* VolumeType)
|
||||||
*VolumeType = PARTITION_FAT32;
|
*VolumeType = PARTITION_FAT32;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
else if (FsRecIsNtfs(DriveNumber, VolumeStartSector))
|
||||||
|
{
|
||||||
|
*VolumeType = PARTITION_NTFS;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -114,3 +120,20 @@ BOOL FsRecIsFat(U32 DriveNumber, U32 VolumeStartSector)
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL FsRecIsNtfs(U32 DriveNumber, U32 VolumeStartSector)
|
||||||
|
{
|
||||||
|
PNTFS_BOOTSECTOR BootSector = (PNTFS_BOOTSECTOR)DISKREADBUFFER;
|
||||||
|
if (!DiskReadLogicalSectors(DriveNumber, VolumeStartSector, 1, BootSector))
|
||||||
|
{
|
||||||
|
FileSystemError("Failed to read the boot sector.");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!RtlCompareMemory(BootSector->SystemId, "NTFS", 4))
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
|
@ -24,5 +24,6 @@ BOOL FsRecognizeVolume(U32 DriveNumber, U32 VolumeStartSector, U8* VolumeType);
|
||||||
BOOL FsRecIsIso9660(U32 DriveNumber);
|
BOOL FsRecIsIso9660(U32 DriveNumber);
|
||||||
BOOL FsRecIsExt2(U32 DriveNumber, U32 VolumeStartSector);
|
BOOL FsRecIsExt2(U32 DriveNumber, U32 VolumeStartSector);
|
||||||
BOOL FsRecIsFat(U32 DriveNumber, U32 VolumeStartSector);
|
BOOL FsRecIsFat(U32 DriveNumber, U32 VolumeStartSector);
|
||||||
|
BOOL FsRecIsNtfs(U32 DriveNumber, U32 VolumeStartSector);
|
||||||
|
|
||||||
#endif // #defined __FSREC_H
|
#endif // #defined __FSREC_H
|
||||||
|
|
|
@ -92,6 +92,7 @@ typedef struct _MASTER_BOOT_RECORD
|
||||||
#define PARTITION_FAT32_XINT13 0x0C // FAT32 using extended int13 services
|
#define PARTITION_FAT32_XINT13 0x0C // FAT32 using extended int13 services
|
||||||
#define PARTITION_XINT13 0x0E // Win95 partition using extended int13 services
|
#define PARTITION_XINT13 0x0E // Win95 partition using extended int13 services
|
||||||
#define PARTITION_XINT13_EXTENDED 0x0F // Same as type 5 but uses extended int13 services
|
#define PARTITION_XINT13_EXTENDED 0x0F // Same as type 5 but uses extended int13 services
|
||||||
|
#define PARTITION_NTFS 0x17 // NTFS
|
||||||
#define PARTITION_PREP 0x41 // PowerPC Reference Platform (PReP) Boot Partition
|
#define PARTITION_PREP 0x41 // PowerPC Reference Platform (PReP) Boot Partition
|
||||||
#define PARTITION_LDM 0x42 // Logical Disk Manager partition
|
#define PARTITION_LDM 0x42 // Logical Disk Manager partition
|
||||||
#define PARTITION_UNIX 0x63 // Unix
|
#define PARTITION_UNIX 0x63 // Unix
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* just some stuff */
|
/* just some stuff */
|
||||||
#define VERSION "FreeLoader v1.8.20"
|
#define VERSION "FreeLoader v1.8.21"
|
||||||
#define COPYRIGHT "Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>"
|
#define COPYRIGHT "Copyright (C) 1998-2003 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 8
|
#define FREELOADER_MINOR_VERSION 8
|
||||||
#define FREELOADER_PATCH_VERSION 20
|
#define FREELOADER_PATCH_VERSION 21
|
||||||
|
|
||||||
|
|
||||||
#ifndef ASM
|
#ifndef ASM
|
||||||
|
|
Loading…
Reference in a new issue