Your message dated Sat, 30 May 2009 11:54:11 +0000
with message-id <[email protected]>
and subject line Bug#495131: fixed in read-edid 2.0.0-1
has caused the Debian Bug report #495131,
regarding read-edid: Switch to use lib86 instead of embedded LRMI
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
495131: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495131
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: read-edid
Source-Version: 1.4.1-2.1
Severity: important
Tags: patch security

Hi,

This packages has embedded copies of lrmi, please switch to use libx86
instead. As a side effect allows this package to build on any-amd64
and any-i386 (including hurd and kfreebsd systems).

Attached a patch fixing this, you might need to run “autoreconf -f -i”,
after applying it.

regards,
guillem
>From c47f361e3aeb816c68dfa2e22a8a24a509a7bbb3 Mon Sep 17 00:00:00 2001
From: Guillem Jover <[email protected]>
Date: Thu, 14 Aug 2008 21:22:10 +0300
Subject: [PATCH] Use external libx86 instead of embedded lrmi

---
 COPYING        |    5 -
 LRMI           |   19 --
 Makefile.am    |    6 +-
 configure.in   |    4 +-
 debian/control |    4 +-
 get-edid.c     |    2 +-
 lrmi.c         |  883 --------------------------------------------------------
 lrmi.h         |   72 -----
 8 files changed, 9 insertions(+), 986 deletions(-)
 delete mode 100644 LRMI
 delete mode 100644 lrmi.c
 delete mode 100644 lrmi.h

diff --git a/COPYING b/COPYING
index 080749e..b4f7582 100644
--- a/COPYING
+++ b/COPYING
@@ -2,11 +2,6 @@ read-edid 1.4.1
 
 $Date: 2001/06/03 21:57:51 $
 
-The lrmi.* files were written by Josh Vanderhoof. They are included
-here merely for convenience and are not strictly part of the read-edid
-package. See the LRMI file and their source code for license.
-
-
 This package is distributed under the license bellow:
 
 
diff --git a/LRMI b/LRMI
deleted file mode 100644
index 4fc7035..0000000
--- a/LRMI
+++ /dev/null
@@ -1,19 +0,0 @@
-The lrmi.c and lrmi.h files are from lrmi-0.6m in the svgalib 1.4.1
-distribution. I can't seem to be able to contact Josh Vanderhoof, and
-his homepage is dead. -- John Fremlin ([email protected]).
-
-From svgalib:
-
-This is a modified version of Josh Vanderhoof's lrmi-0.5 package
-The original is available at http://www.planet.net/pjoshv/
-
-
-
-vbetest - show available modes, and test a mode
-
-mode3 - set mode using vesa bios. It can usually restore text mode after
-        svgalib leaves a non-working text-mode.
-
-vga_reset - call real mode c000:0003, which should be the video card's
-	initialization routine. Should work in some cases when mode3 fails to
-	restore text mode.
diff --git a/Makefile.am b/Makefile.am
index 11b26fc..bd28fa6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,10 @@
 sbin_PROGRAMS = get-edid parse-edid
 
-get_edid_SOURCES = get-edid.c lrmi.c
+get_edid_SOURCES = get-edid.c
+get_edid_LDADD = -lx86
 parse_edid_SOURCES = parse-edid.c
-noinst_HEADERS = lrmi.h
 
-EXTRA_DIST = bootstrap LRMI
+EXTRA_DIST = bootstrap
 
 read-edid: all
 	./get-edid | ./parse-edid
diff --git a/configure.in b/configure.in
index 67006d3..d9e2522 100644
--- a/configure.in
+++ b/configure.in
@@ -8,6 +8,8 @@ dnl Checks for programs
 
 AC_PROG_CC
 
+AC_CHECK_HEADER([libx86.h], [], [AC_MSG_ERROR([cannot find libx86.h header])])
+
 dnl Simple, huh?
 
-AC_OUTPUT([Makefile])
\ No newline at end of file
+AC_OUTPUT([Makefile])
diff --git a/debian/control b/debian/control
index 37bf2e2..48223bb 100644
--- a/debian/control
+++ b/debian/control
@@ -2,11 +2,11 @@ Source: read-edid
 Section: utils
 Priority: optional
 Maintainer: Branden Robinson <[email protected]>
-Build-Depends: debhelper (>= 4.0), texinfo
+Build-Depends: debhelper (>= 4.0), libx86-dev, texinfo
 Standards-Version: 3.6.2
 
 Package: read-edid
-Architecture: i386 powerpc
+Architecture: i386 hurd-i386 kfreebsd-i386 amd64 kfreebsd-amd64 powerpc
 Depends: ${shlibs:Depends}
 Description: hardware information-gathering tool for VESA PnP monitors
  read-edid consists of two tools:
diff --git a/get-edid.c b/get-edid.c
index fb9cd0a..758d38b 100644
--- a/get-edid.c
+++ b/get-edid.c
@@ -6,7 +6,7 @@
 #include <string.h>
 #include <sys/types.h>
 
-#include "lrmi.h"
+#include <libx86.h>
 
 typedef u_int8_t byte;
 typedef u_int32_t uint32;
diff --git a/lrmi.c b/lrmi.c
deleted file mode 100644
index f5abf93..0000000
--- a/lrmi.c
+++ /dev/null
@@ -1,883 +0,0 @@
-/*
-Linux Real Mode Interface - A library of DPMI-like functions for Linux.
-
-Copyright (C) 1998 by Josh Vanderhoof
-
-You are free to distribute and modify this file, as long as you
-do not remove this copyright notice and clearly label modified
-versions as being modified.
-
-This software has NO WARRANTY.  Use it at your own risk.
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <asm/vm86.h>
-
-#ifdef USE_LIBC_VM86
-#include <sys/vm86.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include "lrmi.h"
-
-#define REAL_MEM_BASE 	((void *)0x10000)
-#define REAL_MEM_SIZE 	0x10000
-#define REAL_MEM_BLOCKS 	0x100
-
-struct mem_block
-	{
-	unsigned int size : 20;
-	unsigned int free : 1;
-	};
-
-static struct
-	{
-	int ready;
-	int count;
-	struct mem_block blocks[REAL_MEM_BLOCKS];
-	} mem_info = { 0 };
-
-static int
-real_mem_init(void)
-	{
-	void *m;
-	int fd_zero;
-
-	if (mem_info.ready)
-		return 1;
-
-	fd_zero = open("/dev/zero", O_RDONLY);
-	if (fd_zero == -1)
-		{
-		perror("open /dev/zero");
-		return 0;
-		}
-
-	m = mmap((void *)REAL_MEM_BASE, REAL_MEM_SIZE,
-	 PROT_READ | PROT_WRITE | PROT_EXEC,
-	 MAP_FIXED | MAP_PRIVATE, fd_zero, 0);
-
-	if (m == (void *)-1)
-		{
-		perror("mmap /dev/zero");
-		close(fd_zero);
-		return 0;
-		}
-
-	mem_info.ready = 1;
-	mem_info.count = 1;
-	mem_info.blocks[0].size = REAL_MEM_SIZE;
-	mem_info.blocks[0].free = 1;
-
-	return 1;
-	}
-
-
-static void
-insert_block(int i)
-	{
-	memmove(
-	 mem_info.blocks + i + 1,
-	 mem_info.blocks + i,
-	 (mem_info.count - i) * sizeof(struct mem_block));
-
-	mem_info.count++;
-	}
-
-static void
-delete_block(int i)
-	{
-	mem_info.count--;
-
-	memmove(
-	 mem_info.blocks + i,
-	 mem_info.blocks + i + 1,
-	 (mem_info.count - i) * sizeof(struct mem_block));
-	}
-
-void *
-LRMI_alloc_real(int size)
-	{
-	int i;
-	char *r = (char *)REAL_MEM_BASE;
-
-	if (!mem_info.ready)
-		return NULL;
-
-	if (mem_info.count == REAL_MEM_BLOCKS)
-		return NULL;
-
-	size = (size + 15) & ~15;
-
-	for (i = 0; i < mem_info.count; i++)
-		{
-		if (mem_info.blocks[i].free && size < mem_info.blocks[i].size)
-			{
-			insert_block(i);
-
-			mem_info.blocks[i].size = size;
-			mem_info.blocks[i].free = 0;
-			mem_info.blocks[i + 1].size -= size;
-
-			return (void *)r;
-			}
-
-		r += mem_info.blocks[i].size;
-		}
-
-	return NULL;
-	}
-
-
-void
-LRMI_free_real(void *m)
-	{
-	int i;
-	char *r = (char *)REAL_MEM_BASE;
-
-	if (!mem_info.ready)
-		return;
-
-	i = 0;
-	while (m != (void *)r)
-		{
-		r += mem_info.blocks[i].size;
-		i++;
-		if (i == mem_info.count)
-			return;
-		}
-
-	mem_info.blocks[i].free = 1;
-
-	if (i + 1 < mem_info.count && mem_info.blocks[i + 1].free)
-		{
-		mem_info.blocks[i].size += mem_info.blocks[i + 1].size;
-		delete_block(i + 1);
-		}
-
-	if (i - 1 >= 0 && mem_info.blocks[i - 1].free)
-		{
-		mem_info.blocks[i - 1].size += mem_info.blocks[i].size;
-		delete_block(i);
-		}
-	}
-
-
-#define DEFAULT_VM86_FLAGS 	(IF_MASK | IOPL_MASK)
-#define DEFAULT_STACK_SIZE 	0x1000
-#define RETURN_TO_32_INT 	255
-
-static struct
-	{
-	int ready;
-	unsigned short ret_seg, ret_off;
-	unsigned short stack_seg, stack_off;
-	struct vm86_struct vm;
-	} context = { 0 };
-
-
-static inline void
-set_bit(unsigned int bit, void *array)
-	{
-	unsigned char *a = array;
-
-	a[bit / 8] |= (1 << (bit % 8));
-	}
-
-
-static inline unsigned int
-get_int_seg(int i)
-	{
-	return *(unsigned short *)(i * 4 + 2);
-	}
-
-
-static inline unsigned int
-get_int_off(int i)
-	{
-	return *(unsigned short *)(i * 4);
-	}
-
-
-static inline void
-pushw(unsigned short i)
-	{
-	struct vm86_regs *r = &context.vm.regs;
-	r->esp -= 2;
-	*(unsigned short *)(((unsigned int)r->ss << 4) + r->esp) = i;
-	}
-
-
-int
-LRMI_init(void)
-	{
-	void *m;
-	int fd_mem;
-
-	if (context.ready)
-		return 1;
-
-	if (!real_mem_init())
-		return 0;
-
-	/*
-	 Map the Interrupt Vectors (0x0 - 0x400) + BIOS data (0x400 - 0x502)
-	 and the ROM (0xa0000 - 0x100000)
-	*/
-	fd_mem = open("/dev/mem", O_RDWR);
-
-	if (fd_mem == -1)
-		{
-		perror("open /dev/mem");
-		return 0;
-		}
-
-	m = mmap((void *)0, 0x502,
-	 PROT_READ | PROT_WRITE | PROT_EXEC,
-	 MAP_FIXED | MAP_PRIVATE, fd_mem, 0);
-
-	if (m == (void *)-1)
-		{
-		perror("mmap /dev/mem");
-		return 0;
-		}
-
-	m = mmap((void *)0xa0000, 0x100000 - 0xa0000,
-	 PROT_READ | PROT_WRITE,
-	 MAP_FIXED | MAP_SHARED, fd_mem, 0xa0000);
-
-	if (m == (void *)-1)
-		{
-		perror("mmap /dev/mem");
-		return 0;
-		}
-
-
-	/*
-	 Allocate a stack
-	*/
-	m = LRMI_alloc_real(DEFAULT_STACK_SIZE);
-
-	context.stack_seg = (unsigned int)m >> 4;
-	context.stack_off = DEFAULT_STACK_SIZE;
-
-	/*
-	 Allocate the return to 32 bit routine
-	*/
-	m = LRMI_alloc_real(2);
-
-	context.ret_seg = (unsigned int)m >> 4;
-	context.ret_off = (unsigned int)m & 0xf;
-
-	((unsigned char *)m)[0] = 0xcd; 	/* int opcode */
-	((unsigned char *)m)[1] = RETURN_TO_32_INT;
-
-	memset(&context.vm, 0, sizeof(context.vm));
-
-	/*
-	 Enable kernel emulation of all ints except RETURN_TO_32_INT
-	*/
-	memset(&context.vm.int_revectored, 0, sizeof(context.vm.int_revectored));
-	set_bit(RETURN_TO_32_INT, &context.vm.int_revectored);
-
-	context.ready = 1;
-
-	return 1;
-	}
-
-
-static void
-set_regs(struct LRMI_regs *r)
-	{
-	context.vm.regs.edi = r->edi;
-	context.vm.regs.esi = r->esi;
-	context.vm.regs.ebp = r->ebp;
-	context.vm.regs.ebx = r->ebx;
-	context.vm.regs.edx = r->edx;
-	context.vm.regs.ecx = r->ecx;
-	context.vm.regs.eax = r->eax;
-	context.vm.regs.eflags = DEFAULT_VM86_FLAGS;
-	context.vm.regs.es = r->es;
-	context.vm.regs.ds = r->ds;
-	context.vm.regs.fs = r->fs;
-	context.vm.regs.gs = r->gs;
-	}
-
-
-static void
-get_regs(struct LRMI_regs *r)
-	{
-	r->edi = context.vm.regs.edi;
-	r->esi = context.vm.regs.esi;
-	r->ebp = context.vm.regs.ebp;
-	r->ebx = context.vm.regs.ebx;
-	r->edx = context.vm.regs.edx;
-	r->ecx = context.vm.regs.ecx;
-	r->eax = context.vm.regs.eax;
-	r->flags = context.vm.regs.eflags;
-	r->es = context.vm.regs.es;
-	r->ds = context.vm.regs.ds;
-	r->fs = context.vm.regs.fs;
-	r->gs = context.vm.regs.gs;
-	}
-
-#define DIRECTION_FLAG 	(1 << 10)
-
-static void
-em_ins(int size)
-	{
-	unsigned int edx, edi;
-
-	edx = context.vm.regs.edx & 0xffff;
-	edi = context.vm.regs.edi & 0xffff;
-	edi += (unsigned int)context.vm.regs.ds << 4;
-
-	if (context.vm.regs.eflags & DIRECTION_FLAG)
-		{
-		if (size == 4)
-			asm volatile ("std; insl; cld"
-			 : "=D" (edi) : "d" (edx), "0" (edi));
-		else if (size == 2)
-			asm volatile ("std; insw; cld"
-			 : "=D" (edi) : "d" (edx), "0" (edi));
-		else
-			asm volatile ("std; insb; cld"
-			 : "=D" (edi) : "d" (edx), "0" (edi));
-		}
-	else
-		{
-		if (size == 4)
-			asm volatile ("cld; insl"
-			 : "=D" (edi) : "d" (edx), "0" (edi));
-		else if (size == 2)
-			asm volatile ("cld; insw"
-			 : "=D" (edi) : "d" (edx), "0" (edi));
-		else
-			asm volatile ("cld; insb"
-			 : "=D" (edi) : "d" (edx), "0" (edi));
-		}
-
-	edi -= (unsigned int)context.vm.regs.ds << 4;
-
-	context.vm.regs.edi &= 0xffff0000;
-	context.vm.regs.edi |= edi & 0xffff;
-	}
-
-static void
-em_rep_ins(int size)
-	{
-	unsigned int ecx, edx, edi;
-
-	ecx = context.vm.regs.ecx & 0xffff;
-	edx = context.vm.regs.edx & 0xffff;
-	edi = context.vm.regs.edi & 0xffff;
-	edi += (unsigned int)context.vm.regs.ds << 4;
-
-	if (context.vm.regs.eflags & DIRECTION_FLAG)
-		{
-		if (size == 4)
-			asm volatile ("std; rep; insl; cld"
-			 : "=D" (edi), "=c" (ecx)
-			 : "d" (edx), "0" (edi), "1" (ecx));
-		else if (size == 2)
-			asm volatile ("std; rep; insw; cld"
-			 : "=D" (edi), "=c" (ecx)
-			 : "d" (edx), "0" (edi), "1" (ecx));
-		else
-			asm volatile ("std; rep; insb; cld"
-			 : "=D" (edi), "=c" (ecx)
-			 : "d" (edx), "0" (edi), "1" (ecx));
-		}
-	else
-		{
-		if (size == 4)
-			asm volatile ("cld; rep; insl"
-			 : "=D" (edi), "=c" (ecx)
-			 : "d" (edx), "0" (edi), "1" (ecx));
-		else if (size == 2)
-			asm volatile ("cld; rep; insw"
-			 : "=D" (edi), "=c" (ecx)
-			 : "d" (edx), "0" (edi), "1" (ecx));
-		else
-			asm volatile ("cld; rep; insb"
-			 : "=D" (edi), "=c" (ecx)
-			 : "d" (edx), "0" (edi), "1" (ecx));
-		}
-
-	edi -= (unsigned int)context.vm.regs.ds << 4;
-
-	context.vm.regs.edi &= 0xffff0000;
-	context.vm.regs.edi |= edi & 0xffff;
-
-	context.vm.regs.ecx &= 0xffff0000;
-	context.vm.regs.ecx |= ecx & 0xffff;
-	}
-
-static void
-em_outs(int size)
-	{
-	unsigned int edx, esi;
-
-	edx = context.vm.regs.edx & 0xffff;
-	esi = context.vm.regs.esi & 0xffff;
-	esi += (unsigned int)context.vm.regs.ds << 4;
-
-	if (context.vm.regs.eflags & DIRECTION_FLAG)
-		{
-		if (size == 4)
-			asm volatile ("std; outsl; cld"
-			 : "=S" (esi) : "d" (edx), "0" (esi));
-		else if (size == 2)
-			asm volatile ("std; outsw; cld"
-			 : "=S" (esi) : "d" (edx), "0" (esi));
-		else
-			asm volatile ("std; outsb; cld"
-			 : "=S" (esi) : "d" (edx), "0" (esi));
-		}
-	else
-		{
-		if (size == 4)
-			asm volatile ("cld; outsl"
-			 : "=S" (esi) : "d" (edx), "0" (esi));
-		else if (size == 2)
-			asm volatile ("cld; outsw"
-			 : "=S" (esi) : "d" (edx), "0" (esi));
-		else
-			asm volatile ("cld; outsb"
-			 : "=S" (esi) : "d" (edx), "0" (esi));
-		}
-
-	esi -= (unsigned int)context.vm.regs.ds << 4;
-
-	context.vm.regs.esi &= 0xffff0000;
-	context.vm.regs.esi |= esi & 0xffff;
-	}
-
-static void
-em_rep_outs(int size)
-	{
-	unsigned int ecx, edx, esi;
-
-	ecx = context.vm.regs.ecx & 0xffff;
-	edx = context.vm.regs.edx & 0xffff;
-	esi = context.vm.regs.esi & 0xffff;
-	esi += (unsigned int)context.vm.regs.ds << 4;
-
-	if (context.vm.regs.eflags & DIRECTION_FLAG)
-		{
-		if (size == 4)
-			asm volatile ("std; rep; outsl; cld"
-			 : "=S" (esi), "=c" (ecx)
-			 : "d" (edx), "0" (esi), "1" (ecx));
-		else if (size == 2)
-			asm volatile ("std; rep; outsw; cld"
-			 : "=S" (esi), "=c" (ecx)
-			 : "d" (edx), "0" (esi), "1" (ecx));
-		else
-			asm volatile ("std; rep; outsb; cld"
-			 : "=S" (esi), "=c" (ecx)
-			 : "d" (edx), "0" (esi), "1" (ecx));
-		}
-	else
-		{
-		if (size == 4)
-			asm volatile ("cld; rep; outsl"
-			 : "=S" (esi), "=c" (ecx)
-			 : "d" (edx), "0" (esi), "1" (ecx));
-		else if (size == 2)
-			asm volatile ("cld; rep; outsw"
-			 : "=S" (esi), "=c" (ecx)
-			 : "d" (edx), "0" (esi), "1" (ecx));
-		else
-			asm volatile ("cld; rep; outsb"
-			 : "=S" (esi), "=c" (ecx)
-			 : "d" (edx), "0" (esi), "1" (ecx));
-		}
-
-	esi -= (unsigned int)context.vm.regs.ds << 4;
-
-	context.vm.regs.esi &= 0xffff0000;
-	context.vm.regs.esi |= esi & 0xffff;
-
-	context.vm.regs.ecx &= 0xffff0000;
-	context.vm.regs.ecx |= ecx & 0xffff;
-	}
-
-static void
-em_inb(void)
-	{
-	asm volatile ("inb (%w1), %b0"
-	 : "=a" (context.vm.regs.eax)
-	 : "d" (context.vm.regs.edx), "0" (context.vm.regs.eax));
-	}
-
-static void
-em_inw(void)
-	{
-	asm volatile ("inw (%w1), %w0"
-	 : "=a" (context.vm.regs.eax)
-	 : "d" (context.vm.regs.edx), "0" (context.vm.regs.eax));
-	}
-
-static void
-em_inl(void)
-	{
-	asm volatile ("inl (%w1), %0"
-	 : "=a" (context.vm.regs.eax)
-	 : "d" (context.vm.regs.edx));
-	}
-
-static void
-em_outb(void)
-	{
-	asm volatile ("outb %b0, (%w1)"
-	 : : "a" (context.vm.regs.eax),
-	 "d" (context.vm.regs.edx));
-	}
-
-static void
-em_outw(void)
-	{
-	asm volatile ("outw %w0, (%w1)"
-	 : : "a" (context.vm.regs.eax),
-	 "d" (context.vm.regs.edx));
-	}
-
-static void
-em_outl(void)
-	{
-	asm volatile ("outl %0, (%w1)"
-	 : : "a" (context.vm.regs.eax),
-	 "d" (context.vm.regs.edx));
-	}
-
-static int
-emulate(void)
-	{
-	unsigned char *insn;
-	struct
-		{
-		unsigned int size : 1;
-		unsigned int rep : 1;
-		} prefix = { 0, 0 };
-	int i = 0;
-
-	insn = (unsigned char *)((unsigned int)context.vm.regs.cs << 4);
-	insn += context.vm.regs.eip;
-
-	while (1)
-		{
-		if (insn[i] == 0x66)
-			{
-			prefix.size = 1 - prefix.size;
-			i++;
-			}
-		else if (insn[i] == 0xf3)
-			{
-			prefix.rep = 1;
-			i++;
-			}
-		else if (insn[i] == 0xf0 || insn[i] == 0xf2
-		 || insn[i] == 0x26 || insn[i] == 0x2e
-		 || insn[i] == 0x36 || insn[i] == 0x3e
-		 || insn[i] == 0x64 || insn[i] == 0x65
-		 || insn[i] == 0x67)
-			{
-			/* these prefixes are just ignored */
-			i++;
-			}
-		else if (insn[i] == 0x6c)
-			{
-			if (prefix.rep)
-				em_rep_ins(1);
-			else
-				em_ins(1);
-			i++;
-			break;
-			}
-		else if (insn[i] == 0x6d)
-			{
-			if (prefix.rep)
-				{
-				if (prefix.size)
-					em_rep_ins(4);
-				else
-					em_rep_ins(2);
-				}
-			else
-				{
-				if (prefix.size)
-					em_ins(4);
-				else
-					em_ins(2);
-				}
-			i++;
-			break;
-			}
-		else if (insn[i] == 0x6e)
-			{
-			if (prefix.rep)
-				em_rep_outs(1);
-			else
-				em_outs(1);
-			i++;
-			break;
-			}
-		else if (insn[i] == 0x6f)
-			{
-			if (prefix.rep)
-				{
-				if (prefix.size)
-					em_rep_outs(4);
-				else
-					em_rep_outs(2);
-				}
-			else
-				{
-				if (prefix.size)
-					em_outs(4);
-				else
-					em_outs(2);
-				}
-			i++;
-			break;
-			}
-		else if (insn[i] == 0xec)
-			{
-			em_inb();
-			i++;
-			break;
-			}
-		else if (insn[i] == 0xed)
-			{
-			if (prefix.size)
-				em_inl();
-			else
-				em_inw();
-			i++;
-			break;
-			}
-		else if (insn[i] == 0xee)
-			{
-			em_outb();
-			i++;
-			break;
-			}
-		else if (insn[i] == 0xef)
-			{
-			if (prefix.size)
-				em_outl();
-			else
-				em_outw();
-
-			i++;
-			break;
-			}
-		else
-			return 0;
-		}
-
-	context.vm.regs.eip += i;
-	return 1;
-	}
-
-
-/*
- I don't know how to make sure I get the right vm86() from libc.
- The one I want is syscall # 113 (vm86old() in libc 5, vm86() in glibc)
- which should be declared as "int vm86(struct vm86_struct *);" in
- <sys/vm86.h>.
-
- This just does syscall 113 with inline asm, which should work
- for both libc's (I hope).
-*/
-#if !defined(USE_LIBC_VM86)
-static int
-lrmi_vm86(struct vm86_struct *vm)
-	{
-	int r;
-#ifdef __PIC__
-	asm volatile (
-	 "pushl %%ebx\n\t"
-	 "movl %2, %%ebx\n\t"
-	 "int $0x80\n\t"
-	 "popl %%ebx"
-	 : "=a" (r)
-	 : "0" (113), "r" (vm));
-#else
-	asm volatile (
-	 "int $0x80"
-	 : "=a" (r)
-	 : "0" (113), "b" (vm));
-#endif
-	return r;
-	}
-#else
-#define lrmi_vm86 vm86
-#endif
-
-
-static void
-debug_info(int vret)
-	{
-	int i;
-	unsigned char *p;
-
-	fputs("vm86() failed\n", stderr);
-	fprintf(stderr, "return = 0x%x\n", vret);
-	fprintf(stderr, "eax = 0x%08lx\n", context.vm.regs.eax);
-	fprintf(stderr, "ebx = 0x%08lx\n", context.vm.regs.ebx);
-	fprintf(stderr, "ecx = 0x%08lx\n", context.vm.regs.ecx);
-	fprintf(stderr, "edx = 0x%08lx\n", context.vm.regs.edx);
-	fprintf(stderr, "esi = 0x%08lx\n", context.vm.regs.esi);
-	fprintf(stderr, "edi = 0x%08lx\n", context.vm.regs.edi);
-	fprintf(stderr, "ebp = 0x%08lx\n", context.vm.regs.ebp);
-	fprintf(stderr, "eip = 0x%08lx\n", context.vm.regs.eip);
-	fprintf(stderr, "cs  = 0x%04x\n", context.vm.regs.cs);
-	fprintf(stderr, "esp = 0x%08lx\n", context.vm.regs.esp);
-	fprintf(stderr, "ss  = 0x%04x\n", context.vm.regs.ss);
-	fprintf(stderr, "ds  = 0x%04x\n", context.vm.regs.ds);
-	fprintf(stderr, "es  = 0x%04x\n", context.vm.regs.es);
-	fprintf(stderr, "fs  = 0x%04x\n", context.vm.regs.fs);
-	fprintf(stderr, "gs  = 0x%04x\n", context.vm.regs.gs);
-	fprintf(stderr, "eflags  = 0x%08lx\n", context.vm.regs.eflags);
-
-	fputs("cs:ip = [ ", stderr);
-
-	p = (unsigned char *)((context.vm.regs.cs << 4) + (context.vm.regs.eip & 0xffff));
-
-	for (i = 0; i < 16; ++i)
-		fprintf(stderr, "%02x ", (unsigned int)p[i]);
-
-	fputs("]\n", stderr);
-	}
-
-
-static int
-run_vm86(void)
-	{
-	unsigned int vret;
-
-	while (1)
-		{
-		vret = lrmi_vm86(&context.vm);
-
-		if (VM86_TYPE(vret) == VM86_INTx)
-			{
-			unsigned int v = VM86_ARG(vret);
-
-			if (v == RETURN_TO_32_INT)
-				return 1;
-
-			pushw(context.vm.regs.eflags);
-			pushw(context.vm.regs.cs);
-			pushw(context.vm.regs.eip);
-
-			context.vm.regs.cs = get_int_seg(v);
-			context.vm.regs.eip = get_int_off(v);
-			context.vm.regs.eflags &= ~(VIF_MASK | TF_MASK);
-
-			continue;
-			}
-
-		if (VM86_TYPE(vret) != VM86_UNKNOWN)
-			break;
-
-		if (!emulate())
-			break;
-		}
-
-	debug_info(vret);
-
-	return 0;
-	}
-
-
-int
-LRMI_call(struct LRMI_regs *r)
-	{
-	unsigned int vret;
-
-	memset(&context.vm.regs, 0, sizeof(context.vm.regs));
-
-	set_regs(r);
-
-	context.vm.regs.cs = r->cs;
-	context.vm.regs.eip = r->ip;
-
-	if (r->ss == 0 && r->sp == 0)
-		{
-		context.vm.regs.ss = context.stack_seg;
-		context.vm.regs.esp = context.stack_off;
-		}
-	else
-		{
-		context.vm.regs.ss = r->ss;
-		context.vm.regs.esp = r->sp;
-		}
-
-	pushw(context.ret_seg);
-	pushw(context.ret_off);
-
-	vret = run_vm86();
-
-	get_regs(r);
-
-	return vret;
-	}
-
-
-int
-LRMI_int(int i, struct LRMI_regs *r)
-	{
-	unsigned int vret;
-	unsigned int seg, off;
-
-	seg = get_int_seg(i);
-	off = get_int_off(i);
-
-	/*
-	 If the interrupt is in regular memory, it's probably
-	 still pointing at a dos TSR (which is now gone).
-	*/
-	if (seg < 0xa000 || (seg << 4) + off >= 0x100000)
-		{
-		fprintf(stderr, "Int 0x%x is not in rom (%04x:%04x)\n", i, seg, off);
-		return 0;
-		}
-
-	memset(&context.vm.regs, 0, sizeof(context.vm.regs));
-
-	set_regs(r);
-
-	context.vm.regs.cs = seg;
-	context.vm.regs.eip = off;
-
-	if (r->ss == 0 && r->sp == 0)
-		{
-		context.vm.regs.ss = context.stack_seg;
-		context.vm.regs.esp = context.stack_off;
-		}
-	else
-		{
-		context.vm.regs.ss = r->ss;
-		context.vm.regs.esp = r->sp;
-		}
-
-	pushw(DEFAULT_VM86_FLAGS);
-	pushw(context.ret_seg);
-	pushw(context.ret_off);
-
-	vret = run_vm86();
-
-	get_regs(r);
-
-	return vret;
-	}
-
diff --git a/lrmi.h b/lrmi.h
deleted file mode 100644
index 9434525..0000000
--- a/lrmi.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-Linux Real Mode Interface - A library of DPMI-like functions for Linux.
-
-Copyright (C) 1998 by Josh Vanderhoof
-
-You are free to distribute and modify this file, as long as you
-do not remove this copyright notice and clearly label modified
-versions as being modified.
-
-This software has NO WARRANTY.  Use it at your own risk.
-
-*/
-
-#ifndef LRMI_H
-#define LRMI_H
-
-struct LRMI_regs
-	{
-	unsigned int edi;
-	unsigned int esi;
-	unsigned int ebp;
-	unsigned int reserved;
-	unsigned int ebx;
-	unsigned int edx;
-	unsigned int ecx;
-	unsigned int eax;
-	unsigned short int flags;
-	unsigned short int es;
-	unsigned short int ds;
-	unsigned short int fs;
-	unsigned short int gs;
-	unsigned short int ip;
-	unsigned short int cs;
-	unsigned short int sp;
-	unsigned short int ss;
-	};
-
-/*
- Initialize
- returns 1 if sucessful, 0 for failure
-*/
-int
-LRMI_init(void);
-
-/*
- Simulate a 16 bit far call
- returns 1 if sucessful, 0 for failure
-*/
-int
-LRMI_call(struct LRMI_regs *r);
-
-/*
- Simulate a 16 bit interrupt
- returns 1 if sucessful, 0 for failure
-*/
-int
-LRMI_int(int interrupt, struct LRMI_regs *r);
-
-/*
- Allocate real mode memory
- The returned block is paragraph (16 byte) aligned
-*/
-void *
-LRMI_alloc_real(int size);
-
-/*
- Free real mode memory
-*/
-void
-LRMI_free_real(void *m);
-
-#endif
-- 
1.5.6.3


--- End Message ---
--- Begin Message ---
Source: read-edid
Source-Version: 2.0.0-1

We believe that the bug you reported is fixed in the latest version of
read-edid, which is due to be installed in the Debian FTP archive:

read-edid_2.0.0-1.diff.gz
  to pool/main/r/read-edid/read-edid_2.0.0-1.diff.gz
read-edid_2.0.0-1.dsc
  to pool/main/r/read-edid/read-edid_2.0.0-1.dsc
read-edid_2.0.0-1_amd64.deb
  to pool/main/r/read-edid/read-edid_2.0.0-1_amd64.deb
read-edid_2.0.0.orig.tar.gz
  to pool/main/r/read-edid/read-edid_2.0.0.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
LIU Qi <[email protected]> (supplier of updated read-edid package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 11 May 2009 13:14:40 +0800
Source: read-edid
Binary: read-edid
Architecture: source amd64
Version: 2.0.0-1
Distribution: unstable
Urgency: low
Maintainer: LIU Qi <[email protected]>
Changed-By: LIU Qi <[email protected]>
Description: 
 read-edid  - hardware information-gathering tool for VESA PnP monitors
Closes: 231307 395741 406736 433713 495131 502125 502126
Changes: 
 read-edid (2.0.0-1) unstable; urgency=low
 .
   * new upstream version and maintainer (Closes: #502125)
     - the new version uses libx86 instead of LRMI (Closes: #495131)
     - libx86 will build on new kernel (Closes: #502126)
   * add missing binary-indep in debian/rules (Closes: #395741)
   * new version is modified to build on any architecture
     - fixed the powerpc build problem (Closes: #406736)
     - fixed the rebuild problem (Closes: #433713)
   * install the read-edid in usr/sbin directory (Closes: #231307)
Checksums-Sha1: 
 67a43dce679379140dea8844b7320cf0ff53c44f 1050 read-edid_2.0.0-1.dsc
 8605a242c0a104a70ab1a5cdd616fffbac52d6c8 82282 read-edid_2.0.0.orig.tar.gz
 e158026b04c964fcd3ee57aad70121fcc3d5c8ba 4109 read-edid_2.0.0-1.diff.gz
 bb8074e53260921d591a37182ffae0742861a5fd 9048 read-edid_2.0.0-1_amd64.deb
Checksums-Sha256: 
 83d428f596f2f9a823bbeed30f68422662128a896355d790c1cd45fa94698f6c 1050 
read-edid_2.0.0-1.dsc
 246ec14ec509e09ac26fe6862b120481b2cc881e2f142ba40886d6eec15e77e8 82282 
read-edid_2.0.0.orig.tar.gz
 405512685288849c5eb51499e25f23c321ef94d9f98d5cb737446fcdc04503ed 4109 
read-edid_2.0.0-1.diff.gz
 7890f8bf26fa75344dccfffe66143a444faa7c1a9f43bf1fee408fdba2437108 9048 
read-edid_2.0.0-1_amd64.deb
Files: 
 9281ed7fbff7768bdab6cfdf14c07e09 1050 utils optional read-edid_2.0.0-1.dsc
 586e7fa1167773b27f4e505edc93274b 82282 utils optional 
read-edid_2.0.0.orig.tar.gz
 4cbe7b546b673015fead6579603eb41f 4109 utils optional read-edid_2.0.0-1.diff.gz
 083c215563cf76658261ef4add115912 9048 utils optional 
read-edid_2.0.0-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkohE28ACgkQgY5NIXPNpFWNWgCgnJFjSKHTUXJ34zBoSvAQraqp
0/QAn2g6UrymiOIK2NoEcYLbFEJJWyGn
=Yaq5
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to