ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

VOID LoadAndBootBootSector ( PCSTR  OperatingSystemName)

Definition at line 22 of file miscboot.c.

Referenced by OptionMenuCustomBootBootSectorFile(), and RunLoader().

{
    PFILE   FilePointer;
    CHAR    SettingName[80];
    ULONG   SectionId;
    CHAR    FileName[260];
    ULONG   BytesRead;

    // Find all the message box settings and run them
    UiShowMessageBoxesInSection(OperatingSystemName);

    // Try to open the operating system section in the .ini file
    if (!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 sector
    if (!FsReadFile(FilePointer, 512, &BytesRead, (void*)0x7c00) || (BytesRead != 512))
    {
        UiMessageBox("Unable to read boot sector.");
        return;
    }

    // Check for validity
    if (*((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 doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.