Linux non root celll in jetson-tk1

57 views
Skip to first unread message

Sneha

unread,
Apr 18, 2017, 9:17:35 AM4/18/17
to Jailhouse
Hi

I'am able to run Jailhouse 0.6 in Jetson- TK1. I have successfully created root cell using jetson-tk1.cell and a non root Linux cell using jetson-tk1-linux-demo.cell built using the corresponding .c files provided in configs/.

I could load a Linux kernel (4.1.0) in jetson-tk1-linux-demo.cell. jailhouse cell start jetson-tk1-linux-demo executes and gives no errors. But I don't see any output on the serial. jailhouse cell list shows the cell as "running".

What am I missing?

Thanks
Sneha

Jan Kiszka

unread,
Apr 18, 2017, 11:20:59 AM4/18/17
to Sneha, Jailhouse
Possibly the right config for that kernel - make sure that has the
required UART driver built-in.

Did you try to start linux via "jailhouse cell linux" or manually? Did
you provide the right device tree?

Jan

--
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

Sneha

unread,
Apr 19, 2017, 6:09:00 AM4/19/17
to Jailhouse
Hi Jan

Thanks for replying.

This is how I start a non root cell:

$ LOAD_ADDR=0xe8000000
$ DTB_ADDR=0xea000000
$ jailhouse cell create jetson-tk1-linux-demo.cell
$ jailhouse cell load --name jetson-tk1-linux-demo linux-loader.bin -a 0x0 zImage -a $LOAD_ADDR inmate-jetson-tk1.dtb -a $DTB_ADDR -s "kernel=$LOAD_ADDR dtb=$DTB_ADDR" -a 0x100
$ jailhouse cell start jetson-tk1-linux-demo

inmate-jetson-tk1.dtb was generated using dts/inmate-jetson-tk1.dts at the time of cross-compiling Jailhouse.
zImage is the Linux kernel 4.1.0

I'am using a copy of the same kernel in Jetson-TK1 as well(which gets moved to root cell). Since I'am getting output on the serial when Jailhouse is not enabled I suppose the UART driver is present.
I found SERIO in .config which was also enabled.

What options should I enable in .config in order to get the required UART driver built with the kernel?

Could you suggest how I can use jailhouse cell linux in order to get the kernel in a non root cell up and running?

Thanks
Sneha

Jan Kiszka

unread,
Apr 19, 2017, 7:12:17 AM4/19/17
to Sneha, Jailhouse
On 2017-04-19 12:09, Sneha wrote:
> Hi Jan
>
> Thanks for replying.
>
> This is how I start a non root cell:
>
> $ LOAD_ADDR=0xe8000000
> $ DTB_ADDR=0xea000000
> $ jailhouse cell create jetson-tk1-linux-demo.cell
> $ jailhouse cell load --name jetson-tk1-linux-demo linux-loader.bin -a 0x0 zImage -a $LOAD_ADDR inmate-jetson-tk1.dtb -a $DTB_ADDR -s "kernel=$LOAD_ADDR dtb=$DTB_ADDR" -a 0x100
> $ jailhouse cell start jetson-tk1-linux-demo
>
> inmate-jetson-tk1.dtb was generated using dts/inmate-jetson-tk1.dts at the time of cross-compiling Jailhouse.
> zImage is the Linux kernel 4.1.0
>
> I'am using a copy of the same kernel in Jetson-TK1 as well(which gets moved to root cell). Since I'am getting output on the serial when Jailhouse is not enabled I suppose the UART driver is present.
> I found SERIO in .config which was also enabled.
>
> What options should I enable in .config in order to get the required UART driver built with the kernel?

Don't know by heart, but I've attached the .config I'm using for ARM
inmates. It's 4.10-based, so there remains some variation if you really
want 4.1.

>
> Could you suggest how I can use jailhouse cell linux in order to get the kernel in a non root cell up and running?

jailhouse cell linux --help

There is also some description in Documentation/non-root-linux.txt.
.config.xz

Sneha

unread,
Apr 19, 2017, 7:55:17 AM4/19/17
to Jailhouse
Hi Jan

Thanks again for replying.

I will try to build the kernel using the .config you have provided and will update.

I have looked into non-root-cell.txt in Documentation. To provide initrd, I had enabled the support for RAMdisk in .config and built the kernel. I found /dev/ram0 to /dev/ram15 when I booted Jetson-TK1 using this kernel. I gave

$ sudo jailhouse cell linux jetson-tk1-linux-demo​.cell zImage --initrd /dev/ram0 -c "console=ttyS0,1152000"

on the console after enabling Jailhouse. But it gave me an error related to /dev/ram0. Same thing happened for the rest(ram1-ram15).

Am I missing something? What should I pass to --initrd?

Regards
Sneha

Jan Kiszka

unread,
Apr 19, 2017, 10:56:14 AM4/19/17
to Sneha, Jailhouse
The initrd image file, not the path under which the inmate will find it
later on.

Sneha

unread,
May 15, 2017, 8:21:27 AM5/15/17
to Jailhouse, snehaj...@gmail.com
Hi Jan

I still need to use the kernel config you provided. But I tried using the kernel of jailhouse/queues branch in git.kiszka.org. I don't know how to create initrd using Buildroot, but I was successful in creating initramfs using it. I had enabled libserial and some other serial related libraries. While building the Kernel, I enabled CONFIG_SERIO,set CONFIG_BLK_DEV_RAM=m, CONFIG_BLK_DEV_RAM_COUNT=1 and CONFIG_BLK_DEV_RAM_SIZE=4096.

After enabling Jailhouse using jetson-tk1.cell, I tried the following :

sudo jailhouse cell linux \
--dtb configs/dts/inmate-jetson-tk1.dtb \
--initrd rootfs.cpio \
--cmdline "console=ttyS0,115200" \
--arch arm \
configs/jetson-tk1-linux-demo.cell Image

rootfs.cpio was created using Buildroot. PFA the buildroot config.
Linux Kernel from http://git.kiszka.org/?p=linux.git;a=shortlog;h=refs/heads/queues/jailhouse. PFA the kernel config.

I still don't see any output on serial(ttyS0). I don't get any errors. jailhouse cell list displays the cell as running.

I also tried using rootfs.tar instead of rootfs.cpio created using Buildroot, but still the same behaviour. I gave initramfs instead of initrd since it was mentioned in jailhouse cell linux --help.

Another observation is when I pass zImage instead of Image, Jailhouse traps.

Does the root cell also need /dev/ram0 for the non root cell to work? How can I build initrd using Buildroot? Is it for the root cell or the non root cell?

Please help.

Regards
Sneha

kernel-config.txt
buildroot-config.txt

Ralf Ramsauer

unread,
May 15, 2017, 10:11:19 AM5/15/17
to Sneha, Jailhouse


On 05/15/2017 02:21 PM, Sneha wrote:
> Hi Jan
>
> I still need to use the kernel config you provided. But I tried using the kernel of jailhouse/queues branch in git.kiszka.org. I don't know how to create initrd using Buildroot, but I was successful in creating initramfs using it. I had enabled libserial and some other serial related libraries. While building the Kernel, I enabled CONFIG_SERIO,set CONFIG_BLK_DEV_RAM=m, CONFIG_BLK_DEV_RAM_COUNT=1 and CONFIG_BLK_DEV_RAM_SIZE=4096.
>
> After enabling Jailhouse using jetson-tk1.cell, I tried the following :
>
> sudo jailhouse cell linux \
> --dtb configs/dts/inmate-jetson-tk1.dtb \
> --initrd rootfs.cpio \
> --cmdline "console=ttyS0,115200" \
> --arch arm \
> configs/jetson-tk1-linux-demo.cell Image
>
> rootfs.cpio was created using Buildroot. PFA the buildroot config.
> Linux Kernel from http://git.kiszka.org/?p=linux.git;a=shortlog;h=refs/heads/queues/jailhouse. PFA the kernel config.
>
> I still don't see any output on serial(ttyS0). I don't get any errors. jailhouse cell list displays the cell as running.
>
> I also tried using rootfs.tar instead of rootfs.cpio created using Buildroot, but still the same behaviour. I gave initramfs instead of initrd since it was mentioned in jailhouse cell linux --help.
>
> Another observation is when I pass zImage instead of Image, Jailhouse traps.
Shouldn't happen. Could you please paste the message?

As a first step, I recommend to try to boot Linux without providing an
initial ramdisk. This reduces the problem set a bit.

You should at least see your kernel booting followed by a panic. After
this works, try providing your initrd as a next step.
>
> Does the root cell also need /dev/ram0 for the non root cell to work? How can I build initrd using Buildroot? Is it for the root cell or the non root cell?
No, /dev/ram0 has nothing to do with Jailhouse or with you non-root cell.

Clone buildroot, type 'make menuconfig' and configure it according to
your wishes.
Set BR2_TARGET_ROOTFS_CPIO=y and BR2_TARGET_ROOTFS_CPIO_NONE=y to get an
uncompressed initrd.

'make' will finally build your 'output/images/rootfs.cpio' that can be
used as rootfs for your inmate.

Ralf
>
> Please help.
>
> Regards
> Sneha
>
Reply all
Reply to author
Forward
0 new messages