Subject: Re: Newbie Kernel Compilation.
To: Daniel Brown <crp02@holyrood.ed.ac.uk>
From: Olivier Piras <pirus@internaute.fr>
List: port-arm32
Date: 11/27/1996 00:06:39
On Tue, 26 Nov 1996, Daniel Brown wrote:

> Dear folks,
> 
> Been busy the last little while having a bash at compiling my very own
> SA-aware kernel. The experience turned up a few things that I'm not
> certain about, so wanted to air publically, just in case I've done
> horrible things to the innards of the computer that'll come back to haunt
> me later.
> 
> Last night, I busily ftp'd the src-1.2A-111096.tar.gz from kcl, unpacked
> the lot, and followed the compile instructions to the letter. At which
> point everything started to chuckle away, 99% of the source compiling,
> until fpe.c's turn came up.
> 
> Thence, screen fulls of errors, concerning it's attempts to dereference an
> incomplete type, followed by the whole thing throwing it's hands up in the
> air in horror, and exiting.
> 
> Aha! (I thought) - let's sup the rest over from NetBSD.org, to see if the
> problem's been fixed. So I pulled over the sup set from kcl, unpacked
> everything, and... ran around for a while looking for the appropriate
> supfile, gave up, and eventually found a working one at NetBSD.org, then
> supped to my heart's content.
> 
> Re-config'd, made clean, depended, then re-made the kernel. This time the
> make fell over at ioconf.c - one of the machine generated config files,
> strangely enough. The cfdata[] structure seemed to have excess entries in
> it, which cc couldn't handle (but gcc had no problems with).
> 
> After trying a few things, I eventually hit on the idea of removing the
> last (void, and NULL) entry in the table, and everything chuckled on once
> more.
> 
> Until fpe.c, which still fell over with the same problems.
> 
> Much rummaging around narrowed the problem to the fp_state structs, which
> no-longer seem to exist in the world, but can be reasonably replaced by
> fpe_sp_state ones instead (which appear to have all the required elements
> present and correct).
> 
> Compile once more, and meet the second problem in fpe.c - in
> initialise_fpe, the install_coproc_handler calls need coproc1_handler,
> and coproc2_handler casting into undef_handler_t before it'll pass muster.
> 
> Compile once more, and everything zooms through to the linking stage.
> Then death once more - autonicetime, and autoniceval referenced but
> without storage. 
> 
> These crop up in sys/conf/param.c, a file reputedly copied over to
> compile/KERNELNAMEHERE. It seems the compile version was missing the last
> few lines, in which the autonice* numbers were declared, and defined.
> 
> Add these, recompile, and hey-presto. My first netbsd kernel :-)


A faster way to get the kernel to compile is to comment out the `options FPE'
line, which is enabled in the GENERIC config file. Doing this, you get 
only the ARM FPE to be compiled in your kernel. (btw, GENERIC is the only 
config file where the single precision FPE is enabled, all others use ARM's)

I compiled a kernel this way yesterday; the FPE doesn't seem to trash anything
since then, and my FP oriented programs look good... (at least, not worse
than they did before ;-)


> All the best,
> 
> Dan.


Cheers,
		Olivier.