Add VBE PM interface

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-09-16 00:37:30 +02:00
parent b09cf083a0
commit 0b37526a5a
3 changed files with 32 additions and 4 deletions

View file

@ -289,10 +289,9 @@ fill_vbe_info (struct multiboot_info *mbi, grub_uint8_t *ptrorig,
ptrorig += sizeof (struct grub_vbe_mode_info_block);
ptrdest += sizeof (struct grub_vbe_mode_info_block);
/* FIXME: retrieve those. */
mbi->vbe_interface_seg = 0;
mbi->vbe_interface_off = 0;
mbi->vbe_interface_len = 0;
grub_vbe_bios_get_pm_interface (&mbi->vbe_interface_seg,
&mbi->vbe_interface_off,
&mbi->vbe_interface_len);
mbi->flags |= MULTIBOOT_INFO_VBE_INFO;

View file

@ -248,6 +248,32 @@ grub_vbe_bios_get_display_start (grub_uint32_t *x,
return regs.eax & 0xffff;
}
/* Call VESA BIOS 0x4f0a. */
grub_vbe_status_t
grub_vbe_bios_get_pm_interface (grub_uint16_t *segment, grub_uint16_t *offset,
grub_uint16_t *length)
{
struct grub_bios_int_registers regs;
regs.eax = 0x4f0a;
regs.ebx = 0x0000;
regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
grub_bios_interrupt (0x10, &regs);
if ((regs.eax & 0xffff) != GRUB_VBE_STATUS_OK)
{
*segment = 0;
*offset = 0;
*length = 0;
}
*segment = regs.es & 0xffff;
*offset = regs.edi & 0xffff;
*length = regs.ecx & 0xffff;
return regs.eax & 0xffff;
}
grub_err_t
grub_vbe_probe (struct grub_vbe_info_block *info_block)
{

View file

@ -209,6 +209,9 @@ grub_err_t grub_vbe_set_video_mode (grub_uint32_t mode,
grub_err_t grub_vbe_get_video_mode (grub_uint32_t *mode);
grub_err_t grub_vbe_get_video_mode_info (grub_uint32_t mode,
struct grub_vbe_mode_info_block *mode_info);
grub_vbe_status_t
grub_vbe_bios_get_pm_interface (grub_uint16_t *seg, grub_uint16_t *offset,
grub_uint16_t *length);
#endif /* ! GRUB_VBE_MACHINE_HEADER */