How would you wire small computer to run on both batteries and AC power?
This is certainly possible. There are DC/DC converters made exactly for this purpose. You might want to google for "dc/dc atx power supply 12v". These converters are available at different power ratings. Many of them are designed for carputers (computers in cars). In the picture you see a small one providing 80 W power. It is mounted as part of the ATX main board connector. Stronger units usually come as separate boards, connecting to the main board via a cable.


Image source: Hardware Webwinkel

It is also possible to attach a car battery charger to the battery, making operation and charging completely independent.



Note that 12 V is the nominal voltage of the battery. Actual voltages for a lead type car battery should be anything from 11.8 (empty battery) to 14.7 V (charging, battery close to full).