How to add the bootargs parameter between the bootcmds parameters

2024-03-07 Thread Mario Marietto
Hello to everyone.

These days I'm playing with my old ARM Chromebook model "SNOW". As you
probably know,this kind of Netbook can load an external operating system
using the sd card slot or the usb port. Unfortunately,my Chromebook has the
sd card slot broken. So,what I want to do is to load Linux using the usb
port. I've bought one converter from sd card to usb and I've installed
Devuan 5 on the sd card ; I have inserted the sd card inside the adapter
and would like to boot Linux (Devuan 5) through it. The u-boot version that
I have installed is special because the code contains the patches needed to
enable kvm. You should also know that the parameters to boot Linux are
embedded inside the code,as you can see below :

https://github.com/virtualopensystems/u-boot/blob/eecfeb578e296ef3b739ac918a39b6c177dff58a/include/configs/snow.h#L101

now. I've tried many times to recompile it,trying to change the root device
from /dev/mmcblk1p4 to /dev/sda4,because sda4 is the root device
now,because the Linux files are stored on the sd card,partition 4,but I
failed every time. Now I want to use another method to bypass the
"root=/dev/mmcblk1p4"
parameter. This is what I did :

setenv bootcmd "usb start ; usb dev 0 ; ext2load usb 0:3 0x80008000 uImage
; ext2load usb 0:3 0x4300 exynos5250-snow.dtb ; bootargs console=tty1
root=/dev/sda4 rw rootwait clk_ignore_unused --no-log ; bootm 0x80008000 -
0x4300"
saveenv
boot

Well,it does not work because despite the fact that I have said to choose
sda4 as the root device,it persists to use mmcblk1p4. This is the message
reported :

waiting for root device /dev/mmcblk1p4
sda attached SCSI removable disk...

I would like to know if I have written the parameters correctly. I don't
see errors. The only problem is that it does not pick sda4.

Let me know,thanks.

-- 
Mario.


I'm trying to create a new nv_uboot-snow-usb.kpart file changing some parameters inside the file snow.h file, but the modifications I made aren't detected.

2024-02-04 Thread Mario Marietto
Hello.

My ARM Chromebook SNOW model has the mmc slot broken,but I've realized

that I can boot Linux using the USB port ! To enable the booting of Linux
via USB

I have modified this file :


https://github.com/virtualopensystems/u-boot/blob/eecfeb578e296ef3b739ac918a39b6c177dff58a/include/configs/snow.h#L101


in this way :

/*
 * Copyright (C) 2013 - Virtual Open Systems
 * Author: Nikolay Nikolaev 
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, version 2, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef __configs_snow_h__
#define __configs_snow_h__

#include 

#undef CONFIG_DEFAULT_DEVICE_TREE
#define CONFIG_DEFAULT_DEVICE_TREE  exynos5250-snow

/* Generally verified boot needs more heap space */
#undef CONFIG_SYS_MALLOC_LEN
#define CONFIG_SYS_MALLOC_LEN   (32 << 20)

#define CONFIG_INITRD_ADDRESS 0x4400

#include 

/* Disable ChromeOS specifics */
#undef CONFIG_CHROMEOS

/* Force reading the environment */
#undef CONFIG_OF_LOAD_ENVIRONMENT

#define CONFIG_CHROMEOS_USB

/* Support vboot flag reading from GPIO hardwrae */
#define CONFIG_CHROMEOS_GPIO_FLAG

/* Support vboot flag reading from EC */
#define CONFIG_CHROMEOS_MKBP_FLAG

/* Use the default arch_phys_memset implementation */
#define CONFIG_PHYSMEM

/* Adjust the display resolution. */
#undef MAIN_VRESOL_VAL
#undef MAIN_HRESOL_VAL
#define MAIN_VRESOL_VAL 0x300
#define MAIN_HRESOL_VAL 0x556
#undef LCD_XRES
#undef LCD_YRES
#define LCD_XRES 1366
#define LCD_YRES 768
#define CONFIG_SYS_WHITE_ON_BLACK

/*
 * Extra bootargs used for direct booting, but not for vboot.
 * - console of the board
 * - debug and earlyprintk: easier to debug; they could be removed later
 */
#define CONFIG_DIRECT_BOOTARGS \
"console=tty1 debug clk_ignore_unused"

/* Standard input, output and error device of U-Boot console. */
#define CONFIG_STD_DEVICES_SETTINGS EXYNOS_DEVICE_SETTINGS

#define CONFIG_CHROMEOS_SD_TO_SPI \
"sd_to_spi=echo Flashing U-Boot from SD card to SPI flash; " \
"if mmc dev 1 && " \
"mmc rescan && " \
"mmc read 40008000 1 1000 && " \
"sf probe 1:0 && " \
"sf update 40008000 0 8; then " \
"echo Flash completed; else " \
"echo Flash failed; " \
"fi\0"

/* Replace default CONFIG_EXTRA_ENV_SETTINGS */
#ifdef CONFIG_EXTRA_ENV_SETTINGS
#undef CONFIG_EXTRA_ENV_SETTINGS
#endif
#define CONFIG_EXTRA_ENV_SETTINGS \
EXYNOS_DEVICE_SETTINGS \
"dtaddr=0x4300\0"\
"initrdaddr=0x4400\0"\
"boot_noinitrd=usb start ; usb dev 0 ; ext2load usb 0:2 ${loadaddr}
uImage ; ext2load usb 0:2 ${dtaddr} exynos5250-snow.dtb ; bootm
${loadaddr} - ${dtaddr}\0"\
"boot_initrd=usb start ; usb dev 0 ; ext2load usb 0:2 ${loadaddr}
uImage ; ext2load usb 0:2 ${initrdaddr} initrd ; ext2load usb 0:2
${dtaddr} exynos5250-snow.dtb ; bootm ${loadaddr} ${initrdaddr}
${dtaddr}\0"\
"bootdelay=10\0"

#ifdef CONFIG_BOOTARGS
#undef CONFIG_BOOTARGS
#endif
#define CONFIG_BOOTARGS \
"console=tty1 root=/dev/da0p4 rw rootwait clk_ignore_unused --no-log"

/* Replace default CONFIG_BOOTCOMMAND */
#ifdef CONFIG_BOOTCOMMAND
#undef CONFIG_BOOTCOMMAND
#endif
#define CONFIG_BOOTCOMMAND \
"run boot_noinitrd"

/* Enable splash screens */
#define CONFIG_CROS_SPLASH

/* Enable simple framebuffer */
#define CONFIG_SIMPLEFB

/* Enable writing on a FAT formatted filesystem */
#define CONFIG_FAT_WRITE

/* Enable virt mode commands */
#define CONFIG_ARMV7_VIRT

/* Disable d-cache */
#define CONFIG_SYS_DCACHE_OFF

#endif /* __configs_snow_h__ */

I have modified mmc with usb 0 and I've changed the timeout from
"bootdelay=3\0"

to "bootdelay=10\0" and I ran the script that located here :


https://github.com/virtualopensystems/u-boot/blob/eecfeb578e296ef3b739ac918a39b6c177dff58a/scripts/build.sh


that creates a new : nv_uboot-snow-usb.kpart file,that I install on the sd
card where

I have installed Linux,using the following commands :


# dd if=/dev/zero of=/dev/sdi1
dd: writing to '/dev/sdi1': No space left on device
32769+0 records in
32768+0 records out
16777216 bytes (17 MB, 16 MiB) copied, 2.07775 s, 8.1 MB/s

# sudo dd if=nv_uboot-snow-usb.kpart of=/dev/sdi1


At this point I attach the usb to sd card converter on the Chromebook and I
try to

boot Linux,but to my surprise I see that the bootloader is still set to 3
seconds.

It means that for some reason,the new nv_uboot-snow-usb.kpart is not
detected,


Re: I'm looking for the source code of a specific u-boot version.

2023-12-28 Thread Mario Marietto
Is my version the correct one ?

root@devuan-bunsen:/mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd/bootloaders#
strings u-boot.bin | grep U-Boot

** Invalid partition type "%.32s" (expect "U-Boot")
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e
${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo
Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT
FAILED: continuing...; fi; done
U-Boot.armv7
MU-Boot EFI: Relocation at %p is out of range (%lx)
No valid device tree binary found - please append one to U-Boot
binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use
-d 
U-Boot
U-Boot 2017.05 (Dec 28 2023 - 22:52:29 +0100) for snow


On Thu, Dec 28, 2023 at 11:44 PM Mario Marietto  wrote:
>
> Maybe some parameter is wrong inside the snow_defconfig file ? Can you
> give a look ?
>
> CONFIG_ARM=y
> CONFIG_SKIP_LOWLEVEL_INIT=y
> CONFIG_SPL_SKIP_LOWLEVEL_INIT=y
> CONFIG_ARCH_CPU_INIT=y
> # CONFIG_SPL_USE_ARCH_MEMCPY is not set
> # CONFIG_SPL_USE_ARCH_MEMSET is not set
> CONFIG_ARCH_EXYNOS=y
> CONFIG_TEXT_BASE=0x43E0
> CONFIG_SYS_MALLOC_LEN=0x5004000
> CONFIG_SYS_MALLOC_F_LEN=0x400
> CONFIG_ARCH_EXYNOS5=y
> CONFIG_TARGET_SNOW=y
> CONFIG_NR_DRAM_BANKS=8
> CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x205
> CONFIG_SF_DEFAULT_SPEED=5000
> CONFIG_ENV_SIZE=0x4000
> CONFIG_ENV_OFFSET=0x3FC000
> CONFIG_ENV_SECT_SIZE=0x4000
> CONFIG_DEFAULT_DEVICE_TREE="exynos5250-snow"
> CONFIG_SPL_TEXT_BASE=0x02023400
> CONFIG_SPL=y
> CONFIG_DEBUG_UART_BASE=0x12c3
> CONFIG_DEBUG_UART_CLOCK=1
> CONFIG_IDENT_STRING=" for snow"
> CONFIG_SYS_LOAD_ADDR=0x43e0
> CONFIG_DEBUG_UART=y
> CONFIG_FIT=y
> CONFIG_FIT_BEST_MATCH=y
> CONFIG_BOOTSTD_FULL=y
> CONFIG_BOOTMETH_CROS=y
> CONFIG_DISTRO_DEFAULTS=y
> CONFIG_SILENT_CONSOLE=y
> CONFIG_BLOBLIST=y
> # CONFIG_SPL_BLOBLIST is not set
> CONFIG_BLOBLIST_ADDR=0x43d0
> # CONFIG_SPL_FRAMEWORK is not set
> CONFIG_SPL_FOOTPRINT_LIMIT=y
> CONFIG_SPL_MAX_FOOTPRINT=0x3800
> CONFIG_SYS_PROMPT="snow # "
> CONFIG_SYS_PBSIZE=1024
> CONFIG_CMD_GPIO=y
> CONFIG_CMD_I2C=y
> CONFIG_CMD_MMC=y
> CONFIG_CMD_SPI=y
> CONFIG_CMD_USB=y
> # CONFIG_CMD_SETEXPR is not set
> CONFIG_CMD_CACHE=y
> CONFIG_CMD_TIME=y
> CONFIG_CMD_SOUND=y
> CONFIG_CMD_PMIC=y
> CONFIG_CMD_REGULATOR=y
> CONFIG_CMD_TPM=y
> CONFIG_CMD_TPM_TEST=y
> CONFIG_CMD_EXT4_WRITE=y
> CONFIG_ENV_OVERWRITE=y
> CONFIG_ENV_IS_IN_SPI_FLASH=y
> CONFIG_ENV_SPI_BUS=1
> CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> CONFIG_I2C_CROS_EC_LDO=y
> CONFIG_SYS_I2C_S3C24X0=y
> CONFIG_I2C_MUX=y
> CONFIG_I2C_ARB_GPIO_CHALLENGE=y
> CONFIG_CROS_EC_KEYB=y
> CONFIG_CROS_EC=y
> CONFIG_CROS_EC_I2C=y
> CONFIG_SUPPORT_EMMC_BOOT=y
> CONFIG_MMC_DW=y
> CONFIG_MMC_SDHCI=y
> CONFIG_MMC_SDHCI_S5P=y
> CONFIG_MTD=y
> CONFIG_SPI_FLASH_GIGADEVICE=y
> CONFIG_SPI_FLASH_WINBOND=y
> CONFIG_SMC911X=y
> CONFIG_DM_PMIC=y
> CONFIG_DM_PMIC_MAX77686=y
> CONFIG_PMIC_S5M8767=y
> CONFIG_PMIC_TPS65090=y
> CONFIG_DM_REGULATOR=y
> CONFIG_DM_REGULATOR_MAX77686=y
> CONFIG_REGULATOR_S5M8767=y
> CONFIG_REGULATOR_TPS65090=y
> CONFIG_DM_PWM=y
> CONFIG_PWM_EXYNOS=y
> CONFIG_SOUND=y
> CONFIG_I2S=y
> CONFIG_I2S_SAMSUNG=y
> CONFIG_SOUND_MAX98095=y
> CONFIG_SOUND_WM8994=y
> CONFIG_EXYNOS_SPI=y
> CONFIG_TPM_TIS_INFINEON=y
> CONFIG_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_DWC3=y
> CONFIG_USB_EHCI_HCD=y
> CONFIG_USB_HOST_ETHER=y
> CONFIG_USB_ETHER_ASIX88179=y
> CONFIG_VIDEO=y
> # CONFIG_VIDEO_BPP8 is not set
> CONFIG_VIDCONSOLE_AS_LCD=y
> CONFIG_DISPLAY=y
> CONFIG_VIDEO_EXYNOS=y
> CONFIG_EXYNOS_DP=y
> CONFIG_EXYNOS_FB=y
> CONFIG_VIDEO_BRIDGE=y
> CONFIG_VIDEO_BRIDGE_PARADE_PS862X=y
> CONFIG_VIDEO_BRIDGE_NXP_PTN3460=y
> CONFIG_TPM=y
> CONFIG_ERRNO_STR=y
> CONFIG_UNIT_TEST=y
> # CONFIG_UT_LIB_ASN1 is not set
>
> On Thu, Dec 28, 2023 at 11:26 PM Mario Marietto  
> wrote:
> >
> > I've just built it with Ubuntu 18.04 / gcc 7.5.0 ; I have my
> > u-boot.bin and I tried to see if it worked,but unfortunately it
> > doesn't.
> >
> > root@devuan-bunsen:/mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd#
> > ./start-freebsd
> >
> > Parsing config from freebsd.cfg
> > xc: error: panic: xg_dom_core.c:689: xc_dom_find_loader: no loader
> > found: Invalid kernel
> > libxl: error: libxl_dom.c:571:libxl__build_dom: xc_dom_parse_image failed
> > libxl: error: libxl_create.c:1640:domcreate_rebuild_done: Domain
> > 1:cannot (re-)build domain: -3
> > libxl: error: libxl_domain.c:1183:libxl__destroy_domid: Domain
> > 1:Non-existent

Re: I'm looking for the source code of a specific u-boot version.

2023-12-28 Thread Mario Marietto
Maybe some parameter is wrong inside the snow_defconfig file ? Can you
give a look ?

CONFIG_ARM=y
CONFIG_SKIP_LOWLEVEL_INIT=y
CONFIG_SPL_SKIP_LOWLEVEL_INIT=y
CONFIG_ARCH_CPU_INIT=y
# CONFIG_SPL_USE_ARCH_MEMCPY is not set
# CONFIG_SPL_USE_ARCH_MEMSET is not set
CONFIG_ARCH_EXYNOS=y
CONFIG_TEXT_BASE=0x43E0
CONFIG_SYS_MALLOC_LEN=0x5004000
CONFIG_SYS_MALLOC_F_LEN=0x400
CONFIG_ARCH_EXYNOS5=y
CONFIG_TARGET_SNOW=y
CONFIG_NR_DRAM_BANKS=8
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x205
CONFIG_SF_DEFAULT_SPEED=5000
CONFIG_ENV_SIZE=0x4000
CONFIG_ENV_OFFSET=0x3FC000
CONFIG_ENV_SECT_SIZE=0x4000
CONFIG_DEFAULT_DEVICE_TREE="exynos5250-snow"
CONFIG_SPL_TEXT_BASE=0x02023400
CONFIG_SPL=y
CONFIG_DEBUG_UART_BASE=0x12c3
CONFIG_DEBUG_UART_CLOCK=1
CONFIG_IDENT_STRING=" for snow"
CONFIG_SYS_LOAD_ADDR=0x43e0
CONFIG_DEBUG_UART=y
CONFIG_FIT=y
CONFIG_FIT_BEST_MATCH=y
CONFIG_BOOTSTD_FULL=y
CONFIG_BOOTMETH_CROS=y
CONFIG_DISTRO_DEFAULTS=y
CONFIG_SILENT_CONSOLE=y
CONFIG_BLOBLIST=y
# CONFIG_SPL_BLOBLIST is not set
CONFIG_BLOBLIST_ADDR=0x43d0
# CONFIG_SPL_FRAMEWORK is not set
CONFIG_SPL_FOOTPRINT_LIMIT=y
CONFIG_SPL_MAX_FOOTPRINT=0x3800
CONFIG_SYS_PROMPT="snow # "
CONFIG_SYS_PBSIZE=1024
CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_SPI=y
CONFIG_CMD_USB=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_CACHE=y
CONFIG_CMD_TIME=y
CONFIG_CMD_SOUND=y
CONFIG_CMD_PMIC=y
CONFIG_CMD_REGULATOR=y
CONFIG_CMD_TPM=y
CONFIG_CMD_TPM_TEST=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_ENV_SPI_BUS=1
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_I2C_CROS_EC_LDO=y
CONFIG_SYS_I2C_S3C24X0=y
CONFIG_I2C_MUX=y
CONFIG_I2C_ARB_GPIO_CHALLENGE=y
CONFIG_CROS_EC_KEYB=y
CONFIG_CROS_EC=y
CONFIG_CROS_EC_I2C=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_MMC_DW=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_S5P=y
CONFIG_MTD=y
CONFIG_SPI_FLASH_GIGADEVICE=y
CONFIG_SPI_FLASH_WINBOND=y
CONFIG_SMC911X=y
CONFIG_DM_PMIC=y
CONFIG_DM_PMIC_MAX77686=y
CONFIG_PMIC_S5M8767=y
CONFIG_PMIC_TPS65090=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_MAX77686=y
CONFIG_REGULATOR_S5M8767=y
CONFIG_REGULATOR_TPS65090=y
CONFIG_DM_PWM=y
CONFIG_PWM_EXYNOS=y
CONFIG_SOUND=y
CONFIG_I2S=y
CONFIG_I2S_SAMSUNG=y
CONFIG_SOUND_MAX98095=y
CONFIG_SOUND_WM8994=y
CONFIG_EXYNOS_SPI=y
CONFIG_TPM_TIS_INFINEON=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX88179=y
CONFIG_VIDEO=y
# CONFIG_VIDEO_BPP8 is not set
CONFIG_VIDCONSOLE_AS_LCD=y
CONFIG_DISPLAY=y
CONFIG_VIDEO_EXYNOS=y
CONFIG_EXYNOS_DP=y
CONFIG_EXYNOS_FB=y
CONFIG_VIDEO_BRIDGE=y
CONFIG_VIDEO_BRIDGE_PARADE_PS862X=y
CONFIG_VIDEO_BRIDGE_NXP_PTN3460=y
CONFIG_TPM=y
CONFIG_ERRNO_STR=y
CONFIG_UNIT_TEST=y
# CONFIG_UT_LIB_ASN1 is not set

On Thu, Dec 28, 2023 at 11:26 PM Mario Marietto  wrote:
>
> I've just built it with Ubuntu 18.04 / gcc 7.5.0 ; I have my
> u-boot.bin and I tried to see if it worked,but unfortunately it
> doesn't.
>
> root@devuan-bunsen:/mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd#
> ./start-freebsd
>
> Parsing config from freebsd.cfg
> xc: error: panic: xg_dom_core.c:689: xc_dom_find_loader: no loader
> found: Invalid kernel
> libxl: error: libxl_dom.c:571:libxl__build_dom: xc_dom_parse_image failed
> libxl: error: libxl_create.c:1640:domcreate_rebuild_done: Domain
> 1:cannot (re-)build domain: -3
> libxl: error: libxl_domain.c:1183:libxl__destroy_domid: Domain
> 1:Non-existent domain
> libxl: error: libxl_domain.c:1137:domain_destroy_callback: Domain
> 1:Unable to destroy guest
> libxl: error: libxl_domain.c:1064:domain_destroy_cb: Domain
> 1:Destruction of domain failed
> freebsd is an invalid domain identifier (rc=-6)
>
> start-freebsd :
>
> xl create freebsd.cfg
> xl console freebsd
>
> freebsd.cfg :
>
> name="freebsd"
> kernel="/mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd/bootloaders/u-boot.bin"
> extra = "console=hvc0"
> memory=512
> vcpus=1
> disk = [ 'FreeBSD-13.2-RELEASE-armv7.img,raw,xvda' ]
>
>
> On Thu, Dec 28, 2023 at 10:54 PM Tony Dinh  wrote:
> >
> > On Thu, Dec 28, 2023 at 11:48 AM Simon Glass  wrote:
> > >
> > > Hi Mario,
> > >
> > > On Thu, Dec 28, 2023 at 3:48 PM Mario Marietto  
> > > wrote:
> > > >
> > > > I tried to compile it,but If failed :
> > > >
> > > > /mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd/bootloaders/u-boot-2017.05#
> > > > ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make snow_defconfig
> > > >
> > > >   HOSTCC  scripts/basic/fixdep
> > > >   HOSTCC  scripts/kconfig/conf.o
> > > >   HOSTCC  scripts/kconfig/zconf.tab.o
> > > > In file included from scripts/kconfig/zconf.tab.c:2470:

Re: I'm looking for the source code of a specific u-boot version.

2023-12-28 Thread Mario Marietto
I've just built it with Ubuntu 18.04 / gcc 7.5.0 ; I have my
u-boot.bin and I tried to see if it worked,but unfortunately it
doesn't.

root@devuan-bunsen:/mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd#
./start-freebsd

Parsing config from freebsd.cfg
xc: error: panic: xg_dom_core.c:689: xc_dom_find_loader: no loader
found: Invalid kernel
libxl: error: libxl_dom.c:571:libxl__build_dom: xc_dom_parse_image failed
libxl: error: libxl_create.c:1640:domcreate_rebuild_done: Domain
1:cannot (re-)build domain: -3
libxl: error: libxl_domain.c:1183:libxl__destroy_domid: Domain
1:Non-existent domain
libxl: error: libxl_domain.c:1137:domain_destroy_callback: Domain
1:Unable to destroy guest
libxl: error: libxl_domain.c:1064:domain_destroy_cb: Domain
1:Destruction of domain failed
freebsd is an invalid domain identifier (rc=-6)

start-freebsd :

xl create freebsd.cfg
xl console freebsd

freebsd.cfg :

name="freebsd"
kernel="/mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd/bootloaders/u-boot.bin"
extra = "console=hvc0"
memory=512
vcpus=1
disk = [ 'FreeBSD-13.2-RELEASE-armv7.img,raw,xvda' ]


On Thu, Dec 28, 2023 at 10:54 PM Tony Dinh  wrote:
>
> On Thu, Dec 28, 2023 at 11:48 AM Simon Glass  wrote:
> >
> > Hi Mario,
> >
> > On Thu, Dec 28, 2023 at 3:48 PM Mario Marietto  
> > wrote:
> > >
> > > I tried to compile it,but If failed :
> > >
> > > /mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd/bootloaders/u-boot-2017.05#
> > > ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make snow_defconfig
> > >
> > >   HOSTCC  scripts/basic/fixdep
> > >   HOSTCC  scripts/kconfig/conf.o
> > >   HOSTCC  scripts/kconfig/zconf.tab.o
> > > In file included from scripts/kconfig/zconf.tab.c:2470:
> > > In function ‘dep_stack_insert’,
> > > inlined from ‘sym_check_print_recursive’ at 
> > > scripts/kconfig/symbol.c:1123:3,
> > > inlined from ‘sym_check_deps’ at scripts/kconfig/symbol.c:1300:3:
> > > scripts/kconfig/symbol.c:1099:19: warning: storing the address of
> > > local variable ‘cv_stack’ in ‘check_top’ [-Wdangling-pointer=]
> > >  1099 | check_top = stack;
> > >   | ~~^~~
> > > scripts/kconfig/symbol.c: In function ‘sym_check_deps’:
> > > scripts/kconfig/symbol.c:1120:26: note: ‘cv_stack’ declared here
> > >  1120 | struct dep_stack cv_stack;
> > >   |  ^~~~
> > > scripts/kconfig/symbol.c:1090:4: note: ‘check_top’ declared here
> > >  1090 | } *check_top;
> > >   |^
> > >   HOSTLD  scripts/kconfig/conf
> > > #
> > > # configuration written to .config
> > > #
> > >
> > > /mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd/bootloaders/u-boot-2017.05#
> > > ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make
> > >
> > > scripts/kconfig/conf  --silentoldconfig Kconfig
> > >   CHK include/config.h
> > >   CFG u-boot.cfg
> > >   GEN include/autoconf.mk
> > >   GEN include/autoconf.mk.dep
> > >   CFG spl/u-boot.cfg
> > >   GEN spl/include/autoconf.mk
> > >   CHK include/config/uboot.release
> > >   CHK include/generated/version_autogenerated.h
> > >   CHK include/generated/timestamp_autogenerated.h
> > >   UPD include/generated/timestamp_autogenerated.h
> > >   CC  lib/asm-offsets.s
> > > arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv5
> > > arm-linux-gnueabihf-gcc: note: valid arguments are: armv4 armv4t
> > > armv5t armv5te armv5tej armv6 armv6j armv6k armv6z armv6kz armv6zk
> > > armv6t2 armv6-m armv6s-m armv7 armv7-a armv7ve armv7-r armv7-m
> > > armv7e-m armv8-a armv8.1-a armv8.2-a armv8.3-a armv8.4-a armv8.5-a
> > > armv8.6-a armv8-m.base armv8-m.main armv8-r armv8.1-m.main armv9-a
> > > iwmmxt iwmmxt2; did you mean ‘armv4’?
> > > arm-linux-gnueabihf-gcc: error: missing argument to ‘-march=’
> > > make[1]: *** [Kbuild:44: lib/asm-offsets.s] Error 1
> > > make: *** [Makefile:1287: prepare0] Error 2
> >
> > You might need to compile with an old toolchain, e.g. gcc 4?
>
> I think Simon is right. I could not rebuild that 2017.05 u-boot with
> gcc 12 now. So I looked at the old log, and it was built with gcc 6.3.
>
>   gcc -Wp,-MD,disk/.part_efi.o.d  -nostdinc -isystem
> /usr/lib/gcc/arm-linux-gnueabi/6/include -Iinclude
> -I./arch/arm/include -include ./include/linux/kconfig.h -D__KERNEL__
> -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security
> -fno-builtin -ffr

Re: I'm looking for the source code of a specific u-boot version.

2023-12-28 Thread Mario Marietto
I tried to compile it,but If failed :

/mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd/bootloaders/u-boot-2017.05#
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make snow_defconfig

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2470:
In function ‘dep_stack_insert’,
inlined from ‘sym_check_print_recursive’ at scripts/kconfig/symbol.c:1123:3,
inlined from ‘sym_check_deps’ at scripts/kconfig/symbol.c:1300:3:
scripts/kconfig/symbol.c:1099:19: warning: storing the address of
local variable ‘cv_stack’ in ‘check_top’ [-Wdangling-pointer=]
 1099 | check_top = stack;
  | ~~^~~
scripts/kconfig/symbol.c: In function ‘sym_check_deps’:
scripts/kconfig/symbol.c:1120:26: note: ‘cv_stack’ declared here
 1120 | struct dep_stack cv_stack;
  |  ^~~~
scripts/kconfig/symbol.c:1090:4: note: ‘check_top’ declared here
 1090 | } *check_top;
  |^
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#

/mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd/bootloaders/u-boot-2017.05#
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make

scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK include/config.h
  CFG u-boot.cfg
  GEN include/autoconf.mk
  GEN include/autoconf.mk.dep
  CFG spl/u-boot.cfg
  GEN spl/include/autoconf.mk
  CHK include/config/uboot.release
  CHK include/generated/version_autogenerated.h
  CHK include/generated/timestamp_autogenerated.h
  UPD include/generated/timestamp_autogenerated.h
  CC  lib/asm-offsets.s
arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv5
arm-linux-gnueabihf-gcc: note: valid arguments are: armv4 armv4t
armv5t armv5te armv5tej armv6 armv6j armv6k armv6z armv6kz armv6zk
armv6t2 armv6-m armv6s-m armv7 armv7-a armv7ve armv7-r armv7-m
armv7e-m armv8-a armv8.1-a armv8.2-a armv8.3-a armv8.4-a armv8.5-a
armv8.6-a armv8-m.base armv8-m.main armv8-r armv8.1-m.main armv9-a
iwmmxt iwmmxt2; did you mean ‘armv4’?
arm-linux-gnueabihf-gcc: error: missing argument to ‘-march=’
make[1]: *** [Kbuild:44: lib/asm-offsets.s] Error 1
make: *** [Makefile:1287: prepare0] Error 2

On Thu, Dec 28, 2023 at 3:47 PM Mario Marietto  wrote:
>
> Hello.
>
> Can someone provide the right link to download u-boot-2017.0.5 , please ?
>
> I've found it here,but I'm not sure that it's the correct version :
>
> https://src.fedoraproject.org/repo/pkgs/uboot-tools/u-boot-2017.05.tar.bz2/sha512/be270f9242a72b05463092a022bbabd54996762de1ff23bf7575124ac02e62f49572a4e2f6f571a5019047d40027e56e35593b5cc373c4a5a39b100c3377ba93/
>
> Can you confirm it ? thanks.
>
> On Thu, Dec 28, 2023 at 1:14 AM Tony Dinh  wrote:
> >
> > Hi Mario and Heinrich,
> >
> > On Wed, Dec 27, 2023 at 12:23 PM Mario Marietto  
> > wrote:
> > >
> > > Hello.
> > >
> > > I'm trying to boot FreeBSD for arm32 bit as DomU on my ARM Chromebook
> > > SNOW with xen. Basically there are two ways to accomplish this task :
> > >
> > >
> > > 1) to write a patch that allows the FreeBSD kernel to boot as a zImage
> > > file. This could be accomplished applying this patch to a specific
> > > file that's on the source code of FreeBSD :
> > >
> > >
> > > https://xenbits.xen.org/gitweb/?p=p...8;hb=0782e25d98cc1391472717035f986c979edef0c9
> > >
> > >
> > >
> > > This patch was written by Julien Grall a lot of time ago and now it
> > > does not work anymore. This is the reason explain by the xen
> > > developers :
> > >
> > >
> > >
> > > It appears FreeBSD-CURRENT removed the last step converting the kernel
> > > file to kernel.bin.The patch can be readily rebased, but without
> > > kernel.bin that doesn't do too much.
> > >
> > >
> > >
> > > So,without a rebase of that patch the first option is not applicable.
> > > And I'm not able to fix it.
> > >
> > >
> > > 2) booting FreeBSD using U-Boot,as explained to me by a xen developer :
> > >
> > >
> > > I was trying to explain why and how Julien's patch works so that you
> > > could be the one to re-do something similar or fix the patch on the
> > > FreeBSD kernel that you are working with. I am happy to help review
> > > and write patches but I don't work with the FreeBSD kernel so I
> > > wouldn't be able to help you quickly. However, I might have a
> > > suggestion. Do you know if FreeBSD can be booted by U-Boot ?
> > > Because
> > > U-Boot definitely boots as Xen on ARM guest firmware/bootloader. You
> > >

Re: I'm looking for the source code of a specific u-boot version.

2023-12-28 Thread Mario Marietto
Hello.

Can someone provide the right link to download u-boot-2017.0.5 , please ?

I've found it here,but I'm not sure that it's the correct version :

https://src.fedoraproject.org/repo/pkgs/uboot-tools/u-boot-2017.05.tar.bz2/sha512/be270f9242a72b05463092a022bbabd54996762de1ff23bf7575124ac02e62f49572a4e2f6f571a5019047d40027e56e35593b5cc373c4a5a39b100c3377ba93/

Can you confirm it ? thanks.

On Thu, Dec 28, 2023 at 1:14 AM Tony Dinh  wrote:
>
> Hi Mario and Heinrich,
>
> On Wed, Dec 27, 2023 at 12:23 PM Mario Marietto  
> wrote:
> >
> > Hello.
> >
> > I'm trying to boot FreeBSD for arm32 bit as DomU on my ARM Chromebook
> > SNOW with xen. Basically there are two ways to accomplish this task :
> >
> >
> > 1) to write a patch that allows the FreeBSD kernel to boot as a zImage
> > file. This could be accomplished applying this patch to a specific
> > file that's on the source code of FreeBSD :
> >
> >
> > https://xenbits.xen.org/gitweb/?p=p...8;hb=0782e25d98cc1391472717035f986c979edef0c9
> >
> >
> >
> > This patch was written by Julien Grall a lot of time ago and now it
> > does not work anymore. This is the reason explain by the xen
> > developers :
> >
> >
> >
> > It appears FreeBSD-CURRENT removed the last step converting the kernel
> > file to kernel.bin.The patch can be readily rebased, but without
> > kernel.bin that doesn't do too much.
> >
> >
> >
> > So,without a rebase of that patch the first option is not applicable.
> > And I'm not able to fix it.
> >
> >
> > 2) booting FreeBSD using U-Boot,as explained to me by a xen developer :
> >
> >
> > I was trying to explain why and how Julien's patch works so that you
> > could be the one to re-do something similar or fix the patch on the
> > FreeBSD kernel that you are working with. I am happy to help review
> > and write patches but I don't work with the FreeBSD kernel so I
> > wouldn't be able to help you quickly. However, I might have a
> > suggestion. Do you know if FreeBSD can be booted by U-Boot ?
> > Because
> > U-Boot definitely boots as Xen on ARM guest firmware/bootloader. You
> > should be able to build U-Boot and use the U-Boot binary as Xen guest
> > kernel, then U-Boot could load FreeBSD from disk or network and start
> > it. For instance as domU config file:
> >
> > kernel="/home/petalinux/u-boot.bin"
> > disk = [ '/home/petalinux/test.img,raw,xvda' ]
> >
> >
> > Actually I'm working on the idea n. 2. Basically I need to find the
> > proper u-boot file that's able to boot the image of FreeBSD that I
> > have installed (13.2 for arm32 bit). Maybe I found it here :
> >
> >
> > http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/nv_uboot-snow-simplefb.kpart.bz2
> >
> >
> > I found that link inside this tutorial :
> >
> >
> > https://wiki.freebsd.org/arm/Chromebook
> >
> >
> > the version of u-boot that has been embedded in that file is the following 
> > one :
> >
> >
> > # strings nv_uboot-snow-simplefb.kpart | grep U-Boot
> > U-Boot 2011.12-gc1f6280 (May 27 2013 - 15:06:59) for SMDK5250
> >
> >
> > So the question is easy : I need to find the source code of that old
> > version of u-boot,because once compiled,it will give me the proper
> > u-boot.bin kernel / bootloader file that maybe will be able to boot
> > FreeBSD.
>
> Yes, it can boot a 32-bit ARM board. I'm not a FreeBSD person, but
> I've helped a FreeBSD user booting a 32-bit ARM box with u-boot
> (GoFlexHome Marvell Kirkwood 6281). The u-boot version was 2017.05. I
> used an out-of-tree u-boot build. This u-boot executed the ubldr to
> boot FreeBSD.
>
> Please see here:
> https://forum.doozan.com/read.php?3,49039,82059#msg-82059
>
> It's been so long, I don't remember the details. Just to confirm what
> Heinrich said that u-boot can indeed boot 32-bit FreeBSD, since many
> years ago.
>
> All the best,
> Tony
>
> >
> >
> > --
> > Mario.



-- 
Mario.


I'm looking for the source code of a specific u-boot version.

2023-12-27 Thread Mario Marietto
Hello.

I'm trying to boot FreeBSD for arm32 bit as DomU on my ARM Chromebook
SNOW with xen. Basically there are two ways to accomplish this task :


1) to write a patch that allows the FreeBSD kernel to boot as a zImage
file. This could be accomplished applying this patch to a specific
file that's on the source code of FreeBSD :


https://xenbits.xen.org/gitweb/?p=p...8;hb=0782e25d98cc1391472717035f986c979edef0c9



This patch was written by Julien Grall a lot of time ago and now it
does not work anymore. This is the reason explain by the xen
developers :



It appears FreeBSD-CURRENT removed the last step converting the kernel
file to kernel.bin.The patch can be readily rebased, but without
kernel.bin that doesn't do too much.



So,without a rebase of that patch the first option is not applicable.
And I'm not able to fix it.


2) booting FreeBSD using U-Boot,as explained to me by a xen developer :


I was trying to explain why and how Julien's patch works so that you
could be the one to re-do something similar or fix the patch on the
FreeBSD kernel that you are working with. I am happy to help review
and write patches but I don't work with the FreeBSD kernel so I
wouldn't be able to help you quickly. However, I might have a
suggestion. Do you know if FreeBSD can be booted by U-Boot ? Because
U-Boot definitely boots as Xen on ARM guest firmware/bootloader. You
should be able to build U-Boot and use the U-Boot binary as Xen guest
kernel, then U-Boot could load FreeBSD from disk or network and start
it. For instance as domU config file:

kernel="/home/petalinux/u-boot.bin"
disk = [ '/home/petalinux/test.img,raw,xvda' ]


Actually I'm working on the idea n. 2. Basically I need to find the
proper u-boot file that's able to boot the image of FreeBSD that I
have installed (13.2 for arm32 bit). Maybe I found it here :


http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/nv_uboot-snow-simplefb.kpart.bz2


I found that link inside this tutorial :


https://wiki.freebsd.org/arm/Chromebook


the version of u-boot that has been embedded in that file is the following one :


# strings nv_uboot-snow-simplefb.kpart | grep U-Boot
U-Boot 2011.12-gc1f6280 (May 27 2013 - 15:06:59) for SMDK5250


So the question is easy : I need to find the source code of that old
version of u-boot,because once compiled,it will give me the proper
u-boot.bin kernel / bootloader file that maybe will be able to boot
FreeBSD.


-- 
Mario.


How to boot FreeBSD as a domU using u-boot.bin as a kernel bootloader on my ARM Chromebook

2023-12-19 Thread Mario Marietto
Hello.

I'm trying to boot FreeBSD for arm32 bit as DomU on my ARM Chromebook.
Basically there are two ways to accomplish this task :

1) to write a patch that allows the FreeBSD kernel to boot as a zImage
file. This could be accomplished applying this patch to a specific file
that's on the source code of FreeBSD :


https://xenbits.xen.org/gitweb/?p=p...8;hb=0782e25d98cc1391472717035f986c979edef0c9



This patch was written by Julien Grall a lot of time ago and now it does
not work anymore. This is the reason :

It appears FreeBSD-CURRENT removed the last step converting the kernel file
to kernel.bin. The patch can be readily rebased, but without kernel.bin
that doesn't do too much.


So,without a rebase of that patch the first option is not applicable. And
I'm not able to fix it.

2) booting FreeBSD using U-Boot,as explained to me by a xen developer :

I was trying to explain why and how Julien's patch works so that you could
be the one to re-do something similar or fix the patch on the FreeBSD
kernel that you are working with. I am happy to help review and write
patches but I don't work with the FreeBSD kernel so I wouldn't be able to
help you quickly. However, I might have a suggestion. Do you know if
FreeBSD can be booted by U-Boot ? Because U-Boot definitely boots as Xen on
ARM guest firmware/bootloader. You should be able to build U-Boot and use
the U-Boot binary as Xen guest kernel, then U-Boot could load FreeBSD from
disk or network and start it. For instance as domU config file:

kernel="/home/petalinux/u-boot.bin"
disk = [ '/home/petalinux/test.img,raw,xvda' ]

I know it is important to build u-boot with the following config to make it
work on Xen.

CONFIG_CMO_BY_VA_ONLY=y


According with these suggestions (and with the suggestions of a FreeBSD
developer) I have compiled the needed u-boot.bin from scratch using this
procedure :

# git clone https://github.com/u-boot/u-boot.git

# cd u-boot

# ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make snow_defconfig : this
line generates the file .config

# nano .config and I've added these parameters :

CONFIG_ARMV7_NONSEC=n
CONFIG_EFI_GRUB_ARM32_WORKAROUND=y

suggested to me by a FreeBSD developer in relation to the FreeBSD fragment :

https://github.com/freebsd/freebsd-ports/blob/main/sysutils/u-boot-master/files/FreeBSD_Fragment

but I haven't added this parameter :

CONFIG_CMO_BY_VA_ONLY=y

according with what he said,instead :

"I took a brief look at your post and it seems to me that the option
CONFIG_CMO_BY_VA_ONLY is irrelevant to your target armv7 32 bit platform :

https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/cpu/armv8/Kconfig?ref_type=heads#L3

Finally,the uboot-bin file is generated with this command :

# ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make

At this point,I took a look inside the .config file and I saw that the
parameter "CONFIG_ARMV7_NONSEC=n" has been removed. So,for some reason,it
is not accepted and this could be a problem

These are the xen config files that I've used :

nano freebsd.cfg

name="test"
kernel="u-boot.bin"
extra = "console=hvc0"
memory=256
vcpus=1
disk = [ 'FreeBSD-13.2-RELEASE-armv7.img,raw,xvda' ]

nano start-freebsd

xl create freebsd.cfg
xl console freebsd

This is what happens when I launch the vm :

# ./start-freebsd

Parsing config from freebsd.cfg
xc: error: panic: xg_dom_core.c:689: xc_dom_find_loader: no loader found:
Invalid kernel
libxl: error: libxl_dom.c:571:libxl__build_dom: xc_dom_parse_image failed
libxl: error: libxl_create.c:1640:domcreate_rebuild_done: Domain 1:cannot
(re-)build domain: -3
libxl: error: libxl_domain.c:1183:libxl__destroy_domid: Domain
1:Non-existent domain
libxl: error: libxl_domain.c:1137:domain_destroy_callback: Domain 1:Unable
to destroy guest
libxl: error: libxl_domain.c:1064:domain_destroy_cb: Domain 1:Destruction
of domain failed
freebsd is an invalid domain identifier (rc=-6)

-- 
Mario.


OF: fdt: Ignoring memory range 0x40000000 - 0x80000000

2023-09-26 Thread Mario Marietto
Hello.

The project that I've been working on since 2 years is to enable KVM (with
the support of libvirt and virt-manager) on a recent version of Linux and
of its kernel on the old but still nice ARM Chromebook model xe303c12. My
goal is to virtualize FreeBSD 13.2 for armV7. I've almost completed the
project. At today I'm using Ubuntu 22.04 (but it works also with Devuan 5)
; KVM is enabled ; libvirt 9.7.0 and virt-manager are working great. And
I've almost been able to virtualize FreeBSD. Almost because I've found a
problem that I need to fix or the whole project will die. Ubuntu recognizes
only 1 GB of memory free,but the ARM Chromebook has 2 GB of memory soldered
to the mobo. So,1 GB of memory has been lost during the transition from the
first project I tried to enable KVM with an old kernel (and ubuntu)
version,that you can find here :


http://www.virtualopensystems.com/en/solutions/guides/kvm-on-chromebook/#setting-up-the-boot-medium


and my project,which uses a more recent kernel version (5.4) and ubuntu
version (22.04). I think that when I have recompiled the kernel,I've lost
some kernel entries that are enabled on the 3.13 kernel used by the
developers at the Virtual Open System. Well,I have no idea about which
entries my kernel config are missing.

I have checked the available memory for the OS giving the command :


# free -m


If I don't recover 1 GB of memory,I can't virtualize FreeBSD,because only 1
GB is a very small amount of memory to be able to run the host and the
guest OS.

So,can someone help me to find which kernel entries I should add to have
all the 2 GB of memory available ?

Virtual Open System offers it's own kernel config file,that I have saved
here :


https://pastebin.ubuntu.com/p/j4B54TChKD/


using their kernel config file I see that I have a total of 2 GB of memory
available (I spend 400 mb to load Linux,so only 600 remains ; it's not
good. In Fact I get a lot of qemu crashes), but If I use my config file the
OS starts with only 1 GB.


I want also share two kernel config files :

1) the kernel 3.13 dmesg log file where 2 GB is recognized,here :

https://pastebin.ubuntu.com/p/gsw9SM4zY3/

2) the kernel 5.4 dmesg log file where only 1 GB is recognized,here :

https://pastebin.ubuntu.com/p/W6Mgj4jGg2/


I've compared the dmesg logs (kernel 3.13 vs kernel 5.4 config files) and I
think this is the reason why I have only 1 GB of memory available :

* OF: fdt: Ignoring memory range 0x4000 - 0x8000*

This line is not present on the kernel 3.13 dmesg log file,but it is on the
kernel 5.4 dmesg log file. The dtb file generation seems involved. What do
you think ?

I'm trying to understand what to do to fix this problem. Can you give me
some suggestions ? thanks

-- 
Mario.


Re: How u-boot can chain "grub" and booting a mainline kernel on my ARM Chromebook

2023-07-01 Thread Mario Marietto
Hello.

I've been able to understand what was the X variable,the component that
allows the hexdump0815 ubuntu iso images to boot correctly : it is
syslinux. So,now I know what I should do : to try to chainload the u-boot
installed on the first partition with syslinux,installed on the 4 partition
I think,I don't know. I would like to understand if this task can be
accomplished or not.

On Sat, Jul 1, 2023 at 3:25 PM Mario Marietto 
wrote:

> ok. Can we come back to the main problem,please ? Is there a method to do
> what I want ? Is there some kind of technique ? Very thanks.
>
> On Sat, Jul 1, 2023 at 2:57 PM Mario Marietto 
> wrote:
>
>> Some days ago I successfully compiled the kernel version. 5.4.244 with
>> all the kvm flags enabled and the exynos 5250-snow.dtb file.
>>
>> On Sat, Jul 1, 2023 at 2:46 PM Peter Robinson 
>> wrote:
>>
>>> On Sat, Jul 1, 2023 at 1:40 PM Mario Marietto 
>>> wrote:
>>> >
>>> > Excuse me. The problem is not the kernel version that I'm running,but
>>> how to use the unverified u-boot created by virtual open systems to
>>> chainload the kernel of whatever used to boot one recent ISO image created
>>> by hexdump0815. Because it contains the code to put the chromebook in
>>> hypervisor mode. Without that special u-boot version,I can for sure install
>>> one ISO image of hexdump0815 (I've chosen jammy as an example,but
>>> hexdump0815 created some more updated isos),but KVM will not be enabled.
>>>
>>> You'll note I didn't comment on the U-Boot piece, but my point still
>>> remains, that KVM for a 32 bit Arm host was removed in the 5.7 kernel
>>> upstream, so even when you sort out the other problem you still won't
>>> have virt due to the kernel.
>>>
>>> > On Sat, Jul 1, 2023 at 2:34 PM Peter Robinson 
>>> wrote:
>>> >>
>>> >> On Sat, Jul 1, 2023 at 1:25 PM Mario Marietto 
>>> wrote:
>>> >> >
>>> >> > Hello.
>>> >> >
>>> >> > I would like to enable KVM virtualization on my old ARM Chromebook
>>> >> > laptop,based on the Exynos5250 arm 32 bit cpu aka snow,model
>>> xe303c12.
>>> >>
>>> >> Upstream Linux kernel dropped support for running virt on 32 bit hosts
>>> >> (you can still run a 32 bit guest on a 64 bit host) in the upstream
>>> >> linux kernel with the 5.7 release (May 31st, 2020) so you'll probably
>>> >> have to run a 5.4.x LTS kernel rather than 5.18.x (not sure why you
>>> >> chose that one) at the very least.
>>> >>
>>> >> > The first thing I did has been to dd the image below directly on
>>> the sd
>>> >> > card :
>>> >> >
>>> >> >
>>> https://github.com/hexdump0815/imagebuilder/releases/download/220619-01/chromebook_snow-armv7l-jammy.img.gz
>>> >> >
>>> >> > and it worked like a charm,but kvm was disabled. So,I have started
>>> to look
>>> >> > for a good documentation to understand how to enable kvm and I
>>> found this :
>>> >> >
>>> >> >
>>> http://www.virtualopensystems.com/en/solutions/guides/kvm-on-chromebook/
>>> >> >
>>> >> > I've followed all the instructions and it worked,but only with
>>> Ubuntu 13.04
>>> >> > and 14.04. More upgraded ubuntu versions give a lot of problems and
>>> they
>>> >> > don't work.
>>> >> >
>>> >> > So,I've thought about a fresh idea. What about to install the
>>> virtual open
>>> >> > systems "non-verified u-boot" on the first partition like explained
>>> in the
>>> >> > tutorial,and,instead of starting another u-boot after the
>>> original,can I
>>> >> > chain grub with the kernel installed for example by the ubuntu
>>> jammy iso
>>> >> > image created by "hexdump0815" ? To be honest I'm not sure if
>>> hexdump0815
>>> >> > used grub,but I will explain this later.
>>> >> >
>>> >> > Anyway,I've got the idea by reading here :
>>> >> >
>>> >> >
>>> https://unix.stackexchange.com/questions/599141/how-to-install-grub-bootloader-as-second-stage-bootloader
>>> >> > So,now,I'm going to explain what's the content of the partitions on
>>> my
>>> >> > Frankenstein sd card.

Re: How u-boot can chain "grub" and booting a mainline kernel on my ARM Chromebook

2023-07-01 Thread Mario Marietto
ok. Can we come back to the main problem,please ? Is there a method to do
what I want ? Is there some kind of technique ? Very thanks.

On Sat, Jul 1, 2023 at 2:57 PM Mario Marietto 
wrote:

> Some days ago I successfully compiled the kernel version. 5.4.244 with all
> the kvm flags enabled and the exynos 5250-snow.dtb file.
>
> On Sat, Jul 1, 2023 at 2:46 PM Peter Robinson 
> wrote:
>
>> On Sat, Jul 1, 2023 at 1:40 PM Mario Marietto 
>> wrote:
>> >
>> > Excuse me. The problem is not the kernel version that I'm running,but
>> how to use the unverified u-boot created by virtual open systems to
>> chainload the kernel of whatever used to boot one recent ISO image created
>> by hexdump0815. Because it contains the code to put the chromebook in
>> hypervisor mode. Without that special u-boot version,I can for sure install
>> one ISO image of hexdump0815 (I've chosen jammy as an example,but
>> hexdump0815 created some more updated isos),but KVM will not be enabled.
>>
>> You'll note I didn't comment on the U-Boot piece, but my point still
>> remains, that KVM for a 32 bit Arm host was removed in the 5.7 kernel
>> upstream, so even when you sort out the other problem you still won't
>> have virt due to the kernel.
>>
>> > On Sat, Jul 1, 2023 at 2:34 PM Peter Robinson 
>> wrote:
>> >>
>> >> On Sat, Jul 1, 2023 at 1:25 PM Mario Marietto 
>> wrote:
>> >> >
>> >> > Hello.
>> >> >
>> >> > I would like to enable KVM virtualization on my old ARM Chromebook
>> >> > laptop,based on the Exynos5250 arm 32 bit cpu aka snow,model
>> xe303c12.
>> >>
>> >> Upstream Linux kernel dropped support for running virt on 32 bit hosts
>> >> (you can still run a 32 bit guest on a 64 bit host) in the upstream
>> >> linux kernel with the 5.7 release (May 31st, 2020) so you'll probably
>> >> have to run a 5.4.x LTS kernel rather than 5.18.x (not sure why you
>> >> chose that one) at the very least.
>> >>
>> >> > The first thing I did has been to dd the image below directly on the
>> sd
>> >> > card :
>> >> >
>> >> >
>> https://github.com/hexdump0815/imagebuilder/releases/download/220619-01/chromebook_snow-armv7l-jammy.img.gz
>> >> >
>> >> > and it worked like a charm,but kvm was disabled. So,I have started
>> to look
>> >> > for a good documentation to understand how to enable kvm and I found
>> this :
>> >> >
>> >> >
>> http://www.virtualopensystems.com/en/solutions/guides/kvm-on-chromebook/
>> >> >
>> >> > I've followed all the instructions and it worked,but only with
>> Ubuntu 13.04
>> >> > and 14.04. More upgraded ubuntu versions give a lot of problems and
>> they
>> >> > don't work.
>> >> >
>> >> > So,I've thought about a fresh idea. What about to install the
>> virtual open
>> >> > systems "non-verified u-boot" on the first partition like explained
>> in the
>> >> > tutorial,and,instead of starting another u-boot after the
>> original,can I
>> >> > chain grub with the kernel installed for example by the ubuntu jammy
>> iso
>> >> > image created by "hexdump0815" ? To be honest I'm not sure if
>> hexdump0815
>> >> > used grub,but I will explain this later.
>> >> >
>> >> > Anyway,I've got the idea by reading here :
>> >> >
>> >> >
>> https://unix.stackexchange.com/questions/599141/how-to-install-grub-bootloader-as-second-stage-bootloader
>> >> > So,now,I'm going to explain what's the content of the partitions on
>> my
>> >> > Frankenstein sd card.
>> >> >
>> >> > 1) /dev/sdh1 = unknown = 16 MB. I've created this partition by doing
>> :
>> >> >
>> >> > $ sudo dd if=nv_uboot-snow.kpart of=/dev/sdh1
>> >> >
>> >> > Where I've got the file nv_uboot-snow.kpart ? From here :
>> >> >
>> >> >
>> http://www.virtualopensystems.com/downloads/guides/kvm_on_chromebook/nv_u-boot-snow.kpart
>> >> >
>> >> > 2) /dev/sdh2 = unknown = 16 MB. This partition has been created by
>> >> > executing the following
>> >> >
>> >> > script :
>> >> >
>> >> > $ sudo ./scripts/sdcard.sh /dev/sdh
>> >> >
>

Re: How u-boot can chain "grub" and booting a mainline kernel on my ARM Chromebook

2023-07-01 Thread Mario Marietto
Some days ago I successfully compiled the kernel version. 5.4.244 with all
the kvm flags enabled and the exynos 5250-snow.dtb file.

On Sat, Jul 1, 2023 at 2:46 PM Peter Robinson  wrote:

> On Sat, Jul 1, 2023 at 1:40 PM Mario Marietto 
> wrote:
> >
> > Excuse me. The problem is not the kernel version that I'm running,but
> how to use the unverified u-boot created by virtual open systems to
> chainload the kernel of whatever used to boot one recent ISO image created
> by hexdump0815. Because it contains the code to put the chromebook in
> hypervisor mode. Without that special u-boot version,I can for sure install
> one ISO image of hexdump0815 (I've chosen jammy as an example,but
> hexdump0815 created some more updated isos),but KVM will not be enabled.
>
> You'll note I didn't comment on the U-Boot piece, but my point still
> remains, that KVM for a 32 bit Arm host was removed in the 5.7 kernel
> upstream, so even when you sort out the other problem you still won't
> have virt due to the kernel.
>
> > On Sat, Jul 1, 2023 at 2:34 PM Peter Robinson 
> wrote:
> >>
> >> On Sat, Jul 1, 2023 at 1:25 PM Mario Marietto 
> wrote:
> >> >
> >> > Hello.
> >> >
> >> > I would like to enable KVM virtualization on my old ARM Chromebook
> >> > laptop,based on the Exynos5250 arm 32 bit cpu aka snow,model xe303c12.
> >>
> >> Upstream Linux kernel dropped support for running virt on 32 bit hosts
> >> (you can still run a 32 bit guest on a 64 bit host) in the upstream
> >> linux kernel with the 5.7 release (May 31st, 2020) so you'll probably
> >> have to run a 5.4.x LTS kernel rather than 5.18.x (not sure why you
> >> chose that one) at the very least.
> >>
> >> > The first thing I did has been to dd the image below directly on the
> sd
> >> > card :
> >> >
> >> >
> https://github.com/hexdump0815/imagebuilder/releases/download/220619-01/chromebook_snow-armv7l-jammy.img.gz
> >> >
> >> > and it worked like a charm,but kvm was disabled. So,I have started to
> look
> >> > for a good documentation to understand how to enable kvm and I found
> this :
> >> >
> >> >
> http://www.virtualopensystems.com/en/solutions/guides/kvm-on-chromebook/
> >> >
> >> > I've followed all the instructions and it worked,but only with Ubuntu
> 13.04
> >> > and 14.04. More upgraded ubuntu versions give a lot of problems and
> they
> >> > don't work.
> >> >
> >> > So,I've thought about a fresh idea. What about to install the virtual
> open
> >> > systems "non-verified u-boot" on the first partition like explained
> in the
> >> > tutorial,and,instead of starting another u-boot after the
> original,can I
> >> > chain grub with the kernel installed for example by the ubuntu jammy
> iso
> >> > image created by "hexdump0815" ? To be honest I'm not sure if
> hexdump0815
> >> > used grub,but I will explain this later.
> >> >
> >> > Anyway,I've got the idea by reading here :
> >> >
> >> >
> https://unix.stackexchange.com/questions/599141/how-to-install-grub-bootloader-as-second-stage-bootloader
> >> > So,now,I'm going to explain what's the content of the partitions on my
> >> > Frankenstein sd card.
> >> >
> >> > 1) /dev/sdh1 = unknown = 16 MB. I've created this partition by doing :
> >> >
> >> > $ sudo dd if=nv_uboot-snow.kpart of=/dev/sdh1
> >> >
> >> > Where I've got the file nv_uboot-snow.kpart ? From here :
> >> >
> >> >
> http://www.virtualopensystems.com/downloads/guides/kvm_on_chromebook/nv_u-boot-snow.kpart
> >> >
> >> > 2) /dev/sdh2 = unknown = 16 MB. This partition has been created by
> >> > executing the following
> >> >
> >> > script :
> >> >
> >> > $ sudo ./scripts/sdcard.sh /dev/sdh
> >> >
> >> > 3) /dev/sdh3 = ext2 BOOT.
> >> >
> >> > Inside the partition /dev/sdh3 I have copied the following files and
> >> > folders (taken
> >> > from the hexdump0815 "chromebook_snow-armv7l-jammy.img.gz" file :
> >> >
> >> > a) dtb-5.18.1-stb-cbe+ = directory
> >> > b) extlinux = directory
> >> > c) extra = directory
> >> >
> >> > d) config.5.18.1-stb-cbe+ : file
> >> > e) initrd.img-5.18.1-stb-cbe+ : file
> >> > f) System.map-5.18.1-stb-cb

Re: How u-boot can chain "grub" and booting a mainline kernel on my ARM Chromebook

2023-07-01 Thread Mario Marietto
Excuse me. The problem is not the kernel version that I'm running,but how
to use the unverified u-boot created by virtual open systems to chainload
the kernel of whatever used to boot one recent ISO image created by
hexdump0815. Because it contains the code to put the chromebook in
hypervisor mode. Without that special u-boot version,I can for sure install
one ISO image of hexdump0815 (I've chosen jammy as an example,but
hexdump0815 created some more updated isos),but KVM will not be enabled.

On Sat, Jul 1, 2023 at 2:34 PM Peter Robinson  wrote:

> On Sat, Jul 1, 2023 at 1:25 PM Mario Marietto 
> wrote:
> >
> > Hello.
> >
> > I would like to enable KVM virtualization on my old ARM Chromebook
> > laptop,based on the Exynos5250 arm 32 bit cpu aka snow,model xe303c12.
>
> Upstream Linux kernel dropped support for running virt on 32 bit hosts
> (you can still run a 32 bit guest on a 64 bit host) in the upstream
> linux kernel with the 5.7 release (May 31st, 2020) so you'll probably
> have to run a 5.4.x LTS kernel rather than 5.18.x (not sure why you
> chose that one) at the very least.
>
> > The first thing I did has been to dd the image below directly on the sd
> > card :
> >
> >
> https://github.com/hexdump0815/imagebuilder/releases/download/220619-01/chromebook_snow-armv7l-jammy.img.gz
> >
> > and it worked like a charm,but kvm was disabled. So,I have started to
> look
> > for a good documentation to understand how to enable kvm and I found
> this :
> >
> > http://www.virtualopensystems.com/en/solutions/guides/kvm-on-chromebook/
> >
> > I've followed all the instructions and it worked,but only with Ubuntu
> 13.04
> > and 14.04. More upgraded ubuntu versions give a lot of problems and they
> > don't work.
> >
> > So,I've thought about a fresh idea. What about to install the virtual
> open
> > systems "non-verified u-boot" on the first partition like explained in
> the
> > tutorial,and,instead of starting another u-boot after the original,can I
> > chain grub with the kernel installed for example by the ubuntu jammy iso
> > image created by "hexdump0815" ? To be honest I'm not sure if hexdump0815
> > used grub,but I will explain this later.
> >
> > Anyway,I've got the idea by reading here :
> >
> >
> https://unix.stackexchange.com/questions/599141/how-to-install-grub-bootloader-as-second-stage-bootloader
> > So,now,I'm going to explain what's the content of the partitions on my
> > Frankenstein sd card.
> >
> > 1) /dev/sdh1 = unknown = 16 MB. I've created this partition by doing :
> >
> > $ sudo dd if=nv_uboot-snow.kpart of=/dev/sdh1
> >
> > Where I've got the file nv_uboot-snow.kpart ? From here :
> >
> >
> http://www.virtualopensystems.com/downloads/guides/kvm_on_chromebook/nv_u-boot-snow.kpart
> >
> > 2) /dev/sdh2 = unknown = 16 MB. This partition has been created by
> > executing the following
> >
> > script :
> >
> > $ sudo ./scripts/sdcard.sh /dev/sdh
> >
> > 3) /dev/sdh3 = ext2 BOOT.
> >
> > Inside the partition /dev/sdh3 I have copied the following files and
> > folders (taken
> > from the hexdump0815 "chromebook_snow-armv7l-jammy.img.gz" file :
> >
> > a) dtb-5.18.1-stb-cbe+ = directory
> > b) extlinux = directory
> > c) extra = directory
> >
> > d) config.5.18.1-stb-cbe+ : file
> > e) initrd.img-5.18.1-stb-cbe+ : file
> > f) System.map-5.18.1-stb-cbe+ : file
> > g) vmlinux.kpart-5.18.1-stb-cbe+ : file
> > h) zImage-5.18.1-stb.cbe+ : file
> >
> > Inside the directory "dtb-5.18.1-stb-cbe+" there are the following files
> :
> >
> > a) exynos5250-snow.dtb
> > b) exynos5250-snow-rev5.dtb
> > c) exynos5250-spring.dtb
> >
> > Inside the directory "extlinux",there is the following file :
> >
> > a) extlinux.conf : that has the following content :
> >
> > TIMEOUT 30
> >
> > DEFAULT linux-snow-rev4
> >
> > MENU TITLE snow chromebook boot options
> >
> > # rev4 snow chromebook
> > LABEL linux-snow-rev4
> >   MENU LABEL linux rev4 snow
> >   LINUX ../zImage-5.18.1-stb-cbe+
> >   INITRD ../initrd.img-5.18.1-stb-cbe+
> >   FDT ../dtb-5.18.1-stb-cbe+/exynos5250-snow.dtb
> >   APPEND console=tty1 root=LABEL=rootpart ro rootwait net.ifnames=0
> > ipv6.disable=1 fsck.repair=yes noresume
> >
> > # rev5 snow chromebook
> > LABEL linux-snow-rev5
> >   MENU LABEL linux rev5 snow
> >   LINUX ../zImage-5.18.1-stb-cbe+
> >   INITRD ../in

How u-boot can chain "grub" and booting a mainline kernel on my ARM Chromebook

2023-07-01 Thread Mario Marietto
Hello.

I would like to enable KVM virtualization on my old ARM Chromebook
laptop,based on the Exynos5250 arm 32 bit cpu aka snow,model xe303c12.
The first thing I did has been to dd the image below directly on the sd
card :

https://github.com/hexdump0815/imagebuilder/releases/download/220619-01/chromebook_snow-armv7l-jammy.img.gz

and it worked like a charm,but kvm was disabled. So,I have started to look
for a good documentation to understand how to enable kvm and I found this :

http://www.virtualopensystems.com/en/solutions/guides/kvm-on-chromebook/

I've followed all the instructions and it worked,but only with Ubuntu 13.04
and 14.04. More upgraded ubuntu versions give a lot of problems and they
don't work.

So,I've thought about a fresh idea. What about to install the virtual open
systems "non-verified u-boot" on the first partition like explained in the
tutorial,and,instead of starting another u-boot after the original,can I
chain grub with the kernel installed for example by the ubuntu jammy iso
image created by "hexdump0815" ? To be honest I'm not sure if hexdump0815
used grub,but I will explain this later.

Anyway,I've got the idea by reading here :

https://unix.stackexchange.com/questions/599141/how-to-install-grub-bootloader-as-second-stage-bootloader
So,now,I'm going to explain what's the content of the partitions on my
Frankenstein sd card.

1) /dev/sdh1 = unknown = 16 MB. I've created this partition by doing :

$ sudo dd if=nv_uboot-snow.kpart of=/dev/sdh1

Where I've got the file nv_uboot-snow.kpart ? From here :

http://www.virtualopensystems.com/downloads/guides/kvm_on_chromebook/nv_u-boot-snow.kpart

2) /dev/sdh2 = unknown = 16 MB. This partition has been created by
executing the following

script :

$ sudo ./scripts/sdcard.sh /dev/sdh

3) /dev/sdh3 = ext2 BOOT.

Inside the partition /dev/sdh3 I have copied the following files and
folders (taken
from the hexdump0815 "chromebook_snow-armv7l-jammy.img.gz" file :

a) dtb-5.18.1-stb-cbe+ = directory
b) extlinux = directory
c) extra = directory

d) config.5.18.1-stb-cbe+ : file
e) initrd.img-5.18.1-stb-cbe+ : file
f) System.map-5.18.1-stb-cbe+ : file
g) vmlinux.kpart-5.18.1-stb-cbe+ : file
h) zImage-5.18.1-stb.cbe+ : file

Inside the directory "dtb-5.18.1-stb-cbe+" there are the following files :

a) exynos5250-snow.dtb
b) exynos5250-snow-rev5.dtb
c) exynos5250-spring.dtb

Inside the directory "extlinux",there is the following file :

a) extlinux.conf : that has the following content :

TIMEOUT 30

DEFAULT linux-snow-rev4

MENU TITLE snow chromebook boot options

# rev4 snow chromebook
LABEL linux-snow-rev4
  MENU LABEL linux rev4 snow
  LINUX ../zImage-5.18.1-stb-cbe+
  INITRD ../initrd.img-5.18.1-stb-cbe+
  FDT ../dtb-5.18.1-stb-cbe+/exynos5250-snow.dtb
  APPEND console=tty1 root=LABEL=rootpart ro rootwait net.ifnames=0
ipv6.disable=1 fsck.repair=yes noresume

# rev5 snow chromebook
LABEL linux-snow-rev5
  MENU LABEL linux rev5 snow
  LINUX ../zImage-5.18.1-stb-cbe+
  INITRD ../initrd.img-5.18.1-stb-cbe+
  FDT ../dtb-5.18.1-stb-cbe+/exynos5250-snow-rev5.dtb
  APPEND console=tty1 root=LABEL=rootpart ro rootwait net.ifnames=0
ipv6.disable=1 fsck.repair=yes noresume

# spring chromebook - untested
LABEL linux-spring
  MENU LABEL linux spring
  LINUX ../zImage-5.18.1-stb-cbe+
  INITRD ../initrd.img-5.18.1-stb-cbe+
  # rev4 snow chromebook
  FDT ../dtb-5.18.1-stb-cbe+/exynos5250-spring.dtb
  APPEND console=tty1 root=LABEL=rootpart ro rootwait net.ifnames=0
ipv6.disable=1 fsck.repair=yes noresume

Inside the extra directory there are the following files :

a) kernel-chromebook_snow-legacy.tar.gz
b) uboot.kpart.cbe-snow
c) uboot.kpart.cbe-snow-alternative
d) uboot.kpart.cbe-spring

4) /dev/sdh4 : inside here I have copied all the files of the jammy
userland prepared by hexdump0818.

That's all. What I want to do is if and how can I chainload the
"non-verified u-boot"
that is installed on the partition /dev/sdh1 with grub or whatever
mechanism it is able to boot the hexdump0815 jammy iso image.

As I repeat,the "non-verified u-boot" is produced by the script called
"build.sh",that's stored inside the u-boot/scripts directory. And if what I
want to do is impossible,can you explain to me how I can enable kvm on my
chromebook arm,using the most recent kernel possible ? I already know that
the support for kvm on arm 32 has been dropped on kernel 5.7,but for me to
use a lower kernel than 5.7 is ok. I've been working on this project for a
lot of months. I would like to see some progress. Thanks.

-- 
Mario.