Switch from graphics mode into text mode and vice versa wit→

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
User avatar
EladAshkcenazi335
Posts: 10
Joined: Sat May 06, 2017 11:35 am
Libera.chat IRC: ELAD335

Switch from graphics mode into text mode and vice versa wit→

Post by EladAshkcenazi335 »

→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:)
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Switch from graphics mode into text mode and vice versa

Post by Brendan »

Hi,
EladAshkcenazi335 wrote:→hout BIOS interrupts ?
Don't.

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.
Post Reply