Search code examples
c++bios

Using BIOS functions through C++


I'm searching for information about managing BIOS settings through C++. I am unfamiliar with low level programming. I tried to make a research, but my lack of knowledge in low level programming terminology terminated my progress.

I need to draw pixels on the screen, change to text mode or video mode and so on. Is it possible to do it with a C++ program?

Can someone give me some information which can guide me through the process?


Solution

  • You question in fact has many subquestion :

    • do you need some kind of a boot loader ? definitively no
    • can you do that with standard portable C++ ? obviously no(*)
    • can you do that from a C++ program ? yes
    • what are the BIOS functions to change video mode ... BIOS interrupt call on wikipedia will give you the answer or at least an entry point
    • how to call that from a C++ program ? _asm keyword is your friend. It you use Windows and a MS compiler, _asm page on MSDN will give you examples.

    It will look like :

    _asm {
        mov ah, sub_function
        mov al, parameter
        int bios_function
    }
    

    (*) standard portable C++ is independant of platform and implementation. As soon as you use BIOS call you are tight to a platform.