Click here to Skip to main content
15,896,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a question about BIOS routines:

When we write this code in windows
C++
mov ah, 0x0e
mov al, '!'
int 0x10

Does it really call BIOS routine directly or converts it to the Win API?
In other words, can we call BIOS routines directly from Windows or GNU/Linux?
Posted
Updated 14-May-12 10:43am
v2

1 solution

Of course it calls BIOS directly, tries to do so. But don't think you can use such code to call BIOS in Windows or Linux.

You can use many assembly codes in the application mode, but hardly BIOS. In x86 real mode, you could, but this is not what modern OS use. For example, in your code, int 0x10 will throw the exception like General Protection Fault. Remember, you are working in the protected mode of x86. Please see:
http://en.wikipedia.org/wiki/Protected_mode[^].

See also:
http://en.wikipedia.org/wiki/Real_mode[^],
http://en.wikipedia.org/wiki/Unreal_mode[^].

—SA
 
Share this answer
 
v4
Comments
Reza Oruji 15-May-12 0:59am    
so when i write this code in windows my program runs in virtual x8086 mode?
Sergey Alexandrovich Kryukov 17-May-12 16:34pm    
No. I don't know if the rudiments of x8086/88 still left in Windows. Therefore, it will throw exception, as I pointed out above. Try by yourself to see.
And if you agree, please accept the answer formally (green button) -- thanks.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900