How to write a Kernel Modules ?

Hi Everybody,
I'm trying to write a kernel module for the solaris 7 (64 bit) kernel.
but i can't modload it.
should i put it in a specific directory or can i modload it from my home
directory ?
maybe i'm not using the right compilation switches ? what should they be
can anyone send me a redundant module ( such as the one in the _init man
page) that actually downloads ?
thanx
Oren
p.s. please send your response to [email protected]

Hi,
Try placing the module in /kernel/drv/sparcv9 or /usr/kernel/drv/
sparcv9 and give it a try.
On more research..
man page of modload(1M) says that,
If filename is an absolute pathname then the file specified
by that absolute path is loaded. If filename does not begin
with a '/' then the path to load filename is relative to
the current directory unless the -p option is specified.
The kernel's modpath variable can be set using the
/etc/system file. The default value of the kernel's modpath
variable is set to the path where the operating system was
loaded. Typically this is /kernel /usr/kernel.
Thanks,
Gopinath.

Similar Messages

  • How to write a kernel module for Solaris

    Hi
    I would like to know where I can find information about writing a kernel module for Solaris. Is there a pdf developers reference?

    http://docs.sun.com
    Search "writing device drivers".Even if I don't intend writing a device driver?

  • How to communicate wite kernel module

    After a kernel module was loaded successfully, how to communicate wite this kernel module like change the status of the kernel module.
    In Linux, I can use /proc file to do that. But, In solaris, /proc file is just used for processors.
    Now, how can I communicate write my kernel module? Can I use /proc file to do that like in Linux?

    Hello,
    <ul>
    <li>forget /proc, the procfs is for process table only on solaris
    <li>if the kernel module is "driver" type you can use standard read/write/ioctl ... on block/charcter in dev (see OpenSolaris community and documentation Writing Device Drivers)
    <li>there are other types of kernel modules such as streams, filesystems, schedulers ...
    <li>the kernel module can export some symbols to see it from mdb (see blog)
    <li>...
    </ul>
    <br>
    M.C>

  • How to begin a kernel module?

    Hello,
    I am new to solaris OS. Now I want to write a kernel module, which may be a simple (pseudo )file system. I have read some materials, such as "Writing a device driver" provided by docs.sun.com and "Slaris Internals", , but I have no idea to start. I wonder if ddi and dki functions are enough to implement a simple file system. Could someone please give me some guides for achieve my goal? Thank you !!!

    Hello.
    There are different kernel modules:
    - Drivers
    - streams modules
    - misc. modules
    - file systems and
    - executable file formats
    (I think there are even more types)
    As far as I know only drivers and streams modules are documented. (Misc. modules are not documented but they are quite simple.)
    As far as I know file system modules are not documented but I think the necessary DDI functions are present in the sys/include files of Solaris.
    If your pseudo file system driver does not access anything which requires kernel access you might write an NFS file server that runs in user mode instead and mount your file system using "-F NFS". I think this is only a bit more difficult than writing a real file system driver. Note that the NFS protocol is well documented!
    Martin R.

  • How to write a function module?

    How can i write a function module that does the same thing as BAPI_FLIGHT_GETLIST in the SAP system?

    Hi
    Hope it will help you.
    Reward if help.
    Function Modules;
    Check this matter.
    Function Modules are Global ABAP programs created by SAP for reusable purpose.they have IMPORT,EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.
    You can create them from TCode SE37.
    Go through the following doc:
    Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.
    Function Module Interfaces
    The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:
    Syntax
    ... [IMPORTING parameters]
    [EXPORTING parameters]
    [CHANGING parameters]
    [TABLES table_parameters]
    [{RAISING|EXCEPTIONS} exc1 exc2 ...]
    The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with [CLASS-]METHODS. The additional option of defining table parameters using TABLES is obsolete.
    Interface parameters
    The interface parameters are defined on the relevant tab pages in the Function Builder.
    IMPORTING parameters are input parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input parameter. The content of the actual parameter is passed to the input parameter when the call is made. The content of an input parameter for which 'pass by reference' is defined cannot be changed in the function module.
    EXPORTING parameters are output parameters. When the function module is called, a suitable actual parameter can be specified for every output parameter. The content of an output parameter that is defined for 'pass by value' is transferred to the actual parameter if the function module is completed without errors. An output parameter that is defined for pass by reference is not initialized when the function module is called.
    CHANGING parameters are input and output parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input or output parameter. When the function module is called, the content of the actual parameter is passed to the input/output parameter, and when the function module is completed, the content of the input/output parameter is passed to the actual parameter.
    TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
    Exceptions
    The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
    The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
    The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
    Note
    For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
    RFC is a technology which is used to access a functions (Modules) from
    the remote systems.
    If a function module is set as remote enabled which can be access from
    the remote system via RFC.Eg: U can access the Remote enabled function modules in ur VB,Webdynpro,Java,Visual composer program.
    A function module can be set as remote enabled by SE37->Go to ur FM->click the option Button "remote enabled".
    But Normal function modules can not accessd from the remote system.
    Good Example for RFC enabled function module is : BAPI(Business Application Programming Interface)
    Note: All BAPIs are Remote enabled but not all remote enabled function modules are BAPI.
    CALLING A FUNCTION MODULE:
    1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"
    --> Write the Corresponding FM name --> Hit Enter
    2)The appropriate import ,export Parameters will be displayed in ur editor
    3)Pass the Values Here.
    Also check these links.
    http://www.geocities.com/victorav15/sapr3/abapfun.html
    Check this link:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    Check this link:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    See the following links:
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm

  • How to make a kernel modules in petalinux

    i am making a kernel module in petalinux with QEMU(emulator).
    I mean, my computer's OS is ubuntu. And then I turn on the QEMU, and next I turn on the petalinux.
    My problem is that I can't make a kernel module with SDK or Makefile.
    First of all, when I make a module with SDK, I don't understand the Manual.
    I think manual is for board.
    Second, when I make a module with Makefile, module was generated.
    But when I download the module in petalinux.
    There is error which is 'invalid module format' message.
    Third, There is module in linux, and I want to run this module in petalinux.
    Is it possible??
    If there is a solution, how can i run that module.
    I have no idea about them.
    I want to solve the problem as soon as possible.
    If you have any ideas, please let me know. Thank you.

    Hi,
    Try placing the module in /kernel/drv/sparcv9 or /usr/kernel/drv/
    sparcv9 and give it a try.
    On more research..
    man page of modload(1M) says that,
    If filename is an absolute pathname then the file specified
    by that absolute path is loaded. If filename does not begin
    with a '/' then the path to load filename is relative to
    the current directory unless the -p option is specified.
    The kernel's modpath variable can be set using the
    /etc/system file. The default value of the kernel's modpath
    variable is set to the path where the operating system was
    loaded. Typically this is /kernel /usr/kernel.
    Thanks,
    Gopinath.

  • How to use Corecrypto kernel module

    Hi all,
    I know that Corecrypto kernel module received a FIPS 140 vaulidation, but I can't find any document for this module.
    My questions is: how can I leverge this crypto module? For example, is there any API exposed so that I can use it to do AES encryption?
    Is it a replacement of CommonCrypto library, or totally different thing?

    It's an Apple internal one; They're slowly but surely moving stuff out of xnu and into kexts - corecrypto is one example, and pthread.kext is another (formerly all those psync functions). It's a totally different thing.
    in the xnu's src - 2422, /libkern/libkern/crypto/register_crypto.h, you have the crypto_functions struct. This relies on the EXTERNAL_HEADERS/corecrypto headers, but that's about all the documentation you're going to get in the form of the function prototypes it registers (albeit for internal use). Other functionality in the kernel (most notably CoreStorage, and AppleKeyStore iOS has nke.tls, SEP, the dreaded AMFI, and others) then calls these functions, and visible exported one e.g. xts_encrypt (libkern/crypto/corecrypto_aesxts.c) call on the cc.kext. I doubt Apple will let you release a kext which ties to corecrypto.kext, since the latter is deemed private.
    CommonCrypto is still very much alive, but that's the user mode API. That's /usr/lib/system/libcorecrypto.dylib, which is re-exported by LibSystem (like the rest of the .../system/ dylibs). That's safe to use (again, in user mode).
    It's possible that at some point they'll create a UserClient so that libcorecrypto would actually go via IOKit to kernel mode and do the crypto there, but that's not how it is now. To parallel Linux, it also has a crypto directory in the kernel sources, which are used for kernel-mode sym encryption/hashes, but you still have a user mode libcrypt (part of openSSL) which takes no advantage of that.

  • How to compile a kernel module without recompiling the whole kernel?

    Hi,
    I'm pretty sure my question is a bit newbish, still I haven't been able to found any information/solution to my problem in 3days.
    The kernel I use doesn't come with the module I need for my hardware and I would like to know if there's a way to compile it without having to make a new kernel myself (since compiling the kernel takes ages on my machine).
    Even if your answer is a "Let me Google that for you", I'm so desperate that I'll be happy to see it.
    Thank you all in advance for your answers!

    Do you have a /proc/config.gz that you could use? Otherwise I don't know. I mean, many modules should be compilable simply with the system-installed kernel headers, but not all native modules might follow that rule.
    Unfortunatel most of what you find on the web talks about how to create new modules which can be compild against the installed kernel tree, not about how to compile one of the native kernel modules against it.
    Actually, try what those links suggest.
    Skip the configuration part, and just do:
    make -C /lib/modules/`uname -r`/build M=$(PWD)/drivers/video modules
    (maybe `make -C /lib/modules/`uname -r`/build M=$(PWD)/drivers/video clean` first )
    EDIT: Meh, that uses your config and won't build that driver... there must be some way though
    EDIT2: Try:
    make -C /lib/modules/`uname -r`/build M=$(PWD)/drivers/video modules CONFIG_FB_VT8623=m CONFIG_FB_SVGALIB=m
    The problem though is, that they might have removed some of the dependencies of the module, so if it doesn't compile, you'll have to recompile the kernel.
    Good thing is though, you can use their .config as base (found in /usr/src/linux-..../.config)
    You can also check if your config "supports" your module by putting it into the kernel source tree, running `make menuconfig` and typing /8623 and pressing enter.
    The last line in that screen should read:
    Selects: <list of options>
    As long as all of those options are either =y or =m, you're good. SVGALIB can be =n because it's part of drivers/video/ and you can compile it together with  your module.
    Last edited by Blµb (2012-03-02 15:14:16)

  • How to write the exceptions in function module

    dear all,
         how to write the exceptions in function modules with example.
    thanq
    jyothi

    Hi,
    Raising Exceptions
    There are two ABAP statements for raising exceptions. They can only be used in function modules:
    RAISE except.
    und
    MESSAGE.....RAISING except.
    The effect of these statements depends on whether the calling program handles the exception or not. The calling program handles an exception If the name of the except exception or OTHERS is specified after the EXCEPTION option of the CALL FUNCTION statement.
    If the calling program does not handle the exception
    · The RAISEstatement terminates the program and switches to debugging mode.
    · The MESSAGE..... RAISING statement displays the specified message. Processing is continued in relation to the message type.
    If the calling program handles the exception, both statements return control to the program. No values are transferred. The MESSAGE..... RAISING statement does not display a message. Instead, it fills the system fields sy-msgid, sy-msgty, sy-msgno , and SY-MSGV1 to SY-MSGV4.
    Source Code of READ_SPFLI_INTO_TABLE
    The entire source code of READ_SPFLI_INTO_TABLE looks like this:
    FUNCTION read_spfli_into_table.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(ID) LIKE SPFLI-CARRID DEFAULT 'LH '
    *" EXPORTING
    *" VALUE(ITAB) TYPE SPFLI_TAB
    *" EXCEPTIONS
    *" NOT_FOUND
    SELECT * FROM spfli INTO TABLE itab WHERE carrid = id.
    IF sy-subrc NE 0.
    MESSAGE e007(at) RAISING not_found.
    ENDIF.
    ENDFUNCTION.
    The function module reads all of the data from the database table SPFLI where the key field CARRID is equal to the import parameter ID and places the entries that it finds into the internal table spfli_tab. If it cannot find any entries, the exception NOT_FOUND is triggered with MESSAGE ... RAISING. Otherwise, the table is passed to the caller as an exporting parameter.
    Calling READ_SPFLI_INTO_TABLE
    The following program calls the function module READ_SPFLI_INTO_TABLE:
    REPORT demo_mod_tech_fb_read_spfli.
    PARAMETERS carrier TYPE s_carr_id.
    DATA: jtab TYPE spfli_tab,
    wa LIKE LINE OF jtab.
    CALL FUNCTION 'READ_SPFLI_INTO_TABLE'
    EXPORTING
    id = carrier
    IMPORTING
    itab = jtab
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    CASE sy-subrc.
    WHEN 1.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
    WHEN 2.
    MESSAGE e702(at).
    ENDCASE.
    LOOP AT jtab INTO wa.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDLOOP.
    The actual parameters carrier and jtab have the same data types as their corresponding interface parameters in the function module. The exception NOT_FOUND is handled in the program. It displays the same message that the function module would have displayed had it handled the error.
    Or
    just have to decide what exceptions u want and under what conditions.
    then declarethese exeptions under the exceptions tab.
    in the source code of ur function module.
    if
    like this u can code .
    now when u call the function module in tme mainprogram.
    if some error occurs and u have declared a exception for this then it will set sy-subrc = value u give inthe call of this fm.
    in the fm u can program these sy-subrc values and trigger the code for ur exception.
    Please reward if useful
    Regards,
    Ravi
    Edited by: Ravikanth Alapati on Mar 27, 2008 9:36 AM

  • How to find which function module write the relevant idoctype?

    Dear All,
    how to find which function module write the relevant idoctype?

    Hi,
    Generally the function modules of the idoc types are having a naming convention as IDOC_INPUT for inbound processing and IDOC_OUTPUT for outbound processing followed by the idoc type name
    for example : For IDOC type ORDERS
    the inbound function module will be IDOC_INPUT_ORDERS and for outbound IDOC_OUTPUT_ORDERSP
    In this way you can find the function module for a particular IDOC
    P.S: Hope this is what you have asked for
    Regards
    Sarves

  • [SOLVED]How can I disable ehci_hcd kernel module?

    How can I disable ehci_hcd kernel module loading?
    I have up to date archlinux.
    I tried add 'modprobe -r ehci_hcd' to '/etc/rc.local' but this broke net-profiles - ppp connection at bootup(I have USB modem (which of course work with uhci_hcd module) connected).
    I also tried with '/etc/modprobe.d/modprobe.conf' and 'blacklist ehci_hcd' but ehci_hcd still loading at bootup.
    Last edited by amen (2010-01-27 17:48:45)

    bangkok_manouel wrote:http://wiki.archlinux.org/index.php/Rc.conf#Hardware
    Thanks, but:
    1) blacklist module in /etc/rc.conf not work:
    MOD_AUTOLOAD="yes"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(floppy !snd-pcsp !ehci_hcd)
    2) this not work also:
    MOD_AUTOLOAD="no"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(long_long_list_of_modules_without_ehci_hcd)
    I found solution:
    1) comments 2 lines in /etc/modprobe.d/usb-load-ehci-first.conf
    #install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe --ignore-install ohci_hcd $CMDLINE_OPTS
    #install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe --ignore-install uhci_hcd $CMDLINE_OPTS
    2) and blacklist module ehci_hcd in /etc/rc.conf.

  • How to write adapter module to convert the xml to pdf file

    Hi all,
      how to write adapter module to convert the xml to pdf file.
    Please any body assist step by step procedure.

    PI 7.1 XML to PDF transformation
    have you seen below links:
    http://forums.sdn.sap.com/thread.jspa?threadID=1212478
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14363

  • How to install tools to build a standard kernel module?

    Hello!
    I am a long time Fedora user trying to switch over to Arch for the ease of customization.
    I am trying to build the hybrid_wl driver for my broadcom wireless card, and the requirements section says I need to have "the proper tools, packages, header files and libraries to build a standard kernel module. This is usually done by installing the kernel developer of kernel source package and caries from distro to distro."
    I have never messed around with the kernel in Arch (or Fedora, for that matter) so I really have no clue what a standard module even is. What do I need to install to get this driver working?
    Any help is welcome!
    Thanks,
    Jim

    that is in aur.
    http://aur.archlinux.org/packages.php?ID=19514
    read about what is aur here: http://wiki.archlinux.org/index.php/AUR_User_Guidelines

  • Sample of how to write data to NI 9802 SD Card C-Module

    I have basic knowledge of LabVIEW but now I want to go into Real-Time and FPGA. I want to learn how to write a data read from an analog input to a SD card using NI 9802.  For the purpose of learning data rate does not matter, as long as I can write something to the memory card.  I read some documents online but I have not found an example so I can understand how to do it.  I will much appreciate if there is any help.
    My settings:
    - cRIO 9073
    - Slot 0: NI 9229 (reading only AIO)
    - Sot  1: NI 9802 (Memory card is inserted to slot 0) - must be used in FPGA mode only.

    Hi,
    To getstarted with, you can first attempt to mount and unmount the NI 9802 using the invoke methods "Mount SD Card" and "Unmount SD Card" in the RT vi. For this you only need to open an FPGA reference to the FPGA vi. After Mounting, you can obtain the drive letter and use it to create the file and write data.
    Best Regards,
    Gogineni
    Kudos are welcome

  • How do I install / update a specific kernel module?

    Hi
    I'm trying to update an existing kernel module. I can download it and it comes with a pretty easy to use Makefile based on http://www.kernel.org/doc/Documentation … odules.txt. The Makefile installs the newly created module into /lib/modules/$kernelversion/extra. I have some questions regarding this behavior:
    * The Makefile creates a *.ko whereas arch uses compressed *.ko.gz modules. Do I have to compress the built module before installing it?
    * Is the default install path (/extra) right? What about the module that already exists in /kernel/drivers/xxxx? Should I leave the new one in extra and remove the old one, or just replace the old one directly (backup not withstanding)?
    Regards,
    can

    Never heard of the /extra dir in this context. AFAIK the correct way to do this is to place the updated module in /lib/modules/$kernelversion/updates (create the updates dir if it's not already there). This way, the older version remains in place, but the version in /updates takes precedence.

Maybe you are looking for

  • OSX 10.8 BUG REPORTING

    I am having a problem, mostly with Apple Mail.  I lose the ability to type.  Keyboard inop.  Sometimes it occurs with Chrome (sorry, until they fix Safari, Chrome works better.  I'd love a fully integrated browser, but it ain't here yet!). Restarting

  • ISE 1.3 bugs in Guest Types?

    Hi, I've created a guest type that looks like this: Maximum account duration: 90 days Allow 15 simultaneous logins  Removes the oldes connection Maximum device guest can register: 1 When I log in to the sponsor portal and select the created guest typ

  • How to enable Party Information DFF at the branch level only in R12

    As we all know now bank and branch information are stored at the HZ_Parties level. I want to have a DFF only at the branch level. This DFF shouldn't appear in neither at bank level, customer maintence level or supplier level. I tried to build by cust

  • Ideal size for publishing for iPad

    I'm creating a interactive eBook with pages being designed in Edge Animate. As of revision 28 of the DPS viewer, the 20px iOS status bar will always be displayed. As a result, I set my article size and folio size (landscape only) to be 1024 x 748. Ho

  • ORA-907 ERROR WHEN IMPORT (COMMENT 처리)

    제품 : ORACLE SERVER 작성날짜 : 1997-10-15 ORA-907 ERROR WHEN IMPORT (COMMENT 처리) ======================================== ORA-907: missing right parenthesis error 이 error 는 export 한 table 을 create 시 comment 를 사용한 경우 발생하는 ORACLE error 이다. 이는 version 8.0.4