N00b question ! Consider a petrol pump where petrol is issued (output) based on liters required (input). Can such a device be controlled by Linux ? How does one go about designing software for such devices ?
Sure can. Linux is in all sorts of embedded environments. You may want to google for "real time OS" and "embedded linux"
Check out uCLinux and what it's used for. But in reality, something that particularly simple could be done with a simple logic circuit EDIT: With the addition of the proper sensing array !