Documentation/fb/vesafb.rst GitHub 원문 ↗

Linux 6.18.37 · Frame Buffer

vesafb - Generic graphic framebuffer driver

VBE 2.0 부팅 mode 번호, scrolling, palette와 MTRR 설정의 전문 번역입니다.

Source pathDocumentation/fb/vesafb.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

vesafb.rst:1-190

`vesafb`는 부팅 real mode에서 VBE 2.0 BIOS가 만든 linear framebuffer를 그대로 사용하므로 범용성이 높지만 mode·timing을 나중에 바꿀 수 없고 X server가 console mode를 복원해야 합니다.

vesafb 결정 시점
VESA mode 번호 선택Linux mode는 `+0x200`BIOS real-mode calllinear framebuffer 생성`/dev/fb0` 사용부팅 후 mode 변경 불가

모든 핵심 선택은 protected mode 진입 전에 끝납니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ===========================================
2 vesafb - Generic graphic framebuffer driver
3 ===========================================
4
5 This is a generic driver for a graphic framebuffer on intel boxes.
6
7 The idea is simple: Turn on graphics mode at boot time with the help
8 of the BIOS, and use this as framebuffer device /dev/fb0, like the m68k
9 (and other) ports do.
10
11 This means we decide at boot time whenever we want to run in text or
12 graphics mode. Switching mode later on (in protected mode) is
13 impossible; BIOS calls work in real mode only. VESA BIOS Extensions
14 Version 2.0 are required, because we need a linear frame buffer.
15
16 Advantages:
17
18 * It provides a nice large console (128 cols + 48 lines with 1024x768)
19 without using tiny, unreadable fonts.
20 * You can run XF68_FBDev on top of /dev/fb0 (=> non-accelerated X11
21 support for every VBE 2.0 compliant graphics board).
22 * Most important: boot logo :-)
23
24 Disadvantages:
25
26 * graphic mode is slower than text mode...
27
28
29 How to use it?
30 ==============
31
32 Switching modes is done using the vga=... boot parameter. Read
33 Documentation/admin-guide/svga.rst for details.
34
35 You should compile in both vgacon (for text mode) and vesafb (for
36 graphics mode). Which of them takes over the console depends on
37 whenever the specified mode is text or graphics.
38
39 The graphic modes are NOT in the list which you get if you boot with
40 vga=ask and hit return. The mode you wish to use is derived from the
41 VESA mode number. Here are those VESA mode numbers:
42
43 ====== ======= ======= ======== =========
44 colors 640x480 800x600 1024x768 1280x1024
45 ====== ======= ======= ======== =========
46 256 0x101 0x103 0x105 0x107
47 32k 0x110 0x113 0x116 0x119
48 64k 0x111 0x114 0x117 0x11A
49 16M 0x112 0x115 0x118 0x11B
50 ====== ======= ======= ======== =========
51
52
53 The video mode number of the Linux kernel is the VESA mode number plus
54 0x200:
55
56 Linux_kernel_mode_number = VESA_mode_number + 0x200
57
58 So the table for the Kernel mode numbers are:
59
60 ====== ======= ======= ======== =========
61 colors 640x480 800x600 1024x768 1280x1024
62 ====== ======= ======= ======== =========
63 256 0x301 0x303 0x305 0x307
64 32k 0x310 0x313 0x316 0x319
65 64k 0x311 0x314 0x317 0x31A
66 16M 0x312 0x315 0x318 0x31B
67 ====== ======= ======= ======== =========
68
69 To enable one of those modes you have to specify "vga=ask" in the
70 lilo.conf file and rerun LILO. Then you can type in the desired
71 mode at the "vga=ask" prompt. For example if you like to use
72 1024x768x256 colors you have to say "305" at this prompt.
73
74 If this does not work, this might be because your BIOS does not support
75 linear framebuffers or because it does not support this mode at all.
76 Even if your board does, it might be the BIOS which does not. VESA BIOS
77 Extensions v2.0 are required, 1.2 is NOT sufficient. You will get a
78 "bad mode number" message if something goes wrong.
79
80 1. Note: LILO cannot handle hex, for booting directly with
81 "vga=mode-number" you have to transform the numbers to decimal.
82 2. Note: Some newer versions of LILO appear to work with those hex values,
83 if you set the 0x in front of the numbers.
84
85 X11
86 ===
87
88 XF68_FBDev should work just fine, but it is non-accelerated. Running
89 another (accelerated) X-Server like XF86_SVGA might or might not work.
90 It depends on X-Server and graphics board.
91
92 The X-Server must restore the video mode correctly, else you end up
93 with a broken console (and vesafb cannot do anything about this).
94
95
96 Refresh rates
97 =============
98
99 There is no way to change the vesafb video mode and/or timings after
100 booting linux. If you are not happy with the 60 Hz refresh rate, you
101 have these options:
102
103 * configure and load the DOS-Tools for the graphics board (if
104 available) and boot linux with loadlin.
105 * use a native driver (matroxfb/atyfb) instead if vesafb. If none
106 is available, write a new one!
107 * VBE 3.0 might work too. I have neither a gfx board with VBE 3.0
108 support nor the specs, so I have not checked this yet.
109
110
111 Configuration
112 =============
113
114 The VESA BIOS provides protected mode interface for changing
115 some parameters. vesafb can use it for palette changes and
116 to pan the display. It is turned off by default because it
117 seems not to work with some BIOS versions, but there are options
118 to turn it on.
119
120 You can pass options to vesafb using "video=vesafb:option" on
121 the kernel command line. Multiple options should be separated
122 by comma, like this: "video=vesafb:ypan,inverse"
123
124 Accepted options:
125
126 inverse use inverse color map
127
128 ========= ======================================================================
129 ypan enable display panning using the VESA protected mode
130 interface. The visible screen is just a window of the
131 video memory, console scrolling is done by changing the
132 start of the window.
133
134 pro:
135
136 * scrolling (fullscreen) is fast, because there is
137 no need to copy around data.
138
139 kontra:
140
141 * scrolling only parts of the screen causes some
142 ugly flicker effects (boot logo flickers for
143 example).
144
145 ywrap Same as ypan, but assumes your gfx board can wrap-around
146 the video memory (i.e. starts reading from top if it
147 reaches the end of video memory). Faster than ypan.
148
149 redraw Scroll by redrawing the affected part of the screen, this
150 is the safe (and slow) default.
151
152
153 vgapal Use the standard vga registers for palette changes.
154 This is the default.
155 pmipal Use the protected mode interface for palette changes.
156
157 mtrr:n Setup memory type range registers for the vesafb framebuffer
158 where n:
159
160 - 0 - disabled (equivalent to nomtrr) (default)
161 - 1 - uncachable
162 - 2 - write-back
163 - 3 - write-combining
164 - 4 - write-through
165
166 If you see the following in dmesg, choose the type that matches the
167 old one. In this example, use "mtrr:2".
168 ...
169 mtrr: type mismatch for e0000000,8000000 old: write-back new:
170 write-combining
171 ...
172
173 nomtrr disable mtrr
174
175 vremap:n
176 Remap 'n' MiB of video RAM. If 0 or not specified, remap memory
177 according to video mode. (2.5.66 patch/idea by Antonino Daplas
178 reversed to give override possibility (allocate more fb memory
179 than the kernel would) to 2.4 by [email protected])
180
181 vtotal:n If the video BIOS of your card incorrectly determines the total
182 amount of video RAM, use this option to override the BIOS (in MiB).
183 ========= ======================================================================
184
185 Have fun!
186
187 Gerd Knorr <[email protected]>
188
189 Minor (mostly typo) changes
190 by Nico Schmoigl <[email protected]>
191

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

부팅 시 BIOS가 만드는 선형 framebuffer

1-28

`vesafb`는 Intel 시스템의 범용 그래픽 framebuffer 드라이버입니다. 부팅 때 BIOS로 graphics mode를 켜고 m68k 등 다른 port처럼 이를 `/dev/fb0` framebuffer로 사용합니다.

text mode와 graphics mode 가운데 무엇을 쓸지 부팅 때 결정합니다. protected mode에서는 BIOS call을 할 수 없고 real mode에서만 가능하므로 나중에 mode를 바꿀 수 없습니다. linear framebuffer가 필요하므로 VESA BIOS Extensions 2.0이 필수입니다.

장점은 1024x768에서 128열 x 48행 같은 큰 console을 작은 글꼴 없이 쓸 수 있고, `/dev/fb0` 위에서 `XF68_FBDev`를 실행해 모든 VBE 2.0 compliant 보드에서 비가속 X11을 사용할 수 있으며 boot logo도 표시할 수 있다는 점입니다. 단점은 graphics mode가 text mode보다 느리다는 것입니다.

vesafb 특성
항목내용
초기화부팅 real mode에서 BIOS가 graphics mode 설정
장치`/dev/fb0` linear framebuffer
요구 사항VESA BIOS Extensions 2.0
장점큰 console, 범용 비가속 X11, boot logo
단점text mode보다 느리고 부팅 후 mode 변경 불가

===========================================
vesafb - Generic graphic framebuffer driver
===========================================

This is a generic driver for a graphic framebuffer on intel boxes.

The idea is simple:  Turn on graphics mode at boot time with the help
of the BIOS, and use this as framebuffer device /dev/fb0, like the m68k
(and other) ports do.

This means we decide at boot time whenever we want to run in text or
graphics mode.  Switching mode later on (in protected mode) is
impossible; BIOS calls work in real mode only.  VESA BIOS Extensions
Version 2.0 are required, because we need a linear frame buffer.

Advantages:

 * It provides a nice large console (128 cols + 48 lines with 1024x768)
   without using tiny, unreadable fonts.
 * You can run XF68_FBDev on top of /dev/fb0 (=> non-accelerated X11
   support for every VBE 2.0 compliant graphics board).
 * Most important: boot logo :-)

Disadvantages:

 * graphic mode is slower than text mode...

VESA와 Linux kernel mode 번호

29-84

mode 전환은 `vga=...` 부팅 매개변수로 하며 자세한 내용은 `Documentation/admin-guide/svga.rst`를 참고합니다. text mode용 `vgacon`과 graphics mode용 `vesafb`를 모두 내장하고 지정 mode가 text인지 graphics인지에 따라 console을 맡깁니다.

graphics mode는 `vga=ask`로 부팅해 Enter를 눌렀을 때 나오는 목록에는 없습니다. 640x480, 800x600, 1024x768, 1280x1024 각각의 VESA mode는 256색에서 `0x101/103/105/107`, 32k색에서 `0x110/113/116/119`, 64k색에서 `0x111/114/117/11A`, 16M색에서 `0x112/115/118/11B`입니다.

Linux kernel mode number는 `Linux_kernel_mode_number = VESA_mode_number + 0x200`으로 계산합니다. 따라서 같은 표는 256색 `0x301/303/305/307`, 32k색 `0x310/313/316/319`, 64k색 `0x311/314/317/31A`, 16M색 `0x312/315/318/31B`가 됩니다.

`lilo.conf`에 `vga=ask`를 넣고 LILO를 다시 실행한 뒤 prompt에서 원하는 mode를 입력합니다. 1024x768x256은 `305`입니다. 실패한다면 BIOS가 linear framebuffer나 해당 mode를 지원하지 않는 경우입니다. 보드가 지원해도 BIOS가 지원하지 않을 수 있고 VBE 1.2는 충분하지 않습니다. 실패 시 `bad mode number`가 나옵니다.

LILO는 원칙적으로 16진수를 처리하지 못하므로 `vga=mode-number` 직접 부팅에는 10진수로 바꿔야 합니다. 일부 최신 LILO는 `0x` 접두사를 붙인 16진수도 처리합니다.

vesafb mode 번호 계산
색상VESA 640/800/1024/1280Linux kernel 640/800/1024/1280
256101 / 103 / 105 / 107301 / 303 / 305 / 307
32k110 / 113 / 116 / 119310 / 313 / 316 / 319
64k111 / 114 / 117 / 11A311 / 314 / 317 / 31A
16M112 / 115 / 118 / 11B312 / 315 / 318 / 31B

표의 값은 16진수이며 Linux 값은 VESA 값에 0x200을 더합니다.

How to use it?
==============

Switching modes is done using the vga=... boot parameter.  Read
Documentation/admin-guide/svga.rst for details.

You should compile in both vgacon (for text mode) and vesafb (for
graphics mode). Which of them takes over the console depends on
whenever the specified mode is text or graphics.

The graphic modes are NOT in the list which you get if you boot with
vga=ask and hit return. The mode you wish to use is derived from the
VESA mode number. Here are those VESA mode numbers:

====== =======  =======  ======== =========
colors 640x480  800x600  1024x768 1280x1024
====== =======  =======  ======== =========
256    0x101    0x103    0x105    0x107
32k    0x110    0x113    0x116    0x119
64k    0x111    0x114    0x117    0x11A
16M    0x112    0x115    0x118    0x11B
====== =======  =======  ======== =========


The video mode number of the Linux kernel is the VESA mode number plus
0x200:

 Linux_kernel_mode_number = VESA_mode_number + 0x200

So the table for the Kernel mode numbers are:

====== =======  =======  ======== =========
colors 640x480  800x600  1024x768 1280x1024
====== =======  =======  ======== =========
256    0x301    0x303    0x305    0x307
32k    0x310    0x313    0x316    0x319
64k    0x311    0x314    0x317    0x31A
16M    0x312    0x315    0x318    0x31B
====== =======  =======  ======== =========

To enable one of those modes you have to specify "vga=ask" in the
lilo.conf file and rerun LILO. Then you can type in the desired
mode at the "vga=ask" prompt. For example if you like to use
1024x768x256 colors you have to say "305" at this prompt.

If this does not work, this might be because your BIOS does not support
linear framebuffers or because it does not support this mode at all.
Even if your board does, it might be the BIOS which does not.  VESA BIOS
Extensions v2.0 are required, 1.2 is NOT sufficient.  You will get a
"bad mode number" message if something goes wrong.

1. Note: LILO cannot handle hex, for booting directly with
   "vga=mode-number" you have to transform the numbers to decimal.
2. Note: Some newer versions of LILO appear to work with those hex values,
   if you set the 0x in front of the numbers.

X11 mode 복원과 refresh rate

85-110

`XF68_FBDev`는 정상 동작하지만 비가속입니다. `XF86_SVGA` 같은 다른 가속 X server의 동작 여부는 server와 그래픽 보드 조합에 달려 있습니다.

X server는 video mode를 올바르게 복원해야 합니다. 그렇지 않으면 console이 깨지고 `vesafb`는 이를 복구할 수 없습니다.

Linux 부팅 뒤에는 `vesafb` video mode나 timing을 바꿀 수 없습니다. 기본 60 Hz가 마음에 들지 않으면 그래픽 보드용 DOS tool을 구성해 `loadlin`으로 Linux를 부팅하거나, `vesafb` 대신 `matroxfb`·`atyfb` 같은 native driver를 쓰거나 새 드라이버를 작성해야 합니다.

VBE 3.0도 refresh 설정에 사용할 가능성이 있지만 원문 작성자는 지원 보드와 사양이 없어 시험하지 못했습니다.

vesafb X11과 refresh 선택
BIOS가 부팅 때 60 Hz mode 설정`XF68_FBDev`는 비가속으로 사용X server가 console mode를 정확히 복원다른 refresh가 필요하면 DOS tool + `loadlin`또는 `matroxfb`/`atyfb` 같은 native driver 사용

부팅 후 변경이 불가능하므로 초기 mode 또는 native driver를 선택해야 합니다.

X11
===

XF68_FBDev should work just fine, but it is non-accelerated.  Running
another (accelerated) X-Server like XF86_SVGA might or might not work.
It depends on X-Server and graphics board.

The X-Server must restore the video mode correctly, else you end up
with a broken console (and vesafb cannot do anything about this).


Refresh rates
=============

There is no way to change the vesafb video mode and/or timings after
booting linux.  If you are not happy with the 60 Hz refresh rate, you
have these options:

 * configure and load the DOS-Tools for the graphics board (if
   available) and boot linux with loadlin.
 * use a native driver (matroxfb/atyfb) instead if vesafb.  If none
   is available, write a new one!
 * VBE 3.0 might work too.  I have neither a gfx board with VBE 3.0
   support nor the specs, so I have not checked this yet.

protected-mode scrolling 옵션

111-151

VESA BIOS는 일부 매개변수를 바꾸는 protected-mode interface를 제공합니다. `vesafb`는 이를 palette 변경과 display panning에 사용할 수 있지만 일부 BIOS에서 동작하지 않아 기본으로 꺼져 있습니다.

커널 명령행은 `video=vesafb:option` 형식이고 여러 옵션은 `video=vesafb:ypan,inverse`처럼 쉼표로 구분합니다. `inverse`는 inverse color map을 사용합니다.

`ypan`은 visible screen을 video memory의 창으로 보고 시작 위치를 바꿔 console을 scroll합니다. full-screen scrolling은 data copy가 없어 빠르지만 화면 일부만 scroll하면 boot logo flicker 같은 보기 흉한 깜박임이 생깁니다.

`ywrap`은 `ypan`과 같지만 video memory 끝에 닿으면 맨 위부터 다시 읽는 wraparound를 보드가 지원한다고 가정하며 더 빠릅니다. `redraw`는 영향 영역을 다시 그리는 안전하지만 느린 기본값입니다.

vesafb scrolling 방식
옵션방식특성
`ypan`visible window 시작 위치 이동전체 화면은 빠르나 부분 scroll flicker
`ywrap`video memory wraparound`ypan`보다 빠름
`redraw`변경 영역 다시 그리기안전하고 느린 기본값
`inverse`inverse color map표시 색상 반전

Configuration
=============

The VESA BIOS provides protected mode interface for changing
some parameters.  vesafb can use it for palette changes and
to pan the display.  It is turned off by default because it
seems not to work with some BIOS versions, but there are options
to turn it on.

You can pass options to vesafb using "video=vesafb:option" on
the kernel command line.  Multiple options should be separated
by comma, like this: "video=vesafb:ypan,inverse"

Accepted options:

inverse        use inverse color map

========= ======================================================================
ypan          enable display panning using the VESA protected mode
          interface.  The visible screen is just a window of the
          video memory, console scrolling is done by changing the
          start of the window.

          pro:

                * scrolling (fullscreen) is fast, because there is
                  no need to copy around data.

          kontra:

                * scrolling only parts of the screen causes some
                  ugly flicker effects (boot logo flickers for
                  example).

ywrap          Same as ypan, but assumes your gfx board can wrap-around
          the video memory (i.e. starts reading from top if it
          reaches the end of video memory).  Faster than ypan.

redraw          Scroll by redrawing the affected part of the screen, this
          is the safe (and slow) default.

palette·MTRR·video RAM override

152-190

`vgapal`은 palette 변경에 표준 VGA register를 사용하며 기본값입니다. `pmipal`은 protected-mode interface를 사용합니다.

`mtrr:n`은 vesafb framebuffer의 memory type range register를 설정합니다. 0은 비활성화로 `nomtrr`와 같고 기본값입니다. 1은 uncachable, 2는 write-back, 3은 write-combining, 4는 write-through입니다.

dmesg에 `mtrr: type mismatch for e0000000,8000000 old: write-back new: write-combining` 같은 메시지가 나오면 기존 type과 같은 값을 선택합니다. 이 예에서는 `mtrr:2`입니다. `nomtrr`는 MTRR을 끕니다.

`vremap:n`은 video RAM n MiB를 remap합니다. 0이거나 생략하면 video mode에 맞춰 remap합니다. 이 동작은 Antonino Daplas의 2.5.66 patch/idea를 바탕으로, kernel 계산보다 많은 framebuffer memory를 할당할 수 있도록 `[email protected]`가 2.4에 override 가능하게 역적용했습니다.

`vtotal:n`은 Video BIOS가 총 video RAM을 잘못 판단할 때 MiB 단위로 덮어씁니다. 원저자는 Gerd Knorr이고 Nico Schmoigl이 주로 오탈자를 수정했습니다.

vesafb memory와 palette 옵션
옵션효과
`vgapal`기본표준 VGA palette register
`pmipal`선택protected-mode palette
`mtrr:0`disabled`nomtrr`, 기본
`mtrr:1/2/3/4`UC/WB/WC/WT기존 MTRR type과 일치 필요
`vremap:n`MiBvideo RAM remap
`vtotal:n`MiBBIOS 총 VRAM 값 override


vgapal          Use the standard vga registers for palette changes.
          This is the default.
pmipal    Use the protected mode interface for palette changes.

mtrr:n          Setup memory type range registers for the vesafb framebuffer
          where n:

              - 0 - disabled (equivalent to nomtrr) (default)
              - 1 - uncachable
              - 2 - write-back
              - 3 - write-combining
              - 4 - write-through

          If you see the following in dmesg, choose the type that matches the
          old one. In this example, use "mtrr:2".
...
mtrr:     type mismatch for e0000000,8000000 old: write-back new:
          write-combining
...

nomtrr    disable mtrr

vremap:n
          Remap 'n' MiB of video RAM. If 0 or not specified, remap memory
          according to video mode. (2.5.66 patch/idea by Antonino Daplas
          reversed to give override possibility (allocate more fb memory
          than the kernel would) to 2.4 by [email protected])

vtotal:n  If the video BIOS of your card incorrectly determines the total
          amount of video RAM, use this option to override the BIOS (in MiB).
========= ======================================================================

Have fun!

Gerd Knorr <[email protected]>

Minor (mostly typo) changes
by Nico Schmoigl <[email protected]>