From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KW92O-0006lc-Qx for mharc-grub-devel@gnu.org; Thu, 21 Aug 2008 08:13:12 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KW92N-0006lQ-Hq for grub-devel@gnu.org; Thu, 21 Aug 2008 08:13:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KW92K-0006kx-Ut for grub-devel@gnu.org; Thu, 21 Aug 2008 08:13:11 -0400 Received: from [199.232.76.173] (port=34705 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KW92K-0006kk-PA for grub-devel@gnu.org; Thu, 21 Aug 2008 08:13:08 -0400 Received: from khepri.openbios.org ([80.190.231.112]:15378) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KW92K-0006Lg-Bw for grub-devel@gnu.org; Thu, 21 Aug 2008 08:13:08 -0400 Received: from dslb-088-066-029-053.pools.arcor-ip.net ([88.66.29.53] helo=[192.168.0.27]) by khepri.openbios.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1KW92H-0006aR-Kr for grub-devel@gnu.org; Thu, 21 Aug 2008 14:13:05 +0200 Message-ID: <48AD5BD1.3060301@coresystems.de> Date: Thu, 21 Aug 2008 14:13:05 +0200 From: Stefan Reinauer Organization: coresystems GmbH User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: The development of GRUB 2 References: <48ABDC72.10200@isy.liu.se> <20080820101259.GB8201@thorin> In-Reply-To: <20080820101259.GB8201@thorin> X-Enigmail-Version: 0.95.7 OpenPGP: id=3134D111 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: Dell Media Direct button X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2008 12:13:11 -0000 Robert Millan wrote: > On Wed, Aug 20, 2008 at 10:57:22AM +0200, Per Öberg wrote: > >> Hi >> >> Some laptops, e.g., from Dell have a special button that they use to >> boot a special embedded OS for media only instead of the ordinary OS. >> >> For my Dell XPS1330M I can determine if the Media button was pressed by >> first writing 0xf9 to port 0x70 and then testing bit 0x08 of port 0x71. >> >> It would be really nice if such a test could be enabled in grub so that >> grub can go directly to a specific menu alternative without showing the >> gui if the media button was pressed. >> >> Is this interesting? I'd like to contribute but I don't know where to start. >> > > Sounds interesting, but this needs some thought on how to design it. > > I suppose what you want is change the 'default' variable. Perhaps increase > it by 1? But then, where do you do this? grub_machine_init is too early as > 'default' hasn't been set yet. > > Maybe we could have a global 'int default_offset' variable that is initialized > in grub_machine_init and later on used by normal.mod? > > The sequence of writing to port 0x70 / reading from port 0x71 reflects reading from the computer's "cmos" nvram memory. bit 7 of 0x70 is reserved for disabling NMIs, so the actual information is stored in byte 0x79[8] in the cmos. To allow full flexibility, there should just be a module that allows reading / writing the cmos values (could also be useful for other things, such as reading a boot order set by the bios). Everything else makes more sense in scripting: - changing "default" - changing "timeout" - support for bit operations in the parser - etc... -- coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br. Tel.: +49 761 7668825 • Fax: +49 761 7664613 Email: info@coresystems.de • http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg • HRB 7656 Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866