Subject: Re: LKM on amd64
To: None <port-amd64@netbsd.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: port-amd64
Date: 08/10/2004 21:16:36
Now that I believe I'm understanding the issues...

M.Drochner@fz-juelich.de said:
> Did this ever work? 

Yes, by pure luck, if DIAGNOSTIC wasn't defined.

> The problem is appearently that the addresses in the lkm_map
> are not within VM_{MIN,MAX}_KERNEL_ADDRESS.

This is a serious problem, and it only works because noone
checks the offsets into kernel_map, or offsets of pages
relativly to uvm.kernel_object.

> Why is the special map needed

Because amd64 can only handle 32-bit offsets into code
without -fpic, and LKMs don't use -fpic.
(This reminds me of the xfree86 loader...)

> what is the intention behind
> lkm_end = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2; ?

To answer myself again: These are appearently the hardwired
page tables. For LKM's I don't see a reason not to allocate
some dynamically if needed, but this is not done yet.

best regards
Matthias