Browse Source

wiki update

master
Hayashi Naoyuki 1 year ago
parent
commit
cdcf4a5498
5 changed files with 1537 additions and 19 deletions
  1. +183
    -0
      AlphaPC 164LX.md
  2. +452
    -0
      HiFive Unleashed.md
  3. +237
    -19
      Home.md
  4. +368
    -0
      ODROID-C2.md
  5. +297
    -0
      QEMU RV64.md

+ 183
- 0
AlphaPC 164LX.md View File

@@ -0,0 +1,183 @@
# AlphaPC 164LX

AlphaPC 164LX supports the 21164A Alpha processor.
This board supports SRM Console firmware and Alpha BIOS.
OpenSolaris requires the SRM Console firmware.

--------

## Supported devices
You can use a serial port as console.(A video console is not supported.)

Supported PCI card

* DEC DE500 Fast-Ethernet
* Intel 82559 Fast-Ethernet
* Silicon Image 3124 SATA
* Silicon Image 3132 SATA

The other PCI card supported by illumos will work well.

Currently, the bootable SCSI Card is not supported.
You can install bootloader to IDE Hard Disk. The system can boot from SATA Hard Disk because the bootloader can load kernel from SATA Hard Disk.
If you write the device driver for LSI 53c875, the system can boot from SCSI Hard Disk. (It is easy that you port the device driver from U-Boot)

--------

## Network Boot

The protocols of the boot device should be set to BOOTP in SRM Console.
For example, if the boot device is eia0, eia0_protocols should be set to BOOTP.
Run boot command in SRM Console.
When booting from network, some errors occurr but you can ignore errors.
You can login as root without using password.

```
>>>boot eia
(boot eia0.0.0.9.0)

Trying BOOTP boot.

Broadcasting BOOTP Request...
Received BOOTP Packet File Name is: /root_alpha/platform/SUNW,pc164lx/inetboot
local inet address: 192.168.5.51
remote inet address: 192.168.5.34
TFTP Read File Name: /root_alpha/platform/SUNW,pc164lx/inetboot
netmask = 255.255.255.0
Server is on same subnet as client.
...........
bootstrap code read in
base = 200000, image_start = 0, image_bytes = a9c88
initializing HWRPB at 2000
initializing page table at 3ffec000
initializing machine state
setting affinity to the primary CPU
jumping to bootstrap code
bootargs=
bootpath=BOOTP 0 9 0 0 0 9 0 00-90-27-57-71-AC 1
load_ramdisk:325 open /platform/alpha/boot_archive
vdev_probe error
\
bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
WARNING: cannot open system file: /etc/system
SunOS Release 5.11 Version SunOS_Development 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
DEBUG enabled
WARNING: Cannot mount /system/boot
Loading smf(5) service descriptions: 138/138
ERROR: svc:/system/filesystem/usr:default failed to mount remount (see 'svcs -x' for details)
Feb 5 07:59:08 svc.startd[100003]: svc:/system/filesystem/usr:default: Method "/lib/svc/method/fs-usr" failed with exit status 95.
Feb 5 07:59:08 svc.startd[100003]: system/filesystem/usr:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run

Enter user name for system maintenance (control-d to bypass): Hostname: pc164lx


Enter user name for system maintenance (control-d to bypass): root
Enter root password (control-d to bypass):
single-user privilege assigned to root on /dev/console.
Entering System Maintenance Mode

Feb 5 08:06:38 su: 'su root' succeeded for root on /dev/console
The Illumos Project SunOS 5.11 SunOS Development Feb. 05, 2020
SunOS Internal Development: non-nightly build
root@pc164lx:~#
```

--------

## Booting from HDD
You can install the bootloader to a IDE Hard Disk when booting from network.

```
installboot /platform/SUNW,pc164lx/inetboot /dev/rdsk/c2d0p0
```

You can install Solaris to SATA Hard Disk when booting from network.
Run boot command with -D *SATA Hard Disk* option in SRM Console.

```
>>>b -fl "-D /pci@0,0/pci1095,7124@3800,0/disk@0,0" dqa
Resetting I/O buses...
(boot dqa0.0.0.11.0 -flags -D /pci@0,0/pci1095,7124@3800,0/disk@0,0)
block 0 of dqa0.0.0.11.0 is a valid boot block
reading 1359 blocks from dqa0.0.0.11.0
bootstrap code read in
base = 200000, image_start = 0, image_bytes = a9e00
initializing HWRPB at 2000
initializing page table at 3ffec000
initializing machine state
setting affinity to the primary CPU
jumping to bootstrap code
bootargs=-D /pci@0,0/pci1095,7124@3800,0/disk@0,0
bootpath=/pci@0,0/pci1095,7124@3800,0/disk@0,0
zfs_bootfs=rpool/ROOT/illumos
zfs_lookup error /platform//boot_archive
zfs_lookup error /platform/SUNW,pc164lx/boot_archive
load_ramdisk:325 open /platform/alpha/boot_archive
vdev_probe error
\
bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
WARNING: cannot open system file: /etc/system
SunOS Release 5.11 Version SunOS_Development 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
DEBUG enabled
WARNING: Cannot mount /system/boot
Loading smf(5) service descriptions: 138/138
Hostname: unknown

WARNING: Reboot required.
The system has updated the cache of files (boot archive) that
is used during the early boot sequence. To avoid booting and
running the system with the previously out-of-sync version of
these files, the system will be restarted.

syncing file systems... done
reset

halted CPU 0

halt code = 5
HALT instruction executed
PC = fffffffdfb02f01c
>>>b -fl "-D /pci@0,0/pci1095,7124@3800,0/disk@0,0" dqa
Resetting I/O buses...
(boot dqa0.0.0.11.0 -flags -D /pci@0,0/pci1095,7124@3800,0/disk@0,0)
block 0 of dqa0.0.0.11.0 is a valid boot block
reading 1359 blocks from dqa0.0.0.11.0
bootstrap code read in
base = 200000, image_start = 0, image_bytes = a9e00
initializing HWRPB at 2000
initializing page table at 3ffec000
initializing machine state
setting affinity to the primary CPU
jumping to bootstrap code
bootargs=-D /pci@0,0/pci1095,7124@3800,0/disk@0,0
bootpath=/pci@0,0/pci1095,7124@3800,0/disk@0,0
zfs_bootfs=rpool/ROOT/illumos
zfs_lookup error /platform//boot_archive
zfs_lookup error /platform/SUNW,pc164lx/boot_archive
load_ramdisk:325 open /platform/alpha/boot_archive
vdev_probe error
\
bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
SunOS Release 5.11 Version SunOS_Development 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
DEBUG enabled
WARNING: Cannot mount /system/boot
Hostname: unknown

unknown console login:
```


+ 452
- 0
HiFive Unleashed.md View File

@@ -0,0 +1,452 @@
# HiFive Unleashed

HiFive Unleashed is the RISC‑V development board.
Currently, GbE, uSD and UART are supported on OpenSolaris.

-------

## DIP Switch
on: 5
off: 1, 2, 3, 4, 6

## How to make a bootable uSD

### Getting the source

```
git clone -b osport/v2019.10 https://bitbucket.org/hayashin/u-boot.git
git clone https://bitbucket.org/hayashin/opensbi.git
git clone https://bitbucket.org/hayashin/freedom-u540-c000-bootloader.git
```

### Building and Flashing
You should build OpenSolaris in advance.
Refer to the following for building firmware and flashing.

```
#! /bin/bash

DISK=/dev/sdc

base_dir=$(cd $(dirname $0); pwd)

illumos_dir=${base_dir}/illumos-gate
opensbi_dir=${base_dir}/opensbi
uboot_dir=${base_dir}/u-boot
fsbl_dir=${base_dir}/freedom-u540-c000-bootloader
platform_dir=/data/proto/root_riscv64/platform/SUNW,sifive

# fsbl
CROSSCOMPILE=${illumos_dir}/usr/src/cross/bin/riscv64-solaris2.11- \
make -C ${fsbl_dir} || exit 1

# u-boot
CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/riscv64-solaris2.11- \
ARCH=riscv \
make -C ${uboot_dir} sifive_fu540_defconfig || exit 1

CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/riscv64-solaris2.11- \
ARCH=riscv \
make -C ${uboot_dir} -j || exit 1

# oepnsbi
CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/riscv64-solaris2.11- \
PLATFORM_RISCV_XLEN=64 \
make -C ${opensbi_dir} \
PLATFORM=sifive/fu540 \
FW_PAYLOAD_PATH=${uboot_dir}/u-boot.bin \
FW_PAYLOAD_FDT_PATH=${illumos_dir}/usr/src/psm/stand/boot/riscv64/sifive/hifive-unleashed-a00.dtb || exit 1

# flash
FSBL=5B193300-FC78-40CD-8002-E86C45580B47
UBOOT=2E54B353-1271-4842-806F-E436D6AF6985
VFAT=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
SOLARIS=6A85CF4D-1DD2-11B2-99A6-080020736631

FSBL_START=2048
FSBL_END=4095
fsbl_img=${fsbl_dir}/fsbl.bin

VFAT_START=4096
VFAT_END=20479
VFAT_SIZE=$(expr ${VFAT_END} - ${VFAT_START} + 1)
vfat_img=${base_dir}/vfat.img

UBOOT_START=20480
UBOOT_END=28671
uboot_img=${opensbi_dir}/build/platform/sifive/fu540/firmware/fw_payload.bin

SOLARIS_START=28672

sgdisk -g -e --clear \
--new=1:${SOLARIS_START}: --change-name=1:solaris --typecode=1:${SOLARIS} \
--new=2:${FSBL_START}:${FSBL_END} --change-name=2:fsbl --typecode=2:${FSBL} \
--new=3:${VFAT_START}:${VFAT_END} --change-name=3:vfat --typecode=3:${VFAT} \
--new=4:${UBOOT_START}:${UBOOT_END} --change-name=4:uboot --typecode=4:${UBOOT} \
${DISK}

dd if=/dev/zero of=${vfat_img} bs=512 count=${VFAT_SIZE}
/sbin/mkfs.vfat ${vfat_img}
MTOOLS_SKIP_CHECK=1 mcopy -i ${vfat_img} ${platform_dir}/hifive-unleashed-a00.dtb ::hifive-unleashed-a00.dtb
MTOOLS_SKIP_CHECK=1 mcopy -i ${vfat_img} ${platform_dir}/inetboot ::inetboot

dd conv=notrunc if=${fsbl_img} of=${DISK} bs=512 seek=${FSBL_START}
dd conv=notrunc if=${vfat_img} of=${DISK} bs=512 seek=${VFAT_START}
dd conv=notrunc if=${uboot_img} of=${DISK} bs=512 seek=${UBOOT_START}
sync
```

-------

### Network Boot
In U-Boot, run `run enet_boot` command.
When booting from network, some errors occurr but you can ignore errors.
You can login as root without using password.

```
SiFive FSBL: 2020-01-16-f3fc96a
Using FSBL DTB
HiFive-U serial #: 00000095
Loading boot payload....


OpenSBI v0.5
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|

Platform Name : SiFive Freedom U540
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs : 5
Current Hart : 1
Firmware Base : 0x80000000
Firmware Size : 104 KB
Runtime SBI Version : 0.2

PMP0: 0x0000000080000000-0x000000008001ffff (A)
PMP1: 0x0000000000000000-0x0000007fffffffff (A,R,W,X)


U-Boot 2019.10-g4b4f5e4eee-dirty (Feb 06 2020 - 21:25:38 +0900)

CPU: rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM: 8 GiB
MMC: spi@10050000:mmc@0: 0
In: serial@10010000
Out: serial@10010000
Err: serial@10010000
Net: eth0: ethernet@10090000
Hit any key to stop autoboot: 0
=> run enet_boot
ethernet@10090000: PHY present at 0
ethernet@10090000: Starting autonegotiation...
ethernet@10090000: Autonegotiation complete
ethernet@10090000: link up, 1000Mbps full-duplex (lpa: 0x3c00)
BOOTP broadcast 1
DHCP client bound to address 192.168.5.55 (2 ms)
Using ethernet@10090000 device
TFTP from server 192.168.5.34; our IP address is 192.168.5.55
Filename '/root_riscv64/platform/SUNW,sifive/inetboot'.
Load address: 0x80400000
Loading: #################################################################
#############################################
6.6 MiB/s
done
Bytes transferred = 562232 (89438 hex)
ethernet@10090000: PHY present at 0
ethernet@10090000: Starting autonegotiation...
ethernet@10090000: Autonegotiation complete
ethernet@10090000: link up, 1000Mbps full-duplex (lpa: 0x3c00)
Using ethernet@10090000 device
TFTP from server 192.168.5.34; our IP address is 192.168.5.55
Filename '/root_riscv64/platform/SUNW,sifive/hifive-unleashed-a00.dtb'.
Load address: 0x80500000
Loading: ##
2.1 MiB/s
done
Bytes transferred = 6755 (1a63 hex)
## Booting kernel from Legacy Image at 80400000 ...
Image Name: OpenSolaris
Image Type: RISC-V Linux Kernel Image (uncompressed)
Data Size: 562168 Bytes = 549 KiB
Load Address: 80400000
Entry Point: 80400000
Verifying Checksum ... OK
## Flattened Device Tree blob at 80500000
Booting using the fdt blob at 0x80500000
Loading Kernel Image
Using Device Tree in place at 0000000080500000, end 0000000080504a62

Starting kernel ...

phys memory add 0000000080000000 - 000000027fffffff
memory resv 0000000080000000 - 00000000803fffff
add io 10090000 2000 for sifive,fu540-c000-gem
add io 100a0000 1000 for sifive,fu540-c000-gem
add io 10040000 1000 for sifive,spi0
add io 20000000 10000000 for sifive,spi0
add io 10041000 1000 for sifive,spi0
add io 30000000 10000000 for sifive,spi0
add io 10050000 1000 for sifive,spi0
add io 10030000 1000 for sifive,i2c0
add io 10010000 1000 for sifive,uart0
add io 10011000 1000 for sifive,uart0
add io 10020000 1000 for sifive,pwm0
add io 10021000 1000 for sifive,pwm0
add io 10000000 1000 for sifive,fu540-c000-prci
add io c000000 4000000 for sifive,plic-1.0.0
bootargs=-D /soc/ethernet@10090000
bootpath=/soc/ethernet@10090000
mfg_name=SUNW,sifive
bpath=/soc/ethernet@10090000
vdev_probe error
mfg_name=SUNW,sifive

bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
intr_init:1202 riscv,max-priority=1
intr_init:1203 riscv,ndev=53
plic_map: index 0 is not used. hart0
plic_map: index 1 is not used. hart1
plic_map: plic index 2 for hart1
plic_map: index 3 is not used. hart2
plic_map: plic index 4 for hart2
plic_map: index 5 is not used. hart3
plic_map: plic index 6 for hart3
plic_map: index 7 is not used. hart4
plic_map: plic index 8 for hart4
SunOS Release 5.11 Version SunOS_Development 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
DEBUG enabled
rootnex_map_regspec: 10090000 -> ffffffc010090000
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 10010000 -> ffffffc010010000
cpu0: RISC-V 64bit hart=1
plic_map: index 0 is not used. hart0
plic_map: index 1 is not used. hart1
plic_map: plic index 2 for hart1
plic_map: index 3 is not used. hart2
plic_map: plic index 4 for hart2
plic_map: index 5 is not used. hart3
plic_map: plic index 6 for hart3
plic_map: index 7 is not used. hart4
plic_map: plic index 8 for hart4
cpu1: RISC-V 64bit hart=2
cpu1: sifive,fu540-c000
cpu1 initialization complete - online
plic_map: index 0 is not used. hart0
plic_map: index 1 is not used. hart1
plic_map: plic index 2 for hart1
plic_map: index 3 is not used. hart2
plic_map: plic index 4 for hart2
plic_map: index 5 is not used. hart3
plic_map: plic index 6 for hart3
plic_map: index 7 is not used. hart4
plic_map: plic index 8 for hart4
cpu2: RISC-V 64bit hart=3
cpu2: sifive,fu540-c000
cpu2 initialization complete - online
plic_map: index 0 is not used. hart0
plic_map: index 1 is not used. hart1
plic_map: plic index 2 for hart1
plic_map: index 3 is not used. hart2
plic_map: plic index 4 for hart2
plic_map: index 5 is not used. hart3
plic_map: plic index 6 for hart3
plic_map: index 7 is not used. hart4
plic_map: plic index 8 for hart4
cpu3: RISC-V 64bit hart=4
cpu3: sifive,fu540-c000
cpu3 initialization complete - online
ERROR: svc:/system/filesystem/usr:default failed to mount remount (see 'svcs -x' for details)
Nov 10 07:03:16 svc.startd[100003]: svc:/system/filesystem/usr:default: Method "/lib/svc/method/fs-usr" failed with exit status 95.
Nov 10 07:03:16 svc.startd[100003]: system/filesystem/usr:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
Hostname: sifive
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run

Enter user name for system maintenance (control-d to bypass): root
Enter root password (control-d to bypass):
single-user privilege assigned to root on /dev/console.
Entering System Maintenance Mode

Nov 10 07:03:27 su: 'su root' succeeded for root on /dev/console
The Illumos Project SunOS 5.11 SunOS Development Feb. 06, 2020
SunOS Internal Development: non-nightly build
root@sifive:~#
```

-------

### Booting from uSD
In U-Boot, run `run mmc_boot` command.

```
SiFive FSBL: 2020-01-16-f3fc96a
Using FSBL DTB
HiFive-U serial #: 00000095
Loading boot payload....


OpenSBI v0.5
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|

Platform Name : SiFive Freedom U540
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs : 5
Current Hart : 1
Firmware Base : 0x80000000
Firmware Size : 104 KB
Runtime SBI Version : 0.2

PMP0: 0x0000000080000000-0x000000008001ffff (A)
PMP1: 0x0000000000000000-0x0000007fffffffff (A,R,W,X)


U-Boot 2019.10-g4b4f5e4eee-dirty (Feb 06 2020 - 21:25:38 +0900)

CPU: rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM: 8 GiB
MMC: spi@10050000:mmc@0: 0
In: serial@10010000
Out: serial@10010000
Err: serial@10010000
Net: eth0: ethernet@10090000
Hit any key to stop autoboot: 0
=> run mmc_boot
562232 bytes read in 291 ms (1.8 MiB/s)
6755 bytes read in 9 ms (732.4 KiB/s)
## Booting kernel from Legacy Image at 80400000 ...
Image Name: OpenSolaris
Image Type: RISC-V Linux Kernel Image (uncompressed)
Data Size: 562168 Bytes = 549 KiB
Load Address: 80400000
Entry Point: 80400000
Verifying Checksum ... OK
## Flattened Device Tree blob at 80500000
Booting using the fdt blob at 0x80500000
Loading Kernel Image
Using Device Tree in place at 0000000080500000, end 0000000080504a62

Starting kernel ...

phys memory add 0000000080000000 - 000000027fffffff
memory resv 0000000080000000 - 00000000803fffff
add io 10090000 2000 for sifive,fu540-c000-gem
add io 100a0000 1000 for sifive,fu540-c000-gem
add io 10040000 1000 for sifive,spi0
add io 20000000 10000000 for sifive,spi0
add io 10041000 1000 for sifive,spi0
add io 30000000 10000000 for sifive,spi0
add io 10050000 1000 for sifive,spi0
add io 10030000 1000 for sifive,i2c0
add io 10010000 1000 for sifive,uart0
add io 10011000 1000 for sifive,uart0
add io 10020000 1000 for sifive,pwm0
add io 10021000 1000 for sifive,pwm0
add io 10000000 1000 for sifive,fu540-c000-prci
add io c000000 4000000 for sifive,plic-1.0.0
bootargs=-D /soc/spi@10050000
bootpath=/soc/spi@10050000
bpath=/soc/spi@10050000
zfs_lookup error /platform//boot_archive
zfs_lookup error /platform/SUNW,sifive/boot_archive
zfs_lookup error /platform/sifive,hifive-unleashed-a00/boot_archive
zfs_lookup error /platform/sifive,fu540-c000/boot_archive
vdev_probe error
mfg_name=SUNW,sifive

bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
intr_init:1202 riscv,max-priority=1
intr_init:1203 riscv,ndev=53
plic_map: index 0 is not used. hart0
plic_map: index 1 is not used. hart1
plic_map: plic index 2 for hart1
plic_map: index 3 is not used. hart2
plic_map: plic index 4 for hart2
plic_map: index 5 is not used. hart3
plic_map: plic index 6 for hart3
plic_map: index 7 is not used. hart4
plic_map: plic index 8 for hart4
SunOS Release 5.11 Version SunOS_Development 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
DEBUG enabled
rootnex_map_regspec: 10050000 -> ffffffc010050000
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 10010000 -> ffffffc010010000
cpu0: RISC-V 64bit hart=1
plic_map: index 0 is not used. hart0
plic_map: index 1 is not used. hart1
plic_map: plic index 2 for hart1
plic_map: index 3 is not used. hart2
plic_map: plic index 4 for hart2
plic_map: index 5 is not used. hart3
plic_map: plic index 6 for hart3
plic_map: index 7 is not used. hart4
plic_map: plic index 8 for hart4
cpu1: RISC-V 64bit hart=2
cpu1: sifive,fu540-c000
cpu1 initialization complete - online
plic_map: index 0 is not used. hart0
plic_map: index 1 is not used. hart1
plic_map: plic index 2 for hart1
plic_map: index 3 is not used. hart2
plic_map: plic index 4 for hart2
plic_map: index 5 is not used. hart3
plic_map: plic index 6 for hart3
plic_map: index 7 is not used. hart4
plic_map: plic index 8 for hart4
cpu2: RISC-V 64bit hart=3
cpu2: sifive,fu540-c000
cpu2 initialization complete - online
plic_map: index 0 is not used. hart0
plic_map: index 1 is not used. hart1
plic_map: plic index 2 for hart1
plic_map: index 3 is not used. hart2
plic_map: plic index 4 for hart2
plic_map: index 5 is not used. hart3
plic_map: plic index 6 for hart3
plic_map: index 7 is not used. hart4
plic_map: plic index 8 for hart4
cpu3: RISC-V 64bit hart=4
cpu3: sifive,fu540-c000
cpu3 initialization complete - online
Hostname: unknown

unknown console login: rootnex_map_regspec: 10011000 -> ffffffc010011000

unknown console login: root

Nov 10 07:02:20 unknown login: Solaris_audit getaddrinfo(unknown) failed[node name or service name not known]: Error 0
Nov 10 07:02:20 unknown login: Solaris_audit adt_get_local_address failed, no Audit IP address available, faking loopback and error: Network is down
Nov 10 07:02:20 unknown login: pam_unix_cred: cannot load ttyname: Network is down, continuing.
Nov 10 07:02:21 unknown login: ROOT LOGIN /dev/console
Last login: Tue Nov 10 07:02:23 on console
The Illumos Project SunOS 5.11 SunOS Development Feb. 06, 2020
SunOS Internal Development: non-nightly build
root@unknown:~#
```


+ 237
- 19
Home.md View File

@@ -1,42 +1,260 @@
# Welcome

Welcome to your wiki! This is the default page we've installed for your convenience. Go ahead and edit it.
A goal of this project is to port OpenSolaris in some architecture.
Most of source code is from [illumos Project](https://wiki.illumos.org/).
## Supported Hardware

## Wiki features
* DEC Alpha

This wiki uses the [Markdown](http://daringfireball.net/projects/markdown/) syntax. The [MarkDownDemo tutorial](https://bitbucket.org/tutorials/markdowndemo) shows how various elements are rendered. The [Bitbucket documentation](https://confluence.atlassian.com/x/FA4zDQ) has more information about using a wiki.
* [[AlphaPC 164LX]]

The wiki itself is actually a git repository, which means you can clone it, edit it locally/offline, add images or any other file type, and push it back to us. It will be live immediately.
* 64bit ARM (ARMv8-A, aarch64)

Go ahead and try:
* [[ODROID-C2]]

* 64bit RISC-V

* [[HiFive Unleashed]]
* [[QEMU RV64]]

- - -

# Build

## Build environment

GNU make and GCC are used for building on Linux. __Building is not supported on OpenSolaris__ because of incompatible changes.

Following packages are required on openSUSE Leap 15.1.
```
$ git clone https://hayashin@bitbucket.org/hayashin/illumos-gate.git/wiki
zypper install git-core gcc gcc-c++ make bison flex perl-XML-Parser libopenssl-devel \
liblz4-devel bzip2 patch zlib-devel ncurses-devel ksh ed mkisofs dtc \
autoconf u-boot-tools
```

Wiki pages are normal files, with the .md extension. You can edit them locally, as well as creating new ones.
## Getting the source

## Syntax highlighting
```
git clone https://bitbucket.org/hayashin/illumos-gate.git
cd illumos-gate
git submodule update --init
```

## Setting the environment

You can also highlight snippets of text (we use the excellent [Pygments][] library).
You need to edit the following configuration files.

[Pygments]: http://pygments.org/
#### usr/src/mk/config.mk
|variable|default value|description|
|:-|:-|:-|
|MACH|aarch64|target architecture. aarch64, alpha and riscv64 are acceptable value.|
|ROOT|/data/proto/root_$(MACH)|build output directory. This directory is used as root directory when booting from NFS.|
|PIC_BASE|/tmp/solaris/$(MACH)/pic|output directory for temporary files|

## Building

Here's an example of some Python code:
Run make in the usr/src directory.
It takes 13 minutes on my Threadripper 1950X machine.

```
#!python
cd usr/src
make tools
make -j

def wiki_rocks(text):
formatter = lambda t: "funky"+t
return formatter(text)
```

- - -

# Installing

## Overview

There is no installer. You can install to a storage device by following the steps below.

1. Boot from the network (DHCP/BOOTP + TFTP + NFSv3)
1. Partition a hard drive (or a MMC device).
1. Initialize a file system (zfs).
1. Extract a tar ball.

## Server settings

You can check out the source of this page to see how that's done, and make sure to bookmark [the vast library of Pygment lexers][lexers], we accept the 'short name' or the 'mimetype' of anything in there.
[lexers]: http://pygments.org/docs/lexers/
### DHCP

The configuration of Vendor Class Identifier is required.

|HW|Vendor Class Identifier|
|:-|:-|
|AlphaPC 164LX|SUNW.pc164lx|
|ODROID-C2|SUNW.meson|
|QEMU virt|SUNW.virt|
|HiFive Unleashed|SUNW.sifive|

Example configuration for the ISC DHCP Server.

```
option space SUNW;
option SUNW.root-mount-options code 1 = text;
option SUNW.root-server-ip-address code 2 = ip-address;
option SUNW.root-server-hostname code 3 = text;
option SUNW.root-path-name code 4 = text;
option SUNW.swap-server-ip-address code 5 = ip-address;
option SUNW.swap-file-path code 6 = text;
option SUNW.boot-file-path code 7 = text;
option SUNW.posix-timezone-string code 8 = text;
option SUNW.boot-read-size code 9 = unsigned integer 16;
option SUNW.install-server-ip-address code 10 = ip-address;
option SUNW.install-server-hostname code 11 = text;
option SUNW.install-path code 12 = text;
option SUNW.sysid-config-file-server code 13 = text;
option SUNW.JumpStart-server code 14 = text;
option SUNW.terminal-name code 15 = text;
option SUNW.standalone-boot-uri code 16 = text;
option SUNW.standalone-boot-http-proxy code 17 = text;

subnet 192.168.0.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
#option routers 192.168.0.1;
#option domain-name-servers 192.168.0.1;
option domain-name "example.com";
default-lease-time 14400;
max-lease-time 172800;

vendor-option-space SUNW;
option SUNW.root-mount-options "rsize=32768";
option SUNW.root-server-hostname "develop";
option SUNW.root-server-ip-address 192.168.0.34;
next-server 192.168.0.34;

group { # id="Solaris-Alpha"
option SUNW.root-path-name "/data/proto/root_alpha";
host pc164lx {
option vendor-class-identifier "SUNW.pc164lx";
option host-name "pc164lx";
filename "/root_alpha/platform/SUNW,pc164lx/inetboot";
fixed-address 192.168.0.51;
hardware ethernet 00:90:27:57:71:ac;
}
}

group { # id="Solaris-ARMv8"
option SUNW.root-path-name "/data/proto/root_aarch64";
host meson {
option host-name "meson";
option vendor-class-identifier "SUNW.meson";
filename "/root_aarch64/platform/SUNW,meson/inetboot";
fixed-address 192.168.0.53;
hardware ethernet 00:1e:06:33:77:91;
}
}

group { # id="Solaris-RISC-V"
option SUNW.root-path-name "/data/proto/root_riscv64";
host virt {
option vendor-class-identifier "SUNW.virt";
option host-name "virt";
filename "/root_riscv64/platform/SUNW,virt/inetboot";
fixed-address 192.168.0.54;
hardware ethernet 52:54:00:70:0a:e3;
}
host sifive {
option vendor-class-identifier "SUNW.sifive";
option host-name "sifive";
filename "/root_riscv64/platform/SUNW,sifive/inetboot";
fixed-address 192.168.0.55;
hardware ethernet 70:b3:d5:92:f0:95;
}
}
}

```

### TFTP
You need to change the tftp server directory to /data/proto.
Configure TFTP_DIRECTORY in /etc/sysconfig/tftp when using openSUSE 15.1.

### NFS
Configure a NFSv3 Server.
The permission of root access to NFS is required.
The following is a sample of /etc/exports.

```
/data/proto/root_aarch64 *(rw,no_root_squash,insecure,sync,no_subtree_check)
/data/proto/root_alpha *(rw,no_root_squash,insecure,sync,no_subtree_check)
/data/proto/root_riscv64 *(rw,no_root_squash,insecure,sync,no_subtree_check)
```

## Partitioning
You can work with shell when booting from the network.
Please see the pages of hardware for how to boot.

### dos disk label

You need to mark the solaris partition as active.

format -> fdisk

```
Total disk size is 3790 cylinders
Cylinder size is 4096 (512 byte) blocks

Cylinders
Partition Status Type Start End Length %
========= ====== ============ ===== === ====== ===
1 Ext Win95 1 17 17 0
2 Active Solaris2 18 3789 3772 100
```

You need to mark the __tag__ of the root slice as __root__.

format -> partition

```
partition> p
Current partition table (original):
Total disk cylinders available: 3772 + 0 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 3771 7.37GB (3771/0/0) 15446016
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 3771 7.36GB (3772/0/0) 15450112
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 2.00MB (1/0/0) 4096
9 unassigned wm 0 0 (0/0/0) 0
```

### GPT disk label

You need to use Solaris ROOT GUID (6A85CF4D-1DD2-11B2-99A6-080020736631) for the root slice.

## Extracting
You can work with shell when booting from the network.
You need to initialize the file system and extract a tar ball.
The following example installs to /dev/dsk/c1t0d0s0.

```
devfsadm
zpool create -f -o altroot=/mnt rpool /dev/dsk/c1t0d0s0
zfs create rpool/ROOT
zfs create rpool/ROOT/illumos
gtar -o -xf /var/illumos.tar.gz -C /mnt/rpool/ROOT/illumos --warning=no-timestamp
chown -R dladm:netadm /mnt/rpool/ROOT/illumos/etc/dladm
chown -R netadm:netadm /mnt/rpool/ROOT/illumos/etc/ipadm
chown -R netadm:netadm /mnt/rpool/ROOT/illumos/etc/nwam
mkdir -p /mnt/rpool/ROOT/illumos/etc/zfs
zfs unmount -a
zpool export rpool
zpool import -o cachefile=/tmp/zpool.cache -o altroot=/mnt rpool
cp /tmp/zpool.cache /mnt/rpool/ROOT/illumos/etc/zfs/
zfs unmount -a
zpool set bootfs=rpool/ROOT/illumos rpool
zpool set cachefile="" rpool
zfs set mountpoint=none rpool
zfs set mountpoint=legacy rpool/ROOT
zfs set mountpoint=/ rpool/ROOT/illumos
zpool export rpool
```

Have fun!

+ 368
- 0
ODROID-C2.md View File

@@ -0,0 +1,368 @@
# ODROID-C2

The [Hardkernel](https://www.hardkernel.com/) ODROID-C2 is a low cost development board.
Currently, GbE, uSD, UART and RTC Shield are supported on OpenSolaris. __eMMC is not supported.__

------

## How to make a bootable uSD

### Partitioning
Two partitions are required.
Create FAT partition and Solaris in an MBR partition table.
You need to mark the solaris partition as active.
*You should create slices with format command when booting from network for Solaris installation.*

```
Command (m for help): p
Disk /dev/sdc: 7.5 GiB, 8068792320 bytes, 15759360 sectors
Disk model: Storage Device
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/sdc1 4096 135167 131072 64M c W95 FAT32 (LBA)
/dev/sdc2 * 135168 15757311 15622144 7.5G bf Solaris
```

### Getting the source

```
git clone -b osport/v2020.02 https://bitbucket.org/hayashin/arm-trusted-firmware.git
git clone -b osport/v2019.10 https://bitbucket.org/hayashin/u-boot.git
git clone -b hardkernel/odroidc2-v2015.01 https://bitbucket.org/hayashin/u-boot.git u-boot-odroid
git clone https://bitbucket.org/hayashin/meson-tools.git
```

### Building and Flashing
You should build OpenSolaris in advance.
Refer to the following for building firmware and flashing.

```
#! /bin/bash

DISK=/dev/sdc

base_dir=$(cd $(dirname $0); pwd)
illumos_dir=${base_dir}/illumos-gate
uboot_dir=${base_dir}/u-boot
uboot_odroid_dir=${base_dir}/u-boot-odroid
atf_dir=${base_dir}/arm-trusted-firmware
fiptool_dir=${atf_dir}/tools/fiptool
mesontools_dir=${base_dir}/meson-tools

# u-boot
CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/aarch64-solaris2.11- \
ARCH=arm \
make -C ${uboot_dir} odroid-c2_defconfig || exit 1

CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/aarch64-solaris2.11- \
ARCH=arm \
make -C ${uboot_dir} -j || exit 1

# arm trusted firmware
CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/aarch64-solaris2.11- \
make -C ${atf_dir} -j DEBUG=1 PLAT=gxbb bl31 || exit 1
make -C ${fiptool_dir} || exit 1

# meson-tools
make -C ${mesontools_dir} || exit 1

${fiptool_dir}/fiptool create --align 16384 \
--scp-fw ${uboot_odroid_dir}/fip/gxb/bl30.bin \
--amlogic-scp-task-fw ${uboot_odroid_dir}/fip/gxb/bl301.bin \
--soc-fw ${atf_dir}/build/gxbb/debug/bl31.bin \
--nt-fw ${uboot_dir}/u-boot.bin \
${base_dir}/fip.bin

cat ${uboot_odroid_dir}/fip/gxb/bl2.package ${base_dir}/fip.bin > ${base_dir}/boot_new.bin
${mesontools_dir}/amlbootsig ${base_dir}/boot_new.bin ${base_dir}/u-boot.img
dd if=${base_dir}/u-boot.img of=${base_dir}/u-boot.gxbb bs=512 skip=96

BL1=${uboot_odroid_dir}/sd_fuse/bl1.bin.hardkernel
dd if=$BL1 of=$DISK conv=fsync bs=1 count=442
dd if=$BL1 of=$DISK conv=fsync bs=512 skip=1 seek=1
dd if=${base_dir}/u-boot.gxbb of=$DISK conv=fsync bs=512 seek=97
```

-----

### Network Boot
In U-Boot, run `run enet_boot` command.
When booting from network, some errors occurr but you can ignore errors.
You can login as root without using password.

```
GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;READ:0;CHK:0;
TE: 280926
no sdio debug board detected

BL2 Built : 11:44:26, Nov 25 2015.
gxb gfb13a3b-c2 - jcao@wonton

Board ID = 8
set vcck to 1100 mv
set vddee to 1050 mv
CPU clk: 1536MHz
DDR channel setting: DDR0 Rank0+1 same
DDR0: 2048MB(auto) @ 912MHz(2T)-13
DataBus test pass!
AddrBus test pass!
Load fip header from SD, src: 0x0000c200, des: 0x01400000, size: 0x000000b0
Load bl30 from SD, src: 0x00010200, des: 0x01000000, size: 0x00009ef0
Sending bl30........................................OK.
Run bl30...
Load bl301 from SD, src: 0x0001c200, des: 0x01000000, size: 0x000018c0
Wait bl30...Done
Sending bl301.......OK.
Run bl301...
31 from SD, src: 0x00020200, des: 0x10100000, size: 0x00009220


--- UART initialized after reboot ---
[Reset cause: unknown]
[Image: unknown, amlogic_Load bl33 from SD, src: 0x0002c200, des: 0x01000000, size: 0x0007cae0
v1.1.3046-00db630-dirty 2016-08-31 09:24:14 tao.zeng@droid04]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: ef be ad de d f0 ad ba ef be ad de not ES chip
[0.395644 Inits done]
secure task start!
high task start!
low task start!
NOTICE: BL31: v2.2(debug):v2.2-593-gf11098fc7-dirty
NOTICE: BL31: Built : 09:33:52, Feb 6 2020
INFO: ARM GICv2 driver initialized
INFO: BL31: Initializing runtime services
INFO: BL31: cortex_a53: CPU workaround for 843419 was applied
INFO: BL31: cortex_a53: CPU workaround for 855873 was applied
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x1000000
INFO: SPSR = 0x3c9


U-Boot 2019.10-g5ed04291cb (Feb 06 2020 - 16:03:57 +0900) odroid-c2

Model: Hardkernel ODROID-C2
Soc: Amlogic Meson GXBB (S905) Revision 1f:b (0:1)
DRAM: 2 GiB
MMC: mmc@72000: 0, mmc@74000: 1
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@c9410000
Hit any key to stop autoboot: 0
=> run enet_boot
Speed: 1000, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.5.53 (0 ms)
Using ethernet@c9410000 device
TFTP from server 192.168.5.34; our IP address is 192.168.5.53
Filename '/root_aarch64/platform/SUNW,meson/inetboot'.
Load address: 0x11000000
Loading: #################################################################
##########################################################
6.9 MiB/s
done
Bytes transferred = 624984 (98958 hex)
Speed: 1000, full duplex
Using ethernet@c9410000 device
TFTP from server 192.168.5.34; our IP address is 192.168.5.53
Filename '/root_aarch64/platform/SUNW,meson/meson-gxbb-odroidc2.dtb'.
Load address: 0x11100000
Loading: ###
5.2 MiB/s
done
Bytes transferred = 10946 (2ac2 hex)
## Booting kernel from Legacy Image at 11000000 ...
Image Name: OpenSolaris
Image Type: AArch64 Linux Kernel Image (uncompressed)
Data Size: 624920 Bytes = 610.3 KiB
Load Address: 7c080000
Entry Point: 7c080000
Verifying Checksum ... OK
## Flattened Device Tree blob at 11100000
Booting using the fdt blob at 0x11100000
Loading Kernel Image
Loading Device Tree to 000000007df5e000, end 000000007df63ac1 ... OK

Starting kernel ...

phys memory add 0000000000000000 - 000000007fffffff
memory resv 0000000000000000 - 0000000000ffffff
memory resv 0000000010000000 - 00000000101fffff
bootargs=-D /soc/ethernet@c9410000
bootpath=/soc/ethernet@c9410000
vdev_probe error
rootnex_map_regspec: c9410000 -> ffff0000c9410000
rootnex_map_regspec: c8834540 -> ffff0000c8834540
WARNING: Cannot mount /system/boot
rootnex_map_regspec: c81004c0 -> ffff0000c81004c0
cpu0: ARM 64bit MIDR=410fd034 REVIDR=00000080
cpu0: Amlogic S905
cpu1: ARM 64bit MIDR=410fd034 REVIDR=00000080
cpu1: Amlogic S905
cpu1 initialization complete - online
cpu2: ARM 64bit MIDR=410fd034 REVIDR=00000080
cpu2: Amlogic S905
cpu2 initialization complete - online
cpu3: ARM 64bit MIDR=410fd034 REVIDR=00000080
cpu3: Amlogic S905
cpu3 initialization complete - online
ERROR: svc:/system/filesystem/usr:default failed to mount remount (see 'svcs -x' for details)
Oct 25 07:18:20 svc.startd[100003]: svc:/system/filesystem/usr:default: Method "/lib/svc/method/fs-usr" failed with exit status 95.
Oct 25 07:18:20 svc.startd[100003]: system/filesystem/usr:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
Hostname: meson
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run

Enter user name for system maintenance (control-d to bypass): root
Enter root password (control-d to bypass):
single-user privilege assigned to root on /dev/console.
Entering System Maintenance Mode

Oct 25 07:18:54 su: 'su root' succeeded for root on /dev/console
The Illumos Project SunOS 5.11 SunOS Development Feb. 05, 2020
SunOS Internal Development: non-nightly build
root@meson:~#
```

-----

### Booting from uSD
Copy inetboot and meson-gxbb-odroidc2.dtb to FAT Partition in uSD.
After building OpenSolaris, these files are installed to the following.
```
/data/proto/root_aarch64/platform/SUNW,meson/inetboot
/data/proto/root_aarch64/platform/SUNW,meson/meson-gxbb-odroidc2.dtb
```

In U-Boot, run `run mmc_boot` command.

```
GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;READ:0;CHK:0;
TE: 279009
no sdio debug board detected

BL2 Built : 11:44:26, Nov 25 2015.
gxb gfb13a3b-c2 - jcao@wonton

Board ID = 8
set vcck to 1100 mv
set vddee to 1050 mv
CPU clk: 1536MHz
DDR channel setting: DDR0 Rank0+1 same
DDR0: 2048MB(auto) @ 912MHz(2T)-13
DataBus test pass!
AddrBus test pass!
Load fip header from SD, src: 0x0000c200, des: 0x01400000, size: 0x000000b0
Load bl30 from SD, src: 0x00010200, des: 0x01000000, size: 0x00009ef0
Sending bl30........................................OK.
Run bl30...
Load bl301 from SD, src: 0x0001c200, des: 0x01000000, size: 0x000018c0
Wait bl30...Done
Sending bl301.......OK.
Run bl301...
l31 from SD, src: 0x00020200, des: 0x10100000, size: 0x00009220


--- UART initialized after reboot ---
[Reset cause: unknown]
[Image: unknown, amlogic_Load bl33 from SD, src: 0x0002c200, des: 0x01000000, size: 0x0007cae0
v1.1.3046-00db630-dirty 2016-08-31 09:24:14 tao.zeng@droid04]
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: ef be ad de d f0 ad ba ef be ad de not ES chip
[0.393815 Inits done]
secure task start!
high task start!
low task start!
NOTICE: BL31: v2.2(debug):v2.2-593-gf11098fc7-dirty
NOTICE: BL31: Built : 09:33:52, Feb 6 2020
INFO: ARM GICv2 driver initialized
INFO: BL31: Initializing runtime services
INFO: BL31: cortex_a53: CPU workaround for 843419 was applied
INFO: BL31: cortex_a53: CPU workaround for 855873 was applied
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x1000000
INFO: SPSR = 0x3c9


U-Boot 2019.10-g5ed04291cb (Feb 06 2020 - 16:03:57 +0900) odroid-c2

Model: Hardkernel ODROID-C2
Soc: Amlogic Meson GXBB (S905) Revision 1f:b (0:1)
DRAM: 2 GiB
MMC: mmc@72000: 0, mmc@74000: 1
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@c9410000
Hit any key to stop autoboot: 0
=> run mmc_boot
624984 bytes read in 29 ms (20.6 MiB/s)
10946 bytes read in 3 ms (3.5 MiB/s)
## Booting kernel from Legacy Image at 11000000 ...
Image Name: OpenSolaris
Image Type: AArch64 Linux Kernel Image (uncompressed)
Data Size: 624920 Bytes = 610.3 KiB
Load Address: 7c080000
Entry Point: 7c080000
Verifying Checksum ... OK
## Flattened Device Tree blob at 11100000
Booting using the fdt blob at 0x11100000
Loading Kernel Image
Loading Device Tree to 000000007df5e000, end 000000007df63ac1 ... OK

Starting kernel ...

phys memory add 0000000000000000 - 000000007fffffff
memory resv 0000000000000000 - 0000000000ffffff
memory resv 0000000010000000 - 00000000101fffff
bootargs=-D /soc/sd@d0072000/blkdev@0
bootpath=/soc/sd@d0072000/blkdev@0
High Speed supported
4bit width
zfs_lookup error /platform//boot_archive
zfs_lookup error /platform/SUNW,meson/boot_archive
zfs_lookup error /platform/hardkernel,odroid-c2/boot_archive
zfs_lookup error /platform/amlogic,meson-gxbb/boot_archive
vdev_probe error
rootnex_map_regspec: d0072000 -> ffff0000d0072000
WARNING: Cannot mount /system/boot
rootnex_map_regspec: c81004c0 -> ffff0000c81004c0
cpu0: ARM 64bit MIDR=410fd034 REVIDR=00000080
cpu0: Amlogic S905
cpu1: ARM 64bit MIDR=410fd034 REVIDR=00000080
cpu1: Amlogic S905
cpu1 initialization complete - online
cpu2: ARM 64bit MIDR=410fd034 REVIDR=00000080
cpu2: Amlogic S905
cpu2 initialization complete - online
cpu3: ARM 64bit MIDR=410fd034 REVIDR=00000080
cpu3: Amlogic S905
cpu3 initialization complete - online
Hostname: unknown

unknown console login: Oct 25 07:20:28 unknown rootnex: rootnex_map_regspec: c9410000 -> ffff0000c9410000
Oct 25 07:20:28 unknown rootnex: rootnex_map_regspec: c8834540 -> ffff0000c8834540

unknown console login: root
Oct 25 07:20:38 unknown login: Solaris_audit getaddrinfo(unknown) failed[node name or service name not known]: Error 0
Oct 25 07:20:38 unknown login: Solaris_audit adt_get_local_address failed, no Audit IP address available, faking loopback and error: Network is down
Oct 25 07:20:38 unknown login: pam_unix_cred: cannot load ttyname: Network is down, continuing.
Oct 25 07:20:38 unknown login: ROOT LOGIN /dev/console
Last login: Tue Oct 25 07:16:58 on console

The Illumos Project SunOS 5.11 SunOS Development Feb. 05, 2020
SunOS Internal Development: non-nightly build
root@unknown:~#
```


+ 297
- 0
QEMU RV64.md View File

@@ -0,0 +1,297 @@
# QEMU RV64

QEMU is a open source machine emulator.

-------

## Building QEMU
### Getting the source
```
git clone https://bitbucket.org/hayashin/qemu.git
```

### Building and Installing
```
cd qemu
./configure --target-list=riscv64-softmmu
make
sudo make install
```

-------

## How to boot

### Creating a bootable image

You should build OpenSolaris in advance.
Get the source code of OpenSBI.
```
git clone https://bitbucket.org/hayashin/opensbi.git
```

Refer to the following for building firmware.

```
CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/riscv64-solaris2.11- \
PLATFORM_RISCV_XLEN=64 \
make -C ${opensbi_dir} \
PLATFORM=qemu/virt \
FW_PAYLOAD_PATH=${illumos_dir}/usr/src/psm/stand/boot/riscv64/virt/inetboot.bin
```

### Creating a disk image

```
qemu-img create -f raw disk.img 16G
```

### Creating a bridge interface

Create a bridge interface for using network from the QEMU virtual machine.

### Network Boot

```
sudo /usr/local/bin/qemu-system-riscv64 -nographic -machine virt -m 1G -smp 4 \
-kernel ${opensbi_dir}/build/platform/qemu/virt/firmware/fw_payload.elf \
-append "-D /virtio_mmio@10008000" \
-netdev bridge,id=net0,br=br1 \
-device virtio-net-device,netdev=net0,mac=52:54:00:70:0a:e3 \
-drive file=disk.img,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-gdb tcp::1234
```

When booting from network, some errors occurr but you can ignore errors.
You can login as root without using password.

```
qemu-system-riscv64: warning: No -bios option specified. Not loading a firmware.
qemu-system-riscv64: warning: This default will change in a future QEMU release. Please use the -bios option to avoid breakages when this happens.
qemu-system-riscv64: warning: See QEMU's deprecation documentation for details.

OpenSBI v0.5-74-gd6fa7f9
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|

Platform Name : QEMU Virt Machine
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs : 8
Current Hart : 3
Firmware Base : 0x80000000
Firmware Size : 120 KB
Runtime SBI Version : 0.2

PMP0: 0x0000000080000000-0x000000008001ffff (A)
PMP1: 0x0000000000000000-0xffffffffffffffff (A,R,W,X)
phys memory add 0000000080000000 - 00000000bfffffff
memory resv 0000000080000000 - 00000000801fffff
add io 10000000 1000 for ns16550a
add io 10008000 1000 for virtio,mmio
add io 10007000 1000 for virtio,mmio
add io 10006000 1000 for virtio,mmio
add io 10005000 1000 for virtio,mmio
add io 10004000 1000 for virtio,mmio
add io 10003000 1000 for virtio,mmio
add io 10002000 1000 for virtio,mmio
add io 10001000 1000 for virtio,mmio
add io c000000 4000000 for riscv,plic0
add io 2000000 10000 for riscv,clint0
bootargs=-D /virtio_mmio@10008000
bootpath=/virtio_mmio@10008000
mfg_name=SUNW,virt
bpath=/virtio_mmio@10008000
vdev_probe error
mfg_name=SUNW,virt

bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
intr_init:1202 riscv,max-priority=1
intr_init:1203 riscv,ndev=53
plic_map: index 0 is not used. hart0
plic_map: plic index 1 for hart0
plic_map: index 2 is not used. hart1
plic_map: plic index 3 for hart1
plic_map: index 4 is not used. hart2
plic_map: plic index 5 for hart2
plic_map: index 6 is not used. hart3
plic_map: plic index 7 for hart3
SunOS Release 5.11 Version SunOS_Development 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
DEBUG enabled
rootnex_map_regspec: 10008000 -> ffffffc010008000
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 10000000 -> ffffffc010000000
cpu0: RISC-V 64bit hart=0
plic_map: index 0 is not used. hart0
plic_map: plic index 1 for hart0
plic_map: index 2 is not used. hart1
plic_map: plic index 3 for hart1
plic_map: index 4 is not used. hart2
plic_map: plic index 5 for hart2
plic_map: index 6 is not used. hart3
plic_map: plic index 7 for hart3
cpu1: RISC-V 64bit hart=1
cpu1: QEMU VIRT CPU
cpu1 initialization complete - online
plic_map: index 0 is not used. hart0
plic_map: plic index 1 for hart0
plic_map: index 2 is not used. hart1
plic_map: plic index 3 for hart1
plic_map: index 4 is not used. hart2
plic_map: plic index 5 for hart2
plic_map: index 6 is not used. hart3
plic_map: plic index 7 for hart3
cpu2: RISC-V 64bit hart=2
cpu2: QEMU VIRT CPU
cpu2 initialization complete - online
plic_map: index 0 is not used. hart0
plic_map: plic index 1 for hart0
plic_map: index 2 is not used. hart1
plic_map: plic index 3 for hart1
plic_map: index 4 is not used. hart2
plic_map: plic index 5 for hart2
plic_map: index 6 is not used. hart3
plic_map: plic index 7 for hart3
cpu3: RISC-V 64bit hart=3
cpu3: QEMU VIRT CPU
cpu3 initialization complete - online
ERROR: svc:/system/filesystem/usr:default failed to mount remount (see 'svcs -x' for details)
Nov 10 07:03:02 svc.startd[100003]: svc:/system/filesystem/usr:default: Method "/lib/svc/method/fs-usr" failed with exit status 95.
Nov 10 07:03:02 svc.startd[100003]: system/filesystem/usr:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
Hostname: virt
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run

Enter user name for system maintenance (control-d to bypass):
```

### Booting from disk image

The difference with the network boot is `-append "-D /virtio_mmio@10007000"`.
```
sudo /usr/local/bin/qemu-system-riscv64 -nographic -machine virt -m 1G -smp 4 \
-kernel ${opensbi_dir}/build/platform/qemu/virt/firmware/fw_payload.elf \
-append "-D /virtio_mmio@10007000" \
-netdev bridge,id=net0,br=br1 \
-device virtio-net-device,netdev=net0,mac=52:54:00:70:0a:e3 \
-drive file=disk.img,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-gdb tcp::1234
```

```
qemu-system-riscv64: warning: No -bios option specified. Not loading a firmware.
qemu-system-riscv64: warning: This default will change in a future QEMU release. Please use the -bios option to avoid breakages when this happens.
qemu-system-riscv64: warning: See QEMU's deprecation documentation for details.

OpenSBI v0.5-74-gd6fa7f9
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|

Platform Name : QEMU Virt Machine
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs : 8
Current Hart : 0
Firmware Base : 0x80000000
Firmware Size : 120 KB
Runtime SBI Version : 0.2

PMP0: 0x0000000080000000-0x000000008001ffff (A)
PMP1: 0x0000000000000000-0xffffffffffffffff (A,R,W,X)
phys memory add 0000000080000000 - 00000000bfffffff
memory resv 0000000080000000 - 00000000801fffff
add io 10000000 1000 for ns16550a
add io 10008000 1000 for virtio,mmio
add io 10007000 1000 for virtio,mmio
add io 10006000 1000 for virtio,mmio
add io 10005000 1000 for virtio,mmio
add io 10004000 1000 for virtio,mmio
add io 10003000 1000 for virtio,mmio
add io 10002000 1000 for virtio,mmio
add io 10001000 1000 for virtio,mmio
add io c000000 4000000 for riscv,plic0
add io 2000000 10000 for riscv,clint0
bootargs=-D /virtio_mmio@10007000
bootpath=/virtio_mmio@10007000
bpath=/virtio_mmio@10007000
zfs_lookup error /platform//boot_archive
zfs_lookup error /platform/SUNW,virt/boot_archive
zfs_lookup error /platform/riscv-virtio/boot_archive
vdev_probe error
mfg_name=SUNW,virt

bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
intr_init:1202 riscv,max-priority=1
intr_init:1203 riscv,ndev=53
plic_map: index 0 is not used. hart0
plic_map: plic index 1 for hart0
plic_map: index 2 is not used. hart1
plic_map: plic index 3 for hart1
plic_map: index 4 is not used. hart2
plic_map: plic index 5 for hart2
plic_map: index 6 is not used. hart3
plic_map: plic index 7 for hart3
SunOS Release 5.11 Version SunOS_Development 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
DEBUG enabled
rootnex_map_regspec: 10007000 -> ffffffc010007000
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 10000000 -> ffffffc010000000
cpu0: RISC-V 64bit hart=0
plic_map: index 0 is not used. hart0
plic_map: plic index 1 for hart0
plic_map: index 2 is not used. hart1
plic_map: plic index 3 for hart1
plic_map: index 4 is not used. hart2
plic_map: plic index 5 for hart2
plic_map: index 6 is not used. hart3
plic_map: plic index 7 for hart3
cpu1: RISC-V 64bit hart=1
cpu1: QEMU VIRT CPU
cpu1 initialization complete - online
plic_map: index 0 is not used. hart0
plic_map: plic index 1 for hart0
plic_map: index 2 is not used. hart1
plic_map: plic index 3 for hart1
plic_map: index 4 is not used. hart2
plic_map: plic index 5 for hart2
plic_map: index 6 is not used. hart3
plic_map: plic index 7 for hart3
cpu2: RISC-V 64bit hart=2
cpu2: QEMU VIRT CPU
cpu2 initialization complete - online
plic_map: index 0 is not used. hart0
plic_map: plic index 1 for hart0
plic_map: index 2 is not used. hart1
plic_map: plic index 3 for hart1
plic_map: index 4 is not used. hart2
plic_map: plic index 5 for hart2
plic_map: index 6 is not used. hart3
plic_map: plic index 7 for hart3
cpu3: RISC-V 64bit hart=3
cpu3: QEMU VIRT CPU
cpu3 initialization complete - online
Hostname: unknown

unknown console login:
```

Loading…
Cancel
Save