Enter graphics mode without interrupts in assembly

后端 未结 2 1335
深忆病人
深忆病人 2021-01-23 13:06

How can I enter graphics mode (mode 13h) without using BIOS interrupts? I\'m targeting 32-bit protected mode where BIOS interrupts aren\'t available. I found a tutorial on web,

相关标签:
2条回答
  • 2021-01-23 13:17

    here's a link with example code: http://files.osdev.org/mirrors/geezer/osd/graphics/modes.c this code wouldn't work inside an operating system like windows or linux though, because it uses the commands inportb and outportb which issue the assembler commands inb and outb, which are disabled in user space.

    by the way - user3340787 didn't ask for how to go to a graphics mode in DOS, he asked how to do it without BIOS, which he might want to do when he writes an operating system

    0 讨论(0)
  • 2021-01-23 13:19

    This would be very hardware dependent. Realistic if you limit yourself to VGA-compatible adapters, but not if you want to support the whole gamut of video hardware out there. But then again, if you were, you probably won't be writing for DOS in the first place.

    For VGA, read up here. The registers are accessed via assembler's IN/OUT commands, read up on them.

    0 讨论(0)
提交回复
热议问题