Instrumented MIPS kernel
Switch branches/tags
Nothing to show
Clone or download
H. Peter Anvin and ddcc timeconst.pl: Eliminate Perl warning
commit 63a3f603413ffe82ad775f2d62a5afff87fd94a0 upstream.

defined(@array) is deprecated in Perl and gives off a warning.
Restructure the code to remove that warning.

[ hpa: it would be interesting to revert to the timeconst.bc script.
  It appears that the failures reported by akpm during testing of
  that script was due to a known broken version of make, not a problem
  with bc.  The Makefile rules could probably be restructured to avoid
  the make bug, or it is probably old enough that it doesn't matter. ]

Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Latest commit 82dda18 Feb 7, 2013
Permalink
Failed to load latest commit information.
Documentation kernel: add support for unionfs 2.6 Feb 18, 2016
arch initial import Feb 18, 2016
block scsi: Fix error handling in SCSI_IOCTL_SEND_COMMAND May 24, 2015
crypto crypto: testmgr - update LZO compression test vectors Sep 18, 2015
drivers fix library path Jul 13, 2016
firmware fixes for using make 3.82 Aug 26, 2010
fs kernel: add support for unionfs 2.6 Feb 18, 2016
include kernel: add support for unionfs 2.6 Feb 18, 2016
init initial import Feb 18, 2016
ipc ipc,sem: fix use after free on IPC_RMID after a task using same semap… Dec 5, 2015
kernel timeconst.pl: Eliminate Perl warning Jul 14, 2018
lib devres: fix a for loop bounds check Dec 5, 2015
mm mm/memory_hotplug.c: check for missing sections in test_pages_in_a_zo… Jan 29, 2016
net initial import Feb 18, 2016
samples const: constify remaining file_operations Oct 1, 2009
scripts kbuild: Fix gcc -x syntax Jun 10, 2013
security kernel: add support for unionfs 2.6 Feb 18, 2016
sound sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND) May 24, 2015
tools/perf perf tools: do not look at ./config for configuration Aug 29, 2011
usr gen_init_cpio: avoid stack overflow when expanding Jun 10, 2013
virt/kvm KVM: Improve create VCPU parameter (CVE-2013-4587) May 19, 2014
.gitignore initial import Feb 18, 2016
.mailmap Add Sascha Hauer to .mailmap Feb 6, 2009
COPYING [PATCH] update FSF address in COPYING Sep 10, 2005
CREDITS Nicolas Pitre has a new email address Sep 15, 2009
Kbuild kbuild: asm symlink support for arch/$ARCH/include Jul 25, 2008
MAINTAINERS kernel: add support for unionfs 2.6 Feb 18, 2016
Makefile kernel: use the gnu89 standard explicitly Feb 18, 2016
README README: fix misleading pointer to the defconf directory Jun 14, 2009
README.md initial import Feb 18, 2016
REPORTING-BUGS REPORTING-BUGS: add get_maintainer.pl blurb Aug 18, 2009
config.mipseb initial import Feb 18, 2016
config.mipsel initial import Feb 18, 2016

README.md

Introduction

This contains the modified MIPS kernel for the FIRMADYNE framework, which includes an in-tree firmadyne module to perform instrumentation and emulation.

This module can be configured using the following parameters:

Parameter Default Values Description
devfs 1 (on) 0, 1 Create stubs in devfs and emulate behavior
execute 1 (on) 0 - 5 Counter to execute /firmadyne/console after 4th execve() syscall (requires syscall hooks), 0 to disable
reboot 1 (on) 0, 1 Attempt to emulate system reboot by re-executing /sbin/init
procfs 1 (on) 0, 1 Create stubs in procfs and emulate behavior
syscall 255 (all) 0 - 16 Output log bitmask for hooking system calls using the kprobe framework, 0 to disable

Usage

Since MIPS systems can be either big-endian or little-endian, this kernel should be compiled for both endianness. The below instructions produce a little- endian (mipsel) kernel, but should be repeated for a big-endian (mipseb) kernel.

Little-Endian (MIPSEL)

Create the kernel build output directory:

mkdir -p build/mipsel

Copy the configuration file into the build directory:

cp config.mipsel build/mipsel/.config

Assuming that the appropriate cross-compiler is installed in /opt/cross/mipsel-linux-musl, execute:

make ARCH=mips CROSS_COMPILE=/opt/cross/mipsel-linux-musl/bin/mipsel-linux-musl- O=./build/mipsel -j8

The output kernel image will be generated at the following location:

build/mipsel/vmlinux

Big-Endian (MIPSEB)

Create the kernel build output directory:

mkdir -p build/mipseb

Copy the configuration file into the build directory:

cp config.mipseb build/mipseb/.config

Assuming that the appropriate cross-compiler is installed in /opt/cross/mipseb-linux-musl, execute:

make ARCH=mips CROSS_COMPILE=/opt/cross/mipseb-linux-musl/bin/mipseb-linux-musl- O=./build/mipseb -j8

The output kernel image will be generated at the following location:

build/mipseb/vmlinux

Notes

This instrumented MIPS kernel is built for the ARCH_MALTA MIPS Malta target with a 24kf processor. As a result, hardware support on this emulated target is limited to peripherals that are both available on the emulated target and supported by QEMU. Since an emulated PCI bus is available and supported, this allows additional ethernet devices (e.g. rtl8139, smc91c111, pcnet32, etc.) to be attached to the virtualized system. Emulated hard drives can be attached using the IDE block device interface.

As future work, it may be useful to switch to VirtIO on MIPS, since support has been recently merged into the Linux kernel. However, this would require a kernel upgrade. Additionally, it may be useful to add support for MIPS64 systems, although these do not appear to be prevalent. Nevertheless, at the time, we performed our published experiments over our dataset using this kernel for MIPS systems.

Pull requests are greatly appreciated!