Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-5463

Suggestion to make freeldr.sys multiboot compilant again.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: None
    • Component/s: NTCore
    • Labels:
      None
    • Environment:

      Operating System: ReactOS
      Platform: x86 Hardware

      Description

      It would be nice if freeldr.sys can be made multiboot compilant again.
      This would allow to boot freeldr.sys directly from grub(2) or Syslinux.
      The freeldr.sys file doesn't even need to exist on the partition you want to boot (could be handy in rescue operations).

      I found 2 references on the web, for making a PE file multiboot compliant:

      1. http://ksrenevasan.blogspot.com/2005/10/writing-multiboot-pe-kernels-using.html

      2. http://fanael.wordpress.com/2010/06/24/making-pe-multiboot-compliant/

      The second link mentions that the method explained on the first link, is a ugly hack (hard coded values, ...)

      The method used by the second link, uses the space in the dos stub at the beginning of the PE file, for storing the needed multiboot fields, but they corrupt the dos stub itself.

      I don't think it is necessary to cripple the dos stub.
      The multiboot header fields can go after a valid dos stub, without corrupting it. The multiboot header must be 32-bit aligned and be in the first 8kb of the file.

      The Multiboot Specification can be found at:
      http://www.gnu.org/software/grub/manual/multiboot/multiboot.html

      Multiboot header layout:
      http://www.gnu.org/software/grub/manual/multiboot/multiboot.html#Header-layout

      The multiboot header must be 32-bit aligned and be in the first 8kb of the file.
      The multiboot header field starts with a magic number (identifying the header, which must be the hexadecimal value 0x1BADB002).

      The Machine state: info the multiboot compliant loader passes when transfering control to the multiboot compliant kernel:
      http://www.gnu.org/software/grub/manual/multiboot/multiboot.html#Machine-state

      • Gert Hulselmans

        Attachments

          Activity

            People

            • Assignee:
              bug zilla Bug Zilla
              Reporter:
              gerth gerth
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: