How can I boot a hard drive into my own non-os software?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How can I boot a hard drive into my own non-os software?
When I say non-os I really mean just some executable code
of my own.
My scenario is:
x86_64 processor, standard hard drive.
I want to create a blank partition and boot into my executable on it.
I'm thinking to use grub as a boot loader but not sure what to
do with my code to make that executable -
Can anyone talk me through how to configure my code so grub
can find and run it? Must I use a header such as ELF - if so what is the minimum I must do - or can I do it as a simple executable without that?
also can I get grub onto a drive before there is any other OS on it?
Or can I get a simpler solution than grub in the first place?
Yes, however without an OS you can not use standard libraries or functions etc. In 16 bit real mode you can use the built in BIOS functions for keyboard and writing to the screen. I would guess you do not have enough programming experience to be able to do this so tell us what are you trying to accomplish so we can offer you some different ideas.
Yes, however without an OS you can not use standard libraries or functions etc. In 16 bit real mode you can use the built in BIOS functions for keyboard and writing to the screen. I would guess you do not have enough programming experience to be able to do this so tell us what are you trying to accomplish so we can offer you some different ideas.
I've been around the block a few times. This is just something I've never done.
It turns out reading the grub docs had persuaded me this was a lot more complicated
than it is but thanks again for the suggestions anyway.
Personally, what I would do is to strip Linux to its very-bare minimum, customized for exactlyyour hardware, and use it as the underlayment of your application.
There are also various non-Linux OSes that are specifically targeted at device-control applications . . .
In short, if it were me, I would not "blur the line" between "your application" and "the system-control program, whatever it may be." I would not merge this concern into "your application."
If you wish it to be, the Linux kernel can be "pretty damned small."
Last edited by sundialsvcs; 10-25-2016 at 02:33 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.