July 22nd, 2003, 12:55 PM
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?
July 22nd, 2003, 02:43 PM
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.
July 22nd, 2003, 02:55 PM
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?
July 22nd, 2003, 04:00 PM
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?