1. links: https://github.com/torvalds/linux/commits/master?author=liuhangbin@gmail.com https://github.com/kernelslacker/trinity/commits/master?author=liuhangbin@gmail.com https://github.com/borkmann/lksctp-tools/commits/master?author=liuhangbin@gmail.com

  2. pci_register_driver(&e100_driver) alloc_etherdev() // alloc dev memory register_netdev()

  3. receive message:

    1. netif_rx_schedule -> napi_schedule -> netif_recive_skb
  4. Send messag:

    1. dev_queue_xmit -> qdisc_run -> hard_start_xmit
    2. hard_start_xmit()
  5. Diff NAPI/Net Poll

    1. NAPI: stop interrupt and start poll mode, increase performance for device which will receive huge of packages per seconds.
    2. Netpoll: let kernel send package with unintact network, e.g. netconsole
  6. Locks

    1. spin lock: used for multi processors, and can only be hold by one kernel task, incase multi processor visit critical Section. should only be uses with little time. Not allowed sleep, can be used in interrupt context
    2. mutex: sleep lock, can only be used in Process Context, could not be used in interrupt context.
    3. RCU(Read-Copy Update): read much and write little, like route query
    4. rwlock
  7. memory management:

    1. First 1M physical memory store BIOS info, linux start from 1M
    2. Segmentation
    3. Page: 4K/per page
    4. X86_64: 0-3G user space, 3-4G kernel space
    5. kernel space: 0-896M, lower memory, > 896M, High memory
    6. the last 128K for page mapping
  8. malloc:

    1. malloc: for user space
    2. kmalloc: for kernel, but with consecutive memory, fast
    3. vmalloc: for kernel, but may not onsecutive, slow
  9. block, char device

    1. char device only be called like stream.
    2. block device can be read from anyware.
  10. show driver print info, module info, and interrupt info

    1. dmesg, lsmod, cat /proc/interrupt
  11. copy_to_user/copy_from_user:

    1. check whether user space pointer is valid
    2. incase of do_page_fault
  12. register char device

    1. cdev_init
    2. register_chrdev()
    3. mknod to create a device under /dev
  13. DMA, interrupt

    1. DMA: no need cpu, copy date from kernel to device directly
    2. interrupt: need cpu, when have IRQ, cpu stop current job and deal with IRQ