Merge mainline into yeeloongfw

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-06-30 02:30:05 +02:00
commit b7e79e8a6a
155 changed files with 5949 additions and 2562 deletions

View file

@ -20,6 +20,7 @@
#include <grub/i386/vga_common.h>
#include <grub/i386/io.h>
#include <grub/types.h>
#include <grub/vga.h>
#define COLS 80
#define ROWS 25
@ -28,15 +29,6 @@ static int grub_curr_x, grub_curr_y;
#define VGA_TEXT_SCREEN 0xb8000
#define CRTC_ADDR_PORT 0x3D4
#define CRTC_DATA_PORT 0x3D5
#define CRTC_CURSOR 0x0a
#define CRTC_CURSOR_ADDR_HIGH 0x0e
#define CRTC_CURSOR_ADDR_LOW 0x0f
#define CRTC_CURSOR_DISABLE (1 << 5)
static void
screen_write_char (int x, int y, short c)
{
@ -53,10 +45,8 @@ static void
update_cursor (void)
{
unsigned int pos = grub_curr_y * COLS + grub_curr_x;
grub_outb (CRTC_CURSOR_ADDR_HIGH, CRTC_ADDR_PORT);
grub_outb (pos >> 8, CRTC_DATA_PORT);
grub_outb (CRTC_CURSOR_ADDR_LOW, CRTC_ADDR_PORT);
grub_outb (pos & 0xFF, CRTC_DATA_PORT);
grub_vga_cr_write (pos >> 8, GRUB_VGA_CR_CURSOR_ADDR_HIGH);
grub_vga_cr_write (pos & 0xFF, GRUB_VGA_CR_CURSOR_ADDR_LOW);
}
static void
@ -68,9 +58,11 @@ inc_y (void)
else
{
int x, y;
for (y = 0; y < ROWS; y++)
for (y = 0; y < ROWS - 1; y++)
for (x = 0; x < COLS; x++)
screen_write_char (x, y, screen_read_char (x, y + 1));
for (x = 0; x < COLS; x++)
screen_write_char (x, ROWS - 1, ' ' | (grub_console_cur_color << 8));
}
}
@ -134,12 +126,13 @@ static void
grub_vga_text_setcursor (int on)
{
grub_uint8_t old;
grub_outb (CRTC_CURSOR, CRTC_ADDR_PORT);
old = grub_inb (CRTC_DATA_PORT);
old = grub_vga_cr_read (GRUB_VGA_CR_CURSOR_START);
if (on)
grub_outb (old & ~CRTC_CURSOR_DISABLE, CRTC_DATA_PORT);
grub_vga_cr_write (old & ~GRUB_VGA_CR_CURSOR_START_DISABLE,
GRUB_VGA_CR_CURSOR_START);
else
grub_outb (old | CRTC_CURSOR_DISABLE, CRTC_DATA_PORT);
grub_vga_cr_write (old | GRUB_VGA_CR_CURSOR_START_DISABLE,
GRUB_VGA_CR_CURSOR_START);
}
static grub_err_t