After looking at this some more I thought it would be better to change the service_next_time_msec, service_cur_time_msec, and timer_running_msec variables to uint32_t. They are only ever set by sim_os_msec() which returns a uint32 so it makes no sense to have them as 64-bit variables.
That exposed another bug where service_next_time_msec is initialized to 0 in a few places. It should be initialized to sim_os_msec(); otherwise the lights can stall on startup.
Another bug is that timer_running_msec[] starts out at 0, which is used as a sentinel to indicate that a timer isn't running. But, while rare, it is possible that this line in the pdp11_70.c code:
_this->realcons->timer_running_msec[TIMER_TEST] = _this->realcons->service_cur_time_msec + TIME_TEST_MS;
just might come out as 0, in which case the timer wouldn't run. There are other occurrences with similar problems for other cpu models, so I introduced a macro, REALCONS_SET_TIMER_MSEC, and I use that to enable the timers. If it just so happens that the value calculated is 0, I bump it up by one millisecond. The probability of hitting that condition is 1 in 2^32, but I decided to fix it anyway.
I attached a unified patch of my changes on the client side. The server side (historybuffer and gpios) has been dealt with a while ago. I could work up a unified patch of that stuff too if anyone wants it.
Steve
On 9/30/26 08:16 AM, Eric N wrote:
> I'll look at doing the PR this weekend. I'm significantly behind the main release, so I'll check to see how much those files have changed since I last checked out. I might throw in the fflush() line I added to the printer section as well that updates your attached printer text file in real time.
>
> Eric
>
>
> On Tuesday, September 29, 2026 at 7:09:14 PM UTC-5
randomshi...@gmail.com wrote:
>
> I'm on commit
> 26d20be <
https://github.com/obsolescence/pidp11/commit/26d20beda0c6b5a1d3a5cb3d7a4dd494e02bff75> of the official obsolescence/pidp11 repo, so that one should have the LED bug. I'm personally waiting for Oct 3, curious.
> >> <
https://groups.google.com/d/msgid/pidp-11/3fa07d63-354a-4310-95e6-f31e4bbabfa2n%40googlegroups.com?utm_medium=email&utm_source=footer <
https://groups.google.com/d/msgid/pidp-11/3fa07d63-354a-4310-95e6-f31e4bbabfa2n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> To view this discussion visit
https://groups.google.com/d/msgid/pidp-11/4910f3e8-e22f-468c-9965-6f7009804f1bn%40googlegroups.com <
https://groups.google.com/d/msgid/pidp-11/4910f3e8-e22f-468c-9965-6f7009804f1bn%40googlegroups.com?utm_medium=email&utm_source=footer>.