Quote:
suppose I want to tell motherboard to disable all the USB ports available something like I want motherboard to stop power supply to all the available USB ports.
No, the OS is here to prevent you from doing this. Any way, since keyboard and mouse are USB, it is a bad idea.
Quote:
More over I just got this idea to play around with my friends
This is called MalWare.
Technically the thing is possible but imply to replace part of the OS, which is something reserved to highly skilled and specialized programmers with probably years of practice on this domain.
The language is probably C++.
This kind of "driver" enter in the "ring 0" category, which the closest to hardware, like the driver to handle a new graphic card.
Quote:
how does the hibernate mode work on windows?
You are lucky, it is another don't touch.
Hibernate basically turn off the computer.
What is the exact reason why you want to do all this ?
This kind of things is in same category as "cutting breaks of a car", you don't do this unless you want to harm someone.
Quote:
In that case why does OS is not preventing it from doing it?
Hibernate is done by the OS.
Hibernate is what the OS do when you let your laptop turned on while you go to lunch.