Hi all, I have create a simpole asm program to print a helloworld message on the screen, and I create a makefile to compile it. The file is named helloworld.gz. How can I start a guest system which run this program? How can I wrote the config file? Thank you for your responses! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > frittitta1@virgilio.it > Sent: 07 August 2006 09:59 > To: xen-devel@lists.xensource.com > Subject: [Xen-devel] Problem with config file > Importance: High > > Hi all, > I have create a simpole asm program to print a helloworld > message on the screen, and I create a makefile to compile it. > The > file is named helloworld.gz. > How can I start a guest system which run > this program? > How can I wrote the config file?Can you please explain just a little bit more about what you''re trying to do? Is your "helloworld.gz" a "kernel" (loosely termed)? If not, skip down to the next section. First of all, if you''re loading a kernel that isn''t a para-virtual OS, the only way you can do this would be as a HVM (fully virtualized, requiring AMD SVM/Intel VT support in the processor). There are a couple of different ways to achieve this (two obvious ones: Either replace hvmloader with your binary, which is fine if you just want to have a clean virtual machine with basic hardware "at reset", or as a bootable disk image (ISO, Hard disk or floppy image) that gets booted by the BIOS - in this state you have text-mode VGA screen and all the IDE/Floppy/CDROM initialized enough to both use BIOS calls and direct hardware access). Neither of these forms, by the way, would want a "gzip" format for easy workings - you could of course write a loader that boots according to one of the two above mentioned methods and then uncompresses the gzip file you have "attached to it". If you haven''t got a kernel, you would want to load a kernel of some sort, which you can get by looking at the /etc/xen/xmexample* files. Then you need to connect to the virtual machine and copy your executable file over from wherever it lives to the virtual machine, and execute it - just the same way you''d execute the same file on the Dom0. -- Mats> > Thank you for your > responses! > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi, I would write a simple program for Xen which print I simple message on the screen. I wrote an assembler procedure to print an helloworld message: .text .globl _start _start: cld # from include/asm-xeno/hypervisor.h movl $2,% eax # __HYPERVISOR_console_write (include/asm- xeno/hypervisor-ifs/hypervisor-if.h) movl $hello_message,% ebx # arg1 = buffer virtual address movl $hello_message_len,%ecx # arg2 = buffer length int $0x82 # from include/asm-xeno/hypervisor.h movl $8,% eax # __HYPERVISOR_sched_op movl $1,% ebx # SCHEDOP_exit int $0x82 hang: jmp hang # shouldn''t get here hello_message: . ascii "This is the hello world program\n" hello_message_len = . - hello_message The Xen loader also wants a 12-byte header on the image file. So I wrote a little assembler module (xenoguestheader.s) to handle that: .text .globl _start _start: .ascii "XenoGues" # read_kernel_header (tools/xc/lib/xc_linux_build.c) .long _start # - the kernel''s load address The final image has to consist of the 12-bytes object code from xenoguestheader.s followed the object code from helloworld.s. Here is my makefile to accomplish that: helloworld.gz: helloworld.s xenoguestheader.raw as -o helloworld.o - a=helloworld.l helloworld.s ld -Ttext 0x100000 -o helloworld. elf helloworld.o objcopy -O binary -S -g helloworld.elf helloworld.raw cat xenoguestheader.raw helloworld.raw | gzip > helloworld.gz xenoguestheader.raw: xenoguestheader.s as -o xenoguestheader.o xenoguestheader.s ld -Ttext 0x100000 -o xenoguestheader xenoguestheader.o objcopy -O binary -S -g xenoguestheader xenoguestheader.raw This makefile produce a helloworld. elf. The problem is to write a config file to do start this program. I would call xm create -c <config_file> and to see the message on the screen. I wrote this option kernel = "helloworld.elf" memory = 32 name = "HelloWorld" on_crash = ''destroy'' But when I run this command on the screen I read this message Error: (22, ''Invalid argument'') _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel