All of lore.kernel.org
 help / color / mirror / Atom feed
* Custom Guest OS not booting
@ 2005-10-02 18:14 ivan
  2005-10-03 18:13 ` Scott Parish
  0 siblings, 1 reply; 5+ messages in thread
From: ivan @ 2005-10-02 18:14 UTC (permalink / raw)
  To: xen-devel

Hi,
Im trying to get a grip on developing with xen and I'm trying to create my own
guest os. The OS is very simple, it prints out a message and then exits.
Source listing below.
When I try to boot this image with xm create -c hello (hello just points
kernel to ivanos) one of two things happen. 

1)
It prints:
Using config file "hello".
Started domain IvanOS, console on port 9627
************ REMOTE CONSOLE: CTRL-] TO QUIT ********

I press return twice and it prints
************ REMOTE CONSOLE EXITED *****************

2)
it prints:
Using config file "hello".
Started domain IvanOS, console on port 9628
************ REMOTE CONSOLE: CTRL-] TO QUIT ********

************ REMOTE CONSOLE EXITED *****************
(104, 'Connection reset by peer')
Error: Error connecting to xend, is xend running?

xend is running. in both cases xend.log shows 
--SNIP--
[2005-10-02 19:10:32 xend] INFO (XendRoot:112) EVENT> xend.console.create [13,
28, 9628]
[2005-10-02 19:10:32 xend] DEBUG (blkif:155) Connecting blkif
<BlkifBackendInterface 28 0>
[2005-10-02 19:10:32 xend] INFO (XendRoot:112) EVENT> xend.domain.create
['IvanOS', '28']
[2005-10-02 19:10:32 xend] INFO (XendRoot:112) EVENT> xend.domain.unpause
['IvanOS', '28']
[2005-10-02 19:10:32 xend] DEBUG (XendDomain:244) XendDomain>reap> domain died
name=IvanOS id=28
[2005-10-02 19:10:32 xend] INFO (XendDomain:564) Destroying domain:
name=IvanOS
[2005-10-02 19:10:32 xend] DEBUG (XendDomainInfo:665) Destroying vifs for
domain 28
--END SNIP--

If someone could point out where im going wrong it would be very much
appreciated. Is there any way to get a more detailed trace of what xen is
doing?

Best regards
Ivan Kelly

--SNIP go.S--
.section __xen_guest
        .ascii "GUEST_OS=ivanos,GUEST_VER=2.0,XEN_VER=2.0,LOADER=generic"
        .byte 0

        .text   
.globl start

start:
        cld
        movl $18,%eax
        movl $0,%ebx
        movl $hello_len,%ecx
        movl $ivanhello,%edx
        int $0x82

        movl $6,%eax
        movl $2,%ebx
        movl $0,%ecx
        int  $0x82

hang:   jmp hang


ivanhello:      .ascii "Welcome to Ivan Os. Have fun!\n"
        hello_len = . - ivanhello
--END SNIP--

--SNIP Makefile--
CC := gcc
LD := ld

# Linker should relocate monitor to this address
MONITOR_BASE := 0xE0100000

# NB. '-Wcast-qual' is nasty, so I omitted it.
CFLAGS := -fno-builtin -O3 -Wall -I. -Wredundant-decls
CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline -ansi

OBJS := 
TARGET := ivanos

default: $(TARGET)

$(TARGET): go.o $(OBJS)
        $(LD) -N -Txen.lds go.o $(OBJS) -o $@.elf
        objcopy -R .note -R .comment $@.elf $@
        gzip -f -9 -c $@ >$@.gz

clean:
        find . -type f -name '*.o' | xargs rm -f
        rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
        find . -type l | xargs rm -f

%.o: %.c $(HDRS) Makefile
        $(CC) $(CFLAGS) -c $< -o $@

%.o: %.S $(HDRS) Makefile
        $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
--END SNIP--

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Custom Guest OS not booting
  2005-10-02 18:14 Custom Guest OS not booting ivan
@ 2005-10-03 18:13 ` Scott Parish
  2005-10-03 19:33   ` ***SPAM*** " Ivan Kelly
  2005-10-05  0:00   ` Mark Williamson
  0 siblings, 2 replies; 5+ messages in thread
From: Scott Parish @ 2005-10-03 18:13 UTC (permalink / raw)
  To: ivan; +Cc: xen-devel

I didn't check which hcall you're making, but i'm betting its the one  
to do consoleio. By default, only dom0 is allowed to do such. You're  
options are either to do the work to get domU io working (non- 
trivial), or hack xen to allow anybody to write to consoleio. Look in  
xen/drivers/char/console.c line 349:

     /* Only domain 0 may access the emergency console. */
     if ( current->domain->domain_id != 0 )
         return -EPERM;

Good luck
sRp


On Oct 2, 2005, at 1:14 PM, ivan wrote:

> Hi,
> Im trying to get a grip on developing with xen and I'm trying to  
> create my own
> guest os. The OS is very simple, it prints out a message and then  
> exits.
> Source listing below.
> When I try to boot this image with xm create -c hello (hello just  
> points
> kernel to ivanos) one of two things happen.
>
> 1)
> It prints:
> Using config file "hello".
> Started domain IvanOS, console on port 9627
> ************ REMOTE CONSOLE: CTRL-] TO QUIT ********
>
> I press return twice and it prints
> ************ REMOTE CONSOLE EXITED *****************
>
> 2)
> it prints:
> Using config file "hello".
> Started domain IvanOS, console on port 9628
> ************ REMOTE CONSOLE: CTRL-] TO QUIT ********
>
> ************ REMOTE CONSOLE EXITED *****************
> (104, 'Connection reset by peer')
> Error: Error connecting to xend, is xend running?
>
> xend is running. in both cases xend.log shows
> --SNIP--
> [2005-10-02 19:10:32 xend] INFO (XendRoot:112) EVENT>  
> xend.console.create [13,
> 28, 9628]
> [2005-10-02 19:10:32 xend] DEBUG (blkif:155) Connecting blkif
> <BlkifBackendInterface 28 0>
> [2005-10-02 19:10:32 xend] INFO (XendRoot:112) EVENT>  
> xend.domain.create
> ['IvanOS', '28']
> [2005-10-02 19:10:32 xend] INFO (XendRoot:112) EVENT>  
> xend.domain.unpause
> ['IvanOS', '28']
> [2005-10-02 19:10:32 xend] DEBUG (XendDomain:244) XendDomain>reap>  
> domain died
> name=IvanOS id=28
> [2005-10-02 19:10:32 xend] INFO (XendDomain:564) Destroying domain:
> name=IvanOS
> [2005-10-02 19:10:32 xend] DEBUG (XendDomainInfo:665) Destroying  
> vifs for
> domain 28
> --END SNIP--
>
> If someone could point out where im going wrong it would be very much
> appreciated. Is there any way to get a more detailed trace of what  
> xen is
> doing?
>
> Best regards
> Ivan Kelly
>
> --SNIP go.S--
> .section __xen_guest
>         .ascii  
> "GUEST_OS=ivanos,GUEST_VER=2.0,XEN_VER=2.0,LOADER=generic"
>         .byte 0
>
>         .text
> .globl start
>
> start:
>         cld
>         movl $18,%eax
>         movl $0,%ebx
>         movl $hello_len,%ecx
>         movl $ivanhello,%edx
>         int $0x82
>
>         movl $6,%eax
>         movl $2,%ebx
>         movl $0,%ecx
>         int  $0x82
>
> hang:   jmp hang
>
>
> ivanhello:      .ascii "Welcome to Ivan Os. Have fun!\n"
>         hello_len = . - ivanhello
> --END SNIP--
>
> --SNIP Makefile--
> CC := gcc
> LD := ld
>
> # Linker should relocate monitor to this address
> MONITOR_BASE := 0xE0100000
>
> # NB. '-Wcast-qual' is nasty, so I omitted it.
> CFLAGS := -fno-builtin -O3 -Wall -I. -Wredundant-decls
> CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith - 
> Winline -ansi
>
> OBJS :=
> TARGET := ivanos
>
> default: $(TARGET)
>
> $(TARGET): go.o $(OBJS)
>         $(LD) -N -Txen.lds go.o $(OBJS) -o $@.elf
>         objcopy -R .note -R .comment $@.elf $@
>         gzip -f -9 -c $@ >$@.gz
>
> clean:
>         find . -type f -name '*.o' | xargs rm -f
>         rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $ 
> (TARGET).gz
>         find . -type l | xargs rm -f
>
> %.o: %.c $(HDRS) Makefile
>         $(CC) $(CFLAGS) -c $< -o $@
>
> %.o: %.S $(HDRS) Makefile
>         $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
> --END SNIP--
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ***SPAM*** Re: Custom Guest OS not booting
  2005-10-03 18:13 ` Scott Parish
@ 2005-10-03 19:33   ` Ivan Kelly
  2005-10-05  0:00   ` Mark Williamson
  1 sibling, 0 replies; 5+ messages in thread
From: Ivan Kelly @ 2005-10-03 19:33 UTC (permalink / raw)
  To: xen-devel

On Mon, Oct 03, 2005 at 01:13:26PM -0500, Scott Parish wrote:
> I didn't check which hcall you're making, but i'm betting its the one  
> to do consoleio. By default, only dom0 is allowed to do such. You're  
yup, it's console io.
> options are either to do the work to get domU io working (non- 
> trivial), or hack xen to allow anybody to write to consoleio. Look in  
> xen/drivers/char/console.c line 349:
I tried the hack to allow all to write, but that didn't seem to work. where
should the console io go to? the linux console? xm dmesg? 
If I was to try and get domu io working where should i start? im guessing it's
a matter of writing a tty driver. does xen have a backend driver for this type
of thing?

Regards 
Ivan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Custom Guest OS not booting
  2005-10-03 18:13 ` Scott Parish
  2005-10-03 19:33   ` ***SPAM*** " Ivan Kelly
@ 2005-10-05  0:00   ` Mark Williamson
  2005-10-05 10:36     ` Keir Fraser
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Williamson @ 2005-10-05  0:00 UTC (permalink / raw)
  To: xen-devel; +Cc: ivan, Scott Parish

> I didn't check which hcall you're making, but i'm betting its the one
> to do consoleio. By default, only dom0 is allowed to do such. You're
> options are either to do the work to get domU io working (non-
> trivial), or hack xen to allow anybody to write to consoleio. Look in
> xen/drivers/char/console.c line 349:
>
>      /* Only domain 0 may access the emergency console. */
>      if ( current->domain->domain_id != 0 )
>          return -EPERM;

I thought you could build Xen with debug=y to make the console hypercall work 
for other doms...

Could be wrong now but worth a try.

Cheers,
Mark

> Good luck
> sRp
>
> On Oct 2, 2005, at 1:14 PM, ivan wrote:
> > Hi,
> > Im trying to get a grip on developing with xen and I'm trying to
> > create my own
> > guest os. The OS is very simple, it prints out a message and then
> > exits.
> > Source listing below.
> > When I try to boot this image with xm create -c hello (hello just
> > points
> > kernel to ivanos) one of two things happen.
> >
> > 1)
> > It prints:
> > Using config file "hello".
> > Started domain IvanOS, console on port 9627
> > ************ REMOTE CONSOLE: CTRL-] TO QUIT ********
> >
> > I press return twice and it prints
> > ************ REMOTE CONSOLE EXITED *****************
> >
> > 2)
> > it prints:
> > Using config file "hello".
> > Started domain IvanOS, console on port 9628
> > ************ REMOTE CONSOLE: CTRL-] TO QUIT ********
> >
> > ************ REMOTE CONSOLE EXITED *****************
> > (104, 'Connection reset by peer')
> > Error: Error connecting to xend, is xend running?
> >
> > xend is running. in both cases xend.log shows
> > --SNIP--
> > [2005-10-02 19:10:32 xend] INFO (XendRoot:112) EVENT>
> > xend.console.create [13,
> > 28, 9628]
> > [2005-10-02 19:10:32 xend] DEBUG (blkif:155) Connecting blkif
> > <BlkifBackendInterface 28 0>
> > [2005-10-02 19:10:32 xend] INFO (XendRoot:112) EVENT>
> > xend.domain.create
> > ['IvanOS', '28']
> > [2005-10-02 19:10:32 xend] INFO (XendRoot:112) EVENT>
> > xend.domain.unpause
> > ['IvanOS', '28']
> > [2005-10-02 19:10:32 xend] DEBUG (XendDomain:244) XendDomain>reap>
> > domain died
> > name=IvanOS id=28
> > [2005-10-02 19:10:32 xend] INFO (XendDomain:564) Destroying domain:
> > name=IvanOS
> > [2005-10-02 19:10:32 xend] DEBUG (XendDomainInfo:665) Destroying
> > vifs for
> > domain 28
> > --END SNIP--
> >
> > If someone could point out where im going wrong it would be very much
> > appreciated. Is there any way to get a more detailed trace of what
> > xen is
> > doing?
> >
> > Best regards
> > Ivan Kelly
> >
> > --SNIP go.S--
> > .section __xen_guest
> >         .ascii
> > "GUEST_OS=ivanos,GUEST_VER=2.0,XEN_VER=2.0,LOADER=generic"
> >         .byte 0
> >
> >         .text
> > .globl start
> >
> > start:
> >         cld
> >         movl $18,%eax
> >         movl $0,%ebx
> >         movl $hello_len,%ecx
> >         movl $ivanhello,%edx
> >         int $0x82
> >
> >         movl $6,%eax
> >         movl $2,%ebx
> >         movl $0,%ecx
> >         int  $0x82
> >
> > hang:   jmp hang
> >
> >
> > ivanhello:      .ascii "Welcome to Ivan Os. Have fun!\n"
> >         hello_len = . - ivanhello
> > --END SNIP--
> >
> > --SNIP Makefile--
> > CC := gcc
> > LD := ld
> >
> > # Linker should relocate monitor to this address
> > MONITOR_BASE := 0xE0100000
> >
> > # NB. '-Wcast-qual' is nasty, so I omitted it.
> > CFLAGS := -fno-builtin -O3 -Wall -I. -Wredundant-decls
> > CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -
> > Winline -ansi
> >
> > OBJS :=
> > TARGET := ivanos
> >
> > default: $(TARGET)
> >
> > $(TARGET): go.o $(OBJS)
> >         $(LD) -N -Txen.lds go.o $(OBJS) -o $@.elf
> >         objcopy -R .note -R .comment $@.elf $@
> >         gzip -f -9 -c $@ >$@.gz
> >
> > clean:
> >         find . -type f -name '*.o' | xargs rm -f
> >         rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $
> > (TARGET).gz
> >         find . -type l | xargs rm -f
> >
> > %.o: %.c $(HDRS) Makefile
> >         $(CC) $(CFLAGS) -c $< -o $@
> >
> > %.o: %.S $(HDRS) Makefile
> >         $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
> > --END SNIP--
> >
> > _______________________________________________
> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Custom Guest OS not booting
  2005-10-05  0:00   ` Mark Williamson
@ 2005-10-05 10:36     ` Keir Fraser
  0 siblings, 0 replies; 5+ messages in thread
From: Keir Fraser @ 2005-10-05 10:36 UTC (permalink / raw)
  To: Mark Williamson; +Cc: ivan, xen-devel, Scott Parish


On 5 Oct 2005, at 01:00, Mark Williamson wrote:

> I thought you could build Xen with debug=y to make the console 
> hypercall work
> for other doms...
>
> Could be wrong now but worth a try.

Yes they can if 'verbose=y' is specified. There should be no problem 
since verbosity is enabled by default right now.

  -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-10-05 10:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-02 18:14 Custom Guest OS not booting ivan
2005-10-03 18:13 ` Scott Parish
2005-10-03 19:33   ` ***SPAM*** " Ivan Kelly
2005-10-05  0:00   ` Mark Williamson
2005-10-05 10:36     ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.