Game Development Reference
In-Depth Information
Uncomment the lines max-load-1 = 24 and watchdog-device by removing the
hash (#) character. The max load means that it will take 24 Raspberry Pis to complete
the task in one minute. In normal usage, this should never happen and would only
really occur when the Pi has hung.
You can now start the watchdog with that configuration. Each time you change
something, you need to restart the watchdog using the following command:
sudo /etc/init.d/watchdog start
There are some other examples in the configuration file that you may find of interest.
Testing the watchdog
In Linux, you can easily place a function into a separate thread that runs in a
new process by using the & symbol. By exploiting this feature together with some
anonymous functions, we can issue a very crude but effective system halt. This is
a quick way to test if the watchdog daemon is working correctly, and it should not
be used to halt the Pi. It is known as a fork bomb, and many operating systems are
susceptible to this.
The random-looking series of characters are actually anonymous functions that
create new anonymous functions, which are placed in its own thread and process.
This is an endless and uncontrollable loop. It most likely adopted the name of a
bomb because once it starts, it cannot be stopped. Even if you try to kill the original
thread, it creates several new threads that need to be killed. It is just impossible to
stop, and eventually "bombs" the system into a critical state. Type these characters
into the command line and press Enter :
: (){ :|:& };:
After you press Enter , the Pi should restart after about 30 seconds, but it might take
up to a minute.
Enabling extra decoders
The Broadcom chip actually has extra hardware for encoding and decoding a few
other well-known formats. The Raspberry Pi foundation did not include these
licenses because they wanted to keep the costs down to a minimum, but they have
included the H.264 license. This allows you to watch HD media on your TV or use
the webcam module.
They provide a way for users to buy separate licenses if you would like to use these
extra encoders/decoders.
 
Search WWH ::




Custom Search