Giter Club home page Giter Club logo

busybear-linux's Introduction

projects

this is where we publish the source code.

busybear-linux's People

Contributors

michaeljclark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

busybear-linux's Issues

stubs-lp64.h

Hello everyone. I have a problem building busybear, because during my make order there is a fatal error as stubs-lp64.h is missing. Can anyone help me fix this problem? I found a relative post but the answers couldn' t help me fix it. Please make simple answers. Still an amateur.

A problem in scripts/build.sh

In https://github.com/michaeljclark/busybear-linux/blob/master/scripts/build.sh#L80-L87:

test -d build/riscv-pk || mkdir build/riscv-pk
test -x build/riscv-pk/bbl || (
    cd build/riscv-pk
    ../../src/riscv-pk/configure \
        --host=${CROSS_COMPILE%-} \
        --with-payload=../linux-${LINUX_KERNEL_VERSION}/vmlinux
    make -j$(nproc)
)

In conf/busybear.config, CROSS_COMPILE is set to riscv64-unknown-linux-gnu-, while in https://github.com/riscv/riscv-pk, it's said we should use the newlib compiler to compile riscv-pk, will the current *.sh file lead to any errors?
image

network doesn't works well

Question 1: (Maybe a bug)
My /etc/network/interfaces is

auto br0
iface br0 inet static
bridge_ports ens33
address 192.168.80.73
netmask 255.255.255.0
network 192.168.80.254
broadcast 192.168.80.255

My ifup script is

#!/bin/sh
brctl addif br0 $1
ifconfig $1 up

My ifdown script is

#!/bin/sh
ifconfig $1 down
brctl delif br0 $1

My ifconfig is

wangya@ubuntu:~/sdb/codes/riscv$ ifconfig
br0 Link encap:Ethernet HWaddr 00:0c:29:e2:9f:e4
inet addr:192.168.80.73 Bcast:192.168.80.255 Mask:255.255.255.0
inet6 addr: fec0::b:40f5:157d:ecf8:1e15/64 Scope:Site
inet6 addr: fec0::b:20c:29ff:fee2:9fe4/64 Scope:Site
inet6 addr: 2002:bfc0:31a:b:20c:29ff:fee2:9fe4/64 Scope:Global
inet6 addr: 2002:bfc0:31a:b:40f5:157d:ecf8:1e15/64 Scope:Global
inet6 addr: fe80::20c:29ff:fee2:9fe4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:61021 errors:0 dropped:316 overruns:0 frame:0
TX packets:177 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9643726 (9.6 MB) TX bytes:28807 (28.8 KB)

docker0 Link encap:Ethernet HWaddr 02:42:ba:20:c3:7d
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

ens33 Link encap:Ethernet HWaddr 00:0c:29:e2:9f:e4
inet addr:192.168.80.72 Bcast:192.168.80.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24480763 errors:0 dropped:5631 overruns:0 frame:0
TX packets:37782 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7189054100 (7.1 GB) TX bytes:2874215 (2.8 MB)

ens38 Link encap:Ethernet HWaddr 00:0c:29:e2:9f:ee
inet addr:192.168.43.129 Bcast:192.168.43.255 Mask:255.255.255.0
inet6 addr: fe80::91de:1f1:2639:94f4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:366356 errors:0 dropped:0 overruns:0 frame:0
TX packets:706088 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:22769377 (22.7 MB) TX bytes:67509900 (67.5 MB)

Then I start qemu like this:
sudo qemu-system-riscv64 -nographic -machine virt -kernel ./riscv-pk/build/bbl -append "root=/dev/vda ro console=ttyS0" -drive file=./busybear-linux/busybear.bin,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,script=./ifup,downscript=./ifdown,id=net0 -device virtio-net-device,netdev=net0

busybear-linux start correctly but comes out : ntpd: bad address '1.pool.ntp.org'
so I type in : ifconfig . It works like below:

root@ucbvax:~# ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56
inet addr:192.168.100.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: 2002:bfc0:31a:b:5054:ff:fe12:3456/64 Scope:Global
inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
inet6 addr: fec0::b:5054:ff:fe12:3456/64 Scope:Site
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1129 errors:0 dropped:12 overruns:0 frame:0
TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:82369 (80.4 KiB) TX bytes:1780 (1.7 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1582 (1.5 KiB) TX bytes:1582 (1.5 KiB)
you can see eth0 is 192.168.100.2 , but my br0 is 192.168.80.73 , Does busybear-linux can't use my setting of network ?

Question2:
Because of the problem above , I want to reboot and excute qemu another time . And I don't know how to exit busybear to my origin shell so I use another terminal and use sudo kill -9 to kill qemu. After this,I use
sudo qemu-system-riscv64 -nographic -machine virt -kernel ./riscv-pk/build/bbl -append "root=/dev/vda ro console=ttyS0" -drive file=./busybear-linux/busybear.bin,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,script=./ifup,downscript=./ifdown,id=net0 -device virtio-net-device,netdev=net0
to excute qemu twice and this time I just see :

ifup: interface lo already configured
ifup: interface eth0 already configured
Initializing mdev...

and I can see nothing when I type in : ifconfig . What should I do?

Thx

/sbin/init: error while loading shared libraries: libm.so.6:

hi,
when i try to run start-qemu.sh , i encounter an issues:
/sbin/init: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory

the following is whole record:

lu@lu-thinkpad:~/Work/RISCV/riscv-linux/busybear-linux$ ./scripts/start-qemu.sh
bbl loader
[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[ 0.000000] No DTB passed to the kernel
[ 0.000000] Linux version 5.0.0 (lu@lu-thinkpad) (gcc version 8.3.0 (GCC)) #1 SMP Tue Jun 18 22:52:44 PDT 2019
[ 0.000000] initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] software IO TLB: mapped [mem 0x83e3c000-0x87e3c000] (64MB)
[ 0.000000] elf_hwcap is 0x112d
[ 0.000000] percpu: Embedded 16 pages/cpu @(ptrval) s25112 r8192 d32232 u65536
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 31815
[ 0.000000] Kernel command line: root=/dev/vda ro console=ttyS0
[ 0.000000] Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.000000] Sorting __ex_table...
[ 0.000000] Memory: 55652K/129024K available (3287K kernel code, 231K rwdata, 933K rodata, 148K init, 764K bss, 73372K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[ 0.000000] plic: mapped 53 interrupts to 1 (out of 2) handlers.
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[ 0.000198] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[ 0.004867] Console: colour dummy device 80x25
[ 0.010140] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=40000)
[ 0.010421] pid_max: default: 32768 minimum: 301
[ 0.012627] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[ 0.012725] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes)
[ 0.054553] rcu: Hierarchical SRCU implementation.
[ 0.065262] smp: Bringing up secondary CPUs ...
[ 0.065435] smp: Brought up 1 node, 1 CPU
[ 0.147954] devtmpfs: initialized
[ 0.158107] random: get_random_u32 called from bucket_table_alloc+0x76/0x17a with crng_init=0
[ 0.161724] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.162171] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.166522] NET: Registered protocol family 16
[ 0.207677] vgaarb: loaded
[ 0.220005] clocksource: Switched to clocksource riscv_clocksource
[ 0.260763] NET: Registered protocol family 2
[ 0.268181] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes)
[ 0.268391] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.268717] TCP bind hash table entries: 1024 (order: 2, 16384 bytes)
[ 0.268938] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.272014] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.272399] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.274479] NET: Registered protocol family 1
[ 0.291991] workingset: timestamp_bits=62 max_order=14 bucket_order=0
[ 0.337034] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[ 0.337236] io scheduler mq-deadline registered
[ 0.337419] io scheduler kyber registered
[ 0.572235] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 0.583886] printk: console [ttyS0] disabled
[ 0.585262] 10000000.uart: ttyS0 at MMIO 0x10000000 (irq = 10, base_baud = 230400) is a 16550A
[ 0.634690] printk: console [ttyS0] enabled
[ 0.660623] loop: module loaded
[ 0.679271] virtio_blk virtio0: [vda] 204800 512-byte logical blocks (105 MB/100 MiB)
[ 0.722422] NET: Registered protocol family 10
[ 0.734534] Segment Routing with IPv6
[ 0.736066] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 0.748445] NET: Registered protocol family 17
[ 0.798589] EXT4-fs (vda): mounted filesystem with ordered data mode. Opts: (null)
[ 0.800248] VFS: Mounted root (ext4 filesystem) readonly on device 254:0.
[ 0.826581] Freeing unused kernel memory: 148K
[ 0.827237] This architecture does not have kernel memory protection.
[ 0.828469] Run /sbin/init as init process
/sbin/init: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory
[ 0.909525] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 0.910776] CPU: 0 PID: 1 Comm: init Not tainted 5.0.0 #1
[ 0.911595] Call Trace:
[ 0.912259] [] walk_stackframe+0x0/0xa0
[ 0.913066] [] show_stack+0x2a/0x34
[ 0.913760] [] dump_stack+0x62/0x7c
[ 0.914497] [] panic+0xe8/0x22e
[ 0.915149] [] do_exit+0x746/0x764
[ 0.915823] [] do_group_exit+0x2a/0x82
[ 0.916541] [] __wake_up_parent+0x0/0x22
[ 0.917278] [] ret_from_syscall+0x0/0xe
[ 0.918776] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00 ]---

qemu riscv installation issue related to busybear

hi, I tried to install qemu riscv using the following link -
https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html
But at the last step when I ran the command - make -j $(nproc) in busybear-linux folder, the following error showed up -
make[1]: Leaving directory '/home/tashfia/riscv64-linux/busybear-linux/build/linux-5.0'
./scripts/build.sh: line 84: ../../src/riscv-pk/configure: No such file or directory
Makefile:10: recipe for target 'busybear.bin' failed
make: *** [busybear.bin] Error 127
Can you please help me out?

*** failed to create busybear.bin

I am building busybear-linux following the instructions on :
https://buildmedia.readthedocs.org/media/pdf/risc-v-getting-started-guide/latest/risc-v-getting-started-guide.pdf

from 1-5 step by step.

  1. git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
  2. git clone https://github.com/qemu/qemu
  3. git clone https://github.com/torvalds/linux
  4. git clone https://github.com/riscv/riscv-pk
  5. git clone https://github.com/michaeljclark/busybear-linux

My platform is ubuntu 19.04
I have started from installing the riscv-gnu-toolchain,

I always failed like the follows. Can anyone help? thank you.


./scripts/build.sh
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.0558494 s, 1.9 GB/s
mke2fs 1.44.6 (5-Mar-2019)
Discarding device blocks: done
Creating filesystem with 102400 1k blocks and 25688 inodes
Filesystem UUID: d9ec9fa2-b0d0-40db-a42e-b13aa7d5e13b
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

*** failed to create busybear.bin

.Trying to build busybear in Linux Mint.

Hey Guys,

I am trying to build busybear on Linux Mint and am getting the following error. For context, I am trying to cross compile Linux for RISC-V using QEMU. Attaching the last couple of lines of output below. Noob to linux toolchains and stuff so any help would be great.

Terminal Output:

CHK include/generated/compile.h
AR built-in.a
LD vmlinux.o
MODPOST vmlinux.o
KSYM .tmp_kallsyms1.o
KSYM .tmp_kallsyms2.o
LD vmlinux
SYSMAP System.map
make[1]: Leaving directory '/media/sriram/Data/RISCV/busybear-linux/build/linux-5.0-rc2'
./scripts/build.sh: line 84: ../../src/riscv-pk/configure: No such file or directory
Makefile:10: recipe for target 'busybear.bin' failed
make: *** [busybear.bin] Error 127

Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.

My comandline parameter:

sudo qemu-system-riscv64 -nographic -machine virt -kernel ./riscv-pk/build/bbl -append "root=/dev/vda ro console=ttyS0" -drive file=./busybear-linux/busybear.bin,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,script=./ifup,downscript=./ifdown,id=net0 -device virtio-net-device,netdev=net0

My console says:
bbl loader
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv
rr vvvvvvvvvvvvvvvvvvvvvv
rr vvvvvvvvvvvvvvvvvvvvvvvv rr
rrrr vvvvvvvvvvvvvvvvvvvvvvvvvv rrrr
rrrrrr vvvvvvvvvvvvvvvvvvvvvv rrrrrr
rrrrrrrr vvvvvvvvvvvvvvvvvv rrrrrrrr
rrrrrrrrrr vvvvvvvvvvvvvv rrrrrrrrrr
rrrrrrrrrrrr vvvvvvvvvv rrrrrrrrrrrr
rrrrrrrrrrrrrr vvvvvv rrrrrrrrrrrrrr
rrrrrrrrrrrrrrrr vv rrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrr

   INSTRUCTION SETS WANT TO BE FREE

[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[ 0.000000] Linux version 4.15.0 (wangya@ubuntu) (gcc version 8.2.0 (GCC)) #2 Mon Aug 20 15:30:47 CST 2018
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] Normal [mem 0x0000000088000000-0x0000087fffffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] software IO TLB [mem 0x83e3d000-0x87e3d000] (64MB) mapped at [ (ptrval)- (ptrval)]
[ 0.000000] elf_hwcap is 0x112d
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 31815
[ 0.000000] Kernel command line: root=/dev/vda ro console=ttyS0
[ 0.000000] Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.000000] Sorting __ex_table...
[ 0.000000] Memory: 56660K/129024K available (2612K kernel code, 211K rwdata, 657K rodata, 100K init, 780K bss, 72364K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[ 0.000000] riscv,cpu_intc,0: 64 local interrupts mapped
[ 0.000000] riscv,plic0,c000000: mapped 10 interrupts to 1/2 handlers
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[ 0.000269] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[ 0.006140] Console: colour dummy device 80x25
[ 0.011585] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=100000)
[ 0.018418] pid_max: default: 32768 minimum: 301
[ 0.022913] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[ 0.028504] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes)
[ 0.091983] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.099809] futex hash table entries: 256 (order: 0, 6144 bytes)
[ 0.133450] random: get_random_u32 called from bucket_table_alloc+0xac/0x1de with crng_init=0
[ 0.141286] NET: Registered protocol family 16
[ 0.173734] vgaarb: loaded
[ 0.191184] clocksource: Switched to clocksource riscv_clocksource
[ 0.216058] NET: Registered protocol family 2
[ 0.233111] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.238970] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.240636] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.247359] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.253394] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.259166] NET: Registered protocol family 1
[ 0.310106] workingset: timestamp_bits=62 max_order=14 bucket_order=0
[ 0.364292] random: fast init done
[ 0.442080] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[ 0.446808] io scheduler noop registered
[ 0.448291] io scheduler deadline registered
[ 0.450300] io scheduler cfq registered (default)
[ 0.454955] io scheduler mq-deadline registered
[ 0.457721] io scheduler kyber registered
[ 0.656392] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 0.705117] console [ttyS0] disabled
[ 0.713086] 10000000.uart: ttyS0 at MMIO 0x10000000 (irq = 1, base_baud = 230400) is a 16550A
[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[ 0.000000] Linux version 4.15.0 (wangya@ubuntu) (gcc version 8.2.0 (GCC)) #2 Mon Aug 20 15:30:47 CST 2018
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] Normal [mem 0x0000000088000000-0x0000087fffffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] software IO TLB [mem 0x83e3d000-0x87e3d000] (64MB) mapped at [ (ptrval)- (ptrval)]
[ 0.000000] elf_hwcap is 0x112d
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 31815
[ 0.000000] Kernel command line: root=/dev/vda ro console=ttyS0
[ 0.000000] Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.000000] Sorting __ex_table...
[ 0.000000] Memory: 56660K/129024K available (2612K kernel code, 211K rwdata, 657K rodata, 100K init, 780K bss, 72364K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[ 0.000000] riscv,cpu_intc,0: 64 local interrupts mapped
[ 0.000000] riscv,plic0,c000000: mapped 10 interrupts to 1/2 handlers
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[ 0.000269] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[ 0.006140] Console: colour dummy device 80x25
[ 0.011585] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=100000)
[ 0.018418] pid_max: default: 32768 minimum: 301
[ 0.022913] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[ 0.028504] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes)
[ 0.091983] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.099809] futex hash table entries: 256 (order: 0, 6144 bytes)
[ 0.133450] random: get_random_u32 called from bucket_table_alloc+0xac/0x1de with crng_init=0
[ 0.141286] NET: Registered protocol family 16
[ 0.173734] vgaarb: loaded
[ 0.191184] clocksource: Switched to clocksource riscv_clocksource
[ 0.216058] NET: Registered protocol family 2
[ 0.233111] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.238970] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.240636] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.247359] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.253394] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.259166] NET: Registered protocol family 1
[ 0.310106] workingset: timestamp_bits=62 max_order=14 bucket_order=0
[ 0.364292] random: fast init done
[ 0.442080] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[ 0.446808] io scheduler noop registered
[ 0.448291] io scheduler deadline registered
[ 0.450300] io scheduler cfq registered (default)
[ 0.454955] io scheduler mq-deadline registered
[ 0.457721] io scheduler kyber registered
[ 0.656392] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 0.705117] console [ttyS0] disabled
[ 0.713086] 10000000.uart: ttyS0 at MMIO 0x10000000 (irq = 1, base_baud = 230400) is a 16550A
[ 0.792525] console [ttyS0] enabled
[ 0.792525] console [ttyS0] enabled
[ 0.999335] NET: Registered protocol family 10
[ 0.999335] NET: Registered protocol family 10
[ 1.044316] Segment Routing with IPv6
[ 1.044316] Segment Routing with IPv6
[ 1.050285] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 1.050285] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 1.062418] bootconsole [early0] uses init memory and must be disabled even before the real one is ready
[ 1.062418] bootconsole [early0] uses init memory and must be disabled even before the real one is ready
[ 1.070272] bootconsole [early0] disabled
[ 1.070272] bootconsole [early0] disabled
[ 1.131410] EXT4-fs (vda): couldn't mount as ext3 due to feature incompatibilities
[ 1.759260] EXT4-fs (vda): mounted filesystem with ordered data mode. Opts: (null)
[ 1.796334] VFS: Mounted root (ext4 filesystem) readonly on device 254:0.
[ 1.856910] Freeing unused kernel memory: 100K
[ 1.861720] This architecture does not have kernel memory protection.
[ 2.281119] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[ 2.290953] CPU: 0 PID: 1 Comm: swapper Not tainted 4.15.0 #2
[ 2.293739] Call Trace:
[ 2.294717] [< (ptrval)>] walk_stackframe+0x0/0xa2
[ 2.298269] [< (ptrval)>] show_stack+0x26/0x34
[ 2.300199] [< (ptrval)>] dump_stack+0x20/0x2c
[ 2.301867] [< (ptrval)>] panic+0xc4/0x1d6
[ 2.303213] [< (ptrval)>] kernel_init+0xd8/0xe8
[ 2.304496] [< (ptrval)>] ret_from_syscall+0xa/0xe
[ 2.306144] ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.

My effort:
I check this codebase and haven't seen a init script ~~~ It seems a bug ~~~

trying to create busybear.bin but it is giving error

Hi,
I am trying to build Busybear Linux but I am getting following error, Please can anyone give me solution.

Error:

riscv64-unknown-linux-gnu-ranlib libmachine.a
riscv64-unknown-linux-gnu-gcc -Wl,--build-id=none -nostartfiles -nostdlib -static -march=rv64imafd -mabi=lp64 -o pk pk.o -L. -lpk -lmachine -lsoftfloat -lutil -lgcc -T ../../src/riscv-pk/pk/pk.lds
riscv64-unknown-linux-gnu-ar rcv libdummy_payload.a _dummy_payload.o dummy_entry.o
a - _dummy_payload.o
a - dummy_entry.o
riscv64-unknown-linux-gnu-ranlib libdummy_payload.a
riscv64-unknown-linux-gnu-gcc -Wl,--build-id=none -nostartfiles -nostdlib -static -march=rv64imafd -mabi=lp64 -o dummy_payload dummy_payload.o -L. -ldummy_payload -lgcc -T ../../src/riscv-pk/dummy_payload/dummy_payload.lds
riscv64-unknown-linux-gnu-ranlib libbbl.a
riscv64-unknown-linux-gnu-gcc -Wl,--build-id=none -nostartfiles -nostdlib -static -march=rv64imafd -mabi=lp64 -o bbl bbl.o -L. -lbbl -ldummy_payload -lmachine -lsoftfloat -lutil -lgcc -T ../../src/riscv-pk/bbl/bbl.lds
make[1]: Leaving directory '/home/billa/MDP/riscv_linux_on_MDP/M2/busybear-linux/build/riscv-pk'
[sudo] password for billa:
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.0506834 s, 2.1 GB/s
mke2fs 1.42.13 (17-May-2015)
Discarding device blocks: done
Creating filesystem with 102400 1k blocks and 25688 inodes
Filesystem UUID: 09eb4b10-8ab4-4fa5-b57b-a5031db7eb26
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

*** failed to create busybear.bin

Network doesn't work on Ubuntu

Follow this tutorial on Ubuntu 18.04.
https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html

It generates a busybear.bin which is bootable. Everything seems ok except the network.

In QEMU guest:
root@busybear:~# ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56
inet addr:192.168.122.2 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fec0::5054:ff:fe12:3456/64 Scope:Site
inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:243 errors:0 dropped:0 overruns:0 frame:0
TX packets:6975 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:24350 (23.7 KiB) TX bytes:293258 (286.3 KiB)

On host:
virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 00:13:3b:0f:d4:78 txqueuelen 1000 (Ethernet)
RX packets 2793 bytes 142212 (142.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 69 bytes 2898 (2.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

The network seems to be configured correctly. But guest doesn't have internet connection. Also, I Cann't ssh into the guest from my host machine.

I am using the following start command:
sudo qemu-system-riscv64
-nographic
-machine virt
-kernel riscv-pk/build/bbl
-append "root=/dev/vda ro console=ttyS0"
-drive file=busybear-linux/busybear.bin,format=raw,id=hd0
-device virtio-blk-device,drive=hd0
-device virtio-net-device,netdev=usernet
-netdev user,id=usernet,hostfwd=tcp::22222-:22

Any suggestion?

Replace bridged networking with QEMU user networking emulation

The current network setup is bridged, which is very brittle (due to differences between operating systems; for example, Ubuntu doesn't ship the bridge utilities by default), and also unnecessarily complex (besides the inherent complexity, up/down scripts are required).

Using the QEMU built-in user is trivial, and much more stable, since it doesn't require any change on the host system.

Change the etc/network/interfaces to be:

iface lo inet loopback

auto eth0
iface eth0 inet static
        address 10.0.2.15
        netmask 255.255.255.0
        broadcast 10.0.2.255
        gateway 10.0.2.2

Then, in the startup script, replace this:

  -netdev type=tap,script=scripts/ifup.sh,downscript=scripts/ifdown.sh,id=net0 \
  -device virtio-net-device,netdev=net0

with:

  -device virtio-net-device,netdev=usernet \
  -netdev user,id=usernet,hostfwd=tcp::10000-:22 \

and drop the ifup/down scripts.

And don't forget to update the README 😄.

change_dir "/opt/riscv/sysroot/lib64" failed

Before running make I need to mkdir /opt/riscv/sysroot/lib64. It looks like this could be related to 5427ac1. I am not using multilib. Seems straight forward, but let me know if you need more info.

The tail of my build output is

...
riscv64-unknown-linux-gnu-gcc  -o dropbearconvert dbutil.o buffer.o dbhelpers.o dss.o bignum.o signkey.o rsa.o dbrandom.o queue.o atomicio.o compat.o fake-rfc2553.o ltc_prng.o ecc.o ecdsa.o crypto_desc.o gensignkey.o gendss.o genrsa.o dropbearconvert.o keyimport.o libtomcrypt/libtomcrypt.a libtommath/libtommath.a
make[1]: Leaving directory '/u1/src/busybear-linux/build/dropbear-2017.75'
sudo -E sh scripts/image.sh
128+0 records in
128+0 records out
134217728 bytes (134 MB, 128 MiB) copied, 0.0546131 s, 2.5 GB/s
mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: done
Creating filesystem with 131072 1k blocks and 32768 inodes
Filesystem UUID: 14d0f4e8-3f02-45df-a0ad-9367c8902717
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

rsync: change_dir "/opt/riscv/sysroot/lib64" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]
make: *** [busybear.bin] Error 23

getting tap interface to work...

I have used your busybear to help me boot opensbi+linux payload

I have setup tap0 on my ubuntu18 (VM) and have a br0 bridge configured.

The Host interface is a Virtualbox Host-Only Interface. I just want to talk with the riscv machine from the HOST..

I am booting riscv on qemu-system-riscv64:

qemu-system-riscv64 -M virt -m 1024M -nographic
-kernel images/opensbi_linux.elf
-drive file=images/ramdisk,format=raw,id=hd0
-device virtio-blk-device,drive=hd0
-append "root=/dev/vda rw console=ttyS0"
-netdev type=tap,ifname=tap0,script=ramdisk/scripts/ifup.sh,downscript=ramdisk/scripts/ifdown.sh,id=net0
-device virtio-net-device,netdev=net0

I have configured the eth0 on the image as both static ip and dchp.

When dhcp I see the request on the Host and it gets an ipaddr during boot. But it never shows up in ifconfig. And I cannot ping the HOST.

If i configure it as static ifconfig shows the address but no route to the outside.

Both are going through the same tap0 interface above.
bridge name bridge id STP enabled interfaces
br0 8000.080027ea438c no enp0s8
tap0

I am at a loss now as the bridge seems to be working at least for dhcp....

FYI: The scripts in the cmdline above are from your repo, ifup/ifdown.
I also took your .config files for busybox and linux and resued tehm in my makery.

Link error

I realize this is quite an old repo, but thought I would post anyway ..

Whilst running make I get the following error

  LINK    busybox_unstripped
Trying libraries: crypt m resolv
Failed: -Wl,--start-group  -lcrypt -lm -lresolv  -Wl,--end-group
Output of:
riscv64-unknown-linux-gnu-gcc -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wno-format-security -Wdeclaration-after-statement -Wold-style-definition -fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -static-libgcc -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-builtin-printf -Os -o busybox_unstripped -Wl,--sort-common -Wl,--sort-section,alignment -Wl,--gc-sections -Wl,--start-group applets/built-in.o archival/lib.a archival/libarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a klibc-utils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a mailutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a util-linux/volume_id/lib.a archival/built-in.o archival/libarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o klibc-utils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o mailutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o printutils/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o util-linux/volume_id/built-in.o -Wl,--end-group -Wl,--start-group -lcrypt -lm -lresolv -Wl,--end-group
==========
/scratch/moore/RISCV/install/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/../../../../riscv64-unknown-linux-gnu/bin/ld: coreutils/lib.a(mktemp.o): in function `.L5':
mktemp.c:(.text.mktemp_main+0x88): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
/scratch/moore/RISCV/install/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/../../../../riscv64-unknown-linux-gnu/bin/ld: util-linux/lib.a(rdate.o): in function `.L6':
rdate.c:(.text.rdate_main+0xd0): undefined reference to `stime'
/scratch/moore/RISCV/install/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/../../../../riscv64-unknown-linux-gnu/bin/ld: coreutils/lib.a(date.o): in function `.L12':
date.c:(.text.date_main+0x1a0): undefined reference to `stime'
collect2: error: ld returned 1 exit status
Note: if build needs additional libraries, put them in CONFIG_EXTRA_LDLIBS.
Example: CONFIG_EXTRA_LDLIBS="pthread dl tirpc audit pam"
make[1]: *** [Makefile:718: busybox_unstripped] Error 1
make[1]: Leaving directory '/scratch/moore/demo/busybear-linux/build/busybox-1.30.1'

The compiler is built from this hash 9249802
https://github.com/riscv-collab/riscv-gnu-toolchain
./configure --enable-multilib
make -j8 linux

I am stumped

how to build on Ubuntu w/ their version of GCC for RISCV

I am trying to build busybear-linux with their supplied GCC for RISCV:
gcc-7-riscv64-linux-gnu and gcc-7-riscv64-linux-gnu-base:amd64
or gcc-8-riscv64-linux-gnu and gcc-8-riscv64-linux-gnu-base:amd64

I have multiple questions:
Should I use GCC 7 or 8?
How would I change the scripts from using a full tool install, for example into /opt/riscv?
If building GCC for RISCV should I use the multilib option:
./configure --prefix=/opt/riscv --enable-multilib
make linux

Could you update the docs to include some clarification.

Thanks for a great project. Note, I did something similar using buildroot on a 2.2 kernel
a very, very long time ago to make an image that fit on a floppy....

Failed to build Linux due to wrong toolchain

Change CONFIG_CROSS_COMPILE="riscv64-unknown-elf-" to "riscv64-unknown-linux-gnu-" in conf/linux.config will fix below issue:
riscv-collab/riscv-gnu-toolchain#335

The interest thing is that if the kernel is compiled with linux toolchain for once, this issue will not happen again, even if I clean the repo and recompile it with the elf toolchain.

BR//Xiaohai Li

dropbear does not recognize riscv architecture

I cannot get dropbear to be built because of this error:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `riscv64-linux-gnu': machine `riscv64' not recognized
configure: error: /bin/bash ./config.sub riscv64-linux-gnu failed

Looking at config.sub, the file does not contain any any entry for riscv arch. On the contrary, openssh has riscv64 machines entries in its config.sub: https://github.com/openssh/openssh-portable/blob/38e83e4f219c752ebb1560633b73f06f0392018b/config.sub#L305

Is there a patch for dropbear? How did you get it to work ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.