Subject: _KERNEL cpp symbol in kernel source
To: None <port-mac68k@NetBSD.org>
From: None <nigel@ind.tansu.com.au>
List: port-mac68k
Date: 07/13/1999 00:21:40
	OK. For those that don't remember, I am trying to use the
kernel source code, _unmodified_, in the Booter.

	I have got the ext2fs, ffs, mfs & ufs source code to compile
under Metrowerks Codewarrior 11 on the Mac. In the end, I only had to
modify sys/syscallargs.h, and add a header file (about 20 lines) as a
prefix. (At the moment, though, the lfs code is just too messy to use)


	Now, to get a lot of it to compile, I had to #define _KERNEL
in my prefix file. This seemed pretty reasonable to me since this
source came from the kernel tarball. The problem is that when I link
against this code, many kernel globals are defined in each .o file.

e.g. kernel_pmap_store, kmem_object and kernel_object are defined in
     both ext2fs_balloc.c and ext2fs_alloc.c


1) Can someone who is familiar with the kernel source work out
   how this code is normally compiled when a kernel is build ?
   I cannot work out how it would actually compile, because at
   link time the same thing would happen.

2) What is the _KERNEL symbol meant to denote ?
   When is & isn't it used ?


	Thanks.

-- 
| Nigel Pearson, nigel@ind.tansu.com.au | "reality  is  that  which  |
|  Telstra IN&IND, Sydney, Australia.   |  doesn't go away when you  |
| Office: 9206 3468    Fax:  9212 6329  |  stop  believing  in  it." |
| Mobile: 0408 664435  Home: 9579 3293  |       Philip K. Dick       |