problem about writing a hello world for VM

View: New views
2 Messages — Rating Filter:   Alert me  

problem about writing a hello world for VM

by 于爱民 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
hello, every one!
 
  I was reading the source code of ResourceMon. As I see in load_current_module() function, when resourcemon has variable vm_is_multi_module set, it would check whether a next VM definition is found. If it is, then vm->start_vm() will be called to start the current vm.
  The corresponding code is as following:
  bool module_manager_t::load_current_module(){
    .....
    if( vm_is_multi_module )
    {
    .....
      L4_Word_t mod_idx = this->current_module + 1;
     while( mod_idx < vm_modules->get_total() )
     {
         vm_modules->get_module_info( mod_idx, mod_cmdline,
          mod_haddr_start, mod_size );
         if( cmdline_has_vmstart(mod_cmdline) )
      break; // We found the next VM definition.
        }
    }
     ......
    if( !vm->start_vm() )
    {
     printf( "Unable to start the virtual machine.\n");
     goto err_out;
    }
 
    return true;
.....
  }
My question is : where does the resourcemon load and start the next vm?
 
Funther, I would write my own VM, can someone give a "hello world" sample code which can run as a VM?
 
Thanks very much!!!
 

RE: problem about writing a hello world for VM

by Jan Stoess :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> My question is : where does the resourcemon load and start the next vm?

The boot process follows a cooperative scheme where the next VM is started
in IResourcemon_client_init_complete_implementation(), which is a callback
function invoked by the current wedge via IDL.  

> Funther, I would write my own VM, can someone give a "hello world" sample
code which can run as a VM?

You could look at some toy OSes built upon L4 for that purpose: e.g.,
http://l4ka.org/relatedprojects.php lists a couple of such OSes developed by
students during course projects here at the chair.

-Jan
 
--
Jan Stoess
System Architecture Group
University of Karlsruhe
Phone: +49 (721) 608-4056
Fax: +49 (721) 608-7664
eMail: stoess@...



smime.p7s (4K) Download Attachment