Results 1 to 4 of 4

Thread: MBR-Loader?

  1. #1
    Junior Member
    Join Date
    Jul 2003

    Question MBR-Loader?

    Hello ... I want to start a programm before my OS boots so there is only one possibility: Put my programm in the MBR. But in fact im not experienced in ASM and so i thougt about writing a programm in C++. But i know that you cant put this programm in the MBR. And there is an other problem too: The size of the programm is larger than the freespace in the MBR!!! So i thought about putting a little loader-programm in the MBR ... and so *ahhmm* does that work? Or is the OS booting faster? If i use a loader and put it before the command to load the OS ... then it starts the programm, but at the same time the next command in the MBR starts the OS. So there are these programms runing parallel, but i want to start my programm first and then load the os ... can you help me?


  2. #2
    AO Curmudgeon rcgreen's Avatar
    Join Date
    Nov 2001
    You would have to learn at least a little assembly language.
    You could modify the boot sector to jump to an executable other than
    the OS kernel, but the executable program would have to be written
    in such a way that it does not need to call any OS services as it runs,
    because it runs before the OS.

    Many of the subroutines in normal programs depend on the OS being up and running
    in order to provide services that the prog wants to call. You would have
    to write your program in assembly and only make bios interrupt calls
    for IO, disk access etc.

    To run a prog written in C or any high level language, an OS must be running
    to support it.
    I came in to the world with nothing. I still have most of it.

  3. #3
    Junior Member
    Join Date
    Jul 2003
    So there is no possibility to run a programm thats larger than 512bytes? Or does an ASM programm work if i put i after the MBR and load it from there?

    tnx Merlin

  4. #4
    Senior Member
    Join Date
    Mar 2003
    central il
    IF the ASM is writen properly it will work, but it will involve a lot of machine level language, by the time you know enough ASM to write a program that will run without the OS you will know how to run it in the MBR.
    Who is more trustworthy then all of the gurus or Buddha’s?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts