Posts

Print on both sides of a paper: Ubuntu 20.04.2 LTS

Image
Introduction This article helps you to enable the option to print on both sides of the paper. Assuming a printer has been already installed in your network/machine 1: Goto settings and clock on Printers. This should show the installed printer. Settings 2: Right click on the printer and open "Printer properties". Select the option "Installable Options" and tick the checkbox "Duplexer" Printer properties 3. Click on "Printer Options" and select "2-sided Printing" as per your choice. Select Long-Edge if you want to turn the page as a Portrait. Selecting 2 sided printing Have a good day!

Enable log in U-Boot

To enable pr_debug - Define CONFIG_LOGLEVEL > 7 in defconfig - Define DEBUG in the .c file on the first line above #includes == Source == ---------------- #define pr_debug(fmt, ...)     CONFIG_LOGLEVEL > 7 ? log_debug(fmt, ##__VA_ARGS__) : 0; CONFIG_LOGLEVEL - Defined in the source file ----------------- #if CONFIG_IS_ENABLED(LOG)     #define log_debug(_fmt...)      log(LOG_CATEGORY, LOGL_DEBUG, ##_fmt) #else     #define log_debug(_fmt, ...)    debug(_fmt, ##__VA_ARGS__) #endif ------------------   #define debug(fmt, args...) debug_cond(_DEBUG, fmt, ##args) -------- #if !_DEBUG && CONFIG_IS_ENABLED(LOG)     #define debug_cond(cond, fmt, args...)     {         log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args);     } #else     #define debug_cond(cond, fmt, args...)     {         if (cond)             printf(pr_fmt(fmt), ##args);     } #endif ------------------- log.h -------------------- #ifdef DEBUG #define _DEBUG 1 #else #define _DEBUG 0 -------------------

How to find a machine is little or big endian?

Image
Introduction This article explains the methods used to find out whether a machine is big or little endian Endianness Endianness is the order of sequencing of bytes in computer memory. It can be either Little endian or Big endian. If the LSB is stored first, its little-endian If the MSB is stored first , its big-endian Its is nicely explained in https://en.wikipedia.org/wiki/Endianness Image credit to Wikipedia How data is stored. Thank you Wikipedia! How to find it in a Linux machine? From shell # little $ echo -n I | od -to2 | awk 'FNR==1{ print substr($2,6,1)}' 1 # big $ echo -n I | od -to2 | awk 'FNR==1{ print substr($2,6,1)}' 0 Using tools bala@IND68FL4H2-L:~/study$ lscpu | grep Endian Byte Order: Little Endian If you don't have tools? If you don't have the above tools, a simple program would do the job #include <stdio.h> int main() {      int a = 1;      char *c = (char *) &a;      if (*c)           puts("Little indian");   

High Assurance boot in i.MX6 (Secure boot)

Image
Introduction Software updates are updated frequently. Any end user can install custom software in devices. This increases the threat of installing malwares. The consequences are unimaginable. Consideration security aspects, it is necessary that the hardware have some mechanism to ensure that the software it is running can be trusted. NXP's i.MX6 series chips provide High Assurance Boot (HAB) feature which meets such a requirement.   Note There are huge source of documents in the community. But have few broken ends. This document links the broken ends. Hence you will find most of the data/text repeated. Mechanism An asymmetric encryption is adopted to implement the HAB feature. An utility called CST – Code Signing Tool is provided by Freescale to generate private key and corresponding public key pairs. For any system image the OEM want to release, the private key is used to do the encryption. This encryption generates a unique identifier for the image which is called a c