{
PFILE FilePointer;
CHAR SettingName[80];
ULONG SectionId;
CHARFileName[260];
ULONGBytesRead;
// Find all the message box settings and run themUiShowMessageBoxesInSection(OperatingSystemName);
// Try to open the operating system section in the .ini fileif (!IniOpenSection(OperatingSystemName, &SectionId))
{
sprintf(SettingName, "Section [%s] not found in freeldr.ini.\n", OperatingSystemName);
UiMessageBox(SettingName);
return;
}
if (!IniReadSettingByName(SectionId, "BootSectorFile", FileName, sizeof(FileName)))
{
UiMessageBox("Boot sector file not specified for selected OS!");
return;
}
FilePointer = FsOpenFile(FileName);
if (!FilePointer)
{
strcat(FileName, " not found.");
UiMessageBox(FileName);
return;
}
// Read boot sectorif (!FsReadFile(FilePointer, 512, &BytesRead, (void*)0x7c00) || (BytesRead != 512))
{
UiMessageBox("Unable to read boot sector.");
return;
}
// Check for validityif (*((USHORT*)(0x7c00 + 0x1fe)) != 0xaa55)
{
UiMessageBox("Invalid boot sector magic (0xaa55)");
return;
}
UiUnInitialize("Booting...");
// Don't stop the floppy drive motor when we// are just booting a bootsector, or drive, or partition.// If we were to stop the floppy motor then// the BIOS wouldn't be informed and if the// next read is to a floppy then the BIOS will// still think the motor is on and this will// result in a read error.//DiskStopFloppyMotor();//DisableA20();ChainLoadBiosBootSectorCode();
}
Generated on Sat May 26 2012 04:46:48 for ReactOS by
1.7.6.1
ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.