about boot linux on spike

79 views
Skip to first unread message

Abirami G

unread,
Jun 19, 2023, 2:53:11 AM6/19/23
to RISC-V SW Dev
I am in the initial stage i want to know about the procedure for booting of linux on spike

Tommy Murphy

unread,
Jun 19, 2023, 4:50:16 AM6/19/23
to Abirami G, RISC-V SW Dev
It might help if you clarified what resources/documentation you have consulted/read already in order to avoid duplication?

Abirami G

unread,
Jun 19, 2023, 8:18:47 AM6/19/23
to RISC-V SW Dev, Abirami G
https://techroose.com/tech/linuxOnSpike.html
I used this link for the booting of the linux on spike i am the fresher to the field so i am getting confused and after git submodule update --recursive --init 
it didnt work 

Tommy Murphy

unread,
Jun 19, 2023, 8:44:02 AM6/19/23
to Abirami G, RISC-V SW Dev

There are many other resources dealing with running Linux on Spike which you should be able to find by searching.

I used this link for the booting of the linux on spike i am the fresher to the field so i am getting confused and after git submodule update --recursive --init 
it didnt work 

Well, nobody here is going to be able to guess what went wrong or what errors you got based on that limited info.
In any case, if the instructions on that blog don't work then you should contact the author for assistance.

Abirami G

unread,
Jun 27, 2023, 12:02:55 AM6/27/23
to RISC-V SW Dev, tommy_...@hotmail.com, Abirami G
In function 'freadahead':
freadahead.c:91:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
   91 |  #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
      |   ^~~~~
make[6]: *** [Makefile:1842: freadahead.o] Error 1
make[6]: *** Waiting for unfinished jobs....
fseeko.c: In function 'rpl_fseeko':
fseeko.c:109:4: error: #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
  109 |   #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
      |    ^~~~~
make[6]: *** [Makefile:1842: fseeko.o] Error 1
make[5]: *** [Makefile:1602: all] Error 2
make[4]: *** [Makefile:1506: all-recursive] Error 1
make[3]: *** [Makefile:1461: all] Error 2
make[2]: *** [package/pkg-generic.mk:198: /home/esp-sw/solutions/spike/freedom-u-sdk/work/buildroot_initramfs/build/host-m4-1.4.17/.stamp_built] Error 2
make[1]: *** [Makefile:36: _all] Error 2
make[1]: Leaving directory '/home/esp-sw/solutions/spike/freedom-u-sdk/buildroot'
make: *** [Makefile:90: /home/esp-sw/solutions/spike/freedom-u-sdk/work/buildroot_initramfs/images/rootfs.tar] Error 2
I facing this issue what I want to do for that......

Tommy Murphy

unread,
Jun 27, 2023, 3:03:56 AM6/27/23
to Abirami G, RISC-V SW Dev, Abirami G
You don't explain exactly what commands (e.g. `git clone`, `configure`, `make`) commands that you're using to arrive at this error, so it's difficult to make any meaningful comment/suggestion.

You also seem to be using a SiFive fork/repo rather than a general RISC-V one, so you might need to direct questions about its behaviour to them.

Abirami G

unread,
Jun 28, 2023, 1:05:51 AM6/28/23
to RISC-V SW Dev, tommy_...@hotmail.com, Abirami G
/home/esp-sw/solutions/spike/freedom-u-sdk/work/riscv-isa-sim/prefix/bin/spike --isa=rv64imafdc -p4 /home/esp-sw/solutions/spike/freedom-u-sdk/work/riscv-pk/bbl
bbl loader

                SIFIVE, INC.

         5555555555555555555555555
        5555                   5555
       5555                     5555
      5555                       5555
     5555       5555555555555555555555
    5555       555555555555555555555555
   5555                             5555
  5555                               5555
 5555                                 5555
5555555555555555555555555555          55555
 55555           555555555           55555
   55555           55555           55555
     55555           5           55555
       55555                   55555
         55555               55555
           55555           55555
             55555       55555
               55555   55555
                 555555555
                   55555
                     5

           SiFive RISC-V Core IP
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Linux version 4.15.0-00048-gfe92d7905c6e (esp-sw@esp-sw) (gcc version 7.2.0 (GCC)) #2 SMP Tue Jun 27 14:24:53 IST 2023
[    0.000000] bootconsole [early0] enabled
[    0.000000] Initial ramdisk at: 0x        (ptrval) (244864512 bytes)
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000fffffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x00000000ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000000ffffffff]
[    0.000000] software IO TLB [mem 0xfa3fd000-0xfe3fd000] (64MB) mapped at [        (ptrval)-        (ptrval)]
[    0.000000] elf_hwcap is 0x112d
[    0.000000] percpu: Embedded 14 pages/cpu @        (ptrval) s28632 r0 d28712 u57344
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 516615
[    0.000000] Kernel command line:
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Sorting __ex_table...
[    0.000000] Memory: 1752956K/2095104K available (3073K kernel code, 211K rwdata, 844K rodata, 239287K init, 780K bss, 342148K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] RCU event tracing is enabled.
[    0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[    0.000000] riscv,cpu_intc,0: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,1: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,2: 64 local interrupts mapped
[    0.000000] riscv,cpu_intc,3: 64 local interrupts mapped
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.000010] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[    0.000990] console [hvc0] enabled
[    0.000990] console [hvc0] enabled
[    0.001780] bootconsole [early0] disabled
[    0.001780] bootconsole [early0] disabled
[    0.002715] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=100000)
[    0.003920] pid_max: default: 32768 minimum: 301
[    0.004525] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.005310] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.007075] Hierarchical SRCU implementation.
[    0.009150] smp: Bringing up secondary CPUs ...
[    0.010290] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.010330] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[    0.011195] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.011235] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[    0.012055] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.012095] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[    0.012310] smp: Brought up 1 node, 4 CPUs
[    0.019845] devtmpfs: initialized
[    0.020780] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.021980] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.022870] random: get_random_u32 called from bucket_table_alloc+0xe6/0x276 with crng_init=0
[    0.023920] NET: Registered protocol family 16
[    0.027225] vgaarb: loaded
[    0.027665] SCSI subsystem initialized
[    0.028400] usbcore: registered new interface driver usbfs
[    0.029050] usbcore: registered new interface driver hub
[    0.029815] usbcore: registered new device driver usb
[    0.030430] pps_core: LinuxPPS API ver. 1 registered
[    0.031010] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giom...@linux.it>
[    0.032145] PTP clock support registered
[    0.032975] clocksource: Switched to clocksource riscv_clocksource
[    0.034890] NET: Registered protocol family 2
[    0.035680] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.036720] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    0.037685] TCP: Hash tables configured (established 16384 bind 16384)
[    0.038480] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[    0.039215] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[    0.040050] NET: Registered protocol family 1
[    0.473240] Unpacking initramfs...
[    0.990535] Initialise system trusted keyrings
[    0.991220] workingset: timestamp_bits=62 max_order=19 bucket_order=0
[    0.996535] random: fast init done
[    1.010340] jitterentropy: Initialization failed with host not compliant with requirements: 2
[    1.011330] Key type asymmetric registered
[    1.011810] Asymmetric key parser 'x509' registered
[    1.012380] io scheduler noop registered
[    1.013065] io scheduler cfq registered (default)
[    1.013615] io scheduler mq-deadline registered
[    1.014145] io scheduler kyber registered
[    1.073715] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    1.075405] libphy: Fixed MDIO Bus: probed
[    1.075960] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.076720] ehci-pci: EHCI PCI platform driver
[    1.077280] usbcore: registered new interface driver usb-storage
[    1.078115] usbcore: registered new interface driver usbhid
[    1.078765] usbhid: USB HID core driver
[    1.079375] NET: Registered protocol family 17
[    1.080360] Loading compiled-in X.509 certificates
[    1.081100] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -2
[    1.081970] Please append a correct "root=" boot option; here are the available partitions:
[    1.083060] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.084020] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.15.0-00048-gfe92d7905c6e #2
[    1.084910] Call Trace:
[    1.085200] [<        (ptrval)>] walk_stackframe+0x0/0xa2
[    1.085830] [<        (ptrval)>] show_stack+0x26/0x34
[    1.086420] [<        (ptrval)>] dump_stack+0x5e/0x7c
[    1.087010] [<        (ptrval)>] panic+0xca/0x1e4
[    1.087560] [<        (ptrval)>] mount_block_root+0x1f2/0x2be
[    1.088230] [<        (ptrval)>] mount_root+0x7c/0x8a
[    1.088820] [<        (ptrval)>] prepare_namespace+0x132/0x180
[    1.089500] [<        (ptrval)>] kernel_init_freeable+0x19a/0x1be
[    1.090210] [<        (ptrval)>] kernel_init+0xe/0xf0
[    1.090800] [<        (ptrval)>] ret_from_syscall+0xa/0xe
Currently I am facing this struggle 

Tommy Murphy

unread,
Jun 28, 2023, 1:40:05 AM6/28/23
to Abirami G, RISC-V SW Dev, Abirami G
Once again you haven't explained what steps you took to arrive at this situation. Posting a log without any context doesn't really provide adequate information for anybody to make any sort of informed comment.

Also, and you still seem to be using SiFive specific resources which means that you probably should be directing support questions to them. At the very least you should probably check their forums for existing posts here on the types of errors that you're seeing in your log:

Reply all
Reply to author
Forward
0 new messages