Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Real mode BIOS call in x86_64 Linux environment

14 views
Skip to first unread message

smsab...@yahoo.com

unread,
May 6, 2008, 12:25:26 PM5/6/08
to
I have an application which gets Video controller information using
VESA BIOS routines. It makes use of LRMI library for making real mode
BIOS call in x86_32 bit Linux machine.

Now, I need to port this application for x64 Linux. But, LRMI is
limited only to x86_32 enviornment. Is there any other equivalent
libarary for x64 porting ?

Thanks in advance,

Arun

Rainer Weikusat

unread,
May 6, 2008, 12:27:19 PM5/6/08
to

The x86_64 'long mode' ('64bit') does not support 8086-emulation
(vm86).

David Schwartz

unread,
May 6, 2008, 6:51:15 PM5/6/08
to

Could you be a bit more specific about what information you need and
what you need it for? It seems odd that a Linux application would want
this kind of information. Is this hardware auditing? Or are you trying
to control the video hardware directly?

DS

smsab...@yahoo.com

unread,
May 6, 2008, 11:23:47 PM5/6/08
to

The requirement is to collect video controller information using Video
BIOS VBE3 in x86_64 Linux OS. The Bios Interrupt routine 0x10 is meant
for Video system. Right now, my application uses LRMI library to make
BIOS routine call 0x10.
But this 32 bit application is failing in x86_64 while making call to
BIOS routine.

Hence, I have started porting the application to x86_64 machine. But,
I am struck up with finding LRMI equivalent in x86_64 platform.
Could you please help me.

Thanks a lot.

Arun

David Schwartz

unread,
May 7, 2008, 12:02:18 AM5/7/08
to
On May 6, 8:23 pm, smsabu2...@yahoo.com wrote:

> The requirement is to collect video controller information using Video
> BIOS VBE3 in x86_64 Linux OS.

I think this is quite close to impossible. Whatever your outer problem
is, there's almost certainly a better way to solve it. You should do
whatever you can to get the requirement fixed.

DS

Rainer Weikusat

unread,
May 7, 2008, 6:03:19 AM5/7/08
to
David Schwartz <dav...@webmaster.com> writes:
> On May 6, 8:23 pm, smsabu2...@yahoo.com wrote:
>> The requirement is to collect video controller information using Video
>> BIOS VBE3 in x86_64 Linux OS.
>
> I think this is quite close to impossible.

It is certainly 'possible', eg by disassembling the BIOS, determining
where it gets the information from and reimplementing the same
functionality without resorting to 'real-mode' softints.

Baron

unread,
May 7, 2008, 4:32:44 PM5/7/08
to
smsab...@yahoo.com wrote:

> The requirement is to collect video controller information using Video
> BIOS VBE3 in x86_64 Linux OS. The Bios Interrupt routine 0x10 is meant
> for Video system. Right now, my application uses LRMI library to make
> BIOS routine call 0x10.

In the Phoenix bios "Video Service" are stored in system ram in segment
0x40. From 0x49 to 0x100 is the information I think you are wanting.

If so then google "Phoenix bios Technical Reference"

> But this 32 bit application is failing in x86_64 while making call to
> BIOS routine.
>
> Hence, I have started porting the application to x86_64 machine. But,
> I am struck up with finding LRMI equivalent in x86_64 platform.
> Could you please help me.
>
> Thanks a lot.
>
> Arun

HTH.
--
Best Regards:
Baron.

Tim Roberts

unread,
May 8, 2008, 3:16:18 AM5/8/08
to

XFree86 and X.Org solve this problem by including an x86 emulator, based on
dosemu. And yes, they actually execute VESA BIOS entry points on non-x86
processors using exactly this method.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

david

unread,
May 9, 2008, 8:20:27 AM5/9/08
to
On Tue, 06 May 2008 21:02:18 -0700, David Schwartz rearranged some
electrons to say:

Sounds like a homework problem to me.

Aragorn

unread,
May 9, 2008, 8:36:54 AM5/9/08
to
david wrote:

> Sounds like a homework problem to me.

Considering that it was crossposted to three groups using Google Groups as a
newsreader, that the OP's intent is to simply read out low level video
hardware data, and that the OP uses a Yahoo throwaway e-mail address as the
poster's identity, the odds to that are indeed very big. ;-)

--
*Aragorn*
(registered GNU/Linux user #223157)

Eric

unread,
May 10, 2008, 4:36:35 AM5/10/08
to
smsab...@yahoo.com wrote:

Its going to be a real trick calling a real mode bios routine from x86_64
protected mode given that the register sizes, meanings, stack word widths are
all different. I would guess that switching to real mode from within linux
would make for a mess unless done by the kernel, and even then, it wouldnt be
a good thing.
I'm really sure, that whatever data/information you are trying to gather can
be gotten from /proc, /sys or somewhere like that, or possibly even from
carious files /etc. Dont re-invent the wheel if you dont have to. Also look
up SMBios aka DMI bios
Eric

Aragorn

unread,
May 10, 2008, 8:11:41 AM5/10/08
to
Eric wrote:

> smsab...@yahoo.com wrote:
>
>> I have an application which gets Video controller information using
>> VESA BIOS routines. It makes use of LRMI library for making real mode
>> BIOS call in x86_32 bit Linux machine.
>>
>> Now, I need to port this application for x64 Linux. But, LRMI is
>> limited only to x86_32 enviornment. Is there any other equivalent
>> libarary for x64 porting ?
>

> Its going to be a real trick calling a real mode bios routine from x86_64
> protected mode given that the register sizes, meanings, stack word widths
> are all different. I would guess that switching to real mode from within
> linux would make for a mess unless done by the kernel, and even then, it
> wouldnt be a good thing.

On x86-32, Linux actually doesn't use real mode during normal operation but
uses V86 mode instead, which is a multitaskable 8086 emulation mode.

Real mode in Linux is only used in some instances at shutdown where a
protected mode poweroff would not work - e.g. because the machine doesn't
support ACPI or even modern APM calls - and during the first phase of the
boot, before the kernel is decompressed into memory, because unless you
have an EFI BIOS, x86 machines always coldboot into real mode by legacy
convention.

The only other real mode implementations of Linux are in embedded systems
which make use of 8086 processors, and then those implementations would not
be real GNU/Linux systems but only ad hoc portions of Linux as a kernel
ported to 16-bit real mode.

Like you say, switching to real mode from within Linux would make for a
very, very ugly mess. It would become about as (un)stable as Windows 3.x
running atop of DOS - or a DOS session in OS/2 1.x if you will - on an
Intel 80286 CPU.

On x86-64, the x86-32 mechanisms of using virtual 86 mode (V86) would work,
provided that you're running in "legacy mode", and thus with a 32-bit
kernel. The native "long" mode - i.e. 64-bit mode - does not support V86
technology, although it does support natively 32-bit protected mode
instructions - not 16-bit protected mode code, though.

> I'm really sure, that whatever data/information you are trying to gather
> can be gotten from /proc, /sys or somewhere like that, or possibly even
> from carious files /etc. Dont re-invent the wheel if you dont have to.
> Also look up SMBios aka DMI bios

Sadly enough, not all SMBios chipsets are fully supported by the kernel
yet. :-/

0 new messages