Subject: loadfile and ddb_init
To: None <tech-kern@netbsd.org, port-mac68k@netbsd.org, chuq@chuq.com>
From: None <nigel@ind.tansu.com.au>
List: tech-kern
Date: 07/24/2001 09:35:58
OK. I have a version of the Booter which does post loadfile()
ELF section header parsing, and now I am trying to decide how to pass
the Elf header pointer to the kernel.
At the moment, the kernel source does this:
extern void ddb_init(int symsize, void *vss, void *vse);
...
src/sys/arch/mac68k/mac68k/machdep.c,v 1.262
...
/*
* Initialize kernel debugger, if compiled in.
*/
{
extern int end;
extern int *esym;
ddb_init(*(int *)&end, ((int *)&end) + 1, esym);
}
...
/*
* Get end of symbols for kernel debugging
*/
esym = (int *)getenv("END_SYM");
#ifndef SYMTAB_SPACE
if (esym == (int *)0)
#endif
esym = (int *)&end;
...
where END_SYM is set by the Booter. Now, I can easily pass
in a MARK_SYM environment variable (and MARK_START, MARK_END, et c.).
What I don't understand at the moment is - where is 'extern int end'
defined and/or set ? I can't seem to find it.
--
| Nigel Pearson, nigel@ind.tansu.com.au | "Reality is that which, |
| Telstra NW-D, Sydney, Australia. | when you stop believing |
| Office: 9206 3468 Fax: 9212 6329 | in it, doesn't go away." |
| Mobile: 0408 664435 Home: 9792 6998 | Philip K. Dick - 'Valis.' |