Calculator Community > KnightOS

Hibernation

(1/4) > >>

SirCmpwn:
So here's what I think I can do with KOS to hibernate:
1. User requests hibernation
2. The kernel takes control, shuts down multithreading and kills interrupts.  It is now the only running process.  Because it halts interrupts, all threads are suspended in their current state.
3. The kernel creates a file: /tmp/hibernation.data (filesystem is in ROM)
4. In this file, it dumps all RAM (which contains executing programs, each program's stack, the thread table, allocated memory... everything that makes KOS tick)
5. Then, it turns off the calculator.
*some time later
6. The user turns on the calculator.
7. During boot, the kernel sees that /tmp/hibernation.data exists, and loads the contents into RAM (remember that at this point, multithreading has not been initialized, or memory management)
8. The kernel deletes /tmp/hibernation.data and skips most of the initialization process.
9. Simply enable interrupts, and you're right back to the state you left it off from!

DJ Omnimaga:
Seems good to me. SOmetimes it's good to not have to wait 2 minutes for an OS to boot everytime you want to use your laptop or computer. Not that it would take this long on a calc, unless you're TI, but it would be good. I like how newer Casio calcs do that.

SirCmpwn:
Yeah, it won't take long either way.  And sleeping the calc would be instantaneous.

DJ Omnimaga:
Sleeping a calc? ???

j/k I know what you mean. :P (although this reminded me so much of "Please SD-Card insert" :P)

SirCmpwn:
A winner is you.

Navigation

[0] Message Index

[#] Next page

Go to full version