Subject: Re: custom kernel problems
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: None <ks@ub.uni-mainz.de>
List: port-sparc
Date: 07/01/1999 15:32:22
hi,

> [...] It compile fine, the loader can load it, but
> when it executes it it gets a page fault trap before printing the
> copyrigth message. Did someone else notice this ?
yes, I got this, too, on my ss20 (it's not converted to elf yet) and
there is a line OBJECT_FMT=AOUT in /etc/mk.conf (if this matters).
tying to build a new userland failed due to the new malloc.c not
compiling (at least) on sparcs (no problem on an i386). the error
is as follows: (I'v reported this on 06/28/99, too)

cc -O2 -DALL_STATE  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror   -D_LIBC -DNLS -DYP -DHESIOD -DLIBC_SCCS -DSYSLIBC_SCCS  -D_REENTRANT -I/import/src/lib/libc/include -D__DBINTERFACE_PRIVATE -DRESOLVSORT -I. -DPOSIX_MISTAKE -DFLOATING_POINT -c /import/src/lib/libc/stdlib/malloc.c
/import/src/lib/libc/stdlib/malloc.c: In function `map_pages':
/import/src/lib/libc/stdlib/malloc.c:314: `pgshift' undeclared (first use in this function)
/import/src/lib/libc/stdlib/malloc.c:314: (Each undeclared identifier is reported only once
/import/src/lib/libc/stdlib/malloc.c:314: for each function it appears in.)
/import/src/lib/libc/stdlib/malloc.c: In function `extend_pgdir':
/import/src/lib/libc/stdlib/malloc.c:344: `pgshift' undeclared (first use in this function)
/import/src/lib/libc/stdlib/malloc.c: In function `malloc_init':
/import/src/lib/libc/stdlib/malloc.c:465: `pgshift' undeclared (first use in this function)
/import/src/lib/libc/stdlib/malloc.c: In function `malloc_pages':
/import/src/lib/libc/stdlib/malloc.c:507: `pgshift' undeclared (first use in this function)
/import/src/lib/libc/stdlib/malloc.c: In function `malloc_make_chunks':
/import/src/lib/libc/stdlib/malloc.c:593: `pgshift' undeclared (first use in this function)
/import/src/lib/libc/stdlib/malloc.c: In function `imalloc':
/import/src/lib/libc/stdlib/malloc.c:719: `pgshift' undeclared (first use in this function)
/import/src/lib/libc/stdlib/malloc.c: In function `irealloc':
/import/src/lib/libc/stdlib/malloc.c:749: `pgshift' undeclared (first use in this function)
/import/src/lib/libc/stdlib/malloc.c: In function `free_pages':
/import/src/lib/libc/stdlib/malloc.c:849: `pgshift' undeclared (first use in this function)
/import/src/lib/libc/stdlib/malloc.c: In function `free_bytes':
/import/src/lib/libc/stdlib/malloc.c:969: `pgshift' undeclared (first use in this function)
/import/src/lib/libc/stdlib/malloc.c: In function `ifree':
/import/src/lib/libc/stdlib/malloc.c:1042: `pgshift' undeclared (first use in this function)
*** Error code 1

Stop.

pgshift depends on SUN4 or (SUN4C or SUN4M) and is set in locore.s.
maybe the magic to get pgshift set right should be done in some header
file malloc includes. but then malloc compiled on an ss5 or IPC
doesn't do TRT on an 4/300.
is it possible to expose the kernel variable 'pgshift' to userland? If
not, I can see no (easy?) way to compile malloc on sparc architecture
independend. hm, how did the old malloc handle this??? time to find
some space for an 1.4-release tree...

-ks