INT 10H

Last updated

INT 10h, INT 10H or INT 16 is shorthand for BIOS interrupt call 10 hex , the 17th interrupt vector in an x86-based computer system. The BIOS typically sets up a real mode interrupt handler at this vector that provides video services. Such services include setting the video mode, character and string output, and graphics primitives (reading and writing pixels in graphics mode).

Contents

To use this call, load AH with the number of the desired subfunction, load other required parameters in other registers, and make the call. INT 10h is fairly slow, so many programs bypass this BIOS routine and access the display hardware directly. Setting the video mode, which is done infrequently, can be accomplished by using the BIOS, while drawing graphics on the screen in a game needs to be done quickly, so direct access to video RAM is more appropriate than making a BIOS call for every pixel.

Furthermore, on a modern x86 system, BIOS calls can only be performed in Real mode, or Virtual 8086 mode. v8086 is not an option in Long mode. This means that a modern operating system, which operates in Protected mode (32 bit), or Long mode (64 bit), would need to switch into real mode and back to call the BIOS - a hugely expensive operation. Although most modern systems typically use device drivers that directly set the video mode, it is not feasible for hobbyist systems to have a device driver for every video card - a problem that also plagues older, unsupported systems such as Windows 98. Such systems instead can drop into Real mode to switch the video mode, then draw to the framebuffer directly.

In EFI 1.x systems, the INT 10H and the VESA BIOS Extensions (VBE) are replaced by the EFI UGA protocol. In widely used UEFI 2.x systems, the INT 10H and the VBE are replaced by the UEFI GOP. [1] [2]

List of supported functions

The list is incomplete; use Ralf Brown's list for comprehensive information. Please only add IBM/PC or other common standard functions. 00h through 0fh are CGA.

FunctionFunction codeParametersReturn
Set video modeAH=00h AL = video mode

AL = video mode (For Old IBM Only)

AL = video mode flag / CRT controller mode byte
Set text-mode cursor shapeAH=01hCH = Scan Row Start, CL = Scan Row End

Normally a character cell has 8 scan lines, 0–7. So, CX=0607h is a normal underline cursor, CX=0007h is a full-block cursor. If bit 5 of CH is set, that often means "Hide cursor". So CX=2607h is an invisible cursor.

Some video cards have 16 scan lines, 00h-0Fh.

Some video cards don't use bit 5 of CH. With these, make Start>End (e.g. CX=0706h)

Set cursor positionAH=02hBH = Page Number, DH = Row, DL = Column
Get cursor position and shapeAH=03hBH = Page NumberAX = 0, CH = Start scan line, CL = End scan line, DH = Row, DL = Column
Read light pen position (Does not work on VGA systems)AH=04hAH = Status (0=not triggered, 1=triggered), BX = Pixel X, CH = Pixel Y, CX = Pixel line number for modes 0Fh-10h, DH = Character Y, DL = Character X
Select active display pageAH=05hAL = Page Number
Scroll up windowAH=06hAL = lines to scroll (0 = clear, CH, CL, DH, DL are used),

BH = Background Color and Foreground color. BH = 43h, means that background color is red and foreground color is cyan. Refer the BIOS color attributes

CH = Upper row number, CL = Left column number, DH = Lower row number, DL = Right column number

Scroll down windowAH=07hlike above
Read character and attribute at cursor positionAH=08hBH = Page NumberAH = Color, AL = Character
Write character and attribute at cursor positionAH=09hAL = Character, BH = Page Number, BL = Color, CX = Number of times to print character
Write character only at cursor positionAH=0AhAL = Character, BH = Page Number, CX = Number of times to print character
Set background/border colorAH=0Bh, BH = 00hBL = Background/Border color (border only in text modes)
Set paletteAH=0Bh, BH = 01hBL = Palette ID (was only valid in CGA, but newer cards support it in many or all graphics modes)
Write graphics pixelAH=0ChAL = Color, BH = Page Number, CX = x, DX = y
Read graphics pixelAH=0DhBH = Page Number, CX = x, DX = yAL = Color
Teletype outputAH=0EhAL = Character, BH = Page Number, BL = Color (only in graphic mode)
Get current video modeAH=0FhAL = Video Mode, AH = number of character columns, BH = active page
Change text mode character set [3] AH=11hBH = Number of bytes per character, CX = Number of characters to change, DX = Starting character to change, ES:BP = Offset of character data
Write string (EGA+, meaning PC AT minimum)AH=13hAL = Write mode, BH = Page Number, BL = Color, CX = Number of characters in string, DH = Row, DL = Column, ES:BP = Offset of string
set VESA-Compliant video modes, beginning at 640 by 480 and reaching 1280 by 1024 with 256 colorsAX=4f02hBX = video mode, if Sign bit (bit 15) set, video memory will not be refreshed
Other VESA VBE commandsAX=4F00h to 4F15hSee specSee spec

See also

Related Research Articles

<span class="mw-page-title-main">BIOS</span> Firmware for hardware initialization and OS runtime services

In computing, BIOS is firmware used to provide runtime services for operating systems and programs and to perform hardware initialization during the booting process. The BIOS firmware comes pre-installed on an IBM PC or IBM PC compatible's system board and exists in some UEFI-based systems to maintain compatibility with operating systems that do not support UEFI native operation. The name originates from the Basic Input/Output System used in the CP/M operating system in 1975. The BIOS originally proprietary to the IBM PC has been reverse engineered by some companies looking to create compatible systems. The interface of that original system serves as a de facto standard.

VESA BIOS Extensions (VBE) is a VESA standard, currently at version 3, that defines the interface that can be used by software to access compliant video boards at high resolutions and bit depths. This is opposed to the "traditional" INT 10h BIOS calls, which are limited to resolutions of 640×480 pixels with 16 colour (4-bit) depth or less. VBE is made available through the video card's BIOS, which installs during boot up some interrupt vectors that point to itself.

x86 assembly language is the name for the family of assembly languages which provide some level of backward compatibility with CPUs back to the Intel 8008 microprocessor, which was launched in April 1972. It is used to produce object code for the x86 class of processors.

INT is an assembly language instruction for x86 processors that generates a software interrupt. It takes the interrupt number formatted as a byte value.

<span class="mw-page-title-main">GNU GRUB</span> Boot loader package

GNU GRUB is a boot loader package from the GNU Project. GRUB is the reference implementation of the Free Software Foundation's Multiboot Specification, which provides a user the choice to boot one of multiple operating systems installed on a computer or select a specific kernel configuration available on a particular operating system's partitions.

<span class="mw-page-title-main">Mode 13h</span> Standard 256-color mode on VGA graphics hardware

Mode 13h is the standard 256-color mode on VGA graphics hardware introduced in 1987 with the IBM PS/2. It has a resolution of 320×200 pixels. It was used extensively in computer games and art/animation software of the late 1980s and early to mid-1990s. "13h" refers to the number of the mode in the VGA BIOS. The "h" stands for hexadecimal.

<span class="mw-page-title-main">UEFI</span> Operating system and firmware specification

Unified Extensible Firmware Interface is a specification that defines the architecture of the platform firmware used for booting the computer hardware and its interface for interaction with the operating system. Examples of firmware that implement the specification are AMI Aptio, Phoenix SecureCore, TianoCore EDK II, InsydeH2O. UEFI replaces the BIOS which was present in the boot ROM of all personal computers that are IBM PC compatible, although it can provide backwards compatibility with the BIOS using CSM booting. Intel developed the original Extensible Firmware Interface (EFI) specification. Some of the EFI's practices and data formats mirror those of Microsoft Windows. In 2005, UEFI deprecated EFI 1.10.

BIOS implementations provide interrupts that can be invoked by operating systems and application programs to use the facilities of the firmware on IBM PC compatible computers. Traditionally, BIOS calls are mainly used by DOS programs and some other software such as boot loaders. BIOS runs in the real address mode of the x86 CPU, so programs that call BIOS either must also run in real mode or must switch from protected mode to real mode before calling BIOS and then switching back again. For this reason, modern operating systems that use the CPU in Protected mode or Long mode generally do not use the BIOS interrupt calls to support system functions, although they use the BIOS interrupt calls to probe and initialize hardware during booting. Real mode has the 1MB memory limitation, modern boot loaders use the unreal mode or protected mode to access up to 4GB memory.

<span class="mw-page-title-main">QEMU</span> Free virtualization and emulation software

QEMU is a free and open-source emulator. It emulates a computer's processor through dynamic binary translation and provides a set of different hardware and device models for the machine, enabling it to run a variety of guest operating systems. It can interoperate with Kernel-based Virtual Machine (KVM) to run virtual machines at near-native speed. QEMU can also do emulation for user-level processes, allowing applications compiled for one architecture to run on another.

An Option ROM for the PC platform is a piece of firmware that resides in ROM on an expansion card, which gets executed to initialize the device and (optionally) add support for the device to the BIOS. In its usual use, it is essentially a driver that interfaces between the BIOS API and hardware. Technically, an option ROM is firmware that is executed by the BIOS after POST and before the BIOS boot process, gaining complete control of the system and being generally unrestricted in what it can do. The BIOS relies on each option ROM to return control to the BIOS so that it can either call the next option ROM or commence the boot process. For this reason, it is possible for an option ROM to keep control and preempt the BIOS boot process. The BIOS generally scans for and initializes option ROMs in ascending address order at 2 KB address intervals within two different address ranges above address C0000h in the conventional (20-bit) memory address space; later systems may also scan additional address ranges in the 24-bit or 32-bit extended address space.

<span class="mw-page-title-main">Video BIOS</span>

Video BIOS is the BIOS of a graphics card in a computer. It initializes the graphics card at the computer's boot time. It also implements INT 10h interrupt and VESA BIOS Extensions (VBE) for basic text and videomode output before a specific video driver is loaded. In UEFI 2.x systems, the INT 10h and the VBE are replaced by the UEFI GOP.

<span class="mw-page-title-main">GUID Partition Table</span> Computer disk partitioning standard

The GUID Partition Table (GPT) is a standard for the layout of partition tables of a physical computer storage device, such as a hard disk drive or solid-state drive, using universally unique identifiers, which are also known as globally unique identifiers (GUIDs). Forming a part of the Unified Extensible Firmware Interface (UEFI) standard, it is nevertheless also used for some BIOSs, because of the limitations of master boot record (MBR) partition tables, which use 32 bits for logical block addressing (LBA) of traditional 512-byte disk sectors.

In the x86-64 computer architecture, long mode is the mode where a 64-bit operating system can access 64-bit instructions and registers. 64-bit programs are run in a sub-mode called 64-bit mode, while 32-bit programs and 16-bit protected mode programs are executed in a sub-mode called compatibility mode. Real mode or virtual 8086 mode programs cannot be natively run in long mode.

INT 13h is shorthand for BIOS interrupt call 13hex, the 20th interrupt vector in an x86-based computer system. The BIOS typically sets up a real mode interrupt handler at this vector that provides sector-based hard disk and floppy disk read and write services using cylinder-head-sector (CHS) addressing. Modern PC BIOSes also include INT 13h extension functions, originated by IBM and Microsoft in 1992, that provide those same disk access services using 64-bit LBA addressing; with minor additions, these were quasi-standardized by Phoenix Technologies and others as the EDD BIOS extensions.

System Management Mode is an operating mode of x86 central processor units (CPUs) in which all normal execution, including the operating system, is suspended. An alternate software system which usually resides in the computer's firmware, or a hardware-assisted debugger, is then executed with high privileges.

<span class="mw-page-title-main">EFI system partition</span> Partition used by Unified Extensible Firmware Interface

The EFIsystem partition or ESP is a partition on a data storage device that is used by computers that have the Unified Extensible Firmware Interface (UEFI). When a computer is booted, UEFI firmware loads files stored on the ESP to start operating systems and various utilities.

<span class="mw-page-title-main">Borland Graphics Interface</span> Graphics library for Borland compilers on DOS

The Borland Graphics Interface, also known as BGI, was a graphics library bundled with several Borland compilers for the DOS operating systems since 1987. BGI was also used to provide graphics for many other Borland products including the Quattro Pro spreadsheet.

The Linux booting process involves multiple stages and is in many ways similar to the BSD and other Unix-style boot processes, from which it derives. Although the Linux booting process depend very much on the computer architecture, those architectures share similar stages and software components, including system startup, bootloader execution, loading and startup of a Linux kernel image, and execution of various startup scripts and daemons. Those are grouped into 4 steps: system startup, bootloader stage, kernel stage, and init process. When a Linux system is powered up or reset, its processor will execute a specific firmware/program for system initialization, such as Power-on self-test, invoking the reset vector to start a program at a known address in flash/ROM, then load the bootloader into RAM for later execution. In personal computer (PC), not only limited to Linux-distro PC, this firmware/program is called BIOS, which is stored in the mainboard. In embedded Linux system, this firmware/program is called boot ROM. After being loaded into RAM, bootloader will execute to load the second-stage bootloader. The second-stage bootloader will load the kernel image into memory, decompress and initialize it then pass control to this kernel image. Second-stage bootloader also performs several operation on the system such as system hardware check, mounting the root device, loading the necessary kernel modules,... Finally, the very first user-space process starts, and other high-level system initializations are performed.

<span class="mw-page-title-main">VGA text mode</span> Computer graphics standard from 1987

VGA text mode was introduced in 1987 by IBM as part of the VGA standard for its IBM PS/2 computers. Its use on IBM PC compatibles was widespread through the 1990s and persists today for some applications on modern computers. The main features of VGA text mode are colored characters and their background, blinking, various shapes of the cursor, and loadable fonts. The Linux console traditionally uses hardware VGA text modes, and the Win32 console environment has an ability to switch the screen to text mode for some text window sizes.

rEFInd Boot manager for UEFI systems

rEFInd is a boot manager for UEFI and EFI-based machines. It can be used to boot multiple operating systems that are installed on a single non-volatile device. It also provides a way to launch UEFI applications.

References

  1. "What is efifb? — The Linux Kernel documentation". www.kernel.org. Retrieved 2020-11-24.
  2. "What is vesafb? — The Linux Kernel documentation". www.kernel.org. Retrieved 2020-11-24.
  3. "A Font changing routine". Forever Young Software. Retrieved March 8, 2020.