Jump to content

divide by zero solution for AMD


2 posts in this topic

Recommended Posts

Just in case this helps anyone, if you installed the JaS 10.4.6 + patch on an AMD system (mine is an Athlon 64 X2, 4600), and you get the divide by zero panic, you can fix it in the kernel. ONLY do this if the panic stack register dump shows an EIP of 0x0019309f ; if you have something else, then it's a different problem (or same problem on a different kernel, and I can't help you). You'll have to hex edit the kernel (/mach_kernel) to fix this, using a tool such as 0xED. No, I can't help you get at the kernel file to modify it if your system won't boot; you'll have to figure that part out yourself.


At offset 0x8209f, change 6 bytes from f7 b1 c0 00 00 00 to b8 01 00 00 00 90. You should then be able to boot.


technical details: the kernel is detecting the HTT cpu feature, though I'm not sure why; I seem to recall that it might be used for a different purpose on AMD cpus, but I can't remember details. In any case, cpu_is_hyperthreaded tries to determine that by dividing the logical_cores_per_package by cores_per_package, and the kernel is determining that cores_per_package is 0 on this cpu, hence leading to a divide by zero. The above change forces the result of that division to 1, meaning a 1:1 mapping of logical-to-core. The "real" fix would be to fix HTT detection, but that's more complex without rebuilding the kernel.

Link to comment
Share on other sites

  • 5 weeks later...

  • Create New...