Skip to content

Commit

Permalink
x86, setup: Store the boot cursor state
Browse files Browse the repository at this point in the history
Add a field to store the boot cursor state and implement this for VGA on
x86. This can then be used to set the default policy for the boot console.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
LKML-Reference: <1258142222-16092-1-git-send-email-mjg@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
Matthew Garrett authored and H. Peter Anvin committed Nov 13, 2009
1 parent 156171c commit d9b2635
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions arch/x86/boot/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ static void store_cursor_position(void)

boot_params.screen_info.orig_x = oreg.dl;
boot_params.screen_info.orig_y = oreg.dh;

if (oreg.ch & 0x20)
boot_params.screen_info.flags |= VIDEO_FLAGS_NOCURSOR;

if ((oreg.ch & 0x1f) > (oreg.cl & 0x1f))
boot_params.screen_info.flags |= VIDEO_FLAGS_NOCURSOR;
}

static void store_video_mode(void)
Expand Down
5 changes: 4 additions & 1 deletion include/linux/screen_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ struct screen_info {
__u16 orig_video_page; /* 0x04 */
__u8 orig_video_mode; /* 0x06 */
__u8 orig_video_cols; /* 0x07 */
__u16 unused2; /* 0x08 */
__u8 flags; /* 0x08 */
__u8 unused2; /* 0x09 */
__u16 orig_video_ega_bx;/* 0x0a */
__u16 unused3; /* 0x0c */
__u8 orig_video_lines; /* 0x0e */
Expand Down Expand Up @@ -65,6 +66,8 @@ struct screen_info {

#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */

#define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */

#ifdef __KERNEL__
extern struct screen_info screen_info;

Expand Down

0 comments on commit d9b2635

Please sign in to comment.