linux driver 課程

linux driver 課程

linux driver 課程

Ubuntu 16.04, Kernel Compile on default setting

 

 

$ sudo su

# apt-get update

# apt-get source linux-image-$(uname -r)

# cd linux-lts-xenial-4.4.0/

# cp /boot/config-4.4.0-31-generic    .config

# ls -al

# apt-get install kernel-package

# make menuconfig

# make-kpkg  -j2 –initrd –append-to-version=–test-kernel kernel_image
$ sudo apt-get install ssh

 

Linux API 文件

 

https://www.kernel.org/doc/htmldocs/kernel-api/index.html

 

常見的編譯錯誤:

 

  • error: implicit declaration of function ‘kfree
    添加#include <linux/slab.h>
  • error: implicit declaration of function ‘create_proc_read_entry’
    加上#include <linux/proc_fs.h>  (沒用)
  •  error: ‘struct tty_driver’ has no member named ‘write’
    請看 https://ithelp.ithome.com.tw/articles/10161491
  • unrecognized ELF data encoding 101:
  • CFLAGS   it to use ccflags-y  Stop
    ccflags-y
  •  implicit declaration of function ‘mdelay’
    #include <linux/delay.h>

 

 

 

 

 

  • 教學 (741)
  • 柯博文個人 (362)