* Dell Media Direct button
@ 2008-08-20 8:57 Per Öberg
2008-08-20 10:12 ` Robert Millan
0 siblings, 1 reply; 9+ messages in thread
From: Per Öberg @ 2008-08-20 8:57 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 851 bytes --]
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.
Regards Per Öberg
--
Per Öberg, Ph.D. Student
Address: Division of Vehicular Systems
Department of Electrical Engineering
Linköpings universitet
581 83 Linköping, SWEDEN
Phone: +46 (0)13-28 23 69
e-mail: oberg@isy.liu.se
PGP: http://www.fs.isy.liu.se/~oberg/0x61984A9D.asc
[-- Attachment #2: oberg.vcf --]
[-- Type: text/x-vcard, Size: 552 bytes --]
begin:vcard
fn;quoted-printable:Per =C3=96berg
n;quoted-printable:=C3=96berg;Per
org;quoted-printable:Link=C3=B6pings Universitet
adr;quoted-printable;quoted-printable:;;M=C3=A4ster Mattias v=C3=A4g;Link=C3=B6ping;;581 83;Sweden
email;internet:oberg@isy.liu.se
title:Doktorand (PhD Student)
tel;work:+46 (0)13 - 282369
tel;fax:+46 (0)13 - 282035
tel;home:+46 (0)13 - 212825
tel;cell:+46 (0)70 - 4857936
note:PGP Public Key: http://www.fs.isy.liu.se/~oberg/0x61984A9D.asc
x-mozilla-html:FALSE
url:http://www.fs.isy.liu.se/~oberg/
version:2.1
end:vcard
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Dell Media Direct button
2008-08-20 8:57 Dell Media Direct button Per Öberg
@ 2008-08-20 10:12 ` Robert Millan
2008-08-20 17:00 ` Vesa Jääskeläinen
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Robert Millan @ 2008-08-20 10:12 UTC (permalink / raw)
To: The development of GRUB 2
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?
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Dell Media Direct button
2008-08-20 10:12 ` Robert Millan
@ 2008-08-20 17:00 ` Vesa Jääskeläinen
2008-08-20 18:02 ` Colin D Bennett
2008-08-21 12:13 ` Stefan Reinauer
2 siblings, 0 replies; 9+ messages in thread
From: Vesa Jääskeläinen @ 2008-08-20 17:00 UTC (permalink / raw)
To: The development of GRUB 2
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?
Nah... Do a module to query for it and if it is there then use scripting
to do alternative path within script. Much better and more convenient.
And you can use script to increment default variable if needed :)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Dell Media Direct button
2008-08-20 10:12 ` Robert Millan
2008-08-20 17:00 ` Vesa Jääskeläinen
@ 2008-08-20 18:02 ` Colin D Bennett
2008-08-20 19:22 ` Javier Martín
2008-08-21 12:13 ` Stefan Reinauer
2 siblings, 1 reply; 9+ messages in thread
From: Colin D Bennett @ 2008-08-20 18:02 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]
On Wed, 20 Aug 2008 12:12:59 +0200
Robert Millan <rmh@aybabtu.com> 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?
If I pressed the "Media Direct" button, I would also want to have a
timeout of 0, since by pressing the Media Direct button instead of the
power button, I've already indicated which entry I want to boot, and
there is no need to show the menu -- unless, perhaps, we decided to
show a different "media" menu... so hopefully giving all the power to
the grub.cfg script would be enough to make all this possible.
Regards,
Colin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Dell Media Direct button
2008-08-20 18:02 ` Colin D Bennett
@ 2008-08-20 19:22 ` Javier Martín
2008-08-21 7:21 ` Per Öberg
0 siblings, 1 reply; 9+ messages in thread
From: Javier Martín @ 2008-08-20 19:22 UTC (permalink / raw)
To: The development of GRUB 2
2008/8/20 Colin D Bennett <colin@gibibit.com>:
> On Wed, 20 Aug 2008 12:12:59 +0200
> Robert Millan <rmh@aybabtu.com> 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?
>
> If I pressed the "Media Direct" button, I would also want to have a
> timeout of 0, since by pressing the Media Direct button instead of the
> power button, I've already indicated which entry I want to boot, and
> there is no need to show the menu -- unless, perhaps, we decided to
> show a different "media" menu... so hopefully giving all the power to
> the grub.cfg script would be enough to make all this possible.
>
> Regards,
> Colin
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>
Well, I own a XPS1330 myself (I'm writing from it now, as I'm taking a
week at the beach in Benidorm ^^). This functionality could be
implemented by a module that used the pre-menu hooks proposed by Bean:
it would check the status before the menu is shown, then act on the
result.
However, all this assumes that pressing that key creates no additional
side effect like the replacement of the MBR by the system firmware,
booting another MBR written in flash memory or something like that: I
thought the choice took place at the "real" MBR, but disassembling it
revealed that it does not use the mentioned I/O ports interface, so
most likely what the system firmware does is set the active flag in
the MediaDirect partition.
I'm ready to check any related patches on the actual hardware _once
I'm back in Madrid_ because here I have no recovery tools.
-Habbit
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Dell Media Direct button
2008-08-20 19:22 ` Javier Martín
@ 2008-08-21 7:21 ` Per Öberg
0 siblings, 0 replies; 9+ messages in thread
From: Per Öberg @ 2008-08-21 7:21 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 6290 bytes --]
Javier Martín wrote:
> 2008/8/20 Colin D Bennett <colin@gibibit.com>:
>> On Wed, 20 Aug 2008 12:12:59 +0200
>> Robert Millan <rmh@aybabtu.com> 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?
>> If I pressed the "Media Direct" button, I would also want to have a
>> timeout of 0, since by pressing the Media Direct button instead of the
>> power button, I've already indicated which entry I want to boot, and
>> there is no need to show the menu -- unless, perhaps, we decided to
>> show a different "media" menu... so hopefully giving all the power to
>> the grub.cfg script would be enough to make all this possible.
>>
>> Regards,
>> Colin
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> http://lists.gnu.org/mailman/listinfo/grub-devel
>>
>>
>
> Well, I own a XPS1330 myself (I'm writing from it now, as I'm taking a
> week at the beach in Benidorm ^^). This functionality could be
> implemented by a module that used the pre-menu hooks proposed by Bean:
> it would check the status before the menu is shown, then act on the
> result.
>
> However, all this assumes that pressing that key creates no additional
> side effect like the replacement of the MBR by the system firmware,
> booting another MBR written in flash memory or something like that: I
> thought the choice took place at the "real" MBR, but disassembling it
> revealed that it does not use the mentioned I/O ports interface, so
> most likely what the system firmware does is set the active flag in
> the MediaDirect partition.
>
> I'm ready to check any related patches on the actual hardware _once
> I'm back in Madrid_ because here I have no recovery tools.
>
> -Habbit
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
It works for me =)
See how below...
There might be different firmware versions out there and there's been a
lot of fuss about early versions of MD screwing up you partition table.
There has also been suggestions on how to disable it by overwriting your
MBR (http://ubuntuforums.org/showthread.php?t=606345).
There seems to be a number of different versions in the range of 1-3 and
some uses a hidden HPA partion while some "hides" the partition by
changing the partition id. The installation process and the possibility
to upgrade between the different version indicates (not same as proof, i
know) that the firmware does about the same for the different releases
and that it is the MBR that is important since this is what you install
to make it work.
Dan Goodell has a website that describes his findings of how the Dell
MBR works (http://www.goodells.net/dellrestore/hpa-issues.htm). On this
website he indicates that these ports exists. I believe that his
documentation is for MD v1-2 and I have v3.3. He has disassembled the
MBR code and the procedure showed in the part he sent me showed out to
work perfectly when using in my test setup.
--------------------------------------------------------------------------
My setup:
--------------------------------------------------------------------------
Comp: Dell XPS1330M,
Media Direct version: 3.3
Delivered: 2008-07-14
Disk layout:
- grub legacy on MBR,
- 100Mb (/dev/sda1, Main grub partiton, config chainloads sda2, sda3 or
sda5)
- 100Mb (/dev/sda2, geexbox, with own grub and grub config files in /boot)
- 30Gb, (/dev/sda3, Kubuntu with own grub and grub config files)
- Extended partition ~250Gb linux (/dev/sda5, Not using yet but with
test-boot-loader) ,~2Gb swap (/dev/sda6) N
I have a small boot loader written from scratch, which is attached to
the mail, that i dd to /dev/sda5 using "dd if=boot.bin of=/dev/sda5
count=512 bs=1"
If i press the MD button it will show a splash screen and then show grub
main menu, same menu as with ordinary power button (but the graphics
mode is different). I can then choose to chainload /dev/sda5 which
changes the graphics mode and turns the screen red for MD or green for
ordinary power button (or was it the opposite...)
Sometimes when i press the MD button it will hang for a while before
showing me the grub menu, pressing esc will then go directly to grub. I
have not done any statistics of when this happens.
Also, sometimes the first part of bootup will take forever but I am
unsure of why. This might indicate that the firmware is looking for
something on disk (or just that i have triggered some complete POST by
aborting the boot process in some way, the BIOS indicates that this is
possible)
If someone wants to test my boot code please be warned. The MD button
has been known to screw things up and I can't guarantee that that my dd
command is correct. Also, I might have changed something since I tried
it yesterday and I haven't got my computer with me so I cant't test the
version I'm sending. I am, however, very curios if this works for anyone
else so I can't wait till I tested it again...
Regards Per Öberg
[-- Attachment #2: boot.bin --]
[-- Type: application/octet-stream, Size: 512 bytes --]
[-- Attachment #3: boot_loader.asm --]
[-- Type: text/plain, Size: 2468 bytes --]
[org 0x0] ; Offset zero is desired
jmp START ; jump to executable code
; definition of boot sector data for a diskette
BS_OEMName db "MSWIN4.1" ; 8 characters
BPB_BytsPerSec dw 0x0200 ; 512 bytes per sector
BPB_SecPerClus db 0x01 ; one sector per cluster
BPB_RsvdSecCnt dw 0x0001 ; one reserved sector
BPB_NumFATs db 0x02 ; two FATs
BPB_RootEntCnt dw 0x00E0 ; 224 entries
BPB_TotSec16 dw 0x0B40 ; 2880 sectors on disk
BPB_Media db 0xF0 ; media type code
BPB_FATSz16 dw 0x0009 ; 9 sectors in one FAT
BPB_SecPerTrk dw 0x0012 ; 18 sectors per track
BPB_NumHeads dw 0x0002 ; 2 heads
BPB_HiddSec dd 0x00000000 ; no hidden sectors
BPB_TotSec32 dd 0x00000000 ; no FAT32 sectors
BS_DrvNum db 0x00 ; drive number 0
BS_Reserved1 db 0x00 ; reserved
BS_BootSig db 0x29 ; extended boot signature
BS_VolID dd 0x12345678 ; serial number
BS_VolLab db "a_nice_disc" ; volume label
BS_FilSysType db "FAT12 " ; file system
%define MD_Get_MD_Status 0xf9
%define MD_Write_Port 0x70
%define MD_Read_Port 0x71
%define MD_Bit_To_Test 0x08
START: ; start of CODE
cli ; disable interrupts
;; Enable 320x200 graphics mode
mov eax,0x13
int 0x10
;; Check if the button is pressed
mov al,MD_Get_MD_Status
out MD_Write_Port,al
in al,MD_Read_Port
test al,MD_Bit_To_Test
mov al,0x0
out MD_Write_Port,al
jz set_red
;; Set green in first palette position
set_green:
mov ax,0
mov dx,0x3c8 ; Set first palette value
out dx,al
inc dx ; Palette is at 0x3c9
mov al,0x00 ; Set red value
out dx,al
mov al,0xff ; Set green value
out dx,al
mov ax,0x0 ; Set blue value
out dx,al
jmp hang_here
;; Set red in first palette position
set_red:
mov ax,0
mov dx,0x3c8 ; Set first palette value
out dx,al
inc dx ; Palette is at 0x3c9
mov al,0xff
out dx,al ; Set red value
mov al,0x0
out dx,al ; Set green value
mov ax,0x0
out dx,al ; Set blue value
hang_here:
jmp hang_here
;; ----------------------
;; Finish up
;; ----------------------
times 512-($-$$)-2 db 0 ; make the code exactly 512 bytes
dw 0xAA55 ; the required final two bytes for a boot sector
[-- Attachment #4: Makefile --]
[-- Type: text/plain, Size: 535 bytes --]
# Per Ãberg
BINDIR=.
# Build tools
CC=gcc
LD=gcc
NASM=nasm
NFLAGS=-f elf
NFLAGS_BIN = -f bin
EXTRA_CFLAGS=
#EXTRA_CFLAGS=-g -DDEBUG
CFLAGS= -m32 -Wall -std=c89 -pedantic -Wunreachable-code
LFLAGS= -m32
OBJS = boot_loader.o
TARGETS =
all:
nasm -f bin -o boot.bin boot_loader.asm
#dd:
# dd if=boot.bin of=/dev/sda5 bs=1 count=512
cleanup:
find . -name '*.[aos]' -o -name '*~' -type f | xargs rm -f
find . -name 'semantic.cache' | xargs rm -f
clean: cleanup
cd $(BINDIR) ; rm -f $(TARGETS)
[-- Attachment #5: oberg.vcf --]
[-- Type: text/x-vcard, Size: 552 bytes --]
begin:vcard
fn;quoted-printable:Per =C3=96berg
n;quoted-printable:=C3=96berg;Per
org;quoted-printable:Link=C3=B6pings Universitet
adr;quoted-printable;quoted-printable:;;M=C3=A4ster Mattias v=C3=A4g;Link=C3=B6ping;;581 83;Sweden
email;internet:oberg@isy.liu.se
title:Doktorand (PhD Student)
tel;work:+46 (0)13 - 282369
tel;fax:+46 (0)13 - 282035
tel;home:+46 (0)13 - 212825
tel;cell:+46 (0)70 - 4857936
note:PGP Public Key: http://www.fs.isy.liu.se/~oberg/0x61984A9D.asc
x-mozilla-html:FALSE
url:http://www.fs.isy.liu.se/~oberg/
version:2.1
end:vcard
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Dell Media Direct button
2008-08-20 10:12 ` Robert Millan
2008-08-20 17:00 ` Vesa Jääskeläinen
2008-08-20 18:02 ` Colin D Bennett
@ 2008-08-21 12:13 ` Stefan Reinauer
2008-08-21 12:20 ` Javier Martín
2008-08-21 13:20 ` Robert Millan
2 siblings, 2 replies; 9+ messages in thread
From: Stefan Reinauer @ 2008-08-21 12:13 UTC (permalink / raw)
To: The development of GRUB 2
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Dell Media Direct button
2008-08-21 12:13 ` Stefan Reinauer
@ 2008-08-21 12:20 ` Javier Martín
2008-08-21 13:20 ` Robert Millan
1 sibling, 0 replies; 9+ messages in thread
From: Javier Martín @ 2008-08-21 12:20 UTC (permalink / raw)
To: The development of GRUB 2
2008/8/21 Stefan Reinauer <stepan@coresystems.de>:
> 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
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
So what about a new "nvram" module in i386-pc that creates a variable
$NVRAM hooked to routines getting/setting the live contents of the
cmos memory? Then menu scripts can check its contents, among them the
MediaDirect button.
-Habbit
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Dell Media Direct button
2008-08-21 12:13 ` Stefan Reinauer
2008-08-21 12:20 ` Javier Martín
@ 2008-08-21 13:20 ` Robert Millan
1 sibling, 0 replies; 9+ messages in thread
From: Robert Millan @ 2008-08-21 13:20 UTC (permalink / raw)
To: The development of GRUB 2
On Thu, Aug 21, 2008 at 02:13:05PM +0200, Stefan Reinauer wrote:
>
> 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).
Ah, good catch. For the record, we already have code that accesses cmos,
in the date handling functions recently added by Bean.
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-08-21 13:22 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-20 8:57 Dell Media Direct button Per Öberg
2008-08-20 10:12 ` Robert Millan
2008-08-20 17:00 ` Vesa Jääskeläinen
2008-08-20 18:02 ` Colin D Bennett
2008-08-20 19:22 ` Javier Martín
2008-08-21 7:21 ` Per Öberg
2008-08-21 12:13 ` Stefan Reinauer
2008-08-21 12:20 ` Javier Martín
2008-08-21 13:20 ` Robert Millan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.