Pavel Machek wrote:
quoted text > diff --git a/arch/x86/kernel/acpi/rm/wakemain.c b/arch/x86/kernel/acpi/rm/wakemain.c
> new file mode 100644
> index 0000000..d3173cc
> --- /dev/null
> +++ b/arch/x86/kernel/acpi/rm/wakemain.c
> @@ -0,0 +1,18 @@
> +#include "wakeup.h"
> +#include "boot.h"
> +
> +extern struct wakeup_header wakeup_header;
> +
> +void main(void)
> +{
> + asm volatile("lcallw __PLACEHOLDER__0_xc000,; movw %cs, %ax; movw %ax, %ds; movw %ax, %es; movw %ax, %ss");
> +
> +// asm volatile("inb , %al; outb %al, __PLACEHOLDER__0_x80; movb , %al; outb %al, ; outb %al, __PLACEHOLDER__0_x80; movb $-74, %al; outb %al, ; outb %al, __PLACEHOLDER__0_x80; movb $-119, %al; outb %al, ; outb %al, __PLACEHOLDER__0_x80; movb , %al; outb %al, ");
> +
> + /* Need to call BIOS */
> + probe_cards(0);
> +// set_mode(wakeup_header.video_mode);
> + set_mode(6);
> +
> + /* Set up GDT and IDT here, possibly CR4 and EFER */
> +}
Surely this needs some cleaning up? ;)
quoted text > diff --git a/arch/x86/kernel/acpi/rm/wakeup.S b/arch/x86/kernel/acpi/rm/wakeup.S
> new file mode 100644
> index 0000000..bfa348c
> --- /dev/null
> +++ b/arch/x86/kernel/acpi/rm/wakeup.S
> @@ -0,0 +1,129 @@
> +/*
> + * ACPI wakeup real mode startup stub
> + */
> +#include <asm/segment.h>
> +#include <asm/msr-index.h>
> +
> +
> +#define BEEP \
> + inb , %al; \
> + outb %al, __PLACEHOLDER__1_x80; \
> + movb , %al; \
> + outb %al, ; \
> + outb %al, __PLACEHOLDER__1_x80; \
> + movb $-74, %al; \
> + outb %al, ; \
> + outb %al, __PLACEHOLDER__1_x80; \
> + movb $-119, %al; \
> + outb %al, ; \
> + outb %al, __PLACEHOLDER__1_x80; \
> + movb , %al; \
> + outb %al, ;
> +
BEEP isn't actually used here and should probably be a C function if
needed. Note: in real mode you can also produce a beep by calling
int $0x10 with %ax = 0x0e07. Please note that some int $0x10
implementations clobber certain registers... see the INT10 macro in the
bootup code.
Seriously cool, though, that you're getting this far.
-hpa
--
unsubscribe notice To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Messages in current thread:
Re: factor out common s2ram wakeup code , H. Peter Anvin , (Fri Jan 25, 4:36 pm)