[PR] Does kernel modules work on AMD64 under NetBSD 5.0.1 ?

View: New views
4 Messages — Rating Filter:   Alert me  

[PR] Does kernel modules work on AMD64 under NetBSD 5.0.1 ?

by Hans Petter Selasky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Can anyone confirm how well kernel modules are tested under AMD64?

I see at least one severe problem, and that is it appears that the code
segment or data segment of the loaded module is freed after modload returns,
or something similar :-) The symptom I see:

modload -o i4b.t /usr/lkm/i4b.o

Module works fine.

scp some 100MBytes of files to the box and the system crashes randomly.

When my I4B is built into the kernel no problem appears.

--HPS


Re: [PR] Does kernel modules work on AMD64 under NetBSD 5.0.1 ?

by Adam Hamsik-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
On Nov,Sunday 1 2009, at 11:23 PM, Hans Petter Selasky wrote:

> Hi,
>
> Can anyone confirm how well kernel modules are tested under AMD64?
>
> I see at least one severe problem, and that is it appears that the  
> code
> segment or data segment of the loaded module is freed after modload  
> returns,
> or something similar :-) The symptom I see:
>
> modload -o i4b.t /usr/lkm/i4b.o

LKM support was removed just after the 5.0 branch you should change  
your module to new modular framework.

Regards

Adam.


Re: [PR] Does kernel modules work on AMD64 under NetBSD 5.0.1 ?

by Hans Petter Selasky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 01 November 2009 23:30:56 Adam Hamsik wrote:
> Hi,
>
...
>
> LKM support was removed just after the 5.0 branch you should change
> your module to new modular framework.
>

Are there any example Make and C-files for this new modular framework?

--HPS

BTW: Please keep some dummy wrapper for malloc() :-)

Re: [PR] Does kernel modules work on AMD64 under NetBSD 5.0.1 ?

by Adam Hamsik-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
On Nov,Monday 2 2009, at 9:03 AM, Hans Petter Selasky wrote:

> On Sunday 01 November 2009 23:30:56 Adam Hamsik wrote:
>> Hi,
>>
> ...
>>
>> LKM support was removed just after the 5.0 branch you should change
>> your module to new modular framework.
>>
>
> Are there any example Make and C-files for this new modular framework?

Look here [1].

> BTW: Please keep some dummy wrapper for malloc() :-)

Old kernel malloc is deprecated too and you should use kmem_alloc for  
memory allocation.

[1]http://nxr.aydogan.net/source/xref/src/sys/modules/example/

Regards

Adam.