Re: FOSDEM 2019 - Embedded FreeBSD on a five-core RISC-V processor using LLVM

2019-02-03 Thread Dinesh Thirumurthy
The recording of Benny's talk is at
https://video.fosdem.org/2019/K.3.401/netbsd_update.mp4

Thomas's talk's recording has not been uploaded. It will show up
sometime this week at
https://video.fosdem.org/2019/K.3.401/

The BSD track that happened is at
https://fosdem.org/2019/schedule/track/bsd/

Thanks.
Regards,
Dinesh



On 2/2/19, Benny Siegert  wrote:
> Don't forget that there are two NetBSD talks this yeat at FOSDEM:
>
> https://fosdem.org/2019/schedule/event/netbsd_update/ (by me, 13:00)
>
> and
>
> https://fosdem.org/2019/schedule/event/kleak/ (Thomas Barabosch, 13:25)
>
> On Fri, Feb 1, 2019 at 11:24 PM Dinesh Thirumurthy
>  wrote:
>>
>> Hi,
>>
>> This talk
>>
>> https://fosdem.org/2019/schedule/event/testing_freebsd_risc_v5/
>>
>> is being presented at 1130 UTC Sat Feb 2nd. You can view via streaming.
>>
>> The BSD track is at https://fosdem.org/2019/schedule/track/bsd/
>>
>> The RISC-V track is at https://fosdem.org/2019/schedule/track/risc_v/
>>
>> Thanks.
>> Regards
>> Dinesh
>
>
>
> --
> Benny
>


FOSDEM 2019 - Embedded FreeBSD on a five-core RISC-V processor using LLVM

2019-02-01 Thread Dinesh Thirumurthy
Hi,

This talk

https://fosdem.org/2019/schedule/event/testing_freebsd_risc_v5/

is being presented at 1130 UTC Sat Feb 2nd. You can view via streaming.

The BSD track is at https://fosdem.org/2019/schedule/track/bsd/

The RISC-V track is at https://fosdem.org/2019/schedule/track/risc_v/

Thanks.
Regards
Dinesh


Running FreeBSD RISC-V images on spike and qemu

2019-01-22 Thread Dinesh Thirumurthy
Hi,

If you want to run FreeBSD daily RISCV images on spike/qemu on NetBSD,
you may use these notes.

https://github.com/hakrdinesh/e/blob/master/nb/RISC-V-TOOLS

Reference:
https://wiki.freebsd.org/riscv

Thanks.

Regards,
Dinesh


Re: qemu-system-riscv64 error, Could not allocate dynamic translator buffer

2019-01-22 Thread Dinesh Thirumurthy
The command works now. Thank you Andreas, Martin.

Regards,
Dinesh

# /usr/sbin/paxctl +m /usr/pkg/bin/qemu-system-riscv64
# qemu-system-riscv64 -machine spike_v1.10 -kernel bbl -nographic
bbl loader
  r
  r
r   vvr
  r
rrr
rrr
rrr
  vv  r
r   vvr
rrvv  r
rr  rrr
  vv  r
rr  vv  rrr
  vv  r
rr  vv  rrr
  vv  r
rr  vv  rrr
  vv  r
rr  rrr
  r
rr  rrr
r
   INSTRUCTION SETS WANT TO BE FREEr
---<>---
KDB: debugger backends: ddb
KDB: current backend: ddb
Found 1 CPUs in the device tree
Copyright (c) 1992-2019 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.0-CURRENT r343301 RISCVTEST riscv
gcc version 8.1.0 (FreeBSD Ports Collection for riscv64)
WARNING: WITNESS option enabled, expect reduced performance.
Preloaded elf64 kernel "kernel" at 0xffc0027774a0.
CPU(0): Unknown Implementer Unknown Processor
arc4random: no preloaded entropy cache
VIMAGE (virtualized network stack) enabled
ULE: setup cpu 0
random: entropy device external interface
nfslock: pseudo-device
openfirm: 
mem: 
null: 
crypto: 
ofwbus0: 
simplebus0:  on ofwbus0
timer0: 
Timecounter "RISC-V Timecounter" frequency 1000 Hz quality 1000
Event timer "RISC-V Eventtimer" frequency 1000 Hz quality 1000
rcons0: 
cpulist0:  on ofwbus0
cpu0:  on cpulist0
cpu0: Nominal frequency 1000Mhz
riscv64_cpu0: register <0>
ofwbus0:  compat ucb,htif0 (no driver attached)
cryptosoft0: 
crypto: assign cryptosoft0 driver id 0, flags 0x600
crypto: cryptosoft0 registers alg 1 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 2 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 3 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 4 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 5 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 16 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 6 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 7 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 32 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 18 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 19 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 20 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 8 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 15 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 9 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 10 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 13 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 14 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 34 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 35 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 36 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 37 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 11 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 22 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 23 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 25 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 24 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 26 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 27 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 28 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 21 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 17 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 29 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 30 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 31 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 38 flags 0 maxoplen 0
Device configuration finished.
procfs registered
Timecounters tick every 1.000 msec
vlan: initialized, using hash tables with chaining
md0: Embedded image 33554432 bytes at 0xffc00060c418
lo0: bpf attached
IPsec: Initialized Security Association Processing.
tcp_init: net.inet.tcp.tcbhashsize auto tuned to 1024
WARNING: WITNESS option enabled, expect reduced performance.
Trying to mount root from ufs:/dev/md0 []...
Warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin

qemu-system-riscv64 error, Could not allocate dynamic translator buffer

2019-01-22 Thread Dinesh Thirumurthy
Hi,

This qemu command runs on FreeBSD and OpenBSD.

qemu-system-riscv64 -machine spike_v1.10 -kernel bbl -nographic

On a 2GB RAM NetBSD 8.0/amd64 VM on VirtualBox 5.1.38 running on
Ubuntu 16.04.5 LTS

bash-4.4# ktruss /usr/pkg/bin/qemu-system-riscv64 -machine spike_v1.10
-kernel bbl -nographic > e
Could not allocate dynamic translator buffer
bash-4.4# ktruss /usr/pkg/bin/qemu-system-riscv64 -machine spike_v1.10
-kernel bbl -nographic > ktruss.err
Could not allocate dynamic translator buffer
bash-4.4# ktrace /usr/pkg/bin/qemu-system-riscv64 -machine spike_v1.10
-kernel bbl -nographic
Could not allocate dynamic translator buffer
bash-4.4# kdump ktrace.out > kdump.out
bash-4.4# uname -a
NetBSD localhost 8.0 NetBSD 8.0 (GENERIC) #0: Tue Jul 17 14:59:51 UTC
2018  mkre...@mkrepro.netbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
amd64
bash-4.4# vmstat
 procsmemory  page   disks   faults  cpu
 r b  avmfre  flt  re  pi   po   fr   sr w0 c0   in   sy  cs us sy id
 0 088936 1883472 208   0   0000 13  0   16  549  66  1  1 98
bash-4.4# ulimit -a
time  (-t seconds) unlimited
file  (-f blocks ) unlimited
data  (-d kbytes ) 262144
stack (-s kbytes ) 4096
coredump  (-c blocks ) unlimited
memory(-m kbytes ) 2010852
locked memory (-l kbytes ) 670284
thread(-r threads) 1024
process   (-p processes  ) 1024
nofiles   (-n descriptors) 1024
vmemory   (-v kbytes ) unlimited
sbsize(-b bytes  ) unlimited
#

The complete log of ktrace+kdump and ktruss are at

https://github.com/hakrdinesh/e/blob/master/nb/ktruss.out

and

https://github.com/hakrdinesh/e/blob/master/nb/kdump.out

ktruss reports ...

   725  1 qemu-system-risc mmap(0, 0x1000, 0x3, 0x1002,
0x, 0, 0) = 0x7421f67ea000
   725  1 qemu-system-risc access("/usr/pkg/share/qemu", 0x4) = 0
   725  1 qemu-system-risc mmap(0, 0x7000, 0x3, 0x1002,
0x, 0, 0) = 0x7421f67e3000
   725  1 qemu-system-risc mmap(0, 0x7000, 0x3, 0x1002,
0x, 0, 0) = 0x7421f67dc000
   725  1 qemu-system-risc mmap(0, 0x81000, 0x3, 0x1002,
0x, 0, 0) = 0x7421f675b000
   725  1 qemu-system-risc mmap(0, 0x200, 0x7, 0x1002,
0x, 0, 0) Err#13 EACCES
   725  1 qemu-system-risc write(0x2, 0x7421f67f3000, 0x2d) = 45
"Could not allocate dynamic translator buffer\n"

kdump reports ...

107  1 qemu-system-risc CALL  access(0x7b80e5ed6c80,4)
   107  1 qemu-system-risc NAMI  "/usr/pkg/share/qemu"
   107  1 qemu-system-risc RET   access 0
   107  1 qemu-system-risc CALL
mmap(0,0x7000,PROT_READ|PROT_WRITE,0x1002,0x,0,0)
   107  1 qemu-system-risc RET   mmap 135793543385088/0x7b80e5ea9000
   107  1 qemu-system-risc CALL
mmap(0,0x7000,PROT_READ|PROT_WRITE,0x1002,0x,0,0)
   107  1 qemu-system-risc RET   mmap 135793543356416/0x7b80e5ea2000
   107  1 qemu-system-risc CALL
mmap(0,0x81000,PROT_READ|PROT_WRITE,0x1002,0x,0,0)
   107  1 qemu-system-risc RET   mmap 135793542828032/0x7b80e5e21000
   107  1 qemu-system-risc CALL
mmap(0,0x200,PROT_READ|PROT_WRITE|PROT_EXEC,0x1002,0x,0,0)
   107  1 qemu-system-risc RET   mmap -1 errno 13 Permission denied
   107  1 qemu-system-risc CALL  write(2,0x7b80e5eb9000,0x2d)
   107  1 qemu-system-risc GIO   fd 2 wrote 45 bytes
"Could not allocate dynamic translator buffer\n"

How would I fix this?

Thank.
Regards,
Dinesh


Re: qemu-system-riscv64 error, missing libX11.so.7 on NetBSD 8.0/amd64

2019-01-22 Thread Dinesh Thirumurthy
>> qemu on NetBSD 8.0 errors out saying libX11.so.7 not found.
>> I am running NetBSD 8.0 on VirtualBox.
>
> Did you install the X sets?
>

Thanks. That fixed it. My mistake. Sorry.

Regards,
Dinesh


qemu-system-riscv64 error, missing libX11.so.7 on NetBSD 8.0/amd64

2019-01-22 Thread Dinesh Thirumurthy
Hi,

qemu on NetBSD 8.0 errors out saying libX11.so.7 not found.
I am running NetBSD 8.0 on VirtualBox.

dt@nb80:~$ qemu-system-riscv64 -machine help
Shared object "libX11.so.7" not found
dt@nb80:~$ env | grep LD
dt@nb80:~$ uname -a
NetBSD nb80 8.0 NetBSD 8.0 (GENERIC) #0: Tue Jul 17 14:59:51 UTC 2018
mkre...@mkrepro.netbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
amd64

dt@nb80:~$ ldd /usr/pkg/bin/qemu-system-riscv64 | grep found
-lX11.7 => not found
-lpixman-1.2 => not found

dt@nb80:~$ sudo find / -name "libX11.so*" -print
/usr/pkg/lib/libX11.so
/usr/pkg/lib/libX11.so.6
/usr/pkg/lib/libX11.so.6.3.0

dt@nb80:~$ ldd /usr/pkg/bin/qemu-system-riscv64
/usr/pkg/bin/qemu-system-riscv64:
-lossaudio.1 => /usr/lib/libossaudio.so.1
-lc.12 => /usr/lib/libc.so.12
-lSDL2-2.0.0 => /usr/pkg/lib/libSDL2-2.0.so.0
-lm.0 => /usr/lib/libm.so.0
-lusbhid.1 => /usr/lib/libusbhid.so.1
-lpthread.1 => /usr/lib/libpthread.so.1
-lrt.1 => /usr/lib/librt.so.1
-lX11.7 => not found
-lcurses.7 => /usr/lib/libcurses.so.7
-lterminfo.1 => /usr/lib/libterminfo.so.1
-lz.1 => /usr/lib/libz.so.1
-lcurl.4 => /usr/pkg/lib/libcurl.so.4
-lidn2.0 => /usr/pkg/lib/libidn2.so.0
-lintl.1 => /usr/lib/libintl.so.1
-lunistring.2 => /usr/pkg/lib/libunistring.so.2
-lssl.12 => /usr/lib/libssl.so.12
-lcrypto.12 => /usr/lib/libcrypto.so.12
-lcrypt.1 => /lib/libcrypt.so.1
-lgssapi.11 => /usr/lib/libgssapi.so.11
-lkrb5.27 => /usr/lib/libkrb5.so.27
-lhx509.6 => /usr/lib/libhx509.so.6
-lasn1.10 => /usr/lib/libasn1.so.10
-lcom_err.8 => /usr/lib/libcom_err.so.8
-lroken.20 => /usr/lib/libroken.so.20
-lutil.7 => /usr/lib/libutil.so.7
-lwind.1 => /usr/lib/libwind.so.1
-lheimbase.2 => /usr/lib/libheimbase.so.2
-lsqlite3.1 => /usr/lib/libsqlite3.so.1
-lheimntlm.5 => /usr/lib/libheimntlm.so.5
-lbz2.1 => /usr/lib/libbz2.so.1
-lpixman-1.2 => not found
-lpng16.16 => /usr/pkg/lib/libpng16.so.16
-ljpeg.9 => /usr/pkg/lib/libjpeg.so.9
-lgcrypt.20 => /usr/pkg/lib/libgcrypt.so.20
-lgpg-error.0 => /usr/pkg/lib/libgpg-error.so.0
-llzo2.2 => /usr/pkg/lib/liblzo2.so.2
-lsnappy.1 => /usr/pkg/lib/libsnappy.so.1
-lstdc++.8 => /usr/lib/libstdc++.so.8
-lgcc_s.1 => /usr/lib/libgcc_s.so.1
-ljemalloc.2 => /usr/pkg/lib/libjemalloc.so.2
-lgthread-2.0.0 => /usr/pkg/lib/libgthread-2.0.so.0
-lglib-2.0.0 => /usr/pkg/lib/libglib-2.0.so.0
-lpcre.1 => /usr/pkg/lib/libpcre.so.1

How do I resolve this?

Thanks.

Regards,
Dinesh


Re: RISC-V port?

2019-01-19 Thread Dinesh Thirumurthy
This too

https://fosdem.org/2019/schedule/event/testing_freebsd_risc_v5/



On Sat, Jan 19, 2019, 03:31 Richard Ibbotson 
> On 18/01/2019 20:38, Chris Hanson wrote:
> > On Jan 17, 2019, at 10:11 AM, Zachary McGrew  wrote:
> >
> >> The RISC-V port is not complete yet. I have the kernel booting to the
> >> point that it wants to mount a root file system, but I am unable to
> >> currently build userland and populate a root filesystem. There is
> >> ongoing work to import a newer GCC that supports RISC-V code generation,
> >> which would allow for this but it's not complete.
> >
> > What about using clang for RISC-V?
>
>
> Hmmm  https://www.youtube.com/watch?v=190qlSnCPak
>
> https://fosdem.org/2019/schedule/event/riscvllvmclang/
>
> https://fosdem.org/2019/schedule/track/risc_v/
>
> --
> Richard
>


Re: RISC-V port?

2019-01-17 Thread Dinesh Thirumurthy
Hi Zach,

Thanks. I will work on it.

Can we get a ports-riscv list going?

I hang out with Shakti RISC-V project guys when possible.

I want FreeBSD, NetBSD, OpenBSD running on their boards.

I have Sifive Linux and lowRISC linux running on FPGAs. As according to
their docs.

FreeBSD runs on qemu.

We can consider sifive_u machine on qemu as common platform to get all BSDs
up.

qemu -machine virt first.

Thanks

Regards
Dinesh
On Thu, Jan 17, 2019, 23:42 Zachary McGrew  Hi Dinesh,
>
> The RISC-V port is not complete yet. I have the kernel booting to the
> point that it wants to mount a root file system, but I am unable to
> currently build userland and populate a root filesystem. There is
> ongoing work to import a newer GCC that supports RISC-V code generation,
> which would allow for this but it's not complete.
>
> The current source is here: https://github.com/zmcgrew/src/
>
> It hasn't landed in cvs yet, I got busy finishing up my master's
> degree. I will try and work on it again as I get some more free time,
> but that is in limited supply lately.
>
> -Zach
>
> Dinesh Thirumurthy  writes:
>
> > Hi Matt, Reinoud, NetBSD Users,
> >
> > Wishing you all a great 2019.
> >
> > I am looking for NetBSD support on RISC-V.
> > According to RISC-V Foundation's website,
> >
> > https://riscv.org/software-status/
> >
> > The information for NetBSD is:
> >
> >  NetBSD
> >
> > Maintainer(s): Matt Thomas (NetBSD), Reinoud Zandijk (NetBSD)
> > Version:
> > Status:
> > Upstreaming status:
> > Future work:
> > Upstream repository:
> > http://cvsweb.netbsd.org/bsdweb.cgi/src/?only_with_tag=MAIN
> > https://github.com/jsonn/src (Git Mirror)
> > Privileged Spec: 1.9
> > User Spec: 2.0
> > ABI:
> >
> > --
> > Apart from Zachary's work at
> https://github.com/zmcgrew/riscv-tools-netbsd
> >
> > Is there a port being worked on? What is the appropriate mailing list
> > to post this?
> >
> > Thanks very much.
> >
> > Regards,
> > Dinesh
>
> --
> Zach McGrew _
> - KG7EYB ASCII ribbon campaign ( )
>   against HTML e-mail   X
>/ \
>

On Jan 17, 2019 23:42, "Zachary McGrew"  wrote:

Hi Dinesh,

The RISC-V port is not complete yet. I have the kernel booting to the
point that it wants to mount a root file system, but I am unable to
currently build userland and populate a root filesystem. There is
ongoing work to import a newer GCC that supports RISC-V code generation,
which would allow for this but it's not complete.

The current source is here: https://github.com/zmcgrew/src/

It hasn't landed in cvs yet, I got busy finishing up my master's
degree. I will try and work on it again as I get some more free time,
but that is in limited supply lately.

-Zach

Dinesh Thirumurthy  writes:

> Hi Matt, Reinoud, NetBSD Users,
>
> Wishing you all a great 2019.
>
> I am looking for NetBSD support on RISC-V.
> According to RISC-V Foundation's website,
>
> https://riscv.org/software-status/
>
> The information for NetBSD is:
>
>  NetBSD
>
> Maintainer(s): Matt Thomas (NetBSD), Reinoud Zandijk (NetBSD)
> Version:
> Status:
> Upstreaming status:
> Future work:
> Upstream repository:
> http://cvsweb.netbsd.org/bsdweb.cgi/src/?only_with_tag=MAIN
> https://github.com/jsonn/src (Git Mirror)
> Privileged Spec: 1.9
> User Spec: 2.0
> ABI:

>
> --
> Apart from Zachary's work at https://github.com/zmcgrew/riscv-tools-netbsd
>
> Is there a port being worked on? What is the appropriate mailing list
> to post this?
>
> Thanks very much.
>
> Regards,
> Dinesh

-- 
Zach McGrew _
- KG7EYB ASCII ribbon campaign ( )
  against HTML e-mail   X
   / \


RISC-V port?

2019-01-10 Thread Dinesh Thirumurthy
Hi Matt, Reinoud, NetBSD Users,

Wishing you all a great 2019.

I am looking for NetBSD support on RISC-V.
According to RISC-V Foundation's website,

https://riscv.org/software-status/

The information for NetBSD is:

 NetBSD

Maintainer(s): Matt Thomas (NetBSD), Reinoud Zandijk (NetBSD)
Version:
Status:
Upstreaming status:
Future work:
Upstream repository:
http://cvsweb.netbsd.org/bsdweb.cgi/src/?only_with_tag=MAIN
https://github.com/jsonn/src (Git Mirror)
Privileged Spec: 1.9
User Spec: 2.0
ABI:

--
Apart from Zachary's work at https://github.com/zmcgrew/riscv-tools-netbsd

Is there a port being worked on? What is the appropriate mailing list
to post this?

Thanks very much.

Regards,
Dinesh