Switch from graphics mode into text mode and vice versa wit→
Switch from graphics mode into text mode and vice versa wit→
→hout BIOS interrupts ?
Restart any PC in the easy way around:
mov eax,cr0
xor al,1
mov cr0,eax
lidt [illegal_idtr]
jmp 0:$
; done:)
mov eax,cr0
xor al,1
mov cr0,eax
lidt [illegal_idtr]
jmp 0:$
; done:)
Re: Switch from graphics mode into text mode and vice versa
Hi,
It's relatively easy to emulate text mode while still using graphics mode, simply by drawing characters yourself. This avoids the need to switch modes (which may be impossible in some cases - e.g. UEFI), and avoids the overhead and "ugliness" (visible black flicker) caused by video mode switching.
It also allows you (initially, or in future improvements done as the OS grows) to:
Cheers,
Brendan
Don't.EladAshkcenazi335 wrote:→hout BIOS interrupts ?
It's relatively easy to emulate text mode while still using graphics mode, simply by drawing characters yourself. This avoids the need to switch modes (which may be impossible in some cases - e.g. UEFI), and avoids the overhead and "ugliness" (visible black flicker) caused by video mode switching.
It also allows you (initially, or in future improvements done as the OS grows) to:
- Use a modern cursor (e.g. a modern "vertical bar" instead of an "antiquated block" cursor)
- Support a much larger range of colours
- Support different font sizes
- Support different styles (bold, italic, underline, super-script, etc)
- Support Unicode/internationalisation
- Support emoji
- Support anti-aliasing (to fix "jagged diagonal edges")
- Use much more detailed (and much easier to read) characters (e.g. maybe a 16*24 font rather than an 8*16 font)
- Support smooth scrolling properly
- Add a vertical scroll bar the user can use (with mouse) to see all the stuff that scrolled off the top of the screen
- Add a background image
- Do anything else I forgot to mention
- Recycle most of the existing code when you implement a GUI
- Avoid giving end users the impression that you aren't good at writing software
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.