Whenever the module decides to switch the video output, it performs
the bios call with the following code (gcc):
__asm__ ("
movw $0x5F22, %ax
xor %bx, %bx
int $0x10
");
The module loads and unload fine, but whenever the previous code is
executed, I get a floating point exception error.
The floating point exception error is caused by the int $0x10 call
(commenting it out from the previous asm call the error disappears).
Is there anybody out there willing to help me out?
I would reeeeally apreciate it!
Thank you
Rodolfo Saccani
You can't just call BIOS functions from Linux like that. Linux runs
in protected mode while the BIOS expects the CPU to be in real mode.
However, I have seen some code before that does just what you want
(switch video modes by making BIOS calls). I can't remember exactly
how it worked (maybe it used virtual x86 mode). I forgot the URL
though (sorry), but maybe someone else has it.
Rob
--
Robert Kaiser email: rkaiser AT sysgo DOT de
SYSGO RTS GmbH http://www.elinos.com
Klein-Winternheim / Germany http://www.sysgo.de
>I am writing a very simple kernel module to switch the video output
>from CRT to TV and viceversa using an extended int 10h bios call.
>This bios call is specific to the industrial motherboard I am using.
>
>Whenever the module decides to switch the video output, it performs
>the bios call with the following code (gcc):
>
>__asm__ ("
> movw $0x5F22, %ax
> xor %bx, %bx
> int $0x10
>");
>
>The module loads and unload fine, but whenever the previous code is
>executed, I get a floating point exception error.
>The floating point exception error is caused by the int $0x10 call
Right. BIOS code is all 16-bit code. You have to switch to V86 mode to do
it.
There is a syscall from user mode to do this switch. I really have no clue
if it can be called through some back door in kernel mode. Go check out
the Linux Real Mode Interface at http://sourceforge.net/projects/lrmi.
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
Here is an example that works on my computer. But I
have not yet seen any other computer where it works:
http://www.daimi.au.dk/~kasperd/vgareset.c
--
Kasper Dupont -- der bruger for meget tid på usenet.
For sending spam use mailto:aaa...@daimi.au.dk
or mailto:mcxumhv...@skrammel.yaboo.dk