Hi,
MadZarx wrote:
Brendan wrote:
What if one user has a tiny ("14 inch") monitor and needs large characters, and another user has a huge ("46 inch") monitor and needs small characters? What if one user has a "4:3" monitor and needs tall thin characters, and another user has a "16:10" monitor and needs wider/shorter characters?
At this early stage I just want to use a small resolution and my own font instead of default text mode fonts and its small resolution. But later, When everything is ready to use VM86, I will add support for more resolutions
I tend to not bother with VM86 - it doesn't work reliably for UEFI systems; and means the OS has to care what sort of firmware/environment the boot loader booted from. Most people don't change resolutions unless they're playing 3D games, and most people won't be playing 3D games (due to performance problems) unless there's a native video driver, so there isn't really any need to switch video modes after boot (unless there's a native video driver). It's enough to set the best video mode you can during boot.
MadZarx wrote:
Brendan wrote:
Note that the monitor can give you "EDID" information that says the physical width and height of the screen, which video modes the monitor supports and (e.g. for LCD monitors) the monitor's native resolution.
I think VBE gives me the EDID?
Yes - getting the EDID is very easy. It's just "blocks of data" though, so you'll have to parse it to extract the information you need.
MadZarx wrote:
Brendan wrote:
For example, the last time I did it I started with "256*64, one bit per pixel" data (with run length encoding and some other tricks to reduce font data size) and scaled it to "x * y, 256-bit alpha per pixel" format that was actually used. This gave relatively good results (e.g. with recognisable small 5*6 characters and nice/smooth large characters).
Thats so cool. But doesnt that font format slow down the print performance? Making a x*y 32 bytes character may reduce the performance :O
It depends on how good your code is. For a basic 2D GUI (text, windows, menus, icons, etc) your code would/should still be fast enough to get acceptable performance when running on Bochs (which is much slower than real computers). It also depends on how much other stuff your code does. For example; if you add something like dithering (which can be expensive) then the cost of drawing text is going to be unnoticeable in comparison.
MadZarx wrote:
Brendan wrote:
You mean qemu can even load the kernel binary itself? Even without that small assembly kernel loader?
But in this early stages I cant risk and run my OS on a real hardware. It may crash the system :O
As long as you don't write to hard drives or modify CMOS it's extremely difficult to do any harm (even if your code does crash).
It's always a very good idea to test on as many different (real and emulated) computers as possible; because different computers are different. It's too easy to have bugs in your code that don't cause symptoms and don't get noticed on some systems (and cause massive problems on other systems), and also too easy to end up effected by hardware and firmware bugs that your code failed to work around.
You'll also find that none of the emulators support EDID (it's hard to give information about the monitor when there isn't a real monitor and it's just a window running in some OS's GUI).
Cheers,
Brendan