hi, I am reading the book Linux Device Drivers 3rd edition(alessandro rubini) ,in the second chapter about 'Building and Running Modules', the book says that : ------------------------- % make make[1]: Entering directory `/usr/src/linux-2.6.10' CC [M] /home/ldd3/src/misc-modules/hello.o Building modules, stage 2. MODPOST CC /home/ldd3/src/misc-modules/hello.mod.o LD [M] /home/ldd3/src/misc-modules/hello.ko make[1]: Leaving directory `/usr/src/linux-2.6.10' % su root# insmod ./hello.ko Hello, world root# rmmod hello Goodbye cruel world root#
Please note once again that , for the above sequence of commands to work,you must have a properly configured and built kernel tree in a place where the makefile is able to find it(/usr/src/linux-2.6.10 in the example shown). ---------------------------- what does it means to have a configured and built kernel? , does it mean that i need to compile the kernel? I have the source of kernel 2.6.16.18 in the /root directory, how do i configure and build it? Please help I am totally new to device drivers!
On 10/11/06, The Xirtna xirtna@gmail.com wrote:
hi, I am reading the book Linux Device Drivers 3rd edition(alessandro rubini)
<snip>
what does it means to have a configured and built kernel? , does it mean that i need to compile the kernel? I have the source of kernel 2.6.16.18 in the /root directory,
Please do not use /root.
how do i configure and build it?
Please help I am totally new to device drivers!
Please see the howto at http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html
In particular check the software requirements section. You will need the ncurses-devel package for curses based kernel configuration.
Regards, Mohan S N
Hi,
--- Mohan Nayaka mohansn@gmail.com wrote:
Please do not use /root.
Why not?
It doesn't matter where you keep the kernel sources. The driver Makefile has to have the kernel sources path set accordingly.
The use of /usr/src is just to keep it under one directory so one doesn't need to keep searching for different kernel sources in the system.
--- "The Xirtna" xirtna@gmail.com wrote:
what does it means to have a configured and built
kernel?
1. To have the kernel sources installed. 2. To have MODULE load/unload support in the kernel (usually enabld by default). 3. To have the kernel installed and running on the system.
Please help I am totally new to device drivers!
Try my simple Linux device driver examples:
http://www.shakthimaan.com/downloads.html
SK
-- Shakthi Kannan http://www.shakthimaan.com
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
On 10/12/06, Shakthi Kannan shakthimaan@yahoo.com wrote:
Hi,
--- Mohan Nayaka mohansn@gmail.com wrote:
Please do not use /root.
Why not?
Because /root is typically the home directory of root. Please correct me if i am wrong, but i think if the driver & kernel sources are kept in some directory owned by user, root access is required only for inserting & removing the module.
It doesn't matter where you keep the kernel sources. The driver Makefile has to have the kernel sources path set accordingly.
The use of /usr/src is just to keep it under one directory so one doesn't need to keep searching for different kernel sources in the system.
true i keep it in ~/linux-x.y.z
--- "The Xirtna" xirtna@gmail.com wrote:
what does it means to have a configured and built
kernel?
- To have the kernel sources installed.
- To have MODULE load/unload support in the kernel
(usually enabld by default). 3. To have the kernel installed and running on the system.
Please help I am totally new to device drivers!
Try my simple Linux device driver examples:
http://www.shakthimaan.com/downloads.html
SK
-- Shakthi Kannan http://www.shakthimaan.com -- http://mm.glug-bom.org/mailman/listinfo/linuxers
On 10/12/06, Shakthi Kannan shakthimaan@yahoo.com wrote:
Hi,
what does it means to have a configured and built
kernel?
- To have the kernel sources installed.
- To have MODULE load/unload support in the kernel
(usually enabld by default). 3. To have the kernel installed and running on the system.
I have placed the kernel sources in /usr/src/linux-2.6.16.18 directory. i tried to compile the kernel using these commands : # make xconfig # make bzImage # make modules # make modules_install # cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.16.18 # mkinitrd /boot/initrd-2.6.16.18.img 2.6.16.18 # make install
But when i boot into the OS with the new kernel, it gives an error at the boot time "Kernel Panic, attempted to kill init.........." ,and the OS doesn't boot! please tell me where i am wrong!
thanks.