How to run Program without OS


We know, we run our program above OS layer. But I want to run my program written in assembly without OS layer how could I achive this, if you have any experiance in this regard please share it. I know that how, on starting, OS is loaded by BIOS; could we use that mathod to run our program withiout OS layer by placing our program in CD. As mostly first booting device is CD-ROM.


  • Hi,
    You need boot code that would boot the computer up after POST (after finding your bootable media e.g floppy, HDD, CD) and the code would have to go into mbr = master boot record.
    Now depending on whether you want to execute a file or code sitting on the device at a certain location you have to write the code accordingly.

    e.g you want to execute your written program from a memory location (which is easier) then you have to define in mbr

    JMP Segment:address
    for example you've written your program onto a floppy drive on
    4th sector
    address 10
    and the length is mby
    100h bytes

    then in the boot sector you have to read this code into memory (with int 13h) and make a JMP to that code after boot code stuff.
    now the only assumption i'm making is that you know how does the boot sector work ;) coz you have to do some tricks to make stack work properly along with correct segment.

    If you wish to execute a file (e.g
    then ask and i'll find this out for you as I can't remember that any more and I don't have my asm stuff on this PC and also I might have to ask my m8 who taught me these things. :)

    The second option is a bit more complicated. So I'd recommend you to do the first option first ;)

    Good luck!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion