From adhiraj at linsyssoft.com Mon Nov 2 06:59:42 2009 From: adhiraj at linsyssoft.com (Adhiraj Joshi) Date: Mon, 2 Nov 2009 20:29:42 +0530 Subject: [driver-utility] Compiling a device driver Message-ID: Hi All, I am writing a simple device driver on open solaris. I have a simple question (may be stupid). Is there a way to compile the driver independently of the kernel build like in Linux? To be more specific, I have compiled and inserted a pseudo device driver which works fine. But if I am to write a real device driver which has to use the APIs provided by the kernel (like registering interrupt handlers and all) how do I link my device driver with the kernel build so that the device driver compiles with those APIs? Is it necessary that the device driver should be part of the kernel and we have to build the entire kernel to build the driver? When I try to compile the kernel using the pointers at this link: http://hub.opensolaris.org/bin/view/Community+Group+on/devref_1#H133BuildingONfromSourceI get multiple errors of the type: /usr/bin/rm -f /export/testws/proto/root_i386/usr/lib/amd64/liby.so.1; install -s -m 755 -f /export/testws/proto/root_i386/usr/lib/amd64 liby.so.1 /usr/bin/rm -f /export/testws/proto/root_i386/usr/lib/amd64/llib-ly.ln; install -s -m 644 -f /export/testws/proto/root_i386/usr/lib/amd64 llib-ly.ln /usr/bin/rm -f /export/testws/proto/root_i386/usr/lib/amd64/liby.so; /usr/bin/ln -s liby.so.1 /export/testws/proto/root_i386/usr/lib/amd64/liby.so /export/testws/usr/src/lib dmake: Warning: Target `install' not remade because of errors Current working directory /export/testws/usr/src/lib **** Error code 1 The following command caused the error: cd lib; pwd; dmake install* dmake: Warning: Command failed for target `lib' Current working directory /export/testws/usr/src Any pointers on what am I missing? Also if this is not the right mailing list to ask this question, can someone point me to the correct one please? Thanks in advance. Adhiraj. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dngireesh at gmail.com Mon Nov 2 08:04:24 2009 From: dngireesh at gmail.com (Gireesh Nagabhushana) Date: Mon, 02 Nov 2009 21:34:24 +0530 Subject: [driver-utility] Compiling a device driver In-Reply-To: References: Message-ID: <1257177864.3734.23.camel@Everest> On Mon, 2009-11-02 at 20:29 +0530, Adhiraj Joshi wrote: > Hi All, > > I am writing a simple device driver on open solaris. I have a simple > question (may be stupid). Is there a way to compile the driver > independently of the kernel build like in Linux? > It is possible to build drivers "standalone". In that case, you may need to copy some header files to default include directory; this depends on the type of driver you build. > To be more specific, I have compiled and inserted a pseudo device > driver which works fine. But if I am to write a real device driver > which has to use the APIs provided by the kernel (like registering > interrupt handlers and all) how do I link my device driver with the > kernel build so that the device driver compiles with those APIs? Did you add -D_KERNEL to CFLAGS? > Is it necessary that the device driver should be part of the kernel > and we have to build the entire kernel to build the driver? > When I try to compile the kernel using the pointers at this link: > http://hub.opensolaris.org/bin/view/Community+Group > +on/devref_1#H133BuildingONfromSource I get multiple errors of the > type: > > /usr/bin/rm -f /export/testws/proto/root_i386/usr/lib/amd64/liby.so.1; > install -s -m 755 -f /export/testws/proto/root_i386/usr/lib/amd64 > liby.so.1 > /usr/bin/rm > -f /export/testws/proto/root_i386/usr/lib/amd64/llib-ly.ln; install -s > -m 644 -f /export/testws/proto/root_i386/usr/lib/amd64 llib-ly.ln > /usr/bin/rm > -f /export/testws/proto/root_i386/usr/lib/amd64/liby.so; /usr/bin/ln > -s liby.so.1 /export/testws/proto/root_i386/usr/lib/amd64/liby.so > /export/testws/usr/src/lib > dmake: Warning: Target `install' not remade because of errors > Current working directory /export/testws/usr/src/lib > *** Error code 1 > The following command caused the error: > cd lib; pwd; dmake install > dmake: Warning: Command failed for target `lib' > Current working directory /export/testws/usr/src > > > Any pointers on what am I missing? Also if this is not the right > mailing list to ask this question, can someone point me to the correct > one please? > You can post at driver-discuss. -- Gireesh > Thanks in advance. > Adhiraj. > > > _______________________________________________ > driver-utility mailing list > driver-utility at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/driver-utility