Page 1 of 1
What's the process behind loading and executing a file?
Posted: Thu Nov 13, 2014 5:37 am
by ThisMayWork
My kernel main is running, I am happily printing messages on the screen using VGA, I have a filesystem, now it's time to load and execute my first program. I took care of the actual loading, but I have no idea where to load it and how to execute it. Do I just call it's main and cross my fingers hopping that it'll work? Also, if it's written in C instead of assembly, how do I expose my printf header to it? (I don't want to build an OS specific toolchain, I only want a hacky method to do it for now).
Re: What's the process behind loading and executing a file?
Posted: Thu Nov 13, 2014 5:40 am
by Combuster
Re: What's the process behind loading and executing a file?
Posted: Fri Nov 14, 2014 5:47 am
by ThisMayWork
Godsend, thank you Combuster.
Re: What's the process behind loading and executing a file?
Posted: Fri Nov 14, 2014 10:26 am
by max
ThisMayWork wrote:(I don't want to build an OS specific toolchain, I only want a hacky method to do it for now).
Starting to program in userspace is actually the exactly right time to build one. It is not as much effort as it looks, and you will love it.