Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux 32b #10

Open
sjthales opened this issue Jun 9, 2021 · 3 comments
Open

linux 32b #10

sjthales opened this issue Jun 9, 2021 · 3 comments

Comments

@sjthales
Copy link

sjthales commented Jun 9, 2021

Hello, is there possible to simulate a linux 32b with Spike ?

@Phantom1003
Copy link
Member

Phantom1003 commented Jun 10, 2021

I did not test this project under 32-bit configurations
As I know, linux, gnu-toolchain and spike support RV32, you need to make sure that busybox supports RV32
Then change the configs under /conf, and change the default ABI and ARCH in Makefile
Please give me some feedback, if you succeed or having any problem

@sjthales
Copy link
Author

Hello,

Thanks for your reply. I succeed in compiling and generating a 32 bits linux image using buildroot 2021.5 et linux 5.4.

When I run the linux image on spike, I get:

[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80400000
[ 0.000000] Linux version 5.4.0 (sjacq@D354044) (gcc version 10.2.0 (GCC)) #2 Fri Jun 11 14:19:46 CEST 2021
[ 0.000000] initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000080400000-0x00000000c03fffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080400000-0x00000000c03fffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080400000-0x00000000c03fffff]
[ 0.000000] elf_hwcap is 0x1101
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 259584
[ 0.000000] Kernel command line: console=hvc0 earlycon=sbi
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] Sorting __ex_table...
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 1024928K/1048576K available (5066K kernel code, 158K rwdata, 943K rodata, 6184K init, 235K bss, 23648K 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_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[ 0.000015] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[ 0.016505] printk: console [hvc0] enabled
[ 0.017005] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=100000)
[ 0.018215] pid_max: default: 32768 minimum: 301
[ 0.018820] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.019680] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.020640] *** VALIDATE tmpfs ***
[ 0.021220] *** VALIDATE proc ***
[ 0.022715] devtmpfs: initialized
[ 0.023465] random: get_random_bytes called from setup_net+0x54/0x1dc with crng_init=0
[ 0.024425] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.025570] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[ 0.026465] NET: Registered protocol family 16
[ 0.035585] usbcore: registered new interface driver usbfs
[ 0.036245] usbcore: registered new interface driver hub
[ 0.036900] usbcore: registered new device driver usb
[ 0.037735] clocksource: Switched to clocksource riscv_clocksource
[ 0.038500] *** VALIDATE ramfs ***
[ 0.039565] NET: Registered protocol family 2
[ 0.040330] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.041405] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.042385] TCP bind hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.043285] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.044060] UDP hash table entries: 512 (order: 1, 8192 bytes, linear)
[ 0.044835] UDP-Lite hash table entries: 512 (order: 1, 8192 bytes, linear)
[ 0.045705] NET: Registered protocol family 1
[ 0.047030] RPC: Registered named UNIX socket transport module.
[ 0.047725] RPC: Registered udp transport module.
[ 0.048280] RPC: Registered tcp transport module.
[ 0.048835] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.302790] workingset: timestamp_bits=30 max_order=18 bucket_order=0
[ 0.307655] NFS: Registering the id_resolver key type
[ 0.308360] Key type id_resolver registered
[ 0.308855] Key type id_legacy registered
[ 0.309330] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.348390] io scheduler mq-deadline registered
[ 0.348925] io scheduler kyber registered
[ 0.381865] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 0.383280] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.384185] usbcore: registered new interface driver usbhid
[ 0.384840] usbhid: USB HID core driver
[ 0.385690] NET: Registered protocol family 10
[ 0.386650] Segment Routing with IPv6
[ 0.387115] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 0.388130] NET: Registered protocol family 17
[ 0.388905] Key type dns_resolver registered
[ 0.391865] Freeing unused kernel memory: 6184K
[ 0.392400] This architecture does not have kernel memory protection.
[ 0.393155] Run /init as init process

Just after the init is run, there is nothing, the boot sequence seems to be frozen.

Do you have an idea why the booting is frozen at init process?

@Phantom1003
Copy link
Member

Can you give some details about your buildroot configuration?
Did there any kernel panic?
It seems like that some problem happens in /init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants