Commit d9b263528e01bfbaf716b51f38606b3dfe5ac1e9

Authored by Matthew Garrett
Committed by H. Peter Anvin
1 parent 156171c71a

x86, setup: Store the boot cursor state

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>

Showing 2 changed files with 10 additions and 1 deletions Side-by-side Diff

arch/x86/boot/video.c
... ... @@ -27,6 +27,12 @@
27 27  
28 28 boot_params.screen_info.orig_x = oreg.dl;
29 29 boot_params.screen_info.orig_y = oreg.dh;
  30 +
  31 + if (oreg.ch & 0x20)
  32 + boot_params.screen_info.flags |= VIDEO_FLAGS_NOCURSOR;
  33 +
  34 + if ((oreg.ch & 0x1f) > (oreg.cl & 0x1f))
  35 + boot_params.screen_info.flags |= VIDEO_FLAGS_NOCURSOR;
30 36 }
31 37  
32 38 static void store_video_mode(void)
include/linux/screen_info.h
... ... @@ -14,7 +14,8 @@
14 14 __u16 orig_video_page; /* 0x04 */
15 15 __u8 orig_video_mode; /* 0x06 */
16 16 __u8 orig_video_cols; /* 0x07 */
17   - __u16 unused2; /* 0x08 */
  17 + __u8 flags; /* 0x08 */
  18 + __u8 unused2; /* 0x09 */
18 19 __u16 orig_video_ega_bx;/* 0x0a */
19 20 __u16 unused3; /* 0x0c */
20 21 __u8 orig_video_lines; /* 0x0e */
... ... @@ -64,6 +65,8 @@
64 65 #define VIDEO_TYPE_PMAC 0x60 /* PowerMacintosh frame buffer. */
65 66  
66 67 #define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */
  68 +
  69 +#define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */
67 70  
68 71 #ifdef __KERNEL__
69 72 extern struct screen_info screen_info;