This sample code demonstrates how to create and use a simple kernel extension on the IBM AIX® platform. After the kernel extension is loaded, they can be called from a user space application. In this case, when the kernel extension is called, the following actions take place:
To see a list of all available sample code downloads, go back to the IBM Systems sample code.
# make Makefile
Testing the kernel extension
Load the kernel extension from the command line prompt.
# ./loadkernext -l hello_world.kex
Its kmid is 0x2c8e204.
Note: You can also view a list of all loaded kernel extensions by using the command genkex.
Run the main program
hello_world kernel extension returned 999
A log file names sample.log is created.
To unload the kernel extension
# ./loadkernext -u hello_world.kex
Note: IBM does not want to receive confidential or proprietary information from you. Please note that any information or material sent to IBM will be deemed NOT to be confidential. By sending IBM any information or material, you grant IBM an unrestricted, royalty-free, irrevocable license to use, reproduce, display, perform, modify, transmit and distribute those materials or information, and you also agree that IBM is free to use any ideas, concepts, know-how or techniques that you send us for any purpose.
About the author(s)
Alfredo (Freddie) Mendoza is an IT Specialist in the ISV Business Strategies and Enablement Group within the IBM Systems and Technology Division with more than 19 years in Application Architecture and Management experience. His current work involves working with Independent Software Vendors to port and migrate their applications into IBM cross platform operating systems offerings. Prior to his current position, Mr. Mendoza worked in IBM’s Global Services, AIX Kernel development organizations and worked as an independent consultant for different software development organizations. Mr. Mendoza has authored and co-authored several patent invention publications on “thread management,” and “software algorithms”. He is a co-author of the “Unix to Linux Porting” book and author of the book “Utility Computing Technologies, Standards and Strategies”.