?? How do I develop a Linux kernel?
Recommend this article:
Http://www.tldp.org/LDP/lkmpg/2.6/html/lkmpg.html
The following is the output under Ubuntu:
[email protected]# make
Make:Warning:File ' Makefile ' has modification time one s in the future
Make-c/lib/modules/3.13.0-24-generic/build m=/root Modules
MAKE[1]: Entering directory '/usr/src/linux-headers-3.13.0-24-generic '
MAKE[2]: Warning:file '/root/makefile ' has modification time ten s in the future
CC [M]/root/hello-1.o
MAKE[2]: Warning:clock skew detected. Your build may incomplete.
Building modules, Stage 2.
MAKE[2]: Warning:file '/root/makefile ' have modification time 8.9 s in the future
Modpost 1 Modules
cc/root/hello-1.mod.o
LD [M]/root/hello-1.ko
MAKE[2]: Warning:clock skew detected. Your build may incomplete.
MAKE[1]: Leaving directory '/usr/src/linux-headers-3.13.0-24-generic '
Make:warning:Clock skew detected. Your build may incomplete.
~
[email protected] # ls
A B.C Hello-1.ko hello-1.o modules.order Myfirstjavaprogram.java
A.C DNS hello-1.mod.c IP.txt module.symvers sumofn-thpowersisann-thpower
B hello-1.c hello-1.mod.o Makefile myfirstjavaprogram.class sumofn-thpowersisann-thpower.c
~
[email protected] # Insmod./hello-1.ko
~
[email protected] # Cat/var/log/kern.log
Feb 2 00:48:18 cmt-ub14x64-02 kernel: [8216591.312610] hello_1:module license ' unspecified ' taints kernel.
Feb 2 00:48:18 cmt-ub14x64-02 kernel: [8216591.312617] disabling lock debugging due to kernel taint
Feb 2 00:48:18 cmt-ub14x64-02 kernel: [8216591.312641] hello_1:module verification failed:signature and/or required Ke Y missing-tainting Kernel
Feb 2 00:48:18 cmt-ub14x64-02 kernel: [8216591.313139] Hello World 1.
~
[email protected]# Cat/proc/modules
Hello_1 12426 0-live 0xffffffffa01e9000 (POF)
Nls_iso8859_1 12713 0-live 0xffffffffa01e4000
Joydev 17381 0-live 0xffffffffa0183000
Hid_generic 12548 0-live 0xffffffffa01db000
UDF 89723 0-live 0xffffffffa01c4000
crc_itu_t 12707 1 udf, Live 0xffffffffa01bf000
Psmouse 102222 0-live 0xffffffffa01a5000
Serio_raw 13462 0-live 0xffffffffa017e000
Hid_hyperv 13059 0-live 0xffffffffa012e000
Hyperv_keyboard 12777 0-live 0xffffffffa00c6000
HID 106148 2 Hid_generic,hid_hyperv, Live 0xffffffffa018a000
NFSD 280297 2-live 0xffffffffa0135000
AUTH_RPCGSS 59338 1 nfsd, Live 0xffffffffa011e000
Nfs_acl 12837 1 nfsd, Live 0xffffffffa00c1000
NFS 236636 0-live 0xffffffffa00e3000
HYPERV_FB 17593 1-live 0xffffffffa00bb000
i2c_piix4 22155 0-live 0xffffffffa00b0000
LOCKD 93977 2 Nfsd,nfs, Live 0xffffffffa00cb000
Mac_hid 13205 0-live 0xffffffffa004f000
Sunrpc 284404 6 nfsd,auth_rpcgss,nfs_acl,nfs,lockd, Live 0xffffffffa0069000
Fscache 63988 1 NFS, Live 0xffffffffa0058000
LP 17759 0-live 0xffffffffa0028000
Parport 42348 1 LP, Live 0xffffffffa0043000
Hv_utils 19003 0-live 0xffffffffa003d000
HV_STORVSC 17785 2-live 0xffffffffa0010000
Hv_vmbus 50383 5 HID_HYPERV,HYPERV_KEYBOARD,HYPERV_FB,HV_UTILS,HV_STORVSC, Live 0xffffffffa002f000
Floppy 69370 0-live 0xffffffffa0016000
Tulip 59672 0-live 0xffffffffa0000000
~
[email protected] # Rmmod Hello-1
~
[email protected]# Cat/proc/modules
Nls_iso8859_1 12713 0-live 0xffffffffa01e4000
Joydev 17381 0-live 0xffffffffa0183000
Hid_generic 12548 0-live 0xffffffffa01db000
UDF 89723 0-live 0xffffffffa01c4000
crc_itu_t 12707 1 udf, Live 0xffffffffa01bf000
Psmouse 102222 0-live 0xffffffffa01a5000
Serio_raw 13462 0-live 0xffffffffa017e000
Hid_hyperv 13059 0-live 0xffffffffa012e000
Hyperv_keyboard 12777 0-live 0xffffffffa00c6000
HID 106148 2 Hid_generic,hid_hyperv, Live 0xffffffffa018a000
NFSD 280297 2-live 0xffffffffa0135000
AUTH_RPCGSS 59338 1 nfsd, Live 0xffffffffa011e000
Nfs_acl 12837 1 nfsd, Live 0xffffffffa00c1000
NFS 236636 0-live 0xffffffffa00e3000
HYPERV_FB 17593 1-live 0xffffffffa00bb000
i2c_piix4 22155 0-live 0xffffffffa00b0000
LOCKD 93977 2 Nfsd,nfs, Live 0xffffffffa00cb000
Mac_hid 13205 0-live 0xffffffffa004f000
Sunrpc 284404 6 nfsd,auth_rpcgss,nfs_acl,nfs,lockd, Live 0xffffffffa0069000
Fscache 63988 1 NFS, Live 0xffffffffa0058000
LP 17759 0-live 0xffffffffa0028000
Parport 42348 1 LP, Live 0xffffffffa0043000
Hv_utils 19003 0-live 0xffffffffa003d000
HV_STORVSC 17785 2-live 0xffffffffa0010000
Hv_vmbus 50383 5 HID_HYPERV,HYPERV_KEYBOARD,HYPERV_FB,HV_UTILS,HV_STORVSC, Live 0xffffffffa002f000
Floppy 69370 0-live 0xffffffffa0016000
Tulip 59672 0-live 0xffffffffa0000000
~
[email protected] # Cat/var/log/kern.log
Feb 2 00:48:18 cmt-ub14x64-02 kernel: [8216591.312610] hello_1:module license ' unspecified ' taints kernel.
Feb 2 00:48:18 cmt-ub14x64-02 kernel: [8216591.312617] disabling lock debugging due to kernel taint
Feb 2 00:48:18 cmt-ub14x64-02 kernel: [8216591.312641] hello_1:module verification failed:signature and/or required Ke Y missing-tainting Kernel
Feb 2 00:48:18 cmt-ub14x64-02 kernel: [8216591.313139] Hello World 1.
Feb 2 00:53:10 cmt-ub14x64-02 kernel: [8216883.303516] Goodbye World 1.
How do I develop a Linux kernel?