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

Better document r13387: freeldr/arch/i386/hardware.c > DetectPnpBios() > "NodeCount &= 0xFF;"

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • Bootloader
    • 13,387

    Description

      (Noticed while working on CORE-12623.)

      r13387 (by fireball)

      --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c	2005/02/01 21:21:33	13386
      +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c	2005/02/02 15:42:48	13387
      @@ -351,6 +351,9 @@
       
       
         x = PnpBiosGetDeviceNodeCount(&NodeSize, &NodeCount);
      +  NodeCount &= 0xFF; // needed since some fscked up BIOSes return
      +                     // wrong info (e.g. Mac Virtual PC)
      +                     // e.g. look: http://my.execpc.com/~geezer/osd/pnp/pnp16.c
         if (x != 0 || NodeSize == 0 || NodeCount == 0)
           {
             DbgPrint((DPRINT_HWDETECT, "PnP-BIOS failed to enumerate device nodes\n"));

      0)
      Fwiw,
      "NodeCount &= 0xFF" != "NodeCount = min(NodeCount, 255)".
      (garbage cleanup != value limit)

      1a)
      http://my.execpc.com/~geezer/osd/pnp/pnp16.c
      now returns "Not Found // The requested URL /CE/AC/geezer/osd/pnp/pnp16.c was not found on this server."
      1b)
      https://web.archive.org/web/20041221024939/http://my.execpc.com/~geezer/osd/pnp/pnp16.c
      read (back then)

      ...
      	num_nodes &= 0xFF;
      ...

      Undocumented.

      2)
      Fwiw, (If I found the right function)
      (Linux) build_devlist()
      doesn't seem to use such a "node count".
      So that code doesn't help here.

      Then:
      Isn't it a hack? Is it correct? If we keep it, add a TRACE() at least.
      Is it still needed? Isn't Mac Virtual PC fixed now? If not, get some examples of wrong NodeCount.
      Compare ReactOS and Linux results, if possible.
      ...

      Attachments

        Activity

          People

            bug zilla Bug Zilla
            Serge Gautherie Serge Gautherie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: