Skip to content

First Post in Embedded System

Starting new section in embedded system.

Few days back I ordered Arduino Uno, for some personal hacking related work. I was planning to get from US but finally I purchased from ProtoCentral (Yea I find it cheaper than ordering from US).

http://www.protocentral.com/19-arduino-uno-r3.html

Here are the specifications of Arduino Uno:

Microcontroller

ATmega328

Operating Voltage

5V

Input Voltage (recommended)

7-12V

Input Voltage (limits)

6-20V

Digital I/O Pins

14 (of which 6 provide PWM output)

Analog Input Pins

6

DC Current per I/O Pin

40 mA

DC Current for 3.3V Pin

50 mA

Flash Memory

32 KB (ATmega328) of which 0.5 KB used by bootloader

SRAM

2 KB (ATmega328)

EEPROM

1 KB (ATmega328)

Clock Speed

16 MHz

Via: http://arduino.cc/en/Main/ArduinoBoardUno

Initially I tried some sample examples from Arduino but later got bored with those blinking demo (Never mind those are useful when you have new platform with you). Well next thing that came in my mind was Flash Memory i.e. 32K and then thought porting FreeRTOS on it.

I have already seen such porting of FreeRTOS so decided to try some other RTOS which is opensource. Finally I landed on ATOMTHREAD (http://atomthreads.com/). Though it don’t support many platforms like FreeRtos but AVR port was already available.

There were many tasks in TODO list:

  1. Cleaning AtomTHREAD repo. It has lots of test related code
  2. Porting AVR libraries which I already got from arduino
  3. Changing CPU Frequency and Makefiles changes to support make and upload to board operations.
  4. Writing first single threading app (Yes, this was blinking demo since UART was not tested)
  5. Writing App to test UART with standard libraries like stdio.h (I can use the implementation of such std libs)
  6. Studying timer interrupt and running scheduler. By default scheduler is not running in atomthread.
  7. Writing multithreading app with all kernel features like timer, semaphore and mutex.

I am planning to write detail blog posts on each points above. So Keep reading. ­čśë

Project Presentation

Here is our Project Presentation on Huge-Page Support in Xen Virtualization.

Ottawa Linux Symposium (OLS) Papers for 2011:

Here is links of Ottawa Linux Symposium 2011 where our paper was selected.

linuxsymposium-2011

Now its on http://www.kernerl.org, here is the link.

http://kernel.org/doc/ols/2011/

Shell script to see if service is stopped

#!/bin/sh
running=1
while [ $running -eq 1 ]
do
sleep 1
running=`ps ax | grep $service_name | grep -v grep | wc -l`
done
echo "$service_name stopped successfully"

Reading a file, word by word

#!/bin/sh
ln=1
#Reading from config file
while [ ! -z "$ln" ] 
do
    read ln
    word1=`echo $ln | awk '{print $1}'`
    word2=`echo $ln | awk '{print $2}'`
    word3=`echo $ln | awk '{print $3}'`    

echo "word1 =  $word1 ,word2 = $word2, word3 = $word3"
done < ./config

Checking if VM is booted

Pre- condition : Assign static ip to VM.

virsh start Fedora13

until ping -c 1 -W 1 192.168.122.11
do
    sleep 1
done
sleep 3
echo "Started"

					

Password less ssh

#!/bin/sh

#$1: User

#$2: IP

## Should  run as root user

ssh-keygen -t rsa

ssh $1@$2 mkdir -p .ssh

cat /root/.ssh/id_rsa.pub | $1@$2 ‘cat >> .ssh/authorized_keys’

 

ssh-keygen -t rsa: ┬áThis will generate public and private ┬ársa key pair for security. ┬áThis should be called only once. ┬áPress “Enter” for every step.

ssh : remote login. This will prompt for password.

last step “cat …” : ┬áSend public key to remote host.