Page 1 of 1

load program

Posted: Wed Apr 11, 2012 12:29 pm
by compro
i have made a basic kernel
now what i want to do is load a .out file as a module (using grub) in my kernel and then execute the program.
how to go about this. any ideas.

Re: load program

Posted: Wed Apr 11, 2012 12:57 pm
by bluemoon

Code: Select all

jmp [location]

Re: load program

Posted: Wed Apr 11, 2012 1:22 pm
by compro
lets say i ended the execution. and now want to return to the code after the line where jmp was called. how do i do that?

Re: load program

Posted: Wed Apr 11, 2012 1:24 pm
by bluemoon
How about this...

Code: Select all

  call module
.halt:
  hlt
  jmp .halt


module:
   ret
just call to the module address you got from grub