bochs-emu / Bochs

Bochs - Cross Platform x86 Emulator Project
https://bochs.sourceforge.io/
GNU Lesser General Public License v2.1
875 stars 102 forks source link

Bochs on low memory #353

Closed XimikBoda closed 3 weeks ago

XimikBoda commented 1 month ago

I'm trying to port Bochs 2.7 for an old phone with a small amount of available RAM (max 3200 kB), I managed to shrink the emulator itself to +- 2.5 mb (without losing functionality), and the only problem left is with the host memory, for which there are about 512 kB left. I wanted to use the built-in swap, but it gives FATAL ERROR: Insufficient working RAM, all blocks are currently used for TLB entries!. Judging by what I found, this error occurs with a small host size. Instead, I tried to change the memory write/read functions to write/read functions from a file in memory_stub.cc. But this makes the emulator unstable (boot loop, freezes, аrtifacts, etc.). I have a feeling that the emulator sometimes accesses the allocated memory directly, bypassing the write/read functions. Can you give any tips on how to solve this problem?

XimikBoda commented 4 weeks ago

Oh, the problem turned out to be in my write/read, (hello std::fstream in rw mode)