From: Pekka Enberg Date: Fri, 26 Mar 2010 19:40:46 +0000 (+0200) Subject: Add a simple "kernel" binary that can be used for testing X-Git-Tag: next-20110824~3^2~528^2~238 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b658fcb081122cf0d8c07a539fd389434612fcfa;p=karo-tx-linux.git Add a simple "kernel" binary that can be used for testing Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/tests/kernel/Makefile b/tools/kvm/tests/kernel/Makefile new file mode 100644 index 000000000000..c7dd8da33332 --- /dev/null +++ b/tools/kvm/tests/kernel/Makefile @@ -0,0 +1,20 @@ +NAME := kernel + +BIN := $(NAME).bin +ELF := $(NAME).elf +OBJ := $(NAME).o + +all: $(BIN) + +$(BIN): $(ELF) + objcopy -O binary $< $@ + +$(ELF): $(OBJ) + ld -Ttext=0x00 -nostdlib -static $< -o $@ + +%.o: %.S + gcc -nostdinc -c $< -o $@ + +clean: + rm -f $(BIN) $(ELF) $(OBJ) +.PHONY: clean diff --git a/tools/kvm/tests/kernel/README b/tools/kvm/tests/kernel/README new file mode 100644 index 000000000000..2923777e6d65 --- /dev/null +++ b/tools/kvm/tests/kernel/README @@ -0,0 +1,16 @@ +Compiling +--------- + +You can simply type: + + $ make + +to build a 16-bit binary that uses the i8086 instruction set. + +Disassembling +------------- + +Use the "-m i8086" command line option with objdump to make sure it knows we're +dealing with i8086 instruction set: + + $ objdump -d -m i8086 i8086.elf diff --git a/tools/kvm/tests/kernel/kernel.S b/tools/kvm/tests/kernel/kernel.S new file mode 100644 index 000000000000..2824b64da657 --- /dev/null +++ b/tools/kvm/tests/kernel/kernel.S @@ -0,0 +1,8 @@ + .code16gcc + .text + .globl _start + .type _start, @function +_start: + # "This is probably the largest possible kernel that is bug free." -- Avi Kivity + 1: + jmp 1b