EmbLogic's Blog

Author Archives: Shubham Gupta

Precision Time Protocol

The Precision Time Protocol (PTP) is a protocol used to synchronize clocks throughout a computer network. On a local area network, it achieves clock accuracy in the sub-microsecond range, making it suitable for measurement and control systems.[1] PTP was originally … Continue reading

Posted in Uncategorized | Leave a comment

gcc- tool chain

GCC is a popular tool chain that can generate executables for wide range of architectures including x86, ARM v4/v5/v6/v7, and many others. In personal computers GNU GCC is a compiler that compiles an application written for LINUX X86 PC. When … Continue reading

Posted in Uncategorized | Leave a comment

Remote Access to Linux

Our office network contains several Windows computers and one Linux desktop. I recently switched from Windows to Linux for most of my work, and have enjoyed its many advantages. But as I became more dependent on the information and applications … Continue reading

Posted in Uncategorized | Leave a comment

Installing and setting TFTPD in Ubuntu

Installing and setting TFTPD in Ubuntu 1. Install tftpd and related packages. $ sudo apt-get install xinetd tftpd tftp 2. Create /etc/xinetd.d/tftp and put this entry: service tftp { protocol = udp port = 69 socket_type = dgram wait = … Continue reading

Posted in Uncategorized | Leave a comment

GPIO Device driver

GPIO Device driver Device node creation without using “mknod” In my last post, where i showed how to write a character gpio driver, i had used mknod for device node creation. Without mknod the device files would not have been … Continue reading

Posted in Uncategorized | Leave a comment

How to Write Your Own Linux Kernel Module with a Simple Example

What are kernel modules? Kernel modules are piece of code, that can be loaded and unloaded from kernel on demand. Kernel modules offers an easy way to extend the functionality of the base kernel without having to rebuild or recompile … Continue reading

Posted in Uncategorized | Leave a comment

U-Boot environment

The U-Boot environment is a block of memory that is kept on persistent storage and copied to RAM when U-Boot starts. It is used to store environment variables which can be used to configure the system. The environment is protected … Continue reading

Posted in Uncategorized | Leave a comment

U-Boot: Quick reference

Information commands bdinfo – print Board Info structure coninfo – print console devices and information flinfo – print FLASH memory information help – print online help Memory commands base – print or set address offset crc32 – checksum calculation cmp … Continue reading

Posted in Uncategorized | Leave a comment

The Linux Kernel Sources

How The Kernel Sources Are Arranged At the very top level of the source tree /usr/src/linux you will see a number of directories: arch The arch subdirectory contains all of the architecture specific kernel code. It has further subdirectories, one … Continue reading

Posted in Uncategorized | Leave a comment

Linux Data Structures

block_dev_struct block_dev_struct data structures are used to register block devices as available for use by the buffer cache. They are held together in the blk_dev vector. struct blk_dev_struct { void (*request_fn)(void); struct request * current_request; struct request plug; struct tq_struct … Continue reading

Posted in Uncategorized | Leave a comment

How the Command Line Parsing Works

How the Command Line Parsing Works There are two different command line parsers available with U-Boot: the old “simple” one, and the much more powerful “hush” shell: Old, simple command line parser supports environment variables (through setenv / saveenv commands) … Continue reading

Posted in Uncategorized | Leave a comment

U-Boot Standalone Applications

U-Boot Standalone Applications U-Boot supports “standalone” applications, which are loaded dynamically; these applications can have access to the U-Boot console I/O functions, memory allocation and interrupt services. A couple of simple examples are included with the U-Boot source code: 5.12.1. … Continue reading

Posted in Uncategorized | Leave a comment

The Universal Boot Loader (“Das U-Boot”)

The Universal Boot Loader (“Das U-Boot”) Table of contents: 1. Abstract ? 1.1. Introduction ? 1.2. History ? 1.3. Supported Hardware ? 1.4. Design Principles ? 1.5. User Interface ? 1.6. Basic Command Set 1.7. Advanced Commands ? 1.7.1. Logbuffer … Continue reading

Posted in Uncategorized | Leave a comment

Tricky C interview questions

1.Give a fastest way to multiply any number by 9. Answer: #include #include void main() { int n; printf(“Enter a number:”); scanf(“%d”,&n); printf(“%d”, (n<<3)+n); getch(); } 2. How to measure the size of any variable without “sizeof” operator? Answer: #define … Continue reading

Posted in Uncategorized | Leave a comment

How to Replace a Switch-Statement with function pointer

float Plus (float a, float b) { return a+b; } float Minus (float a, float b) { return a-b; } float Multiply(float a, float b) { return a*b; } float Divide (float a, float b) { return a/b; } // … Continue reading

Posted in Character Driver | Leave a comment