In any ARM processor, total 16 registers are accessible in any operation Mode. Those registers are as shown in following image, 13 general-purpose registers R0-R12 1 Stack Pointer (SP) 1 Link Register (LR) 1 Program Counter (PC) 1 Application Program Status Register (APSR)’ The meaning and purpose of this ARM registers is as below, R0 to R12 – The initial 13 registers are … Read more
Below functions make sure we are safely and completely reading and writing from a file pointer fd, opened on a specific file.
getcwd, getwd, get_current_dir_name functions return a null-terminated string containing an absolute pathname that is the current working directory of the calling process. The pathname is returned as the function result and via the argument buf, if present.
Following program converts integer number 42 to string “42” using sprintf. sprintf() writes to the character string. We can compile this program is using gcc as, We can compile run program on command line as,
In C program, comments doesn’t have any use other than for better understanding of the developers of the source code in case you are writing big program and wants to remember what is the functionalities of the code blocks (functions/lines) in program. Single Line Comment — Any text on a single line after // is … Read more
In this post, we will create a simple C program, compile it with debugging enabled and then debug it using GDB debugger to identify where exactly the problem is occurring while the program is executing. To prepare our program for debugging with gdb, we must compile it with the -g flag. Now, we will start … Read more
This post is in continuation of our previous post “Understanding ARP (Address Resolution Protocol) basics“ To visualise what ARP reply we are getting from arping command, we need to write an ARP reply receiver code as below, compile this code as, So, as we can see “arping” sent above ARP reply to broadcast destination mac … Read more
For compiling simple golang helloworld program as part of yocto build framework, we need to download meta-golang from https://github.com/madisongh/meta-golang and use this meta layer along with poky to build our written bitbake recipes for cross compilation of golang program. PLEASE NOTE: Starting with OE-Core ‘rocko’ (Yocto Project 2.4), Go support is available directly in OE-Core, … Read more
To get the exact size of a type or a variable on a particular platform, you can use the sizeof operator. The expressions sizeof(type) yields the storage size of the object or type in bytes. Following is an example to get the size of int type on any machine.
If you are trying to run modulo / remainder operator like below, there are higher chances you might get an error as “error: invalid operands to binary” The solution for this error is as mentioned below. Solution : The remainder operator (otherwise known as the modulo operator) % is a binary operator (i.e., takes exactly … Read more