Jump to content

booting program

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
beginner-c

beginner-c

    Newbie

  • Members
  • Pip
  • 4 posts
i have pro that is printing hello world , i want to make it boot after bios like operating sys .

#2
shibbythestoner

shibbythestoner

    Programmer

  • Members
  • PipPipPipPip
  • 135 posts
I think you'd have to actually create a new operating system to do that :/
Posted Image

#3
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,720 posts
Yes and no. You can boot from a floppy that has your program on it, and in the code section of the boot sector, you can tell the computer to run your program. However, it'll never load Windows. You have to remove the floppy and do a hard reboot (i.e. push the power button). EDIT: If you know what you're doing, you can call the Windows loading program after yours exits, and load Windows normally.

Here's a series of articles on the web to help you get started:
Creating a "Toy" OS - Part I
Creating a "Toy" OS - Part II
Creating a "Toy" OS - Part III
Making Your Own Toy Boot Floppy
So you wanna create your own x86 Operating System?

By the way--DO NOT USE EXE FILES GENERATED BY A COMPILER! You must do this in Assembly language. The reason is that your program relies on a lot of DLLs, but you never notice because it's included in the bootstrap loader that the compiler writes for you. Since Windows loads those DLLs into memory, your program will crash and burn without them.

#4
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
I would find a emulator which fits to your platform (preferably Bochs) It can be a pain to reboot to your floppy* all the time after you've made a little change to the bootloader* If you're using an emulator you don't have to do that. You can simply just run it through Bochs.

* I wouldn't use a floppy, but a compact disc or similar. I think floppies are too old. I don't even have one. Am I the only one thinking like that?

* I suppose you're just going to print from the bootloader.

#5
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,720 posts
You can use a flash drive or other media as a boot device, but it's slightly more complicated in that you have to change the BIOS settings to boot from that media device first instead of from the hard drive. By default, most computers try booting from a floppy first.

#6
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
I've never seen a BIOS where it was hard to change the boot priorities. Most BIOSs, at least modern ones, have a decent GUI and descriptions for everything, so even someone who had never tried to change settings in BIOS would be able to do so. Personally, I've set my BIOS to first try the disc, and then my hard drive.

#7
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,720 posts
I didn't mean hard, just a little more of a hassle. It'd be hard if you want to change the boot priority from code.