13 struct fb_var_screeninfo fbvar;
14 struct termios kbd_termios;
15 int ret, fbdev, kbdfd;
18 fbdev = open("/dev/fb0", O_RDWR);
24 ret = ioctl(fbdev, FBIOGET_VSCREENINFO, &fbvar);
26 perror("FBIOGET_VSCREENINFO ioctl");
30 if (fbvar.yoffset != 0) {
31 printf("fixing yoffset.. ");
33 ret = ioctl(fbdev, FBIOPAN_DISPLAY, &fbvar);
35 perror("ioctl FBIOPAN_DISPLAY");
43 tios_f = fopen("/tmp/pico_tios", "rb");
45 kbdfd = open("/dev/tty", O_RDWR);
47 perror("open /dev/tty");
51 if (fread(&kbd_termios, sizeof(kbd_termios), 1, tios_f) == 1) {
52 if (ioctl(kbdfd, KDSETMODE, KD_TEXT) == -1)
53 perror("KDSETMODE KD_TEXT");
55 printf("restoring termios.. ");
56 if (tcsetattr(kbdfd, TCSAFLUSH, &kbd_termios) == -1)