Skip to contentSkip to conversation

be more verbose when probing EDD

RFC PATCH In review [email protected] 4 participants 8 messages Dec 16, 2007 – Dec 22, 2007 x86

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 be more verbose when probing EDD

Hello!

i`m sysadmin for quite some time and while being that, i have come across the one or another system, which refused to boot a linux kernel. typical symptom i have seen is a blinking cursor in the upper left just after kernel/initrd were loaded.

i never spent much time on that and either choose another system for linux or choose "failsafe" option, if the installer of my favourite distro gave that option.

since a colleague of mine was hit by that problem some weeks ago and i also came across that again recently, i started to investigate deeper and found, that EDD Bios probe is the problem here.

i found more than a handful of references on the net where people report similar problems. many discussion threads contained that typical smattering babble and seldom somebody gave that essential hint "try edd=off" for which i`m sure it would have helped many times.

that`s why i started to spend some thoughts on this how to make this easier/better for the user.

so

- it seems there are buggy Bios implementations out there which have problems with EDD
- your favourite distro may have set CONFIG_EDD=y|m , so EDD probe is on by default quite often nowadays.
- setting "edd=off" when you get that hang on boot is _not_ obvious.
- adressing this issue may be a little bit late, since i have mostly seen that problem on older machines, but not on recently bought
- i have at least two different systems with different types of chipsets to demonstrate this

on one of those, i added some printf`s to edd.c and this routine seems to be problematic and never returns

        /* Extended Get Device Parameters */

        ei->params.length = sizeof(ei->params);
        ax = 0x4800;
        dx = devno;
        asm("pushfl; int $0x13; popfl"
            : "+a" (ax), "+d" (dx), "=m" (ei->params)
            : "S" (&ei->params)
            : "ebx", "ecx", "edi");

i had a short conversation with matt domsch and hpa, who both think that additional printf`s would be an easy solution and not too bad to be added.

here is a quick and dirty initial patch from me:

arch/x86/boot/main.c 2007-12-09 16:11:43.644512504 +0100 renamed from arch/x86/boot/main.c.orig 2007-12-09 11:40:24.315346712 +0100 +4 -1
@@ -152,7 +152,10 @@
 
        /* Query EDD information */
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
-       query_edd();
+        printf("Probing EDD (query Bios for boot-device information)\n");
+        printf("If boot hangs here, you may have a buggy Bios. Try edd=skipmbr or edd=off");
+        query_edd();
+        printf("\rOK                                                                       \n");
 #endif
        /* Do the last things and invoke protected mode */
        go_to_protected_mode();

ok, fore sure its better to do that stuff in query_edd() itself, but before making a better version, id like to discuss if such patch would get accepted at all and if its a valid approach to let the kernel print some line which gets overwritten ("\rOK + lot`s of whitespaces") milliseconds later on successful function return.

regards
roland

______________________________________________________________________________
Jetzt neu! Im riesigen WEB.DE Club SmartDrive Dateien freigeben und mit Freunden teilen! http://www.freemail.web.de/club/smartdrive_ttc.htm/?mc=021134

#1 lore raw
Quoted 4 lines · On Sun, 16 Dec 2007, [email protected] wrote:

- it seems there are buggy Bios implementations out there which have problems with EDD
- your favourite distro may have set CONFIG_EDD=y|m , so EDD probe is on by default quite often nowadays.
- setting "edd=off" when you get that hang on boot is _not_ obvious.

It does not look like this issue is common - googling for "Linux EDD Boot hang" does not bring up relevant and recent results - in fact this post of yours comes on top. Further more there does not seem to be problems with newer BIOSes so we would be irritating lot many users needlessly.

Adding 3 printks for each such obscure problem would make it even more complex to parse and make sense of the boot log - I, for example, already dislike the mostly-useless-to-end-user stuff it spews on a normal boot.

If there are known chipsets / BIOSes that have this problem - applying quirks - something like this quirk for pmtmr [1]- (if they work this early) or even special casing them with forced edd=off may be the right and more useful thing to do.

[1] http://www.webservertalk.com/archive242-2006-3-1447442.html

Parag

#2 lore raw
In reply to [email protected]

arch/x86/boot/main.c 2007-12-09 16:11:43.644512504 +0100 line 159

Quoted 8 lines · [email protected] wrote:
        /* Query EDD information */

#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)

arch/x86/boot/main.c 2007-12-09 16:11:43.644512504 +0100 renamed from arch/x86/boot/main.c.orig 2007-12-09 11:40:24.315346712 +0100 +4 -1
-       query_edd();
+        printf("Probing EDD (query Bios for boot-device information)\n");
+        printf("If boot hangs here, you may have a buggy Bios. Try edd=skipmbr or edd=off");
+        query_edd();
+        printf("\rOK                                                                       \n");
 #endif

This is awfully verbose.

I'd prefer something like:

printf("Probing EDD BIOS... ");
query_edd();
printf("ok\n");

[or even "failed"...]

Also, you really should look for the "quiet" command-line option and squelch the message.

-hpa

#3 lore raw
Quoted 11 lines · H. Peter Anvin

arch/x86/boot/main.c 2007-12-09 16:11:43.644512504 +0100 line 159

Quoted 8 lines · [email protected] wrote:
        /* Query EDD information */

#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)

arch/x86/boot/main.c 2007-12-09 16:11:43.644512504 +0100 renamed from arch/x86/boot/main.c.orig 2007-12-09 11:40:24.315346712 +0100 +4 -1
-       query_edd();
+        printf("Probing EDD (query Bios for boot-device information)\n");
+        printf("If boot hangs here, you may have a buggy Bios. Try edd=skipmbr or edd=off");
+        query_edd();
+        printf("\rOK                                                                       \n");
 #endif

This is awfully verbose.

But useful. On the other hand we have lots of IMNSHO quite useless printks in early bootup that could be removed to make up for that

(e.g. candidates would be the
"CPU: After/before generic identify"
or
Entering add_active_range....)

printks and you can easily make up for the added verbosity.

-Andi

#4 lore raw
Quoted 13 lines · Andi Kleen
Quoted 10 lines · H. Peter Anvin

arch/x86/boot/main.c 2007-12-09 16:11:43.644512504 +0100 line 159

Quoted 8 lines · [email protected] wrote:
        /* Query EDD information */

#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)

arch/x86/boot/main.c 2007-12-09 16:11:43.644512504 +0100 renamed from arch/x86/boot/main.c.orig 2007-12-09 11:40:24.315346712 +0100 +4 -1
-       query_edd();
+        printf("Probing EDD (query Bios for boot-device information)\n");
+        printf("If boot hangs here, you may have a buggy Bios. Try edd=skipmbr or edd=off");
+        query_edd();
+        printf("\rOK                                                                       \n");
 #endif

This is awfully verbose.

Quoted 9 lines

But useful. On the other hand we have lots of IMNSHO quite useless printks in early bootup that could be removed to make up for that

(e.g. candidates would be the "CPU: After/before generic identify" or Entering add_active_range....)

printks and you can easily make up for the added verbosity.

Those don't live in an area of memory which is hard-limited to 32K.

-hpa

#5 lore raw
Quoted 1 line

Those don't live in an area of memory which is hard-limited to 32K.

Why not 64k?

Ok, that's a different argument than before. Ok. Although it's only a few bytes.

I would lobby for any message at least contain the suggestion to try edd=off. That could save users a lot of time.

-Andi

#6 lore raw
Quoted 4 lines · Andi Kleen
Quoted 1 line

Those don't live in an area of memory which is hard-limited to 32K.

Why not 64k?

Because the bootloader needs some memory in the same segment that it controls. Furthermore, since there were some residual uses of the 0x9000 segment (now removed, but not all bootloaders could be easily fixed), we were limited to about 40K for everything.

Unfortunately we already have the problem that some bootloaders (notably LOADLIN and mknbi) hardcoded an arbitrary limit which was even smaller than that (about 16K, which we're already pushing up against.)

Quoted 5 lines

Ok, that's a different argument than before. Ok. Although it's only a few bytes.

I would lobby for any message at least contain the suggestion to try edd=off. That could save users a lot of time.

The important thing is that there is a message before and after. The rest can be dealt with by Google on in documentation. That's what the patch currently in x86setup.git does.

-hpa

#7 lore raw
Quoted 8 lines · H. Peter Anvin
Quoted 5 lines

Ok, that's a different argument than before. Ok. Although it's only a few bytes.

I would lobby for any message at least contain the suggestion to try edd=off. That could save users a lot of time.

The important thing is that there is a message before and after. The rest can be dealt with by Google on in documentation. That's what the

That means every user needs to waste at least 5 minutes to google/read docs and be annoyed by someone's ads. Collective waste.

Just adding "Try edd=off if this hangs" is ~23 bytes and adding that should be hardly a problem even in your 32k. Or perhaps if you're more worried about code size than grammer "edd=off when hang" @)

-Andi