Error arch/x86/boot/boot.h:112: Error: bad register name `%dil' cuando compila kernel 2.6.24

From Luniwiki
Jump to: navigation, search

Problema

El kernel no compila y termina con el error siguiente:

arch/x86/boot/boot.h: Assembler messages:
arch/x86/boot/boot.h:112: Error: bad register name `%dil'
make[1]: *** [arch/x86/boot/video.o] Error 1
make: *** [bzImage] Error 2

Resolución

Remplazamos "=r" por "=q" en la linea del error.

static inline u8 rdfs8(addr_t addr)
{
       u8 v;
       asm volatile("movb %%fs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr));
       return v;
}

A remplazar por

static inline u8 rdfs8(addr_t addr)
{
       u8 v;
       asm volatile("movb %%fs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr));
       return v;
}

Explicación

As allan said, replace "=r" with "=q" in the affected line. "dil" (lower 8 bits part of [RE]DI) register is inexistent under x86-32, only available under x86-64.

Referencias

--Daniel Simao 20:28 21 feb 2012 (UTC)