From: Alan Cox on
On Tue, 1 Jun 2010 22:48:20 +0100
Matthew Garrett <mjg59(a)srcf.ucam.org> wrote:

> On Tue, Jun 01, 2010 at 02:43:12PM -0700, Justin P. Mattock wrote:
> > On 06/01/2010 02:29 PM, Matthew Garrett wrote:
> >> So, just to be clear, you run this as root and it immediately returns
> >> you to the prompt? This seems unlikely.
> >
> > yep.. with the above code
> > I (save to a file) then
> > non-root gcc reboot.c -o reboot
> > then su
> > ./reboot
> > just bake to the command prompt
>
> Are you running some sort of security policy that might block hardware
> access?

Try

if (iopl(...))
perror

.... (or strace it running as root)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Alan Cox on
On Thu, 3 Jun 2010 03:18:51 +0100
Matthew Garrett <mjg59(a)srcf.ucam.org> wrote:

> On Wed, Jun 02, 2010 at 07:15:36PM -0700, Justin P. Mattock wrote:
> > as soon as I change:
> >
> > int main() {
> > iopl(3);
> > outb(6, 0xcf9);
> > usleep(100);
> > outb(6, 0xcf9);
> > return 0;
> > }
> > (the above gave a command prompt
> > with numerous tries)
>
> Ok, so it's not that straghtforward. Sigh. There's various hacky
> workarounds we could do here, but Windows doesn't seem to do them so I
> lean towards suspecting that there's something wrong with our keyboard
> controller reboot mechanism. I'll try doing some more tracing.

At least some PCs you need to issue the reboot outb calls on the boot
processor so the userspace tests won't be reliable.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/