charger: Offer kernel build that disables disks, screen, etc. and lets laptop serve as charger for USB/FireWire devices
Hi all,
Consider situations where normal power outlets are not available, e.g. when travelling in remote areas or in an air plane or train, but you do need to charge USB/FireWire devices like a mobile telephone, camera, PDA, etc. It would be efficient to boot your laptop with a special kernel that turns it into a charger.
Some laptops already offer this feature, however the majority of laptops donot. A suspended laptop can offer this too, but please consider situation orplaces where power is so scarce that normally booting a laptop in order tocharge another device is undesirable in terms of being efficient with theenergy stored in the battery or that it is not allowed to activate RF devicesas is in an air plane.
Normal boot will cause that a lot of power will be consumed by the disks,screen, CPUs, RF devices, fans, all LEDs (except the one indicating the deviceis switched on), etc. while you are only interested in power being available at the USB/FireWire ports.
This can be achieved by building a special kernel that will shut down all hardware that is not needed for offering power on the before mentioned ports. Perhaps this can be achieved by kernel configuration alone or it might require a minimal of functionality to put a laptop into such a charging state.
Normally, systems automatically shut down before the battery is drained 100%. This kernel will allow you to drain all the entire battery.
The resulting kernel can be installed and made available in a similar way as the memtest kernel and can be incorporated by installers of GNU/Linux distributions.
Implementing this idea will allow for highly energy efficient recharging of devices like telephones, cameras and other mobile devices via your laptop.
Regards,
Pander
Quoted 2 lines · Pander
Hi all,
...
Quoted 6 lines
This can be achieved by building a special kernel that will shut down all hardware that is not needed for offering power on the before mentioned ports. Perhaps this can be achieved by kernel configuration alone or it might require a minimal of functionality to put a laptop into such a charging state.
Alternative implementation could be that this functionality is present in a normal kernel and is only activated by boot time command argument 'charger'.
While being on the subject anyway, optionally, extra functionality could be implemented for turning the laptop into an emergency light. The boot time command argument 'light' could offer this.
The same functionality as with charger will be enabled and the screen and keyboard will powered up. Initially, the screen will be white. By means of the following keys: arrow op, arrow down, arrow left, arrow right, page up, page down, home, end, return, tab one is able to change the color of the screen in on of 16 basic colors: white, yellow, fuchsia, red, silver, gray, olive, purple, maroon, aqua, lime, teal, green, blue, navy and black (perhaps omit the latter). The space bar key would enable and disable the screen but still allow for the other keys to change the color. Also the brightness keys should be supported.
Of course this is easily done by software on a fully booted system. However, due to the emergency situation, again power can be scarce and must be used as efficient as possible. Considering and discussing implementation of this greatly overlaps the aforementioned proposal.
Kind regards,
Pander
Quoted 29 lines · Pander
Quoted 2 lines · Pander
Hi all,
...
Quoted 6 lines
This can be achieved by building a special kernel that will shut down all hardware that is not needed for offering power on the before mentioned ports. Perhaps this can be achieved by kernel configuration alone or it might require a minimal of functionality to put a laptop into such a charging state.
Alternative implementation could be that this functionality is present in a normal kernel and is only activated by boot time command argument 'charger'.
While being on the subject anyway, optionally, extra functionality could be implemented for turning the laptop into an emergency light. The boot time command argument 'light' could offer this.
The same functionality as with charger will be enabled and the screen and keyboard will powered up. Initially, the screen will be white. By means of the following keys: arrow op, arrow down, arrow left, arrow right, page up, page down, home, end, return, tab one is able to change the color of the screen in on of 16 basic colors: white, yellow, fuchsia, red, silver, gray, olive, purple, maroon, aqua, lime, teal, green, blue, navy and black (perhaps omit the latter). The space bar key would enable and disable the screen but still allow for the other keys to change the color. Also the brightness keys should be supported.
Quoted 8 lines
Of course this is easily done by software on a fully booted system. However, due to the emergency situation, again power can be scarce and must be used as efficient as possible. Considering and discussing implementation of this greatly overlaps the aforementioned proposal.
Kind regards,
Pander
You can do all this in userspace, without using any more power. E.g. instead of a "charger" boot option, just use init=/sbin/charger.
If there are any opportunities to save more power by disabling certain devices, then these capability should be exercised automatically when devices are unused.
Where this is not possible, userspace can explicitly disable the device. E.g. USB mice which usually have broken autosuspend support, and will not "wake up" when used. In this example, userspace can already write "suspend" or "auto" to /sys/bus/usb/devices/.../power/level. See Documentation/ABI/testing/sysfs-bus-usb.
Then you can benefit from writing "charger" or "torch" in userspace, which is generally a much nicer environment. And any extra power saving capabilities you add can be reused by other userspace software, possibly including the modern desktop environments.
W.r.t to suspend: I do not believe it is guaranteed that USB ports will supply full power when the system is suspended. You might have to make that an option.
Here are some of the biggest potential power savings: Disable all radios e.g. WiFi, using the rkill subsystem. Put the screen into power saving mode. Don't access the disk - use a ramdisk, or a good prefetching system, and spin the disk down once you've loaded everything into ram. Don't run any userspace programs which wake up periodically (i.e. audit your system with powertop).
All the above can be implemented in userspace without doing anything really novel. If anything, they will be harder to implement in-kernel because it's not really designed to allow that sort of policy enforcement. And you might even have to run X in order to reliably & portably blank the screen :-).
Have fun
Alan
Quoted 27 lines · Pander
Consider situations where normal power outlets are not available, e.g. when travelling in remote areas or in an air plane or train, but you do need to charge USB/FireWire devices like a mobile telephone, camera, PDA, etc. It would be efficient to boot your laptop with a special kernel that turns it into a charger.
Some laptops already offer this feature, however the majority of laptops donot. A suspended laptop can offer this too, but please consider situation orplaces where power is so scarce that normally booting a laptop in order tocharge another device is undesirable in terms of being efficient with theenergy stored in the battery or that it is not allowed to activate RF devicesas is in an air plane.
Normal boot will cause that a lot of power will be consumed by the disks,screen, CPUs, RF devices, fans, all LEDs (except the one indicating the deviceis switched on), etc. while you are only interested in power being available at the USB/FireWire ports.
This can be achieved by building a special kernel that will shut down all hardware that is not needed for offering power on the before mentioned ports. Perhaps this can be achieved by kernel configuration alone or it might require a minimal of functionality to put a laptop into such a charging state.
Normally, systems automatically shut down before the battery is drained 100%. This kernel will allow you to drain all the entire battery.
Quoted 7 lines
The resulting kernel can be installed and made available in a similar way as the memtest kernel and can be incorporated by installers of GNU/Linux distributions.
Implementing this idea will allow for highly energy efficient recharging of devices like telephones, cameras and other mobile devices via your laptop.
Perhaps using your laptop is a charger is simply inefficient and no matter how simple the system is it is likely to use way more power than any dedicated usb charger would, and certainly more than the laptops that actually support this in hardware.
Signature · 1 line
Len Sorensen