Consciousness is the neurons continually accepting and analyzing new data input from the senses in a delayed realtime fashion. What I mean is, the neurons analyze the data in realtime as they receive it - but there is of course a delay as the signals travel along the nerves.
When the neurons aren't processing in this fashion, we're not conscious. The senses may be operating normally, the eyes may be accepting light just fine, but it's like a CCD without a processing board. Light is hitting the CCD, and it's producing minute electrical charges, but there's nothing there to change those charges into pictures. When we're unconscious, the brain is working on a basic life-support level, but the higher brain functions aren't active - sensory inputs are not being perceived or analyzed.
In death, the neurons shut down. They are no longer able to process sensory inputs, which have also ceased, they can not analyze this sensory deficit, nor are they able to recall or form memories. Consciousness ceases, along with what we call that "person" or personality.
Consciousness itself - I don't know that it's an operating system per se. I think that the operating system is what allows the consciousness process to run. The operating system would be basic software that allows for data intake and storage. Consciousness is the process of organizing, filtering, interpreting, and applying lossy compression to all of this. Why lossy? Obviously, because if you look at a can of soda, you won't be able to remember every ingredient after one glance. You'll probably remember water and corn syrup, but that's about it. It's like compressing a JPEG at a 25 quality level. It'll look lousy, but you'll get the general idea of what it's supposed to look like. But it's filtered data too, with variable compression levels - some memories are more vivid than others.
If consciousness is the OS, what is unconsciousness? People can do just about as many things while unconscious as they can while conscious (think sleepwalkers).
Robots can get plenty done without the aid of what we call consciousness. During sleep, various areas of the brain are stimulated in what a waking mind might call a random fashion. Some order is maintained though, and some of that order can encompass the instructions required to walk. Again, a computer analogy, and a bit fictitious at that - scandisk on a fragmented hard drive. It'll access data sector-by-sector, and in a contiguous fashion, the fragmented data will generally make no sense. Say each sector has a letter of the alphabet on it. Scandisk will see this data stream: "BGIQPCILA" Totally random. But it might come across the sequence "RESTART" and suddenly restart the computer because it chanced upon some order in the fragmented chaos, and went with it.