Change directories and load a program
Change directories and load a program
How would I go about this? I had a test "dir" command but lost some of it due to expirementation. The command was no where near an actual directory command but a test to see if I could jump to the call and print "No working Directories" and do other commands but sadly it just froze my os for now. But how would I actually change to a different directorty? The current directories I have are "source, and obj" and how would I load a simple program?
Re: Change directories and load a program
Loading a program is done by reading the elf information of the binary, copy the relevant sections into memory, set up the relevant page mappings for the program and then jump to the elf entry address.
Changing a directory depends on how you have implemented your virtual filesystem which you probably havent written yet so you should take a look at that first and then everything should be clear to you.
EDIT: hehe I had written problem instead of program.
Changing a directory depends on how you have implemented your virtual filesystem which you probably havent written yet so you should take a look at that first and then everything should be clear to you.
EDIT: hehe I had written problem instead of program.
Last edited by Jezze on Sun Jan 27, 2013 11:48 am, edited 1 time in total.
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
http://github.com/Jezze/fudge/
Re: Change directories and load a program
Somewhere in your kernel you would need to maintain a record of what the current directory is. Then you would need a system call, so that whatever other programs might be interested, such as the shell, can find out what it is. Changing directory would mean updating your internal record of what the current directory is (another system call).
Re: Change directories and load a program
Thank you! Would that be easier in c or assembly?
Re: Change directories and load a program
How the hell would I know. Depends on your preference doesnt it? I'd guess C...
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
http://github.com/Jezze/fudge/