Date: Wed, 9 Oct 2024 21:20:17 +1000 From: Peter Grehan <grehan@freebsd.org> To: Vasily Postnicov <shamaz.mazum@gmail.com> Cc: freebsd-virtualization@freebsd.org Subject: Re: Running Mezzano in bhyve Message-ID: <17f4077d-647d-4848-9d6f-97f9886ef636@freebsd.org> In-Reply-To: <CADnZ6B=ex24mbGN3du6UuS84akJZAxTcG5xqt0HB0RN5S262cQ@mail.gmail.com> References: <CADnZ6B=ex24mbGN3du6UuS84akJZAxTcG5xqt0HB0RN5S262cQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> Hi! Mezzano is an operating system written in Common lisp. I would like > to test it in bhyve. When I launch it, it spins infinitely in a loop > measuring how many CPU cycles it makes in a unit of time (I understood > it by adding various debug messages). > > The timer it uses is something called a PIT: > https://wiki.osdev.org/Programmable_Interval_Timer > <https://wiki.osdev.org/Programmable_Interval_Timer> > > The problem is, once the timer is configured it fires an interrupt only > once, while it obviously must fire interrupts constantly at some > frequency (100 Hz, as I understand from the code). > > Is the PIT supported by bhyve? Does FreeBSD use it anywhere in its kernel? Yes, though mode 3 of the timer isn't supported by the device emulation. It appears that Mezzano uses that mode https://github.com/froggey/Mezzano/blob/master/supervisor/x86-64/time.lisp#L20 Try this patch to the PIT code to see if it helps https://people.freebsd.org/~grehan/bhyve_vatpit.diff later, Peter.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17f4077d-647d-4848-9d6f-97f9886ef636>