Nokia N810 device and USB cable.
File: data_read_m.o
.
Compile and execute a program into the src folder of your workspace (remember that to execute you need to insert the prefix “./” to the file name)
The executable that you just produced is to be run in the personal computer. To execute this application in the Nokia N810 a new version needs to be generated to be run in the new environment. This is done using a “cross compiler” which will be studied in detail in a future session.
Compile again the program but now insert the prefix “sb2” e.g.
sb2 gcc -Wall *.c -o “filename”
The used compiler is not the normal one but the one that generates the code (“filename”) for the Nokia N810. After compiling the program try to execute it with the command ./“filename”. Can you explain what is happening?
Execute the new program, but insert again the prefix “sb2” as follow:
sb2 ./“filename”
Turn on the Nokia N810 and connect the USB cable to the personal computer with the program you just created. In the virtual machine a notification appears offering the possibility of opening the folder in the new device. You may also access this option through the USB icon in the right area of the bottom panel in the screen shown in the following figure.
Copy the executable you just created to the folder in the Nokia N810. You may use the file manager that shows two screens when F3 is pressed and files can be dragged and dropped.
Close the file manager and through the icon in the bottom right part of the screen “unmount” the device and disconnect the USB cable.
In the N810 open the applications menu (icon with four squares) in the left side of the screen. Select the “Utilities” menu and at the bottom select the command terminal (“X Terminal”). A new window opens with a command interpreter similar to the one in the virtual machine.
The folder in which you copy the file is under the
directory “/media/mmc2
”. Search for the
program and copy it with a command similar to:
cp /media/mmc2/filename filename
If the file is not under /media/mmc2
try under/media/mmc1
.
As it has been copied, the program does not have execution permission, thus we need to enable it with the command
chmod u+x filename
After this command you may execute the program. Remember to insert the prefix “./”. Check that the behavior is identical to the one observed in the virtual machine.