How to enable DRM driver debug logging in Linux ?

If you are facing some issues with graphics or DRM , display etc.. sometime your may want to enable the DRM drivers all debugging messages so you can narrow down the problems. In Linux the drm kernel drivers source code can be found in drivers/gpu/drm. Enabling verbose debug messages is done through the drm.debug parameter, … Read more

Ubuntu doesn’t detect WiFi Access Point

Recently I came across very different problem when I moved to a place where there was few more access points, my laptop had ubuntu 14.04. [ Note: Users has reported that this works on latest Ubuntu versions also ] $ lsb_release -a I could see lot of other access points in my ubuntu network manager, … Read more

Understanding wireless beacon packet ( captured using pcap API’s )

As per Wikipedia, Beacon frame is one of the management frames in IEEE 802.11 based WLANs. It contains all the information about the network. Beacon frames are transmitted periodically, they serve to announce the presence of a wireless LAN and to synchronise the members of the service set. Beacon frames are transmitted by the access point (AP) in an infrastructure basic … Read more

Wi-Fi Initial Communication between device and access point

Following diagram shows the initial handshaking between the device ( like mobile ) and wireless access-point ( AP ) in open access mode and secured ( e.g. WPA ) mode, Authentication frame ( in open access ): 802.11 authentication is a process whereby the access point either accepts or rejects the identity of a radio … Read more

Passing command line Arguments / Parameters to Linux kernel module

In Our previous post, “Writing first Linux kernel Module and understanding Kernel module compilation, loading and unloading” We learned how to write a simple Linux kernel module. Lets see an example of how to pass the loading time parameters to the kernel module. The load time parameter passing is very helpful to enable / disable … Read more

Writing first Linux kernel Module and understanding Kernel module compilation, loading and unloading

We will try to understand the simple kernel driver which initially we will compile for ubuntu host and later for a embedded hardware. $ mkdir module_workspace $ vim hello.c Create a Makefile, $ vim Makefile Now, compile this kernel module for ubuntu x86 based host, $ make make -C /lib/modules/3.19.0-30-generic/build M=/home/devbee/devlab/module_workspace modules make[1]: Entering directory … Read more

How initrd is mounted by Linux kernel

Lets first try to understand what are the ways to mount the root file system, Altough the documentation from Documentation/early-userspace/README inside kernel source code is bit outdated, it is still has valid information as below, The kernel has currently 3 ways to mount the root filesystem: a) all required device and filesystem drivers compiled into … Read more

How kernel images are built / compiled

/bin/bash scripts/link-vmlinux.sh arm-linux-gnueabihf-ld -EL -p –no-undefined -X –pic-veneer –build-id LD vmlinux.o scripts/mod/modpost -m -a -o ./Module.symvers -S vmlinux.o GEN .version /bin/bash ./scripts/mkcompile_h include/generated/compile.h \“arm” “y” “” “arm-linux-gnueabihf-gcc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=6 -march=armv6k -mtune=arm1136j-s -msoft-float -Uarm -fno-delete-null-pointer-checks -O2 –param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments … Read more

Kernel startup entry point / how Linux kernel boots

We will consider our hardware platform as ARM, so the kernel startup entry point code is at arch/arm/kernel/head.S This is normally called from the decompressor code. The requirementsare: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,r1 = machine nr, r2 = atags or dtb pointer. This code is mostly position … Read more

How Linux Kernel Module Loading works ?

The kernel bus drivers probe for devices. For every detected device, the kernel creates an internal device structure and the driver core sends an event to udev. Devices identify themselves by an id, which tells what kind of device it is. Usually these id’s consist of vendor and product id and other susbsytem specific values. … Read more