Rebooting Program Troubleshoot In "c"

Discussion in 'Computer Science & Culture' started by Rick, Nov 5, 2001.

Thread Status:
Not open for further replies.
  1. Rick Valued Senior Member

    Messages:
    3,336
    CONSIDER THIS PROGRAM:
    #include<stdio.h>
    #include<conio.h>
    #include"dos.h"
    #include<bios.h>
    void main()
    {
    void far (*p)();
    p=0xFFFF0000;
    (*p)();
    }
    in the above program when i try to compile this with turbo c ver 3.0 it gives error message initially,after closing the turbo compiler and opening it again,the program runs,but never does anything!!!hangs down,DOS error come where it says that this program has performed an illegal operation.NOTE:THIS IS A PROGRAM which calls ROM-BIOS routine no 1,which it performs during booting process,so the address simply tries to access the bios routine itself.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. daktaklakpak God is irrelevant! Registered Senior Member

    Messages:
    710
    If you run it inside a windows box, it will be an illegal operation. If you run it inside the turbo C editor, it will be an illegal operation.

    Try compile it and run it from a clean dos prompt(no windows box please).
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. Rick Valued Senior Member

    Messages:
    3,336
    Hi everyone,

    thanks Bowser for those great links

    Please Register or Log in to view the hidden image!

    ,it did help me.however Dak you have solved my problem as it works fine on clean dos prompt,but i dont know whats wrong?why doesnt it work on windows?

    Please Register or Log in to view the hidden image!

     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. wet1 Wanderer Registered Senior Member

    Messages:
    8,616
    A link to dos through Windows uses a lot of memory and resources in the background. Most dos based programs are memory hungry and want a lot of it and a clear running field so to say. Windows allocates memory and this is not compatable with most dos programs. Some will work but not usually ones that demand the resources and are a hog about it.
     
  8. Porfiry Nomad Staff Member

    Messages:
    4,127
    C++ is a kludge of a language. So is Java. The only language/environment I've ever found pleasurable to use is Objective-C alongside the Cocoa/OpenStep/GNUstep APIs.
     
  9. Rick Valued Senior Member

    Messages:
    3,336
    MAYA

    does anyone know about MAYA language,i heard it was used for programming classic games like QUAKE-3,is that correct?
     
  10. daktaklakpak God is irrelevant! Registered Senior Member

    Messages:
    710
    Any advanced OS needs some way to protect itself from bad codes. In this case, windows created a memory access protection on the address around the boot code in BIOS. So any direct access will cause an illegal operation. Windows doesn't like to be rebooted just by any body making a BIOS call.

    Please Register or Log in to view the hidden image!

     
Thread Status:
Not open for further replies.

Share This Page