Page 1 of 1

Executing code from VFS

Posted: Sun Feb 06, 2011 8:18 am
by LegendDairy
Hi,
I just set up a VFS en initrd using GRUB and I also set up syscalls and I even setup multitasking. Now I was wondering would it be hard to place a "*.bin" in my VFS and execute it?
And where in the *.bin-files does the actual code starts?

Re: Executing code from VFS

Posted: Sun Feb 06, 2011 8:26 am
by Tosi
It starts wherever you want it to. You have control over paging, so you have control over where your programs run. If you're not using paging (bad), just find a good spot in physical memory to put it.
If you want a simple executable, write some PIC and assemble it as a flat binary file. Then put that in your initramd and run it anywhere.