Posts

ProLog

In prolog variable name is first letter is Capital while simple names is in small letter

KERNEL customization steps and DEVICE DRIVERS

  pseudo char dev driver   Semaphore VS Mutex VS Spinlock Similarity – All of these are used for synchronization Difference Mutex provides one person to access a single resource at a time, others must wait in a queue. Once this person is done, the guy next in the queue acquire the resource. So access is serial, one guy after other. Too aggressive. Semaphore are useful if multiple instances (N) of a resource is to be shared among a set of users. As soon as all N resources are acquired, any new requester has to wait. Since there is no single lock to hold, there is as such no ownership of a semaphore. Spinlock is an aggressive mutex. In mutex, if you find that resource is locked by someone else, you (the thread/process) switch the context and start to wait (non-blocking). Whereas spinlocks do not switch context and keep spinning. As soon as resource is free, they go and grab it. In this process of spinning, they consume many CPU cycles. Also, on a uni-process...

communication protocols( UART, SPI, I2C)

Image
Features UART SPI I2C Full Form Universal Asynchronous Receiver/Transmitter Serial Peripheral Interface Inter-Integrated Circuit Interface Diagram Pin Designations TxD: Transmit Data RxD: Receive Data SCLK: Serial Clock MOSI: Master Output, Slave Input MISO: Master Input, Slave Output SS: Slave Select SDA: Serial Data SCL: Serial Clock Data rate As this is is asynchronous communication, data rate between two devices wanting to communicate should be set to equal value. Maximum data rate supported is about 230 Kbps to 460kbps. Maximum data rate limit is not specified in SPI interface. Usually supports about 10 Mbps to 20 Mbps I2C supports 100 kbps, 400 kbps, 3.4 Mbps. Some variants also supports 10 Kbps and 1 Mbps. Distance Lower about 50 feet highest Higher Type of communication Asynchronous Synchronous Synchronous Number of masters Not Application One One or more than One Clock No Common Clock signal is used. Both the devices will use there independent clocks. There is ...

EOS(Embedded Operating System)

Pipes--->                  it is used to transfer data between two processes in FIFO manner. one processes can transfer data without knowing the what other process is doing in other end. Pipes are used in file system for data storage There are two type named  unnamed Syntax for pipe system call pipe(fdptr) fdptr is the pointer to an integer array that will contain two file discriptor  one is for reading and other is for writing kernel assign the inode for pipe from file system designated pipe device using algorithm "ialloc" unnamed pipe who | wc---->internally shell create unnamed pipe can be used for related processes pipe() syscall   named pipe special file(p) --->mkfifo mkfifo cmd ------->mkfifo syscall can be used for non related processes {if(fork()>0) sleep(1000)} it create zombie process Number of times hello printed is equal to number of proces...