Sunday, December 23, 2012

Connect Vodafone Key K3806-Z to Android tablet

Basic requirements:

a. Android tablet rooted.
b. Android Terminal Emulator installed
c. PPP Widget Installed
d. Putty on Windows

Remove PIN
a. Connect the key to Pc, automatically start the Vodafone software
b. Go to Advanced -> Devices -> "PIN request" and uncheck "verify PIN"

Discover which COM port is used by the key
Go to Control Panel -> Device Manager -> Ports (COM & LPT): remember of which COM port is used by the key (Vodafone Mobile Broadband Secondary Port (ZTE)(COM7))

Block the key on the modem fuction.
a. connect the Vodafone Key to the PC
b. Run Putty
c. click on Serial
d. In the speed box write 460800
e. In the serial line box, write COM7
f. Click on the button Open

A terminal will open and type these commands:
i. ATE (result must be OK)
ii. AT%USBMODEM=0 (result must be [0] MODEM DRIVER)
iii. close the terminal

Configuration of the key
a. Connect the Vodafone Key to the tablet
b. Run Android Terminal emulator
c. type su (enter)
d. type echo "19d2 1014" > /sys/bus/usb-serial/drivers/option1/new_id (enter)

Configuration of PPP Widget
a. Go to configure
b. Modify the access point with web.omnitel.it

Connect the Vodafone Key to Internet
Click on Connect on PPP Widget

Sunday, December 2, 2012

How to connect to wireless network with NetworkManager

1. Activate the status of Wi-Fi in NetworkManager
$ nmcli nm wifi on
2. Creates a new connection named "myname" and then connects it to "mySSID" SSID using "mypassword" password.
$ nmcli dev wifi con mySSID password mypassword name myname
3. connects the Wi‐Fi connection with the name "myname"
$ nmcli con up id myname
Other information also in the man page of nmcli

Thursday, October 18, 2012

Multiple forks

This is the code for generate a dynamic number of process (with the system call fork()). The father wait that all the child processes finish.

int main(int argc, char *argv[]){

    if (argc != 2){
        puts("usage prog number_of_process");
        exit(EXIT_FAILURE);
    }

    int num = atoi(argv[1]);
    int i;
    int * pids = malloc(sizeof(int)*num);

    for(i = 0; i < num; i++){

        pids[i] = fork();

        if(pids[i] == 0){
            //This is the code of the child process
            printf("begin %d\n" , i);
            sleep(10); //simulation of work
            printf("finish %d\n", i);
            exit(EXIT_SUCCESS);
        }
    }

    //Waiting the finish of all child processes
    while(wait(NULL)){
        if(errno == ECHILD)
            break;
    }
}

Tuesday, October 9, 2012

Coherence youthful

While this evening I was in the train, I saw a boy with a cool haircut and a "big headset" on his head and this arouse me a reflection.

When the guys drive a motorbike don't wear a helmet because it ruin their hairstyle, but if they follow a fashion (because this type of headset has always existed) their hairstyle is no longer important.

I found an incoherence. If a thing save the life the hairstyle is important but if a thing is fashion the hairstyle is a secondary element.

Virtual Time

This is a summary of section 1 and 2 of Jefferson's paper of University of Southern California "Virtual Time".

What is Virtual Time?
Virtual time is a paradigm that provides a flexible abstraction of real time in much the same way that virtual memory provides an abstraction of real memory. It is implemented using the Time Warp mechanism.

Programmer's POV: the global virtual clock always progresses forward at an unpredictable rate with respect to real time.
Implementer's POV: there are many local virtual clocks, loosely synchronized, and while all of the virtual clocks tend to go forward toward higher virtual times, they occasionally jump backward.

Event at (x, t) where x is the virtual place and t is the virtual time

Processes communicate only by exchanging messages to any process that it can name.

All messages are stamped with four values:
  • Sender
  • Virtual sender time
  • Receiver
  • Virtual receiver time
Virtual time systems are subject to two fundamental semantic rules:
  1. The virtual send time of each message must be less than its virtual receive time
  2. The virtual time of each event in a process must be less than the virtual time of the next event at that process.
This rule imply:
  • All messages output from any one process are sent in order of virtual send time
  • All messages input to any process are read in order of virtual receive time
The major constraint on the implementation:
If an event A causes event B, then the execution of A and B must be scheduled in real time so that A is completed before B starts.

Saturday, October 6, 2012

Black screen at the boot after install nvidia proprietary driver Arch Linux

Today I have installed Arch Linux on my desktop PC and I have occurred in a fault. After the install of Nvidia driver package I have rebooted the system and after the choose of OS in grub the screen is became black.
If I press Ctrl-Alt-Canc the system reboot. I have realized immediately that the error is caused by a conflict of some graphics modules.

I have in my PC an Intel I5 2500k Sandy Bridge(with the integrated graphics card) and a Nvidia GeForce 560.

After a search on the forum of Arch Linux I have known that the system choose the Intel graphics card at boot instead of the Nvidia graphics card, thus load the module for Intel card instead of Nvidia card.

For resolve the problem I have created the file /etc/modprobe.d/blacklist.conf and I have put in this 2 rows:

install i915 /bin/false
install intel_agp /bin/false

With this file, at the boot time, this 2 modules aren't loaded and the system work well with the proprietary Nvidia graphics driver.

Monday, September 24, 2012

Raspberry Pi OS

A month ago I bought an ARM GNU/Linux box, the Raspberry PI, it is a small but complete mini-computer.

These are his Specifications:
  • network port
  • GPIO header
  • composite video
  • analogue audio outputs
  • 2 USB port
  • HDMI port
  • mini-USB power
The University of cambridge has produced a free course on building a very simple operating system for the Raspberry Pi in assembly language and I starting to follow it.

Saturday, September 22, 2012

Hello World!!!

Hi, I'm Pasqualino Sorice, I attend the Bachelor of Science in Engineering in Computer Science and Systems (BSE-CSS) at Sapienza of Rome.

I begin this blog in conjunction with the start of works on my bachelor thesis.
I'll try to keep it as update as possible and to include interesting contribution on computer science.

The base of my thesis is a software open source developed by a Sapienza's group of research, the High Performance and Dependable Computing System.

The software is ROOT-Sim (The ROme OpTimistic Simulator).
This is introduction of his website:
The ROme OpTimistic Simulator is an x86-64 Open Source, parallel/distributed simulation platform developed using C/POSIX technology, which is based on a simulation kernel layer that ultimately relies on MPI for data exchange across different kernel instances. The platform transparently supports all the mechanisms associated with parallelization (e.g., mapping of simulation objects on different kernel instances) and optimistic synchronization (e.g., state recoverability).
The programming model supported by ROOT-Sim allows the simulation-model developer to use a simple application-callback function named ProcessEvent() as the event handler, whose parameters determine which simulation object is currently taking control for processing its next event, and where the state of this object is located in memory. In ROOT-Sim, a simulation object is a data structure, whose state can be scattered on dynamically allocated memory chunks, hence the memory address passed to the callback locates a top level data structure implementing the object state-layout.
I'm reading "Parallel and distributed simulation systems" of Richard M. Fujimoto to come into this attractive argument.

I'm sorry for my bad English, but this is the first time I write a post in English.
I hope I haven't made too many grammatical errors.