relationship between libxl & hvmloader
来源:互联网 发布:河北移动crm软件 编辑:程序博客网 时间:2024/06/11 06:47
Hvmloader provide boot services and run-time services for hvm ,It operates on the virtual devices provided by the device models. the domain builder for HVM virtual machines uses the tools/firmware/hvmloader to create the necessary information that will enable a unmodified guest VM to work in Xen。
When we use libxl tools to create hvm domain ,it will build hvm info then step into hvmloader to load elf image.These paper introduce how the relationship between libxl &hvmloader.
xl.c
|-main.c
|-libxl_read_file_contents() // read config file from parameter
|-parse_global_config() // parse config file decide which xl command
|-cmdtable_lookup() //look cmd from config file according cmd_table
|-create_domain(&dom_info)
|-libxl_read_file_contents()
|-parse_config_data() //parse config file
|-libxl_domain_create_new() //create a new domain according config data
|-do_domain_create()
|-initiate_domain_create()
|-libxl__domain_make()
|-libxl__domain_build_info_setdefault()
|-libxl__bootloader_run() // runing bootloader
|-domcreate_bootloader_done // after bootloader_run done , do callback
|-libxl__domain_build()
|-libxl__build_pre() //
|- libxl__build_hvm() / libxl__build_pv // according dom_type {HVM, PV}
|-libxl__domain_firmware()
|-xc_hvm_build()
|-xc_read_image() //the image is hvmloader which format is elf
|-setup_guest() // copy hvmloader to special memory 【elf.pstart = 0x100000 (1M) elf.pend=
0x171764 (1M + 435388)】
|-elf_init()
|-elf_parse_binary()
|-modules_init()
|-xc_domain_set_pod_target() //Subtract 0x20 from target_pages for the VGA "hole"
|-xc_domain_populate_physmap_exact() //allocate memory for HVM guest ,skipping VGA
hole 0xA0000-0xC0000. first alloc 1G, if fails , turn 2M , also fails, turn 4k eventuraly
|-loadelfimage() // copy elf image into memory
|-elf->dest_base = xc_map_foreign_ranges(pages = pfn_end - pfn_start)
|-elf_load_binary() //load initial elf image
|-loadmodules()
|-build_hvm_info()
|-xc_set_hvm_param() // include HVM_PARAM_STORE_PFN, HVM_PARAM_BUFIOREQ_PFN,
and HVM_PARAM_IOREQ_PFN
|-xc_map_foreign_range() //running with CR0.PG=0 when using Intel EPT. Create a 32-bit
non-PAE page directory of superpages
|-elf_uval() //Insert JMP <rel32> instruction at address 0x0 to reach entry point
|-hvm_build_set_params()
|- libxl__build_post() // write into xenstore entry
|- domcreate_rebuild_done()
|-libxl_domain_unpause() // begin to run vm
|- autoconnect_vncviewer()
|- do_daemonize) // create a fork for new domain
|-libxl_create_logfile()
while(1) : while the domain start
|-domain_wait_event() //after create the domain , wait event ,according the event->type ,[SHUTDOWN
/DEATH/EJECT], do diff operation
|-console_child_report()
In all, when use libxl to create hvm domain, the hvmloader provide a virtual BIOS functiong for hvm domain.Hvmloader is loaded atxl create ,the process as follow:
[libxl]create_domain()—> parse_config_data() —>do_domain_create() —>domcreate_bootloader_done —>
libxl_domain_build_pre()—>libxl_domain_build_hvm() —>setup_guest() —>load efl image to memory
|
[hvmloader]—>step into hvmloader.c ,call asm —>"call main" —>hvmloader.main() —>handler_post() , load into [0xc0000 -0xfffff ] —>do_post() , call INT 0x19,boot Guest OS —>do_boot() —>boot_disk ,transfer control to Guest OS.
0 0
- relationship between libxl & hvmloader
- Relationship Between Availability and Reliability
- Relationship between the Linux Distros
- Relationship between two numbers【2】
- use a relationship between two DataTable
- Relationship between Test Spec and Dev Spec
- The relationship between OpenCore and OMX
- The relationship between Swing,AWT and SWT.
- The relationship between Objects and Closures
- relationship and differences between Bayesian methods
- Relationship between Link quality and signal level
- The Relationship Between ZB,NB,SB and LP 第一篇
- What is the relationship between WebIDL and WebKitIDL
- Relationship between HOF, MBH, convolution layer and sparse coding
- Relationship between catalog, schema, user, and database instance
- 转载:Ask HN: Relationship between OO and functional programming?
- Servlet与会话Bean 之间的关系 The Relationship Between Servlet and SessionBean
- The trust relationship between this workstation and the primary domain failed.
- 成为优秀程序员的十个有效方法
- uva 1557 - Calendar Game(博弈)
- lightoj 1012
- 先起个名字叫第一篇博客吧
- malloc free 和 new delete 区别
- relationship between libxl & hvmloader
- lightoj 1013
- 如何使用Hadoop的ChainMapper和ChainReducer
- Python框架、库和软件资源大全
- Linux学习之"setjmp和longjmp函数"
- JavaFX文档(10)掌握FXML——2 在JavaFX2.1和2.2版中对FXML的增强
- python操作Excel读写--使用xlrd
- New delete 与malloc free 的联系与区别
- Sphinx2.1.9安装及中文索引配置