All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rudolf Marek <r.marek at assembler.cz>
To: devel@acpica.org
Subject: [Devel] Re: Question about ACPICA, QNX and making beeps
Date: Wed, 29 Sep 2021 21:58:42 +0200	[thread overview]
Message-ID: <d21a9612-b189-b565-8c97-cbeb8c2bd0d3@assembler.cz> (raw)
In-Reply-To: CAAuRk_jLAfxp7ryhuWPORetZaqMPoNmsHYP6Y=BtkCucAyp45w@mail.gmail.com

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

Hi Devin,

Dne 28. 09. 21 v 21:04 Devin Steffler napsal(a):
> Hello, I am using ACPICA to read battery information in QNX. That part is 
> working great so far. However, now some code that is being used to make beeps 
> via the PC speaker stopped working. Strangely, this code stops working on a 
> few devices only after ACPICA runs.

You mean same device with same mainboard / BIOS version?

Maybe SMI and/or ACPI bytecode turns on 8254 clock gating? You can

try to disassemble the ACPI DSDT/SSDT bytecode and look for it.

What you can also do, is to try out to send ACPI enable SMI command without

enabling ACPICA and see if it breaks. You can read the I/O port address

and data enable command from FADT. To disassemble the ACPI tables

use acpidump acpixtract and iasl utillites in linux.

> What could my ACPICA be doing (or failing to do) that could cause the beeps to 
> stop working with the code below? Is the PIT being disabled somehow? I guess 
> I'll need to learn more about the PIT and how to check its status to see if 
> it's being disabled after ACPICA runs. Here's example code for QNX to generate 
> a beep using the PC speaker: // 
> ----------------------------------------------- #include <sys/neutrino.h> 
> #include <hw/inout.h> #include <unistd.h> int main(void) { ThreadCtl( 
> _NTO_TCTL_IO, 0 ); // get I/O permissions // start a beep int freq = 1000; int 
> scale = 1193046 / freq; out8(0x43, 0xb6); out8(0x42, scale & 0xff); out8(0x42, 
> scale >> 8); out8(0x61, in8(0x61) | 3);

you can also try to see if your assembly for out8 is correct and maybe not 
re-ordered

by the compiler or that your asm clobber list is correct (same for in8)

> // let the beep play for a second delay(1000);

delay is an OS service right?

Thanks,

Rudolf


[-- Attachment #2: attachment.htm --]
[-- Type: text/html, Size: 3117 bytes --]

             reply	other threads:[~2021-09-29 19:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 19:58 Rudolf Marek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-02  8:51 [Devel] Re: Question about ACPICA, QNX and making beeps Rudolf Marek
2021-10-01 19:08 Devin Steffler
2021-09-30 17:12 Rudolf Marek
2021-09-30 16:58 Rudolf Marek
2021-09-30 13:53 Devin Steffler
2021-09-30 12:56 Devin Steffler
2021-09-28 20:48 Moore, Robert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d21a9612-b189-b565-8c97-cbeb8c2bd0d3@assembler.cz \
    --to=devel@acpica.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.