Understanding Linux /proc/pid/maps or /proc/self/maps

Each row in /proc/$PID/maps describes a region of contiguous virtual memory in a process or thread. Each row has the following fields: address perms offset dev inode pathname 08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm address – This is the starting and ending address of the region in the process’s address space permissions – This describes … Read more

Unit Testing C Code [closed]

One unit testing framework in C is Check; a list of unit testing frameworks in C can be found here and is reproduced below. Depending on how many standard library functions your runtime has, you may or not be able to use one of those. AceUnit AceUnit (Advanced C and Embedded Unit) bills itself as … Read more

C pointer to another struct

struct Node1 { Node2*/or Node1*…. packet1; int num1; } struct Node2 { Node1* packet2; int num2; } int main(void) { struct Node1 *data; struct Node1 var1; struct Node2 *packet; struct Node2 var2; data = &var1; packet = &var2; packet->packet2 = data; }

Access of register STM32 CAN communication

It is the common way to check flags or more precisliy – if bit is set in some register. In this particular example: INAK: Initialization acknowledge This bit is set by hardware and indicates to the software that the CAN hardware is now in initialization mode. So you are basically wait in the infinite loop … Read more