On Thu, May 31, 2018 at 11:12:14AM -0400, Kevin O'Connor wrote:
On Thu, May 31, 2018 at 08:33:50AM +0200, Gerd Hoffmann wrote: [...]
dprintf(1, "bochs-display: using %dx%d, %d bpp (%d stride)\n"
, FRAMEBUFFER_WIDTH, FRAMEBUFFER_HEIGHT
, FRAMEBUFFER_BPP * 8, FRAMEBUFFER_STRIDE);
- cbvga_setup_modes(lfb_addr, FRAMEBUFFER_BPP * 8,
FRAMEBUFFER_WIDTH, FRAMEBUFFER_HEIGHT,
FRAMEBUFFER_STRIDE);
- writew(dispi + VBE_DISPI_INDEX_XRES, FRAMEBUFFER_WIDTH);
- writew(dispi + VBE_DISPI_INDEX_YRES, FRAMEBUFFER_HEIGHT);
- writew(dispi + VBE_DISPI_INDEX_BPP, FRAMEBUFFER_BPP * 8);
- writew(dispi + VBE_DISPI_INDEX_ENABLE, VBE_DISPI_ENABLED);
- writeb(vga, 0x20); /* unblank (for qemu -device VGA) */
An additional question - if the mode can be changed why do we only change it on startup? Is the idea that the OS will have a driver installed that directly changes modes once the OS starts up?
Yes. On linux bochs-drm.ko can handle the device.
Also modesetting isn't that easily in real mode due to the registers being in a 32bit mmio bar. setup() is fine due to running in big real mode.
cheers, Gerd