# BIOS resource allocation and FreeBSD ACPI



## mgp (May 19, 2009)

Hi,
I'd like to bring this topic again as it's very old and I think well known by people who have laptops (I guess the problem is more common for Acer owners).
The problem is the following:

this is verbose output:

```
bge0: <Broadcom NetLink Gigabit Ethernet Controller, ASIC rev. 0xb002> irq 17 at device 0.0 on pci8
pcib3: bge0 requested unsupported memory range 0-0xffffffffffffffff (decoding 0-0, 0-0)
bge0: 0x10000 bytes of rid 0x10 res 3 failed (0, 0xffffffffffffffff).
bge0: couldn't map memory
device_attach: bge0 attach returned 6
```
or

```
ath0: <Atheros 5424/2424> irq 17 at device 0.0 on pci3
ath0: 0x10000 bytes of rid 0x10 res 3 failed (0, 0xffffffff).
ath0: cannot map register space
device_attach: ath0 attach returned 6
```

this happens on different laptops with different hardware but it's the same problem

I have sent several mails to the mailing lists but this is still not resolved...I would very much like if someone can take this and fix it once and for all...

here is a thread where this is discussed a little bit 
http://forums.freebsd.org/showthread.php?t=206
here is an interesting quote (by GullibleJones) from this thread


> That wouldn't work... The problem is due to the lack of a feature rather than a bug. The bug is in the 3680's BIOS - it shouldn't be clearing the resources for various hardware when ACPI is enabled. FreeBSD relies on the BIOS to allocated resources for hardware - to work around this would apparently require FreeBSD to be able to allocate resources on its own (as Linux can, I guess).
> 
> (I do kind of wonder why this feature hasn't been added. It seems to me that relying on BIOSes not to be buggy is a bad idea?)



please, devs, help on this


----------



## mgp (May 19, 2009)

btw I have a laptop with this problem and I can say this:
FreeBSD - doesn't work
NetBSD - doesn't work
OpenSolaris - works
Linux - works
Windows - works


----------



## trev (May 20, 2009)

mgp said:
			
		

> I have sent several mails to the mailing lists but this is still not resolved...I would very much like if someone can take this and fix it once and for all...



The conventional method for resolving such an issue is to lodge a PR. Have you ever lodged a PR?


----------



## mgp (May 20, 2009)

Hi,
actually I haven't
mainly because I can't really estimate the severity and the priority
if you can give me some hints I'll submit a PR
thank you


----------



## SirDice (May 21, 2009)

This will probably cover it:

http://www.freebsd.org/doc/en_US.ISO8859-1/articles/problem-reports/


----------



## mgp (May 30, 2009)

yes, I already submitted a PR


----------



## knotabot (Jun 7, 2009)

A little background on ACPI.

What does ACPI do?

The ACPI standard brings Power Management into operating system control (OSPM), as opposed to the previous BIOS central system, which relied on platform specific firmware to decide power management and configuration policy.

The ACPI specification contains numerous related components, for hardware and software programming, as well as a unified standard for device power interaction and bus configuration.

How does it talk to the hardware?

ACPI compliant systems interact with hardware through either a "Function Fixed Hardware (FFH) Interface" or a platform-independent hardware programming model which relies on platform specific AML provided by the Original Equipment Manufacturer.

The OS independent technology portion of ACPI operates before the BIOS Power On Self Test.

On the software side of ACPI:

The major kernel-level components of the architecture include:

    * AML Interpreter
    * AML Disassembler
    * AML Debugger
    * ACPI Table Manager
    * ACPI Namespace Manager
    * ACPI Resource Manager
    * ACPI Fixed and General Purpose Event Support
    * ACPI Hardware Support

User-space utilities built upon the kernel components include:

    * ASL Compiler & Disassembler
    * ACPI Simulator (AcpiExec)
    * ACPI Table Extractor

In much of the information about ACPI BIOS on many websites, there is a misunderstanding, intentional or unintentional, that it is a part of the BIOS that everyone knows about; Award, Phoenix, AMI etc.
But, in the ACPI specification documentation, it states the ACPI has seperate hardware interface components.

http://common.ziffdavisinternet.com/util_get_image/1/0,1425,i=10764,00.gif


In the diagram you can see the way the ACPI architecture communicates.
The red components in the middle are hardware, which represents the Winbond chip on MB.

In conclusion, ACPI has two component areas. Hardware and Software.

ACPI was developed by Microsoft, Intel and Toshiba.


----------

