Writing and compiling kernel modules
Hi All,
I'm trying to port a kernel module from solaris to HP-UX. At this
point, I'm testing on 11.11, but will try other systems when (if) I'm
successful.
I've downloaded the dummynet tree, and play with it now. 2 questions
come to mind:
1. Can I somehow use gcc to compile a kernel module/driver? All
refernces say I should use the HP ANSI-C compiler, but I wonder if
anybody has managed to use gcc. If so, what are the correct flags?
2. I need to write a "misc" module. All the examples I found are for
either a driver or a STREAMS module. Any ideas?
TIA,
Gali
Re: Writing and compiling kernel modules
Gali Work <galinews@gmail.com> wrote:[color=blue]
> I'm trying to port a kernel module from solaris to HP-UX. At this
> point, I'm testing on 11.11, but will try other systems when (if)
> I'm successful.[/color]
[color=blue]
> I've downloaded the dummynet tree, and play with it now. 2 questions
> come to mind:[/color]
From where did you get dummynet? If from ftp.cup.hp.com, keep in mind
that dummynet is not exactly meant to be an exemplar of kernel modules
:)
[color=blue]
> 1. Can I somehow use gcc to compile a kernel module/driver? All
> refernces say I should use the HP ANSI-C compiler, but I wonder if
> anybody has managed to use gcc. If so, what are the correct flags?[/color]
My personal advice would be "Don't even go there." The HP-UX kernel
is compiled with the HP compilers. You'd need to find some rather
precise translations of all the
kernel-specific-and-probably-poorly-documented-if-at-all options.
[color=blue]
> 2. I need to write a "misc" module. All the examples I found are for
> either a driver or a STREAMS module. Any ideas?[/color]
What do you mean by a "misc" module? I gather you've already gone
through the DDG and all that online stuff?
rick jones
--
Process shall set you free from the need for rational thought.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Re: Writing and compiling kernel modules
Thanks, Rick for the quick reply.
[color=blue][color=green]
> > I've downloaded the dummynet tree, and play with it now. 2 questions
> > come to mind:[/color]
>
> From where did you get dummynet? If from ftp.cup.hp.com, keep in mind
> that dummynet is not exactly meant to be an exemplar of kernel modules
> :)[/color]
Yes, I know, I'm just trying to gather as many examples as possible. If
you have any other input to recommend, please do.
[color=blue]
> My personal advice would be "Don't even go there." The HP-UX kernel
> is compiled with the HP compilers. You'd need to find some rather
> precise translations of all the
> kernel-specific-and-probably-poorly-documented-if-at-all options.[/color]
I suspected that, but wanted to check with others, just in case I was
wrong. I will take your word (and buy the compiler).
[color=blue]
> What do you mean by a "misc" module? I gather you've already gone
> through the DDG and all that online stuff?[/color]
I'm referring to HP's "Developing DLKM" issue 1.0 (and other sources as
well): "Miscellaneous modules can implement any feature within the
kernel". I know it uses mod_misc_opt for its mod_operations structure,
but that's pretty much all I know. I'll keep reading, but I'd love to
see a working sample...
Thanks again.
Re: Writing and compiling kernel modules
Gali Work <galinews@gmail.com> wrote:[color=blue]
> I suspected that, but wanted to check with others, just in case I was
> wrong. I will take your word (and buy the compiler).[/color]
You might wait a bit longer for usenet propagation to reach folks who
may have actually tried gcc for UX kernel, but yeah, having the actual
HP compiler will probably make life much happier. There may be some
way via the developer stuff to get a discount - at least it would be
worth checking.
[color=blue][color=green]
>> What do you mean by a "misc" module? I gather you've already gone
>> through the DDG and all that online stuff?[/color][/color]
[color=blue]
> I'm referring to HP's "Developing DLKM" issue 1.0 (and other sources as
> well): "Miscellaneous modules can implement any feature within the
> kernel". I know it uses mod_misc_opt for its mod_operations structure,
> but that's pretty much all I know. I'll keep reading, but I'd love to
> see a working sample...[/color]
Ah, well, that's gone _well_ past my expereince base :)
rick
--
firebug n, the idiot who tosses a lit cigarette out his car window
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...