Sunday, June 2, 2013

Google plans and more

Well I agree with Simon, not always does power exploit. Here's a sneak peak of what Google plans in its kitty. With the services it is building recently, it won't take people long to move to Google+ when they are being provided with so many 'good' reasons to switch to it.
Read on for more. Check out the latest issue of STUFF for more.
http://www.stuff.tv/
http://www.stuff-magazine.co.uk/

Friday, December 21, 2012

She today

It's heartbreaking to see the fate of Indian Women who are not safe even in Delhi, the national capital of democratic India. The recent gangrape case saw a flurry of nationwide protests. Below is a glimpse of protests through out the country. We must take inspiration from these to build pressure on the government to not only make stricter laws but also punish the bureaucracy especially the police personnel who still have such backward thoughts like "revealing clothing" etc.
  
Protests: A Glimpse
Courtesy: TheHindu, The Hindustan Times

Saturday, October 13, 2012

Euro Series- Post#1 Creation of Euro

After several rounds of meetings, discussions over the years, the Euro virtually came into existence at midnight on 1 January 1999 when the exchange rates between the currencies of the 11 member countries were frozen at the current rates along with a fixed value against Euro. Greece entered the Eurozone in 2001 and 5 other European countries joined later making the total count of Eurozone countries to 17.

Some major stringent conditions to be met for entering the Eurozone

  • annual budget deficits not to exceed 3% of gross domestic product
  • maintain the public debt under 60%.
  • European Central Bank was remitted with setting interest rates. 
  • Each country would retain its own tax policies, budgets and banks and issue their own bonds.
Motivating factors that lead to the creation of Euro

  •  to reduce currency exchange rate volatility leading to price stability, growth and trading benefits..
  • bring liberalization in capital movements across the member countries. 
  • A stronger presence for the EU in the global economy.
Why was UK reluctant to join the Eurozone?
Public opinions opposed the membership of Eurozone. Besides this 4 out of 5 Economic tests on the British economy were not passed which were earmarked by the then UK cabinet as essential requirements for Britain to adopt Euro. also the political sentiment within Britain has been negative with respect to joining the Euro.

Tuesday, September 18, 2012

Anti-Japan Protests in China: Genuine or Politics

I have been covering stories about spreading protests in China over the so called "Illegal" purchase of disputed islands by Japan. It's very shocking to see the protestors coming out in such huge numbers all across the country especially in a communist state like China where there are so many restrictions and censorship. Intuitively This seems to me as yet another move of Ministry of foreign affairs of China. Evidently the mob was reported to be targeting Japanese nationals, embassies and even Factories and outlets owned by Japanese MNCs. Responding to a request from Japanese Prime Minister to take control of the situation Chinese spokesperson very intelligently tried to blame Japan for the protests and to take the responsibility of any losses incurred to not only it's own people but China as well.
China has so many disputes with numerous countries but this kind of cheap and unsocial tactics only suggests where the dragon may be heading following the footsteps of their ancestor "Dinosauria".
You might like to take a look at these news strips.

strip1strip2strip3  ,  strip4, strip5

Monday, September 3, 2012

Pintos Project 2 Argument Passing, User Programs

A brief intro to argument passing in Pintos
Just like in a regular command line argument passing, Pintos already does the parsing of the arguments passed to it via command line. This is done in the file "threads/init.c" in the 'main' function. Running a typical User program involves issuing the following command

>>pintos -q run 'echo x'

This causes the parsing of the arguments like this
"-q">> this is just a pintos option for powering off the system once the processing is done. In the parse_options function appropriate flags are set indicating that the option has been acknowledged and that the PINTOS will be turned off once the task is completed.

All the arguments which are pintos options will get parsed in this function.

Main then calls run_actions with the following argument
" run echo x y " which is passed as a pointer named "argv"

run_actions determines what task needs to be done by using the first string available here i.e. "run", which is nothing but a command which says run the program 'echo' with the arguments 'x' and 'y'.
This leads to the calling of the function "run_task" (due to the argument run) with the argument argv which now points to the string <echo x y>. Run task calls 'process_execute' located in 'userprog/process.c' with the pointer to this string.

process_execute() creates a new thread passing 'start_process' as the function to be performed whose task is to load this user program and the string <echo x y> is passed as well.

start_process creates the interrupt frame and goes on to load the user program and then run it.

inside load is where you need to do the modifications.....

Firstly since the argument file_name_which is passed points to the string <echo x y>, You need to get the name of the user program which needs to loaded which in this case is 'echo'.  You may want to look at the functions present in "lib/string.c" on how this can be done or create your own function to do this.

  file = filesys_open ("echo");          //line 225
the only thing is that instead of this argument, a pointer pointing to this string should be passed.

so that the correct program file will be opened since passing <echo x y> will cause an error as there won't be any such program file.

Then your work is to set up the stack which is done in the function setup_stack called in the line 305.

Insert your code after the page is successfully installed i.e inside
 if (success) { *esp = PHYS_BASE;...................     }

What all you need to do .....
push all the arguments onto the stack in reverse order ...
i.e. PUSH "y\0"
      PUSH "x\0"
      PUSH "echo\0"
You need to remember the addresses  on the stack where these strings are being pushed as u later to need to push these addresses as well.

then include the following line

"*esp=*esp-4+(strlength("x")+1 +strlength("y")+1........)%4;
in order to make the esp pointer a multiple of 4

then push a NULL pointer sentinal of type "uint32_t" corresponding to argv[argc]
here argc is clearly 4

there-after push the addresses the strings on the stack just passed again in the same order.
PUSH addressonstack"y/0"
PUSH addressonstack"x/0"
PUSH addressonstack"echo\0" //******

then push the address of the stack position which contains the address of the string "echo\0", starred in the previous line. Push the value of argc then finally push a fake return point may be NULL.

and you are done...

I haven't given complete details of How this needs to be done which I think you should try before asking some body. Feel free to reply to this thread for any comments, questions or doubts ....









Sunday, September 2, 2012

ENUM vs #DEFINE

I just came across the enumerate feature in C and i was wondering the differences in using "enum" and "#define"

1) First one is essentially that "#define" is a pre-processor directive i.e. it simply does a find and replace before the compiler takes over while "enum" is a part of C.

2)we can define data types using "enum" apart from defining macros.

take a look at this article for more insight..

understanding Enums 

Enum vs #define



 

Wednesday, November 30, 2011

Ratan TATA

Check out the Exclusive e-book containing interview and life of RATAN TATA the name every Indian knows and his recent work, controversies etc. Click here