Re: beeping patch for debugging acpi sleep

From: Stefan Seyfried
Date: Mon Jun 11 2007 - 04:57:42 EST

On Sat, Jun 09, 2007 at 03:08:17PM +0200, Pavel Machek wrote:

How about (WARNING! I never have written i386 assembly, my last assembly
experience was 20 years ago on Z80, so this is basically just copy'n paste,
but i hope you get the idea):

> --- a/arch/i386/kernel/acpi/wakeup.S
> +++ b/arch/i386/kernel/acpi/wakeup.S

> @@ -20,6 +35,9 @@ wakeup_code:
> wakeup_code_start = .
> .code16
> +# Uncomment this to make your computer start producing ugly noise as soon
> +# as BIOS returns to this real-mode entry point.

testl $4, video_flags - wakeup_code
jz 1f
> + BEEP
> movw $0xb800, %ax
> movw %ax,%fs
> movw $0x0e00 + 'L', %fs:(0x10)

IIUC, then this should make "echo 4 > /proc/sys/kernel/acpi_video_flags"
enable the beep at run-time.

Yes, i know, it is not a video flag. And not ACPI. Just add another
sysctl if you care.
Stefan Seyfried
QA / R&D Team Mobile Devices | "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg | "Well, surrounding them's out."

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at