Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to run Program without OS

Hello,

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.

Comments

  • xpzwhisperxpzwhisper Posts: 6Member
    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 myprog.com)
    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!
    Oliver
Sign In or Register to comment.