This is how I run my laptop directly off my DC battery power. I connect a 12 volt cord to a battery. For my solar system I have gel batteries but when I go up to my other cabin I bring a deep cell battery. Red clamp on positive/ black clamp on negative.
Then I plug my DC power adapter for my computer into the socket.
There is a different DC power adapter for every laptop.
If you don’t have a DC power adapter for your computer you can plug a little inverter into the socket and it will run your AC laptop off of DC. They have an annoying little fan that eventually stops working so I don’t like using them.