x86/boot: simplify mode_table

There's no point in writing 80x25 text mode information via multiple
insns all storing immediate values. The data can simply be included
first thing in the vga_modes table, allowing the already present
REP MOVSB to take care of everything in one go.

While touching this also correct a related but stale comment.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
This commit is contained in:
Jan Beulich committed 2022-04-07 08:34:07 +02:00
1 parent 3d486def50
commit 3b91082bb8
1 file changed
+4 -8
+4 -8
View File
@@ -656,8 +656,9 @@ outidx: outb %al, %dx
# Build the table of video modes (stored after the setup.S code at the
# `modelist' label. Each video mode record looks like:
# .word MODE-ID (our special mode ID (see above))
# .byte rows (number of rows)
# .byte columns (number of columns)
# .word rows (number of rows)
# .word columns (number of columns)
# .word 0 (color depth; gfx modes only)
# Returns address of the end of the table in DI, the end is marked
# with a ASK_VGA ID.
mode_table:
@@ -666,12 +667,6 @@ mode_table:
jnz mtab1
leaw modelist, %di # Store standard modes:
movw $VIDEO_80x25,(%di) # The 80x25 mode (ALL)
movw $0x50,2(%di)
movw $0x19,4(%di)
movw $0x00,6(%di)
addw $8,%di
leaw bootsym(vga_modes), %si # All modes for std VGA
movw $vga_modes_end-vga_modes, %cx
rep movsb
@@ -685,6 +680,7 @@ ret0: ret
# Modes usable on all standard VGAs
vga_modes:
.word VIDEO_80x25, 0x50,0x19,0 # 80x25
.word VIDEO_80x50, 0x50,0x32,0 # 80x50
.word VIDEO_80x43, 0x50,0x2b,0 # 80x43
.word VIDEO_80x28, 0x50,0x1c,0 # 80x28
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.