Re: Having trouble plotting pixel color in 24 bit vesa modes
Posted: Fri Jun 03, 2016 6:59 pm
By the way, you could implement a function to save settings to apply after rebooting.
In this way, you can get all of the supported standard and nonstandard modes at boot time from your boot manager (the program that gets loaded by the boot sector and that in turn loads the rest of the kernel or the operating system).
Now, if the user selects a video mode that you cannot currently enter, you can offer the user to switch the video mode after rebooting. Then your boot manager will see the video mode that it should use, and apply before entering 32-bit Protected Mode or 64-bit Long Mode.
In this way, you could switch between standard VGA modes and Super VGA modes for which you have a native driver.
But if you happen to want to switch between standard and Super VGA modes without a driver and without emulating the BIOS code, you can still do so by saving the desired mode on the disk where the OS is installed, and then reboot using that new display mode. Then the boot manager will use the VESA mode (or even the standard text or graphics VGA mode) that was indicated.
It's a great improvement over only using a fixed mode or selecting it only at boot time, isn't it? Now you can select the video mode to use while using your own OS, after rebooting, using on-disk configuration files.
____________________________________
You could also implement saving the state of the whole OS on disk so you can reboot as fast as possible (caching the whole state of the hardware configuration and devices present), then resuming the multitasking and memory-management data back to memory (maybe by flushing I/O and freezing each task individually until you reboot and resume).
Then you can switch more on the fly by rebooting very fast, probably also trying a warm reboot for increased stability, through the KBC or another mechanism. Then it would almost feel as if you had native video drivers if you make it both efficient/fast and stable (meaning resuming the whole state won't cause crashes -- whatever task state was in the devices and in the multitasking/paging structures, that's exactly what will be restored, starting by the most critical programs).
In this way, you can get all of the supported standard and nonstandard modes at boot time from your boot manager (the program that gets loaded by the boot sector and that in turn loads the rest of the kernel or the operating system).
Now, if the user selects a video mode that you cannot currently enter, you can offer the user to switch the video mode after rebooting. Then your boot manager will see the video mode that it should use, and apply before entering 32-bit Protected Mode or 64-bit Long Mode.
In this way, you could switch between standard VGA modes and Super VGA modes for which you have a native driver.
But if you happen to want to switch between standard and Super VGA modes without a driver and without emulating the BIOS code, you can still do so by saving the desired mode on the disk where the OS is installed, and then reboot using that new display mode. Then the boot manager will use the VESA mode (or even the standard text or graphics VGA mode) that was indicated.
It's a great improvement over only using a fixed mode or selecting it only at boot time, isn't it? Now you can select the video mode to use while using your own OS, after rebooting, using on-disk configuration files.
____________________________________
You could also implement saving the state of the whole OS on disk so you can reboot as fast as possible (caching the whole state of the hardware configuration and devices present), then resuming the multitasking and memory-management data back to memory (maybe by flushing I/O and freezing each task individually until you reboot and resume).
Then you can switch more on the fly by rebooting very fast, probably also trying a warm reboot for increased stability, through the KBC or another mechanism. Then it would almost feel as if you had native video drivers if you make it both efficient/fast and stable (meaning resuming the whole state won't cause crashes -- whatever task state was in the devices and in the multitasking/paging structures, that's exactly what will be restored, starting by the most critical programs).