public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.4][2.5][Trivial Patch] Bug in i386/kernel/process.c?
@ 2003-07-03 16:26 Disconnect
  2003-07-04 16:40 ` Disconnect
  0 siblings, 1 reply; 2+ messages in thread
From: Disconnect @ 2003-07-03 16:26 UTC (permalink / raw)
  To: lkml

I was poking into how to force a warm boot (found it easily enough) and
started reading process.c, where the details live.

We have:
static int reboot_mode;
int reboot_thru_bios;
                                                                                
static int __init reboot_setup(char *str)
{
...set reboot_mode/reboot_thru_bios according to reboot=...
}
__setup("reboot=", reboot_setup);

Farther down:
        /* Write 0x1234 to absolute memory location 0x472.  The BIOS
reads
           this on booting to tell it to "Bypass memory test (also warm
           boot)".  This seems like a fairly standard thing that gets
set by
           REBOOT.COM programs, and the previous reset routine did this
           too. */
                                                                                
        *((unsigned short *)0x472) = reboot_mode;
                                                                                (similar code farther down in !reboot_thru_bios)

....but reboot_mode doesn't seem to be initialized if you don't set it
via reboot=...? (Same for reboot_thru_bios)

A simple patch to use the defaults (according to the code comments) is
below; if this is right please push accordingly:

Its against 2.4 but should apply to 2.5 as well.
--- build-dis5-final/arch/i386/kernel/process.c.orig    2003-07-03 12:15:36.000000000 -0400
+++ build-dis5-final/arch/i386/kernel/process.c 2003-07-03 12:16:46.000000000 -0400
@@ -152,8 +152,8 @@
 __setup("idle=", idle_setup);
  
 static long no_idt[2];
-static int reboot_mode;
-int reboot_thru_bios;
+static int reboot_mode = 0x1234;
+int reboot_thru_bios = 1;
  
 #ifdef CONFIG_SMP
 int reboot_smp = 0;

-- 
Disconnect <lkml@sigkill.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [2.4][2.5][Trivial Patch] Bug in i386/kernel/process.c?
  2003-07-03 16:26 [2.4][2.5][Trivial Patch] Bug in i386/kernel/process.c? Disconnect
@ 2003-07-04 16:40 ` Disconnect
  0 siblings, 0 replies; 2+ messages in thread
From: Disconnect @ 2003-07-04 16:40 UTC (permalink / raw)
  To: lkml

Er, that patch won't apply to 2.5 - the code is the same, but its moved
to reboot.c.

Same change, diff't file/offset.

On Thu, 2003-07-03 at 12:26, Disconnect wrote:
> I was poking into how to force a warm boot (found it easily enough) and
> started reading process.c, where the details live.
> 
> We have:
> static int reboot_mode;
> int reboot_thru_bios;
>                                                                                 
> static int __init reboot_setup(char *str)
> {
> ...set reboot_mode/reboot_thru_bios according to reboot=...
> }
> __setup("reboot=", reboot_setup);
> 
> Farther down:
>         /* Write 0x1234 to absolute memory location 0x472.  The BIOS
> reads
>            this on booting to tell it to "Bypass memory test (also warm
>            boot)".  This seems like a fairly standard thing that gets
> set by
>            REBOOT.COM programs, and the previous reset routine did this
>            too. */
>                                                                                 
>         *((unsigned short *)0x472) = reboot_mode;
>                                                                                 (similar code farther down in !reboot_thru_bios)
> 
> ....but reboot_mode doesn't seem to be initialized if you don't set it
> via reboot=...? (Same for reboot_thru_bios)
> 
> A simple patch to use the defaults (according to the code comments) is
> below; if this is right please push accordingly:
> 
> Its against 2.4 but should apply to 2.5 as well.
> --- build-dis5-final/arch/i386/kernel/process.c.orig    2003-07-03 12:15:36.000000000 -0400
> +++ build-dis5-final/arch/i386/kernel/process.c 2003-07-03 12:16:46.000000000 -0400
> @@ -152,8 +152,8 @@
>  __setup("idle=", idle_setup);
>   
>  static long no_idt[2];
> -static int reboot_mode;
> -int reboot_thru_bios;
> +static int reboot_mode = 0x1234;
> +int reboot_thru_bios = 1;
>   
>  #ifdef CONFIG_SMP
>  int reboot_smp = 0;
-- 
Disconnect <lkml@sigkill.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-04 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-03 16:26 [2.4][2.5][Trivial Patch] Bug in i386/kernel/process.c? Disconnect
2003-07-04 16:40 ` Disconnect

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox