Re: Start Linux inside a Vancouver VM using a virtual disk.

Mehdi AICHOUCH <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <CAGBLRX6_q+44_egGTeOHyt21+8NKLVQJJ-359GaDPxLvQthDWg@mail.gmail.com>
Hello Julian,

Thank you very much for your answer!
It clarified to me many points.

You are right, I would like to use a virtual disk
by providing a hard disk image.

I correct all the wrong parameters regarding
the sigma0 and vancouver virtual disk configuration
in my script.

But, I still get an error when Linux try to mount
the virtual file system.

I used my script to boot Linux from the hard disk image "bootable-hdd.img"
as in the example "vancouver-boot-from-disk.wv" and it worked well.

But, when I modified this script in order to make vancouver
starts my patched Linux kernel and the "bootable-hdd.img"
hard disk image, it failed at the mounting of the VFS.

Here are some traces from NOVA, NUL and Linux boot:


NOVA Microhypervisor v5-ee02aed (x86_32): Nov 23 2012 12:23:57 [gcc 4.6.2]

[ 0] CORE:0:0:0 10:2:3:0 [0] AMD Phenom(tm) 9550 Quad-Core Processor
=> hostkeyb:0+0x60+1+12 <=
=> script_start:1+1 <=
=> service_config <=
=> vdisk:rom://imgs/bootable-hdd.img <=
vdisk: Opened 'imgs/bootable-hdd.img' 0x7dde00 bytes.
vdisk: Attached as vdisk 0.
=> service_disk <=
disk: Added '0'
Constructing service /disk...
Service /disk registered.

...

(5) INIT done
(5) reset CPU from c mtr_in effff
(5) > bool VirtualBiosMultiboot::receive(MessageBios&) rip ffff ilen 0 cr0
10 efl 2
(5) module 0 start 0x81c00000+934 cmdline rom://bin/boot/munich

(5) module 1 start 0x81c02000+42ffd0 cmdline rom://imgs/bzImage
root=/dev/sda1 clocks
(5) module 2 start 0x82033000+7dde00 cmdline rom://imgs/bootable-hdd.img

(5) #   MUNICH: v.0.4.6 starts Linux
(5) #   MUNICH: 3.2.16-rt27 (mehdi@mehdi-laptop) #3 SMP PREEMPT RT Sat Apr
28 23:30:12
(5) # |   CEST 2012
(5) #   MUNICH: root=/dev/sda1 clocksource=tsc console=ttyS0
(5) #   MUNICH: initrd 1C33000
(5) #   MUNICH: copy image
(5) #   MUNICH: start kernel

...

(5) #   [   23.256381] VFS: Cannot open root device "sda1" or
unknown-block(0,0)
(5) #   [   23.256381] Please append a correct "root=" boot option; here
are the availa
(5) # |   ble partitions:
(5) #   [   23.256381] Kernel panic - not syncing: VFS: Unable to mount
root fs on unkn
(5) # |   own-block(0,0)
(5) #   [   23.256381] Pid: 1, comm: swapper/0 Tainted: G        W
 3.2.16-rt27 #3
(5) #   [   23.256381] Call Trace:
(5) #   [   23.256381]  [<c05f5299>] panic+0x66/0x173
(5) #   [   23.256381]  [<c0849ca1>] mount_block_root+0x1d3/0x26c
(5) #   [   23.256381]  [<c02311bc>] ? sys_mknod+0x2c/0x30
(5) #   [   23.256381]  [<c0849d93>] mount_root+0x59/0x5f
(5) #   [   23.256381]  [<c0849ee7>] prepare_namespace+0x14e/0x192
(5) #   [   23.256381]  [<c0221665>] ? sys_access+0x25/0x30
(5) #   [   23.256381]  [<c0849344>] kernel_init+0x13f/0x14e
(5) #   [   23.256381]  [<c0849205>] ? parse_early_options+0x25/0x25
(5) #   [   23.256381]  [<c05fe6c2>] kernel_thread_helper+0x6/0x10


And this is my script to Linux inside a vancouver VM using virtual disk.


#!/usr/bin/env novaboot
# -*-sh-*-
HYPERVISOR_PARAMS=serial
QEMU_FLAGS=-cpu phenom -smp 2 -m 512
bin/apps/sigma0.nul tracebuffer_verbose S0_DEFAULT mmconfig hostserial
hostvga hostkeyb:0,0x60,1,12 service_config \
    vdisk:rom://imgs/bootable-hdd.img \
    service_disk \
    script_start:1
bin/apps/vancouver.nul
bin/boot/munich
imgs/bzImage
imgs/bootable-hdd.img
vancuver.nulconfig <<EOF
sigma0::mem:64 sigma0::dma name::/s0/log name::/s0/timer name::/s0/fs/rom
name::/s0/admission name::/s0/disk sigma0::drive:0 ||
rom://bin/apps/vancouver.nul PC_PS2 ahci:0xe0800000,14,0x30 drive:0,0,0 ||
rom://bin/boot/munich ||


rom://imgs/bzImage root=/dev/sda1 clocksource=tsc console=ttyS0 ||
EOF


Could you please help me finding what's wrong in my test case.
Thank you very much in advance.

Mehdi.

On Mon, Nov 26, 2012 at 6:40 PM, Julian Stecklina <
[email protected]> wrote:

> Thus spake Mehdi AICHOUCH <[email protected]>:
>
> > Hello,
> >
> > I was trying to run Linux inside a Vancouver virtual machine and using a
> > virtual disk.
> > But, I got an error when Linux kernel try to mount the root file system.
> >
> >
> > #!/usr/bin/env novaboot
> > # -*-sh-*-
> > HYPERVISOR_PARAMS=serial
> > WVDESC=Kernel compile inside VM (on virtual disk, EPT + VPID)
> > WVTEST_TIMEOUT=1200
> > QEMU_FLAGS=-cpu phenom -m 2048M
> > bin/apps/sigma0.nul tracebuffer_verbose S0_DEFAULT hostserial hostvga
> > hostkeyb:0,0x60,1,12 script_start:1,1 \
> >     service_config vdisk_empty:736870912 service_disk
> > bin/apps/vancouver.nul
> > bin/boot/munich
> > imgs/bzImage
> > imgs/mdisk.img
> > vancuver.nulconfig <<EOF
> > sigma0::mem:512 sigma0::dma  name::/s0/log name::/s0/timer
> name::/s0/fs/rom
> > name::/s0/admission name::/s0/disk disk::0 ||
> > rom://bin/apps/vancouver.nul PC_PS2 ahci:0xe0800000,14,0x30 drive:0,0,0
> ||
> > rom://bin/boot/munich ||
> > rom://imgs/bzImage clocksource=tsc console=ttyS0 ||
> > rom://imgs/mdisk.img
> > EOF
> >
>
> What your configuration script is telling Vancouver, is that you want to
> use mdisk.img as a initrd/initramfs for your Linux kernel. In addition
> you attach an empty virtual disk as a virtual SATA disk (which probably
> fails because disk::0 is wrong, see below). If, as I
> suspect, mdisk.img is a harddisk image, this will not work.
>
> You have two options:
>
> If your root filesystem is small, you should use an initramfs or initrd.
>
> Or you have to tell sigma0 to offer mdisk.img as a virtual disk by using
> vdisk:rom://imgs/mdisk.img instead of vdisk_empty:736870912. In this
> case you also need to correct disk::0 into sigma0::drive:0 in
> vancouver.nulconfig, to allow access to this disk.
>
> HTH, Julian
>

_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.