Reputation: 53
I want to reserve a portion of physical memory when booting Linux. The common kernel parameters should be like "mem=51M memmap=512M$512M". How can I specify these parameters for kernel for Spike?
My Spike execution commands are :
[email protected]:~/riscv$ spike -m2048 +disk=./root.bin bbl ./linux-3.14.33/vmlinux
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] Linux version 3.14.33-g043bb5d (guanglin@guanglin-a11-linux) (gcc version 5.2.0 (GCC) ) #2 Sun Aug 23 17:19:49 EDT 2015
[ 0.000000] Detected 0x7fc00000 bytes of physical memory
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00200000-0x7fdfffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00200000-0x7fdfffff]
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 516110
[ 0.000000] Kernel command line: root=/dev/htifblk0
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[ 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: 2058700K/2093056K available (1722K kernel code, 124K rwdata, 356K rodata, 68K init, 211K bss, 34356K reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:2
[ 0.150000] Calibrating delay using timer specific routine.. 20.01 BogoMIPS (lpj=100050)
[ 0.150000] pid_max: default: 32768 minimum: 301
[ 0.150000] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.150000] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.150000] devtmpfs: initialized
[ 0.150000] NET: Registered protocol family 16
[ 0.150000] bio: create slab <bio-0> at 0
[ 0.150000] Switched to clocksource riscv_clocksource
[ 0.150000] NET: Registered protocol family 2
[ 0.150000] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.150000] TCP bind hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.150000] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.150000] TCP: reno registered
[ 0.150000] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[ 0.150000] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[ 0.150000] NET: Registered protocol family 1
[ 0.150000] futex hash table entries: 256 (order: 0, 6144 bytes)
[ 0.150000] io scheduler noop registered
[ 0.150000] io scheduler cfq registered (default)
[ 0.150000] htifcon htif1: detected console
[ 0.150000] console [htifcon0] enabled
[ 0.150000] htifblk htif2: detected disk
[ 0.150000] htifblk htif2: added htifblk0
[ 0.150000] TCP: cubic registered
[ 0.150000] VFS: Mounted root (ext2 filesystem) readonly on device 254:0.
[ 0.150000] devtmpfs: mounted
[ 0.150000] Freeing unused kernel memory: 68K (ffffffff80000000 - ffffffff80011000)
[ 0.160000] EXT2-fs (htifblk0): warning: mounting unchecked fs, running e2fsck is recommended
/ #
I tried
spike -m2048 +disk=./root.bin bbl ./linux-3.14.33/vmlinux mem=1G memmap=1G$1G
spike -m2048 +disk=./root.bin bbl ./linux-3.14.33/vmlinux mem=512M memmap=512M$512M
None of them works.
If I do
spike -m2048 +disk=./root.bin bbl "./linux-3.14.33/vmlinux mem=512M memmap=512M$512M"
couldn't open ELF program: ./linux-3.14.33/vmlinux mem=512M memmap=512M12M!
Upvotes: 2
Views: 698
Reputation: 1571
For now, arguments to linux need to compiled into linux via the CONFIG_CMDLINE parameter in .config.
A future version of bbl could be improved to support passing arguments to linux.
Upvotes: 1