Wednesday, December 15, 2010

Processor Revolution



Fig. Nvidia Tegra SoC second generation " Tegra 2"
The revolution of Smart Mobile Phone Processors.
More than 1GHz Dual Core Processor

Wednesday, November 10, 2010

Combination and Integration

-CORBA "Common Object Request Broker Architecture": briefly, is a standard to make objects of different programming languages and make them communicate together if they are in the same machine or many machines.

-MPI "Message Passing Interface": is an API that would allow distributed apps to run as a single app.

-SWIG: is a tool used to interface and generate bindings of C/C++ to variety of programming languages such as Java and Python. A special tool for python is called SPI.

Tuesday, November 2, 2010

How to remove extra menu items in grub boot loader

When I have installed updates for my ubuntu linux, the kernel image also updated so I found several images of linux kernel at my machine and also many menu items at the boot loader depending on the number of versions linux kernels in my machine. This was annoying for me.
Then I prefer to have only two menu items at boot loader: one for the current version of linux and the other for windows.

Procedure:
--Write down the menu items you do not like to see in grub. At my case "Ubuntu, with Linux 2.6.32-25-generic (recovery mode)" and "Ubuntu, with Linux 2.6.32-25-generic".
--Delete the following from file /boot/grub/grub.cfg

menuentry 'Ubuntu, with Linux 2.6.32-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,2)'
search --no-floppy --fs-uuid --set 039c3fcd-6448-4da2-9a2c-4ce29e4f7926
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=039c3fcd-6448-4da2-9a2c-4ce29e4f7926 ro quiet splash
initrd /boot/initrd.img-2.6.32-25-generic
echo Abuselim
}
menuentry 'Ubuntu, with Linux 2.6.32-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,2)'
search --no-floppy --fs-uuid --set 039c3fcd-6448-4da2-9a2c-4ce29e4f7926
echo 'Loading Linux 2.6.32-25-generic ...'
linux /boot/vmlinuz-2.6.32-25-generic root=UUID=039c3fcd-6448-4da2-9a2c-4ce29e4f7926 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-25-generic
}

3. Go to /boot and delete files with "2.6.32-25" string
4. reboot and find results ;-)

By aselims

Sunday, October 24, 2010

Stack and Heap Snippet

*Stack allocation
Image myImage;
myImage.SetAllPixels(ClearColor);

*Heap allocation
Image *imagePtr;
imagePtr = new Image();
imagePtr->SetAllPixels(ClearColor);

...

delete imagePtr;

Stack allocation: Constructor and destructor called automatically when the function is entered and exited.
Heap allocation: Constructor and destructor must be called explicitly.

Wednesday, October 20, 2010

How to know if your PC is 64 bit?

Description:
There is a processor flag called lm "long mode" means this processor is a 64-bit capable.
Procedure:
cat proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida

note: Also another flag called vmx that tells this processor supports virtualization Technology for Intel processors.


Wednesday, September 22, 2010

Limited resources devices become not!!!

Break the phenomena... I am always hearing about the mobile devices or in general the devices that is used for embedded systems are all have the constraint "Limited resources". I believe this is not true any more. I can say that there is some mobile devices have a better resources than ordinary computing devices like PC.

Nvidia releases Tigra2: More than 1GHz Dual Core Processor "general purpose", Video decode/encode processors "viewing and capturing", Audio Processor "based on PortalPlayer which is existed in iPod", Image processor "stand-still capturing up to 12MP sensor", 2D/3D GPU, ARM-7 processor "for Chip Management", 32-bit 333MHz datarate LPDDR1 memory bus "resulting in 1.33GB/s of memory bandwidth"... some news tell: it is used in LG Optimus "Cheap phone around 1000LE"...WoW

Another competing alternative is POWERVR

Ref:
http://www.anandtech.com/show/2911
http://www.imgtec.com/powervr/powervr-graphics.asp

Saturday, September 18, 2010

DASH7

What is DASH7 Technology?


The DASH7 protocol is redefining wireless sensor networking and the internet of things with:

  • Multi-kilometer range and excellent penetration of walls, floors, and things made of water.
  • Extremely low power draw (measured in microwatts) and multi-year battery life
  • A maximum bitrate of 200kbps
  • Supports tag-to-tag or “multi-hop” communications, sensors, and public key encryption
  • Multi-channel architecture for real-time locating capability
  • Extremely low latency for tracking moving objects
  • Operation in the license-free and globally available 433 MHz spectrum
  • “Out of the box” interoperability using a single global frequency
  • The brand given to the ISO 18000-7 standard for active RFID
Will this Communication technology beat others? ZigBee and WiMax... who knows?

Wednesday, September 15, 2010

QA & QC

QA: is involved in the whole process and discusses improvement and development of the whole cycle to provide a product.
QC: is the process of detecting defects for the final products.

Wednesday, September 1, 2010

Mutex & Semaphore

Both are used for controlling the use of a shared resource.
- Mutex: is like a binary flag in the fashion of use and release.
- Semaphore: is a signaling counter, when finish using a resource, signal (increment) the semaphore so the resource can be used by the next task.

A problem can be happen when using Mutices, Priority Inversion, which is when a higher priority ready task cant run because a lower priority task is restricting using a resource usually by a mutex. which will lead to missing a deadline and the system to fail. A developer should consider this when using mutex. A solution to this problem is by using Priority Ceiling, that each resource has its own priority, when a task uses this resource, it is associated with the resource priority till it finishes. The priority of the resource equals the highest priority user plus one.

void TaskA(void)
{
...
SetTaskPriority(RES_X_PRIO);
// Access shared resource X.
SetTaskPriority(TASK_A_PRIO);
...
}

Ref:

Memory characteristics [1]

Type
Volatile?
Writeable?
Erase Size
Max Erase Cycles
Cost (per Byte)
Speed
SRAM
Yes
Yes
Byte
Unlimited
Expensive
Fast
DRAM
Yes
Yes
Byte
Unlimited
Moderate
Moderate
Masked ROM
No
No
n/a
n/a
Inexpensive
Fast
PROM
No
Once, with a device programmer
n/a
n/a
Moderate
Fast
EPROM
No
Yes, with a device programmer
Entire Chip
Limited (consult datasheet)
Moderate
Fast
EEPROM
No
Yes
Byte
Limited (consult datasheet)
Expensive
Fast to read, slow to erase/write
Flash
No
Yes
Sector
Limited (consult datasheet)
Moderate
(Cheap by Z)
Fast to read, slow to erase/write
NVRAM
No
Yes
Byte
Unlimited
Expensive (SRAM + battery)
Fast

[1] Barr, Michael. "Memory Types," Embedded Systems Programming, May 2001, pp. 103-104.

Volatile in C

When you declare a variable as a volatile, then you are telling the compiler that this variable may be changed by some external factor and do not optimize the code related to this variable.
Example:
int foo=0;
while (foo != 10)
//do sth

if this code is optimized, the compiler will make the loop always true because it seems it would not be changed through the code (while (true)).

Cases you need to declare a variable as Volatile:
  • Memory-mapped peripheral registers
  • Global variables modified by an interrupt service routine
  • Global variables accessed by multiple tasks within a multi-threaded application
More info at http://www.netrino.com/node/80

Saturday, August 21, 2010

JTAG

stands for Joint Test Action Group which is a common name for
a hardware based tool for testing PCBs "Printed Circuit Boards" and debugging internal instruction in the processor.

Thursday, August 19, 2010

Serial vs Parallel

Why Serial is taking over Parallel Communication?
We have seen the wide spread of USB peripherals, using PCIe over conventional PCI and long ethernet cables... All these represent the approach towards Serial Communication...

Define:
Serial: transfer a bit at a time.
Parallel: transfer multi bits at a time as the number of lanes.

Discuss:
Parallel Communication suffer from the following against Serial Communication:
-More Processing: "takes more time"
-Signal Skewing: due to imperfections in cables, may be a bit would be delayed to others.
-Cross Talking: Signals affects other signals due to magnetic fields resulted from high resonance " not reliable for long distances".
-Larger Size, more cost.


Conclusion:
With the increasing clock speed of the processor:
Parallel transferring becomes not immune to noise especially for long distances, has higher SNR, and less BW.
Serial transferring is much faster, immune to noise, longer distance, and I think easier to program.

Parallel Communication would overcome all these vices if the speed of its data transferring is multiple the speed of Serial Communication and reliable.


However:
As the multi-core processors are being exposed and the clock speed is increasingly higher, the need of parallel applications serial advantageous is vital


Tuesday, August 17, 2010

SRAM vs DRAM

I would like to share this info with you about Static and Dynamic Ram:
  • SRAM multi transistors per bit whereas DRAM uses one transistor and two capacitors per bit.
  • DRAM needs to periodically refreshed "recharged" in order to maintain its value. That is why it is called dynamic.
  • SRAM is faster compared to DRAM
  • SRAM consumes less power than DRAM
  • SRAM is more expensive than DRAM
  • Cheaper DRAM is used in main memory while SRAM is commonly used in cache memory

Friday, August 13, 2010

ِAgile Approach

I liked this humanistic based Development
"Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan" [1]


[1]Beck, Kent; et al. (2001). "Manifesto for Agile Software Development". Agile Alliance. Retrieved 2010-06-14


Thursday, March 4, 2010

PfSense for Load Balance and MultiWan

Many Articles in the web telling how to make Multi Wan Connection for load balancing; one of them http://doc.pfsense.org/index.php/MultiWanVersion1.2
It actually describes the procedure well but one of the problem you would find when one of the WAN lines fail, there will be no Internet connection.
The reason is not because LoadBalancing fails but because DNS servers were not identified in the DHCP service.
Also I have to highlight that for Firewall rules...
  • Rules are evaluated in Top-Down approach at first match basis where there is a DenyAll is hidden in the most down .
  • Uses state; that means if a user requests a service from outside and it is permitted in the inside inteface, no need for declaring a rule in the outside interface.
  • Rules are identified in the inbound direction of interfaces.

CARP

"Common Address Redundancy Protocol" = Clustering
  • More redundancy for high availability.
  • Originally deployed under FreeBSD.
  • Seen when installing and configuring PfSense firewall.

Thursday, February 11, 2010

No restart again for completing updates



The real meaning of HA is done through ksplice
Have you ever get annoyed because you are in the middle of work and your operating system asks you repetitively to rsetart to apply updates?
with Ksplice, no restart is required. It does an in-memory operation to update kernel.
Many definition would be changed of service management such as testing/development environment and production environment for applying patches.
It is free for Ubuntu user editions and costs nearly 4$ a month for server editions.
have a look: http://www.ksplice.com/