Go to file
Rodrigo Arias Mallo f63408f361 Disable nsncd daemon for now as it fails to load
It is currently causing a trap, but the reason is not clear:

nsncd[1179]: unhandled signal 7 code 0x1 at 0x00ffffff8184e920 in libc.so.6[ffffff81824000+1aa000]
CPU: 3 PID: 1179 Comm: nsncd Not tainted 6.1.72 #1-NixOS
Hardware name: riscv-virtio,qemu (DT)
epc : 00ffffff8184e920 ra : 00ffffff8184e868 sp : 00ffffffef6ab610
 gp : 00aaaaaac0f07db8 tp : 00ffffff81822780 t0 : 00ffffffef6ab1f0
 t1 : 00aaaaaac0e5283c t2 : 0000000000000b56 s0 : 00ffffffef6ab668
 s1 : 0000000000000001 a0 : 0000000000000001 a1 : 00ffffffef6ab668
 a2 : 00ffffffef6ab678 a3 : 00aaaaaac0f06e40 a4 : 0000000100000000
 a5 : 00aaaaaac0eac296 a6 : 00ffffff819d3048 a7 : 00ffffffef6ab8c0
 s2 : 0000000000000000 s3 : 00aaaaaac0efac40 s4 : 00aaaaaac0e6755a
 s5 : 00ffffffef6ab678 s6 : 00aaaaaac0efac48 s7 : 00ffffff81a2fd58
 s8 : 00ffffff81a30030 s9 : 00ffffffd7386ef0 s10: 0000000000000000
 s11: 0000000000000000 t3 : 00ffffff8184e818 t4 : 0000000000000028
 t5 : 00ffffff81a24380 t6 : 00ffffff81a074c8
status: 0000000200004020 badaddr: 00aaaaaac0eac296 cause: 0000000000000000
2024-01-22 13:37:26 +01:00
examples Booting 2023-11-29 10:48:59 +01:00
visionfive2 visionfive2: Explain kernel situation 2023-02-16 13:30:40 +01:00
.gitignore init 2022-07-09 04:35:35 +01:00
base.nix Booting 2023-11-29 10:48:59 +01:00
boot.sh Increase SMP CPUs to 32 2024-01-19 13:43:14 +01:00
configuration.nix Add default user and serial boot parameters 2024-01-19 13:43:32 +01:00
flake.lock Boot opensbi without compressed 2024-01-17 18:22:30 +01:00
flake.nix Booting Linux and userspace OK 2024-01-19 12:35:05 +01:00
kernel.nix Disable kernel oprtions 2024-01-17 15:00:51 +01:00
old-flake.lock Boot opensbi without compressed 2024-01-17 18:22:30 +01:00
old-flake.nix Boot opensbi without compressed 2024-01-17 18:22:30 +01:00
overlay.nix Disable EFI in the kernel and use normal stdenv 2024-01-22 13:37:00 +01:00
README.md Add notes about compressed instructions 2024-01-19 16:27:58 +01:00
vm.nix Disable nsncd daemon for now as it fails to load 2024-01-22 13:37:26 +01:00

NixOS on RISC-V

To boot the system in QEMU, first enter the development shell:

$ nix develop

Then run the boot script:

$ ./boot.sh

In u-boot use the following to boot:

=> booti 0x84000000 - ${fdtcontroladdr} 

Use more than 1 CPU

With only 1 CPU some thigs are soo slow to work. For example, the ttyS0 device doesn't arrive on time and the login fails. Or the SSH daemon doesn't start until the third try. With -smp 32 seems to work ok.

Compressed instructions

To see if a binary has compressed instructions or not, you can use objdump:

hut% nix shell -vL nixpkgs#pkgsCross.riscv64.bintools
hut% objdump -M no-aliases -D result/u-boot | grep 'c\.' | head -5
    80200000:   822a                    c.mv    tp,a0
    80200002:   84ae                    c.mv    s1,a1
    80200018:   52c1                    c.li    t0,-16
    8020001e:   0356                    c.slli  t1,0x15
    80200024:   850a                    c.mv    a0,sp

To dump a ROM without the ELF header:

hut% objdump -b binary -m riscv:rv64 -M no-aliases -D result/u-boot.bin