diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2010-08-31 20:21:52 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2010-08-31 20:21:52 +0000 |
| commit | c74dea9cc1dbc0350c6321ce3efe07b6e3bdeb01 (patch) | |
| tree | 1e30d7cae23a620df951c1dd22681915be980572 /sys/dev/fb/vesa.c | |
| parent | 95a0a340f4da999669db57b4fdea5afede9b0bd1 (diff) | |
Notes
Diffstat (limited to 'sys/dev/fb/vesa.c')
| -rw-r--r-- | sys/dev/fb/vesa.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/fb/vesa.c b/sys/dev/fb/vesa.c index 5fa4eb42ef2b..68f184b5c8ea 100644 --- a/sys/dev/fb/vesa.c +++ b/sys/dev/fb/vesa.c @@ -799,19 +799,25 @@ vesa_bios_init(void) /* * Shadow video ROM. */ - offs = BIOS_SADDRTOLADDR(vesa_bios_int10); + offs = vesa_bios_int10; if (vesa_shadow_rom) { vbios = x86bios_get_orm(vesa_bios_offs); if (vbios != NULL) { vesa_bios_size = vbios[2] * 512; - vesa_bios = x86bios_alloc(&vesa_bios_offs, - vesa_bios_size, M_WAITOK); - memcpy(vesa_bios, vbios, vesa_bios_size); - offs = offs - VESA_BIOS_OFFSET + vesa_bios_offs; - offs = (X86BIOS_PHYSTOSEG(offs) << 16) + - X86BIOS_PHYSTOOFF(offs); - x86bios_set_intr(0x10, offs); - } else + offs = BIOS_SADDRTOLADDR(vesa_bios_int10); + if (offs > vesa_bios_offs && + offs < vesa_bios_offs + vesa_bios_size) { + vesa_bios = x86bios_alloc(&vesa_bios_offs, + vesa_bios_size, M_WAITOK); + memcpy(vesa_bios, vbios, vesa_bios_size); + offs = offs - VESA_BIOS_OFFSET + vesa_bios_offs; + offs = (X86BIOS_PHYSTOSEG(offs) << 16) + + X86BIOS_PHYSTOOFF(offs); + x86bios_set_intr(0x10, offs); + } else + offs = vesa_bios_int10; + } + if (vesa_bios == NULL) printf("VESA: failed to shadow video ROM\n"); } if (bootverbose) |
