# How to disable ACPI today with the lastest release of FreeBSD.



## ziomario (Jul 11, 2021)

Hello to everyone. It's again me. I'm trying to understand what are the statement that I should put into the right configuration files to disable totally the acpi,since it seems that it is needed to boot the cdrom with freebsd with qemu and kvm. (for more informations about this,give a look at this post :









						qemu - Mounting from cd9660:/dev/iso9660/13_0_RELEASE_AARCH64_CD failed with error 19.
					

Hello. I'm trying to emulate Freebsd for arm64 on my jetson nano (arm64) using qemu and kvm. This is the script that I'm using :  tunctl -t tap0 ifconfig tap0 up brctl addif virbr0 tap0  /opt/qemu-5.2.0/build/aarch64-softmmu/./qemu-system-aarch64 -m 2048M -cpu cortex-a57 -M virt --enable-kvm \...




					forums.freebsd.org
				




I've googled between the sites and I found that these arguments could be put inside these configuration files. What I don't know,is what's changed from the past freebsd releases until the latest one ? I suppose that most of the statements below have been suppressed,but for a newbie like me it's hard to know what's useful and what's not,since in internet there are a lot of unordered and contradictory informations :



```
a) /boot/loader.conf:

debug.acpi.disabled="thermal"
debug.acpi.disabled ="hostres"
hint.acpi.0.disabled="1"
hint.p4tcc.0.disabled=1
hint.acpi_throttle.0.disabled=1


b) in /boot/device.hints add:

hint.acpi.0.disabled="1"


c) in /boot/defaults/loader.conf make sure:

acpi_dsdt_load="NO"
acpi_dsdt_type="acpi_dsdt"
acpi_dsdt_name="/boot/acpi_dsdt.aml"
acpi_video_load="NO"
```


----------



## Alain De Vos (Jul 11, 2021)

Kernel environment,

```
kenv | grep -i acpi
```
sysctl settings,

```
sysctl -a | grep -i acpi
```
If you want to disable ACPI simply add    hint.acpi.0.disabled="1" to    /boot/device.hints.  
You can disable ACPI temporarily at the boot loader prompt by issuing unset acpi_load if you are having problems booting an ACPI enabled machine.


----------



## ziomario (Jul 11, 2021)

```
CPU  0: ARM Cortex-A57 r1p1 affinity:  0                                                                              
                   Cache Type = <64 byte D-cacheline,64 byte I-cacheline,PIPT ICache,64 byte ERG,64 byte CWG>         
 Instruction Set Attributes 0 = <CRC32,SHA2,SHA1,AES+PMULL>                                                           
 Instruction Set Attributes 1 = <>                                                                                    
         Processor Features 0 = <AdvSIMD,FP,EL3 32,EL2 32,EL1 32,EL0 32>                                              
         Processor Features 1 = <>                                                                                    
      Memory Model Features 0 = <TGran4,TGran64,SNSMem,BigEnd,16bit ASID,16TB PA>                                     
      Memory Model Features 1 = <8bit VMID>                                                                           
      Memory Model Features 2 = <32bit CCIDX,48bit VA>                                                                
             Debug Features 0 = <2 CTX BKPTs,4 Watchpoints,6 Breakpoints,PMUv3,Debugv8>
             Debug Features 1 = <>
         Auxiliary Features 0 = <>
         Auxiliary Features 1 = <>
Trying to mount root from cd9660:/dev/iso9660/13_0_RELEASE_AARCH64_CD [ro]...
mountroot: waiting for device /dev/iso9660/13_0_RELEASE_AARCH64_CD...
Mounting from cd9660:/dev/iso9660/13_0_RELEASE_AARCH64_CD failed with error 19.

Loader variables:
  vfs.root.mountfrom=cd9660:/dev/iso9660/13_0_RELEASE_AARCH64_CD
  vfs.root.mountfrom.options=ro

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        zfs:zroot/ROOT/default
        cd9660:/dev/cd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /)

  ?               List valid disk boot devices
  .               Yield 1 second (for background tasks)
  <empty line>    Abort manual input

mountroot> unset acpi_load
Invalid file system specification.
```


----------



## SirDice (Jul 11, 2021)

ziomario said:


> c) in /boot/defaults/loader.conf make sure:


Never edit files in /boot/default/* or /etc/default/*.


----------



## ziomario (Jul 11, 2021)

what this means ?

# set debug.acpi.disabled ="hostres"

I read that I should choose "hostres" instead of hint.acpi.0.disabled="1" if I want to disable ACPI to allow qemu to boot properly the freebsd arm64 iso image.


----------



## Alain De Vos (Jul 11, 2021)

Totally no idea.
man 4 acpi


----------



## Phishfry (Jul 11, 2021)

Modern motherboards you cannot totally disable ACPI.
What you can do is disable subsets of ACPI like you are showing:


ziomario said:


> debug.acpi.disabled="thermal"


----------



## Phishfry (Jul 11, 2021)

ziomario said:


> what this means ?
> 
> # set debug.acpi.disabled ="hostres"



"[amd64, i386] FreeBSD 9.0-RELEASE includes several changes to improve resource
management of PCI devices. Some x86 machines may not boot or may have devices
that no longer attach when using ACPI as a result of these changes. This can be
worked around by setting a loader(8) tunable debug.acpi.disabled to hostres. To
do this, enter the following lines at the loader prompt:

set debug.acpi.disabled="hostres"
boot

Or, put the following line into /boot/loader.conf:

debug.acpi.disabled="hostres"
..."


----------



## ziomario (Jul 12, 2021)

grahamperrin said:


> What's the origin of the quote?











						qemu - Mounting from cd9660:/dev/iso9660/13_0_RELEASE_AARCH64_CD failed with error 19.
					

Hello. I'm trying to emulate Freebsd for arm64 on my jetson nano (arm64) using qemu and kvm. This is the script that I'm using :  tunctl -t tap0 ifconfig tap0 up brctl addif virbr0 tap0  /opt/qemu-5.2.0/build/aarch64-softmmu/./qemu-system-aarch64 -m 2048M -cpu cortex-a57 -M virt --enable-kvm \...




					forums.freebsd.org


----------



## ziomario (Jul 12, 2021)

Inside the iso image of freebsd there isn't any file called /boot/device.hints.


----------



## Alain De Vos (Jul 12, 2021)

FreeBSD-13.0-RELEASE-amd64-dvd1.iso.xz has a device.hints file.
For AARCH is see,

```
grep -i acpi menu-commands.4th
```
returns,

```
\ ACPI
: acpi_enable ( -- )
    s" set acpi_load=YES" evaluate \ XXX deprecated but harmless
    s" set hint.acpi.0.disabled=0" evaluate
    s" loader.acpi_disabled_by_user" unsetenv
: acpi_disable ( -- )
    s" acpi_load" unsetenv \ XXX deprecated but harmless
    s" set hint.acpi.0.disabled=1" evaluate
    s" set loader.acpi_disabled_by_user=1" evaluate
: toggle_acpi ( N -- N TRUE )
    acpienabled? if
        acpi_disable
        acpi_enable
    acpi_enable
```


----------



## ziomario (Jul 12, 2021)

so,what it means ? I'm not expert as you. I didn't understand which file I should edit to disable ACPI.


----------



## Alain De Vos (Jul 12, 2021)

You can try to :
From /boot/loader.conf remove the line,

```
acpi_load="YES"
```
At /boot/loader.conf add the line,

```
hint.acpi.0.disabled=1
```
That is the boot option to disable ACPI.

If it works or how much is another question.
On my AMD64 PC, disabling ACPI let the kernel crash.


----------

