load program

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
compro
Posts: 9
Joined: Sun Mar 18, 2012 10:29 am

load program

Post 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.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: load program

Post by bluemoon »

Code: Select all

jmp [location]
compro
Posts: 9
Joined: Sun Mar 18, 2012 10:29 am

Re: load program

Post 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?
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: load program

Post 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
Post Reply