Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Aug 2003 14:17:22 +0200
From:      Clemens Fischer <ino-qc@spotteswoode.de.eu.org>
To:        freebsd-stable@freebsd.org
Subject:   kernel: locore.s doesn't assemble (fillkpt, $PAGE_SHIFT, $PTESHIFT)
Message-ID:  <k795yjhp.fsf@ID-23066.news.dfncis.de>

next in thread | raw e-mail | index | archive | help
since august 8th, 2003 the kernel on my i386 pentiumIII won't compile.
the problem arises in locore.s with the definition of the constants
$PAGE_SHIFT and $PTESHIFT used in `shr' and `shl' instructions within
the macros `fillkpt' and `fillkptphys'.

i've tried to cvsup(1) RELENG_4 and RELENG_4_8 every day for over a
week now, but kernel builds (as part of a buildworld) don't work
anymore.  i have set up an area different from the usual /usr/obj/, so
i can experiment.  if somebody has tips for me, i could do a lot
without destroying what's left of my last clean install.

locore.s depends on a number of files, one of which is assym.s.
assym.s should "#define PAGE_SHIFT ...", but the file is empty (but it
exists!).  $PTESHIFT comes from machine/pmap.h, but this file exists
and defines this constant.

here's the make-log, with the offending lines right beneith the error
messages.  the formatting comes from the way cpp(1) expands macros:

--8<---cut here:--start--->8--
Examining locore.o...non-existent...modified before source...out-of-date.
cc -c -x assembler-with-cpp -DLOCORE -O -Wall -Wredundant-decls
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes
-Wpointer-arith -Winline -Wcast-qual -fformat-extensions -ansi
-nostdinc -I- -I. -I/www/freebsd/RELENG_4/src/sys -I/www/
freebsd/RELENG_4/src/sys/../include
-I/www/freebsd/RELENG_4/src/sys/contrib/ipfilter -D_KERNEL -include
opt_global.h -mpr eferred-stack-boundary=2
/www/freebsd/RELENG_4/src/sys/i386/i386/locore.s

/tmp/ccOO8Chb.s: Assembler messages:
/tmp/ccOO8Chb.s:2495: Error: suffix or operands invalid for `shr'
        shrl    $PAGE_SHIFT,%ecx
 
/tmp/ccOO8Chb.s:2496: Error: suffix or operands invalid for `shr'
/tmp/ccOO8Chb.s:2496: Error: suffix or operands invalid for `shl'
        movl    %eax, %ebx              ; shrl  $PAGE_SHIFT, %ebx       ;
shll  $PTESHIFT,%ebx          ; addl   (( KPTphys
  )-KERNBASE)  ,%ebx            ; orl   $0x001 ,%eax            ; orl
%edx  ,%eax          ; 1:    movl    %eax,(%ebx)
                ; addl  $PAGE_SIZE,%eax         ; addl  $PTESIZE,%ebx
   ; loop  1b

/tmp/ccOO8Chb.s:2512: Error: suffix or operands invalid for `shr'
        shrl    $PAGE_SHIFT,%ecx

/tmp/ccOO8Chb.s:2513: Error: suffix or operands invalid for `shr'
/tmp/ccOO8Chb.s:2513: Error: suffix or operands invalid for `shl'
        movl    %eax, %ebx              ; shrl  $PAGE_SHIFT, %ebx       ;
shll  $PTESHIFT,%ebx          ; addl   (( KPTphys
  )-KERNBASE)  ,%ebx            ; orl   $0x001 ,%eax            ; orl
%edx  ,%eax          ; 1:    movl    %eax,(%ebx)
                ; addl  $PAGE_SIZE,%eax         ; addl  $PTESIZE,%ebx
   ; loop  1b
/tmp/ccOO8Chb.s:2518: Error: suffix or operands invalid for `shr'
/tmp/ccOO8Chb.s:2518: Error: suffix or operands invalid for `shl'
        movl    %eax, %ebx              ; shrl  $PAGE_SHIFT, %ebx       ; shll
$PTESHIFT,%ebx          ; addl   (( KPTphys
  )-KERNBASE)  ,%ebx            ; orl   $0x001 ,%eax            ; orl
$0x002   ,%eax               ; 1:    movl    %ea
x,(%ebx)                ; addl  $PAGE_SIZE,%eax         ; addl
$PTESIZE,%ebx           ; loop  1b

/tmp/ccOO8Chb.s:2523: Error: suffix or operands invalid for `shr'
/tmp/ccOO8Chb.s:2523: Error: suffix or operands invalid for `shl'
        movl    %eax, %ebx              ; shrl  $PAGE_SHIFT, %ebx       ;
shll  $PTESHIFT,%ebx          ; addl   (( KPTphys
  )-KERNBASE)  ,%ebx            ; orl   $0x001 ,%eax            ; orl
$0x002   ,%eax               ; 1:    movl    %ea
x,(%ebx)                ; addl  $PAGE_SIZE,%eax         ; addl
$PTESIZE,%ebx           ; loop  1b

/tmp/ccOO8Chb.s:2528: Error: suffix or operands invalid for `shr'
/tmp/ccOO8Chb.s:2528: Error: suffix or operands invalid for `shl'
        movl    %eax, %ebx              ; shrl  $PAGE_SHIFT, %ebx       ;
shll  $PTESHIFT,%ebx          ; addl   (( KPTphys
  )-KERNBASE)  ,%ebx            ; orl   $0x001 ,%eax            ; orl
$0x002   ,%eax               ; 1:    movl    %ea
x,(%ebx)                ; addl  $PAGE_SIZE,%eax         ; addl
$PTESIZE,%ebx           ; loop  1b

/tmp/ccOO8Chb.s:2533: Error: suffix or operands invalid for `shr'
/tmp/ccOO8Chb.s:2533: Error: suffix or operands invalid for `shl'
        movl    %eax, %ebx              ; shrl  $PAGE_SHIFT, %ebx       ;
shll  $PTESHIFT,%ebx          ; addl   (( KPTphys
  )-KERNBASE)  ,%ebx            ; orl   $0x001 ,%eax            ; orl
$0x002   ,%eax               ; 1:    movl    %ea
x,(%ebx)                ; addl  $PAGE_SIZE,%eax         ; addl
$PTESIZE,%ebx           ; loop  1b

/tmp/ccOO8Chb.s:2539: Error: suffix or operands invalid for `shl'
        shll    $PTESHIFT,%ebx          ; addl   (( vm86pa  )-KERNBASE)
,%ebx          ; orl   $0x001 ,%eax            ; orl        $0x002 | 0x004
,%eax         ; 1:    movl    %eax,(%ebx)             ; addl
$PAGE_SIZE,%eax         ; addl  $PTESIZE,%ebx              ; loop  1b

/tmp/ccOO8Chb.s:2545: Error: suffix or operands invalid for `shl'
        shll    $PTESHIFT,%ebx          ; addl   (( vm86pa  )-KERNBASE)
,%ebx          ; orl   $0x001 ,%eax            ; orl        $0x002 | 0x004
,%eax         ; 1:    movl    %eax,(%ebx)             ; addl
$PAGE_SIZE,%eax         ; addl  $PTESIZE,%ebx              ; loop  1b

/tmp/ccOO8Chb.s:2554: Error: suffix or operands invalid for `shl'
        shll    $PTESHIFT,%ebx          ; addl   (( IdlePTD  )-KERNBASE)
,%ebx         ; orl   $0x001 ,%eax            ; orl        $0x002  ,%eax
    ; 1:    movl    %eax,(%ebx)             ; addl  $PAGE_SIZE,%eax
; addl  $PTESIZE,%ebx              ; loop  1b

/tmp/ccOO8Chb.s:2560: Error: suffix or operands invalid for `shl'
        shll    $PTESHIFT,%ebx          ; addl   (( IdlePTD  )-KERNBASE)
,%ebx         ; orl   $0x001 ,%eax            ; orl        $0x002  ,%eax
    ; 1:    movl    %eax,(%ebx)             ; addl  $PAGE_SIZE,%eax
; addl  $PTESIZE,%ebx              ; loop  1b

/tmp/ccOO8Chb.s:2566: Error: suffix or operands invalid for `shl'
        shll    $PTESHIFT,%ebx          ; addl   (( IdlePTD  )-KERNBASE)
,%ebx         ; orl   $0x001 ,%eax            ; orl        $0x002  ,%eax
    ; 1:    movl    %eax,(%ebx)             ; addl  $PAGE_SIZE,%eax
; addl  $PTESIZE,%ebx              ; loop  1b

*** Error code 1

Stop in /www/freebsd/obj/www/freebsd/RELENG_4/src/sys/n1.
--8<---cut here:---end---->8--

btw:  the .depend in my kernel build staging area lists more files
than locore.s itself includes, and all opt_*.h files are empty, as is
assym.s.  i have checked the genassym.sh script and tried the nm(1)
tool, re-installed perl (fearing that this beast was responsible) and
tried to track the problem to the actual point of failure, but the
number of files and procedures involved is too much for me.

this problem needs someone who knows how building the kernel works.

regards,

  clemens



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?k795yjhp.fsf>