Posts

Showing posts from 2021

Autosar

Autosar  Autosar Tool and Manufacture name AUTOSAR_Tool Video Session: S No Titel Youtubelink Comments 1 Autosar Basic https://www.youtube.com/watch?v=NfZI8wvgZPo        Port Creation 2 Autosar Basic2 https://www.youtube.com/watch?v=m_4PPoIyfro        Artop software  3 Autosar Basic 3 https://www.youtube.com/watch?v=rRCNVC6Z9JU&t=3s   4 Autosar Basic 4 Operating System      Operating system 5 ECUC EXTRACTION Operating System      ecu

Address Range

 Memory Calculation: Start Address          End Address          KB                    MB               GB 0x0000 0000           0x0000 3FFF          16 0x0000 0000         0x0000 FFFF        64 0x0000 0000         0x0003 FFFF        256 0x0000 0000         0x3FFF FFFF                                   1024                      1GB 0x0000 0000         0x7FFF FFFF                        ...

Documentation

 Requirement Document: What is the objective of this project? How will the project be developed? How will it fit into the existing system? What will the system do precisely?

ARM Q&A

 what are the different modes in ARM architecture? User Mode: is the usual ARM program execution state, and is used for executing most application programs. Supervisor Mode: is the protected mode for the operation system.  IRQ mode: is used for General purpose interrupt handling.  Fast IRQ mode: support for Data transfer or channel process.  Abort Mode is entered after a data or instruction prefetch Abort. Undefined Mode is entered when an undefined instruction is executed. System Mode is privileged user mode for the operation system. Difference between the return from handler and return from function in assembly language implementation.  interrupt function the return type is RETI, which clear the source of the interrupt. Otherwise, it will be called over and over.   function return is just RET. What is the difference between FIQ and IRQ? FIQ has higher priority than IRQ: FIQ is masked by fewer exceptions and if FIQ & IRQ happen together FIQ goes f...

ARM7

Image
8051 is an 8-bit processor, which means it can do an 8-bit operation at a time. ARM is a 32-bit processor, which can do the 32-bit operation at a time, four times powerful than 8051. ARM 7 (Advanced Risc Machine) 32-bit processor 32-bit ALU (arithmetic logic unit) 32-bit data bus  there are 4 banks in the memory and every data is aligned, it will be stored at an address multiple of 4 (i.e last 2 bits of the address will always be zero) 32-bit instruction (RISC )    Every instruction will have the same size (32 bit). Every instruction will fetch in one cycle.  All the instruction will be stored in the aligned form.  32-bit Address bus: It will allow access up to 4GB.   Von Neuman model Says only one memory, in which all program will store and data will also store.  3 stage pipeline Fetch Decode  Execute 37 Registers - 32-bit Each By which 16 available at a time (R0 ... R15) Load store Model  to add, subtract or any other operation, load t...

Video Tutorials

 C : Understanding C program Compilation Process . Compiling, assembling, and linking . What is the difference between Dynamic and Static library(Static and Dynamic linking) Memory Layout of a C Memory Leak in a C C Programming Interview Questions and Answers . How to Answer for What is Volatile?   Bitwise operator Algorithm: Algorithms and data structures for Interview preparation Algorithms Course Complete: Algorithms and Data structures BareMetal Firmware / IoT Firmware Booting Process ARM architecture A tour of the ARM architecture and its Linux support Gerrit  Git and Gerrit Demo Video Series

Procfs creation at kernel

 source : https://github.com/kishorePonnoju/ModuleLoding/blob/main/charDev/basic.c

Device Driver Basics

 What is device driver ?    is piece of software that controls a particular type of device which connected to the computer system  Diff b/w kernel moulde and Device driver?     A kernel module is a piece of the code that can be added loaded/inserted and unloaded/removed as per the demand/need.  what happened we do insmod on a module? it calls init_module() to intimate the kernel that a module is attempted to be loaded and transfers the control to the kernel. In the kernel, sys_init_module is run. It does a sequence of operations as follows: Verifies if the user who attempts to load the module has permission to do so or not .  After verification, the load_moudle function is called .  The load_module function assigns temporary memory and copies the elf module from userspace to kernel memory using copy_from_user.    It then checks the sanity of the ELF file (verification if it is a proper ELF file)  Then based on the ELF file inte...

Mutex and semaphores

Why we need synchronization? Please thin about the below question, how will u solve the problem. There are two process P1 (having statement S1) and P2 (having statement S2).  write a program to execute statements s2 only after S1? Reader and writer problem, there one shared data is present between 5 readers and one writer.  here is required condition are,  allow multiple readers to read at the same time.  only one single writer can access shared data at the same time. I2c buses acquired by the concurrent user process, how ur driver will handle the concurrent requests.?  The dining philosophers problem states that there are 5 philosophers sharing a circular table and they eat and think alternatively. There is a bowl of rice for each of the philosophers and 5 chopsticks. A philosopher needs both their right and a left chopstick to eat. A hungry philosopher may only eat if there are both chopsticks available. Otherwise, a philosopher puts down their chopstick and b...

USB audio Driver

 Sources: http://ben-collins.blogspot.com/2010/04/writing-alsa-driver.html https://www.alsa-project.org/wiki/Main_Page https://www.ukuug.org/events/linux2003/papers/TIwai/soundsystems.pdf https://www.alsa-project.org/wiki/Main_Page

kernel module access user space file:

Image
is it possible to create a file from kernel space? is it possible to create store the data in kernel space? Yes. its possible  source code:  #include <linux/module.h>   #include <linux/init.h>   #include <linux/fs.h>   #include <linux/uaccess.h>      static char buf[] ="access from the kernel \n";   static char buf1[32];       int __init test_init(void)   {       struct file *fp;       mm_segment_t fs;        int result;       loff_t pos;       printk("test enter\n");       printk("KERNEL_DS=0x%llx USER_DS=0x%llx get_fs()=0x%llx\n", KERNEL_DS, USER_DS, get_fs());       fp =filp_open("/home/kishore/kernel_file",O_RDWR | O_CREAT,0644);       if (IS_ERR(fp)){           printk("create file error\n");           return -1;  ...

Linux interview question

Image
What happens when I dereference a NULL pointer in kernel space?      Kernel panic    What's the difference between initrd and initramfs?      Initrd is a separate image loaded by the bootloader, while intramfs is embedded within the kernel image.  How is the scheduler called in Linux Kernel?      In the Linux kernel, the scheduler is invoked by a periodic timer interrupt. This is called periodic scheduling which is essential for preempting tasks that have consumed more CPU cycles in order to offer other tasks on run-queue a fair chance to utilize the CPU. The scheduler is also invoked by kernel functions that block the current task, and this allows the scheduler to decide on which task on the run-queue should run and context switch to that task What is the difference between vmlinux and vmlinuz? Vmlinux stands for Linux kernel with virtual memory(VM) this is the kernel image. Vmlinuz is the compressed kernel image. What is th...

I/O devices Interface

Image
The microprocessor cannot do anything by itself therefore, It needs to be linked with memory, extra peripherals, or IO devices. This linking is called Interfacing. interfacing of the I/O devices in 8085 can be done in two ways Memory mapped IO interface: I/O mapped I/O interface Memory Mapped IO interface: We assign a memory address that can be used in the same manner as we use a normal memory location. Let's look into below memory mapped on the STM32L microcontroller. Memory mapping of STM32. The ARM architecture is following the Memory-mapped I/O.  common address space for both I/O and Memory.  Two control signal MEMR MEMW Only Memory related Instruction to communicate I/O address space.  ARM has single address liner for memory and IO.  cat /proc/iomem to see memory address space.   I/O mapped  I/O interface: also called port mapped IO. example:  Intel Have separate I/o address and Memory address space.  4 control single  MEMR MEMR...

Linux Host Environment Setup

Image
Install supporting packags   Before you start any development, you need to set an environment up. The environment dedicated to Linux development is quite simple, at least on Debian-based systems: $ sudo apt-get update $ sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev  xterm ncurses-dev lzop ARM CROSS compilation: sudo apt-get install gcc-arm-linux-gnueabihf Own built Kernel Kernel Configuration, Compilation and Install --------------------------------------------- 1. Download Kernel Source from Kernel masters server: $ cd ~/KernelSouceCode $ git clone https://github.com/torvalds/linux.git 2. Kernel Configuration $ cd linux $ make menuconfig  3. Kernel Compilaton $ make -j4  (Static Compilation) out put is vmlinux (kernel raw image) $ du -sh vmlinux (with out compressing) $ make modules  (Dynamic Compilation) out put is .ko  $ du -sh .  4. Kernel Install...

Git commnets

Image
 git commands: ---------------------------- >git status . To know diff old patch and new  >git diff nv_memory_driver/ftl/src/ftl_test_interface.c To create the branch with UTP >bee startsms . <UTP Name> >bee startsms . ADD: ===== git add -A --> stages All git add .  --> stages new and modified, without deleteds git add -u --> stages modified and deleted, without new diff: ===== git diff <file> git diff --staged  git diff --check --> for checking the white space error search ====== > grep -rnsi  git diff at_router/src/at_router.c grep -rnis "PCL_PAD_I2C1_SCL" board_fih* | grep 125  clean: untracked files ====== git clean -f -d or git clean -fd  ------------------------->  To remove directories git clean -f -X or git clean -fX  ------------------------->  To remove ignored files log: git log --author=="kponnojx...

Virtual Memory

Image
Memory Problems: Not enough RAM. As per Address line, a program can access any bye in their 32-bit address space. in case of the 1GB physical memory. what if the program is trying the access more than 1GB memory area access?  the progress will crash.   Holes in our Address space. Programs writing over each other on the same address space. How we do we solve this: key to problem "same Memory space". can we give each its own virtual memory space? if so we can: separately map each programs memory space to the RAM memory space. and even move it to disk if we run out of Memory. Virtual Memory:           In computing, virtual memory, or virtual storage is a memory management technique that provides an "idealized abstraction of the storage resources that are actually available on a given machine" which "creates the illusion to users of a very large (main) memory". Address Translation and MMU : The mechanism to convert the virtual Address to Physical...