요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. include:: <isonum.txt>
=================================
Video Mode Selection Support 2.13
=================================
:Copyright: |copy| 1995--1999 Martin Mares, <[email protected]>
Intro
~~~~~
This small document describes the "Video Mode Selection" feature which
allows the use of various special video modes supported by the video BIOS. Due
to usage of the BIOS, the selection is limited to boot time (before the
kernel decompression starts) and works only on 80X86 machines that are
booted through BIOS firmware (as opposed to through UEFI, kexec, etc.).
.. note::
Short intro for the impatient: Just use vga=ask for the first time,
enter ``scan`` on the video mode prompt, pick the mode you want to use,
remember its mode ID (the four-digit hexadecimal number) and then
set the vga parameter to this number (converted to decimal first).
The video mode to be used is selected by a kernel parameter which can be
specified in the kernel Makefile (the SVGA_MODE=... line) or by the "vga=..."
option of LILO (or some other boot loader you use) or by the "xrandr" utility
(present in standard Linux utility packages). You can use the following values
of this parameter::
NORMAL_VGA - Standard 80x25 mode available on all display adapters.
EXTENDED_VGA - Standard 8-pixel font mode: 80x43 on EGA, 80x50 on VGA.
ASK_VGA - Display a video mode menu upon startup (see below).
0..35 - Menu item number (when you have used the menu to view the list of
modes available on your adapter, you can specify the menu item you want
to use). 0..9 correspond to "0".."9", 10..35 to "a".."z". Warning: the
mode list displayed may vary as the kernel version changes, because the
modes are listed in a "first detected -- first displayed" manner. It's
better to use absolute mode numbers instead.
0x.... - Hexadecimal video mode ID (also displayed on the menu, see below
for exact meaning of the ID). Warning: LILO doesn't support
hexadecimal numbers -- you have to convert it to decimal manually.
Menu
~~~~
The ASK_VGA mode causes the kernel to offer a video mode menu upon
bootup. It displays a "Press <RETURN> to see video modes available, <SPACE>
to continue or wait 30 secs" message. If you press <RETURN>, you enter the
menu, if you press <SPACE> or wait 30 seconds, the kernel will boot up in
the standard 80x25 mode.
The menu looks like::
Video adapter: <name-of-detected-video-adapter>
Mode: COLSxROWS:
0 0F00 80x25
1 0F01 80x50
2 0F02 80x43
3 0F03 80x26
....
Enter mode number or ``scan``: <flashing-cursor-here>
<name-of-detected-video-adapter> tells what video adapter did Linux detect
-- it's either a generic adapter name (MDA, CGA, HGC, EGA, VGA, VESA VGA [a VGA
with VESA-compliant BIOS]) or a chipset name (e.g., Trident). Direct detection
of chipsets is turned off by default as it's inherently unreliable due to
absolutely insane PC design.
"0 0F00 80x25" means that the first menu item (the menu items are numbered
from "0" to "9" and from "a" to "z") is a 80x25 mode with ID=0x0f00 (see the
next section for a description of mode IDs).
<flashing-cursor-here> encourages you to enter the item number or mode ID
you wish to set and press <RETURN>. If the computer complains something about
"Unknown mode ID", it is trying to tell you that it isn't possible to set such
a mode. It's also possible to press only <RETURN> which leaves the current mode.
The mode list usually contains a few basic modes and some VESA modes. In
case your chipset has been detected, some chipset-specific modes are shown as
well (some of these might be missing or unusable on your machine as different
BIOSes are often shipped with the same card and the mode numbers depend purely
on the VGA BIOS).
The modes displayed on the menu are partially sorted: The list starts with
the standard modes (80x25 and 80x50) followed by "special" modes (80x28 and
80x43), local modes (if the local modes feature is enabled), VESA modes and
finally SVGA modes for the auto-detected adapter.
If you are not happy with the mode list offered (e.g., if you think your card
is able to do more), you can enter "scan" instead of item number / mode ID. The
program will try to ask the BIOS for all possible video mode numbers and test
what happens then. The screen will be probably flashing wildly for some time and
strange noises will be heard from inside the monitor and so on and then, really
all consistent video modes supported by your BIOS will appear (plus maybe some
``ghost modes``). If you are afraid this could damage your monitor, don't use
this function.
After scanning, the mode ordering is a bit different: the auto-detected SVGA
modes are not listed at all and the modes revealed by ``scan`` are shown before
all VESA modes.
Mode IDs
~~~~~~~~
Because of the complexity of all the video stuff, the video mode IDs
used here are also a bit complex. A video mode ID is a 16-bit number usually
expressed in a hexadecimal notation (starting with "0x"). You can set a mode
by entering its mode directly if you know it even if it isn't shown on the menu.
The ID numbers can be divided to those regions::
0x0000 to 0x00ff - menu item references. 0x0000 is the first item. Don't use
outside the menu as this can change from boot to boot (especially if you
have used the ``scan`` feature).
0x0100 to 0x017f - standard BIOS modes. The ID is a BIOS video mode number
(as presented to INT 10, function 00) increased by 0x0100.
0x0200 to 0x08ff - VESA BIOS modes. The ID is a VESA mode ID increased by
0x0100. All VESA modes should be autodetected and shown on the menu.
0x0900 to 0x09ff - Video7 special modes. Set by calling INT 0x10, AX=0x6f05.
(Usually 940=80x43, 941=132x25, 942=132x44, 943=80x60, 944=100x60,
945=132x28 for the standard Video7 BIOS)
0x0f00 to 0x0fff - special modes (they are set by various tricks -- usually
by modifying one of the standard modes). Currently available:
0x0f00 standard 80x25, don't reset mode if already set (=FFFF)
0x0f01 standard with 8-point font: 80x43 on EGA, 80x50 on VGA
0x0f02 VGA 80x43 (VGA switched to 350 scanlines with a 8-point font)
0x0f03 VGA 80x28 (standard VGA scans, but 14-point font)
0x0f04 leave current video mode
0x0f05 VGA 80x30 (480 scans, 16-point font)
0x0f06 VGA 80x34 (480 scans, 14-point font)
0x0f07 VGA 80x60 (480 scans, 8-point font)
0x0f08 Graphics hack (see the VIDEO_GFX_HACK paragraph below)
0x1000 to 0x7fff - modes specified by resolution. The code has a "0xRRCC"
form where RR is a number of rows and CC is a number of columns.
E.g., 0x1950 corresponds to a 80x25 mode, 0x2b84 to 132x43 etc.
This is the only fully portable way to refer to a non-standard mode,
but it relies on the mode being found and displayed on the menu
(remember that mode scanning is not done automatically).
0xff00 to 0xffff - aliases for backward compatibility:
0xffff equivalent to 0x0f00 (standard 80x25)
0xfffe equivalent to 0x0f01 (EGA 80x43 or VGA 80x50)
If you add 0x8000 to the mode ID, the program will try to recalculate
vertical display timing according to mode parameters, which can be used to
eliminate some annoying bugs of certain VGA BIOSes (usually those used for
cards with S3 chipsets and old Cirrus Logic BIOSes) -- mainly extra lines at the
end of the display.
Options
~~~~~~~
Build options for arch/x86/boot/* are selected by the kernel kconfig
utility and the kernel .config file.
VIDEO_GFX_HACK - includes special hack for setting of graphics modes
to be used later by special drivers.
Allows to set _any_ BIOS mode including graphic ones and forcing specific
text screen resolution instead of peeking it from BIOS variables. Don't use
unless you think you know what you're doing. To activate this setup, use
mode number 0x0f08 (see the Mode IDs section above).
Still doesn't work?
~~~~~~~~~~~~~~~~~~~
When the mode detection doesn't work (e.g., the mode list is incorrect or
the machine hangs instead of displaying the menu), try to switch off some of
the configuration options listed under "Options". If it fails, you can still use
your kernel with the video mode set directly via the kernel parameter.
In either case, please send me a bug report containing what _exactly_
happens and how do the configuration switches affect the behaviour of the bug.
If you start Linux from M$-DOS, you might also use some DOS tools for
video mode setting. In this case, you must specify the 0x0f04 mode ("leave
current settings") to Linux, because if you don't and you use any non-standard
mode, Linux will switch to 80x25 automatically.
If you set some extended mode and there's one or more extra lines on the
bottom of the display containing already scrolled-out text, your VGA BIOS
contains the most common video BIOS bug called "incorrect vertical display
end setting". Adding 0x8000 to the mode ID might fix the problem. Unfortunately,
this must be done manually -- no autodetection mechanisms are available.
History
~~~~~~~
=============== ================================================================
1.0 (??-Nov-95) First version supporting all adapters supported by the old
setup.S + Cirrus Logic 54XX. Present in some 1.3.4? kernels
and then removed due to instability on some machines.
2.0 (28-Jan-96) Rewritten from scratch. Cirrus Logic 64XX support added, almost
everything is configurable, the VESA support should be much more
stable, explicit mode numbering allowed, "scan" implemented etc.
2.1 (30-Jan-96) VESA modes moved to 0x200-0x3ff. Mode selection by resolution
supported. Few bugs fixed. VESA modes are listed prior to
modes supplied by SVGA autodetection as they are more reliable.
CLGD autodetect works better. Doesn't depend on 80x25 being
active when started. Scanning fixed. 80x43 (any VGA) added.
Code cleaned up.
2.2 (01-Feb-96) EGA 80x43 fixed. VESA extended to 0x200-0x4ff (non-standard 02XX
VESA modes work now). Display end bug workaround supported.
Special modes renumbered to allow adding of the "recalculate"
flag, 0xffff and 0xfffe became aliases instead of real IDs.
Screen contents retained during mode changes.
2.3 (15-Mar-96) Changed to work with 1.3.74 kernel.
2.4 (18-Mar-96) Added patches by Hans Lermen fixing a memory overwrite problem
with some boot loaders. Memory management rewritten to reflect
these changes. Unfortunately, screen contents retaining works
only with some loaders now.
Added a Tseng 132x60 mode.
2.5 (19-Mar-96) Fixed a VESA mode scanning bug introduced in 2.4.
2.6 (25-Mar-96) Some VESA BIOS errors not reported -- it fixes error reports on
several cards with broken VESA code (e.g., ATI VGA).
2.7 (09-Apr-96) - Accepted all VESA modes in range 0x100 to 0x7ff, because some
cards use very strange mode numbers.
- Added Realtek VGA modes (thanks to Gonzalo Tornaria).
- Hardware testing order slightly changed, tests based on ROM
contents done as first.
- Added support for special Video7 mode switching functions
(thanks to Tom Vander Aa).
- Added 480-scanline modes (especially useful for notebooks,
original version written by [email protected], patched by
Jeff Chua, rewritten by me).
- Screen store/restore fixed.
2.8 (14-Apr-96) - Previous release was not compilable without CONFIG_VIDEO_SVGA.
- Better recognition of text modes during mode scan.
2.9 (12-May-96) - Ignored VESA modes 0x80 - 0xff (more VESA BIOS bugs!)
2.10(11-Nov-96) - The whole thing made optional.
- Added the CONFIG_VIDEO_400_HACK switch.
- Added the CONFIG_VIDEO_GFX_HACK switch.
- Code cleanup.
2.11(03-May-97) - Yet another cleanup, now including also the documentation.
- Direct testing of SVGA adapters turned off by default, ``scan``
offered explicitly on the prompt line.
- Removed the doc section describing adding of new probing
functions as I try to get rid of _all_ hardware probing here.
2.12(25-May-98) Added support for VESA frame buffer graphics.
2.13(14-May-99) Minor documentation fixes.
=============== ================================================================
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
문서 정보
1-8이 문서는 Martin Mares가 1995년부터 1999년까지 작성한 `Video Mode Selection Support 2.13` 설명서입니다. 표준 문자 모드와 BIOS가 제공하는 특수 모드를 Linux 부팅 단계에서 고르는 방법을 다룹니다.
소개와 모드 매개변수
9-47Video Mode Selection은 비디오 BIOS가 지원하는 여러 특수 모드를 선택합니다. BIOS를 사용하므로 커널 압축 해제가 시작되기 전의 부팅 시점에만 선택할 수 있고, UEFI나 `kexec`가 아니라 BIOS 펌웨어로 부팅한 80X86 시스템에서만 동작합니다.
빠르게 설정하려면 처음에 `vga=ask`를 사용하고 모드 프롬프트에서 `scan`을 입력한 뒤 원하는 모드를 고릅니다. 표시된 4자리 16진수 모드 ID를 기억하고, LILO를 쓴다면 10진수로 변환해 `vga` 매개변수에 지정합니다.
모드는 커널 Makefile의 `SVGA_MODE=...`, LILO 또는 다른 부트로더의 `vga=...`, 표준 Linux 유틸리티 패키지의 `xrandr`로 선택할 수 있습니다.
| 값 | 의미 |
|---|---|
| `NORMAL_VGA` | 모든 디스플레이 어댑터가 제공하는 표준 80x25 모드 |
| `EXTENDED_VGA` | 표준 8픽셀 글꼴 모드. EGA에서는 80x43, VGA에서는 80x50 |
| `ASK_VGA` | 시작할 때 비디오 모드 메뉴 표시 |
| `0..35` | 메뉴 항목 번호. 0..9는 문자 `0`..`9`, 10..35는 `a`..`z`에 해당 |
| `0x....` | 4자리 16진수 비디오 모드 ID. LILO에서는 10진수로 바꾸어 입력 |
메뉴 항목 번호는 커널이 바뀌거나 감지 순서가 달라질 때 변할 수 있으므로 절대 모드 번호를 쓰는 편이 낫습니다. LILO는 16진수를 지원하지 않으므로 `0x....` ID를 직접 쓰지 말고 10진수로 변환해야 합니다.
16비트 모드 ID
107-159비디오 모드 ID는 보통 `0x`로 시작하는 16진수 16비트 값입니다. 메뉴에 없더라도 정확한 값을 알면 직접 입력할 수 있습니다.
| 범위 | 해석 |
|---|---|
| `0x0000..0x00ff` | 메뉴 항목 참조. `0x0000`이 첫 항목이며 부팅·`scan`마다 순서가 바뀔 수 있어 메뉴 밖에서는 사용하지 않습니다. |
| `0x0100..0x017f` | 표준 BIOS 모드. INT 10, function 00에 전달하는 BIOS 비디오 모드 번호에 `0x0100`을 더한 값입니다. |
| `0x0200..0x08ff` | VESA BIOS 모드. VESA 모드 ID에 `0x0100`을 더한 값이며 자동 감지되어 메뉴에 표시됩니다. |
| `0x0900..0x09ff` | Video7 특수 모드. `INT 0x10, AX=0x6f05`로 설정합니다. |
| `0x0f00..0x0fff` | 표준 모드를 수정하는 등의 기법으로 설정하는 특수 모드입니다. |
| `0x1000..0x7fff` | 해상도로 지정하는 `0xRRCC` 형식. RR은 행 수, CC는 열 수입니다. |
| `0xff00..0xffff` | 이전 버전 호환 별칭입니다. |
Video7의 표준 BIOS 예에서는 940=80x43, 941=132x25, 942=132x44, 943=80x60, 944=100x60, 945=132x28입니다. 해상도 ID에서 `0x1950`은 80x25, `0x2b84`는 132x43입니다. 해상도로 가리키는 방식은 비표준 모드에 가장 이식성 있는 참조지만, 자동 스캔을 하지 않으므로 해당 모드가 발견되어 메뉴에 표시되어야 합니다.
| ID | 특수 모드 또는 별칭 |
|---|---|
| `0x0f00` | 표준 80x25. 이미 설정되어 있으면 모드를 다시 설정하지 않음(`FFFF`) |
| `0x0f01` | 8포인트 글꼴 표준 모드: EGA 80x43, VGA 80x50 |
| `0x0f02` | VGA 80x43: 350 스캔라인과 8포인트 글꼴 |
| `0x0f03` | VGA 80x28: 표준 VGA 스캔과 14포인트 글꼴 |
| `0x0f04` | 현재 비디오 모드를 그대로 유지 |
| `0x0f05` | VGA 80x30: 480 스캔라인과 16포인트 글꼴 |
| `0x0f06` | VGA 80x34: 480 스캔라인과 14포인트 글꼴 |
| `0x0f07` | VGA 80x60: 480 스캔라인과 8포인트 글꼴 |
| `0x0f08` | `VIDEO_GFX_HACK`용 그래픽 모드 |
| `0xffff` | `0x0f00`의 호환 별칭 |
| `0xfffe` | `0x0f01`의 호환 별칭 |
모드 ID에 `0x8000`을 더하면 모드 매개변수로 수직 표시 타이밍을 다시 계산합니다. S3 카드나 오래된 Cirrus Logic BIOS에서 화면 끝에 불필요한 줄이 생기는 문제 같은 특정 VGA BIOS 버그를 없애는 데 사용할 수 있습니다.
빌드 옵션
160-172`arch/x86/boot/*`의 빌드 옵션은 커널 Kconfig 도구와 `.config`에서 선택합니다. `VIDEO_GFX_HACK`은 특수 드라이버가 나중에 사용할 그래픽 모드 설정 기법을 포함합니다.
`VIDEO_GFX_HACK`은 그래픽 모드를 포함한 모든 BIOS 모드를 설정하고 BIOS 변수에서 읽는 대신 텍스트 화면 해상도를 강제할 수 있습니다. 동작을 정확히 아는 경우에만 사용하며 모드 번호 `0x0f08`로 활성화합니다.
문제 해결
173-194모드 목록이 틀리거나 메뉴 대신 시스템이 멈추는 등 감지가 실패하면 `Options` 아래 구성 옵션 일부를 끕니다. 그래도 실패하면 커널 매개변수로 모드를 직접 설정해 사용할 수 있습니다. 버그 보고에는 정확히 어떤 일이 일어나는지와 각 구성 스위치가 동작에 어떤 영향을 주는지 적습니다.
M$-DOS에서 Linux를 시작하며 DOS 도구로 모드를 설정한다면 Linux에 `0x0f04`(`leave current settings`)를 지정해야 합니다. 그렇지 않고 비표준 모드를 쓰면 Linux가 자동으로 80x25로 바꿉니다.
확장 모드에서 화면 아래에 이미 스크롤된 텍스트가 한 줄 이상 남으면 VGA BIOS의 흔한 `incorrect vertical display end setting` 버그입니다. 모드 ID에 `0x8000`을 더하면 고칠 수 있지만 자동 감지는 없으므로 수동으로 해야 합니다.
버전 이력
195-250| 버전 | 변경 사항 |
|---|---|
| 1.0 (??-Nov-95) | 구형 `setup.S`가 지원하던 모든 어댑터와 Cirrus Logic 54XX를 처음 지원했습니다. 일부 1.3.4? 커널에 들어갔지만 몇 시스템에서 불안정해 제거되었습니다. |
| 2.0 (28-Jan-96) | 처음부터 다시 작성했습니다. Cirrus Logic 64XX 지원, 광범위한 구성, 안정화한 VESA 지원, 명시적 모드 번호와 `scan`을 추가했습니다. |
| 2.1 (30-Jan-96) | VESA 모드를 `0x200..0x3ff`로 이동하고 해상도 선택을 지원했습니다. 버그, VESA 우선 순서, CLGD 자동 감지, 스캔을 개선하고 모든 VGA용 80x43을 추가했습니다. |
| 2.2 (01-Feb-96) | EGA 80x43을 수정하고 VESA 범위를 `0x200..0x4ff`로 확장했습니다. 표시 끝 버그 우회, 재계산 플래그, 호환 별칭, 화면 내용 보존을 지원했습니다. |
| 2.3 (15-Mar-96) | Linux 1.3.74 커널에서 동작하도록 변경했습니다. |
| 2.4 (18-Mar-96) | 일부 부트로더의 메모리 덮어쓰기를 고친 Hans Lermen 패치를 반영하고 메모리 관리를 다시 썼습니다. 일부 로더에서만 화면 보존이 되며 Tseng 132x60을 추가했습니다. |
| 2.5 (19-Mar-96) | 2.4에서 생긴 VESA 모드 스캔 버그를 수정했습니다. |
| 2.6 (25-Mar-96) | 일부 VESA BIOS 오류를 보고하지 않아 ATI VGA 등 잘못된 VESA 코드를 가진 카드의 오류 보고를 해결했습니다. |
| 2.7 (09-Apr-96) | 이상한 번호를 쓰는 카드를 위해 `0x100..0x7ff`의 모든 VESA 모드를 허용했습니다. Realtek·Video7 모드, ROM 우선 검사, 480 스캔라인 모드를 추가하고 화면 저장·복원을 고쳤습니다. |
| 2.8 (14-Apr-96) | `CONFIG_VIDEO_SVGA` 없이 빌드되지 않던 문제와 스캔 중 텍스트 모드 인식을 고쳤습니다. |
| 2.9 (12-May-96) | 또 다른 VESA BIOS 문제를 피하려고 VESA 모드 `0x80..0xff`를 무시했습니다. |
| 2.10 (11-Nov-96) | 전체 기능을 선택 사항으로 만들고 `CONFIG_VIDEO_400_HACK`, `CONFIG_VIDEO_GFX_HACK`을 추가했으며 코드를 정리했습니다. |
| 2.11 (03-May-97) | 문서를 포함해 다시 정리했습니다. 직접 SVGA 감지를 기본으로 끄고 프롬프트에서 `scan`을 명시적으로 제안했으며 모든 하드웨어 탐색 제거 방향에 따라 새 탐색 함수 설명을 삭제했습니다. |
| 2.12 (25-May-98) | VESA 프레임 버퍼 그래픽 지원을 추가했습니다. |
| 2.13 (14-May-99) | 문서의 사소한 오류를 수정했습니다. |
요약과 해설
svga.rst:1-250이 기능은 커널 압축 해제 전 BIOS 호출을 사용하므로 UEFI나 `kexec` 부팅에는 적용되지 않습니다. 메뉴 순번은 감지 순서에 따라 달라질 수 있어 재현 가능한 설정에는 16비트 절대 모드 ID가 더 적합합니다.
`scan`은 BIOS가 주장하는 모드를 실제로 시험하므로 화면 깜박임과 모니터 이상 동작이 생길 수 있습니다. 표시 끝 버그는 ID에 `0x8000`을 더해 수직 타이밍을 재계산하는 방식으로 우회할 수 있습니다.