/* Ajith - Syntax Higlighter - End ----------------------------------------------- */

2.18.2008

Compiling a simple C program using GCC

Let us see how to compile a simple C program using gcc compiler, for this we will try out with classical hello world program in C language which is given below:

#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}

We will save the above 'C' code in a file named 'hello.c'. Inorder to compile a C file with gcc, use the following command:
[bash]$ gcc -Wall hello.c -o hello

This compiles the source code in ‘hello.c’ to machine code and stores it in an executable file ‘hello’.

NOTE: The output file for the machine code is specified using the -o option. This option is usually given as the last argument on the command line. If it is omitted, the output is written to a default file called ‘a.out’. If a file with the same name as the executable file already exists in the current directory it will be overwritten.

The option -Wall turns on all the most commonly-used compiler warnings---it is recommended that you always use this option! There are many other warning options, but -Wall is the most important. GCC will not produce any warnings unless they are enabled. Compiler warnings are an essential aid in detecting problems when programming in C and C++.

In this case, the compiler does not produce any warnings with the -Wall option, since the program is completely valid. Source code which does not produce any warnings is said to compile cleanly.

To run the program, type the path name of the executable like this:
[bash]$ ./hello
Hello, world!

This loads the executable file into memory and causes the CPU to begin executing the instructions contained within it. The path ./ refers to the current directory, so ./hello loads and runs the executable file ‘hello’ located in the current directory.

For a detailed view about how the who compilation process goes checkout Compilation process in GCC.

2.13.2008

World’s first optical drive for cell phones

That's really suprising an optical drive for a mobile phone but it is true.

Vmedia Research, Inc. unveiled its mobile entertainment media technology at the GSMA Mobile World Congress in Barcelona. Vmedia™ is an innovative miniature optical disc format designed to bring the quality of a big screen experience and the simplicity of home entertainment to mobile consumer electronics.

The technology consists of the ‘Vmedia disc’ that plays on the world’s smallest blue laser optical drive, the ‘Vmedia drive’. The disc – 32mm in diameter and cased in a slim cartridge – would retail at the same price as a DVD and have the same release dates.

Despite the tiny size, the company claimed that there wouldn’t be a loss in quality: A single disc can hold a complete feature-length movie at 576p resolution by combining blue laser technology with advanced video (H.264) and audio codecs (AAC).

The first generation of the single-layer Vmedia disc has a capacity of 1GB, which will hold the typical movie plus extra features such as out-takes, mobile phone wallpapers and ringtones. The storage could go up to 2GB once the company comes out with dual-layer discs in 2009.

Designed to withstand the rigours of today’s mobile applications, the Vmedia drives are resistant to shock and vibration, and also feature low power consumption, company officials said.

Vmedia has tied up with Indian mobile company, Spice Mobile. The company’s chairman Dr B K Modi introduced the Spice Movie Phone – the world’s first Vmedia-enabled mobile phone – at the Mobile World Congress in Barcelona.

Spice will be distributing Indian and Hollywood content on Vmedia throughout South Asia. “We believe the Movie Phone will become the most popular multimedia communications platform worldwide and may even change the way we all view movies, just as the iPod changed the way we listen to music.” he said.

That's great Spice Mobile is the first company to launch a phone with the optical drive.

2.12.2008

OpD2d - Direct to disk audio recorder

It all began long back .... Long Long ago ....

It was the period when Online Music Sharing was ruling the Internet ... major companies from Music industry started using DRM Codenamed: Digital Rights Management or Digital Restrictions Management in their albums to Copy-Protect (It is what a Mu$ic company says) or to kill Online Music Sharing.

Later DRM controlled and prevented copying or conversion of music by end users to other formats. Which made Music Companies $RICH$ as every user has to buy his own copy of a song inorder to listen it.

Then came the GEEK's (or HACKER's according to Music Industry and government's) with a temporary solution until they are able to crack the DRM. It can be called as "Get it when it enters the cave".

Whenever a Audio file is played in a PC the digital data in the Audio file is converted into Analog stuff in the sound card. Sound cards usually have digital-to-analog converters, that converts data in digital format to an analog signal which is sent to a speaker or headphone. This is how we can hear the MUSIC dude ....

Geek's did a trick by simply recording the output Analog signal from the sound card with a simple software program like OpD2d.

OpD2d (Direct to disk audio recorder) is a simple audio recording application with an odd old interface. It can be used to easily record anything that gets into your sound card and save it directly onto your hard disk.

It was originally written to make use of the Yamaha SW1000 XG soundcard's ability to record the digital audio it is playing. This is a really useful feature since I can simply record streaming audio from the Internet directly onto my hard disk, then burn it onto CD. This app supports all Windows based operating system's from Window98 to XP.

The present version 1.3 of OpD2d, even supports to save the recorded content directly into an MP3 file. And this software comes with a "FREE USAGE" tag. So why to waste time start using it

http://www.opcode.co.uk/opd2d/default.asp

Better do a Google search with OpD2d as the download link may be a broken one ...

2.10.2008

How to Enable USB device

Today a desktop computer equipped with a CD writer or a DVD burner is very rare in most of the companies. But a much larger security threat is posed by the open USB ports where mischievous office workers can just plugin the Flash Pen Drive, External Hard Disk or their iPod music player and transfer corporate data or even copy licensed software to their memory sticks in seconds. Sometimes even used for delivering trojans or spyware into the companies networks.

So called SMART ADMINISTRATORS disabled USB Drive access by changing the BIOS settings and then locking it up with a "PASSWORD". Even though they are a step ahead as we don't know the password for BIOS but it is not a fool proof way. As BIOS password can be broken in a simple way.

While some ADMINS simply remove the USB port option to the PC. While some for temporary restriction simply disable "Write Access" to USB port so that no one can copy data files from PC into a USB. Let us see how to disable WRITE PROTECTION option.

NOTE: It is the time to make hands dirty so backup the Registry.

Open the Windows Registry by giving "regedit" command in command prompt. If regedit is not disabled then you can see the registry editor. Now on the Left side of the editor open the following registry key

HKEY_LOCAL_MACHINE\System\CurrentControlSet\ Control\StorageDevicePolicies

If your sysadmin has enabled WRITE protection then you can see a DWORD called WriteProtect with its value as 1 in the Right side of the editor. Set the value of WriteProtect as 0 to disable the write protection.

Note: Remember that the above trick works only with Windows XP SP2.

If you like to go a step further and enable connecting USB storage devices to their computers, Open registry and navigate to the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor

Now in the Right pane of the registry editor you can see a DWORD called Start with its value as 4 (Hexadecimal). Change the value to 3 to enable the USB storage devices.

1.16.2008

Running Linux from a USB Drive

I successfully installed LINUX on my kingston Datatraveller 2GB USB and it worked quickly and flawlessly.

Things Needed to Begin
  1. USB Storage Device - (256mb or larger recommended using USB 2.0)

  2. PC that can boot from a USB Device (check your BIOS or your User Manual)

  3. Damn Small Linux (DSL) Distro

  4. Syslinux 3.11

  5. HP USB Disk Storage Format Tool
Formatting The USB Storage Device
  1. Insert your USB Storage Device into an empty USB slot on your PC

  2. Download and Install the HP USB Disk Storage Format Tool. Once the usb disk storage format tool is installed, run it

  3. Use the following settings in the HP USB Disk Storage Format Tool
    1. Device: The name and capacity of your storage device
    2. File system: FAT
    3. Volume label: Name it what you want (I chose LINUX)
    4. Confirm the Format by clicking Yes.
    5. Once the Format is complete it will give you a list of information about the file system, volume, etc. about your device. Click OK.
Extracting Necessary Files
  1. Download and Extract the Damn Small Linux distro (dsl-4.2.4-embedded.zip) to your USB device using Win-Zip or any extraction software.

  2. Download and Extract all the files from syslinux-3.11 to a folder named Syslinux on your primary hard drive (mine is C:)

  3. In Command Prompt type cd c:\syslinux\win32 (substitute c: for the drive letter of your hard drive) and Press Enter

  4. Type syslinux.exe -f F: (F: reprents the drive letter of my USB Device. Yours may be different. GET THIS RIGHT). Press Enter.

  5. Exit from Command Prompt

Booting to Linux

Keep your USB Device plugged in and Reboot your PC. Enter your BIOS setup (usually by pressing F2 or DEL) and set your Boot order to boot from the USB Device First. Exit your BIOS and Save the Changes. Since there are MANY different BIOS you must figure out on your own if your PC supports booting from USB.

Voilla it works fine for me

REFERENCES
1. http://www.althack.com/