Add testing facilities
This commit is contained in:
parent
225a7c238d
commit
5c36fac374
13
Makefile
13
Makefile
@ -1,7 +1,18 @@
|
|||||||
.PHONY: all clean
|
.PHONY: all clean test
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(MAKE) -C src all
|
$(MAKE) -C src all
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C src clean
|
$(MAKE) -C src clean
|
||||||
|
|
||||||
|
test:
|
||||||
|
$(MAKE) -C test
|
||||||
|
dd if=/dev/zero bs=1M count=0 seek=64 of=test.img
|
||||||
|
parted -s test.img mklabel msdos
|
||||||
|
parted -s test.img mkpart primary 1 100%
|
||||||
|
echfs-utils -m -p0 test.img quick-format 32768
|
||||||
|
echfs-utils -m -p0 test.img import test/test.elf test.elf
|
||||||
|
echfs-utils -m -p0 test.img import test/qloader2.cfg qloader2.cfg
|
||||||
|
./qloader2-install test.img
|
||||||
|
qemu-system-x86_64 -hda test.img
|
||||||
|
2
test/.gitignore
vendored
Normal file
2
test/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
test.o
|
||||||
|
test.elf
|
3
test/Makefile
Normal file
3
test/Makefile
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
test.elf:
|
||||||
|
nasm test.asm -felf32 -o test.o
|
||||||
|
../toolchain/bin/i386-elf-ld test.o -nostdlib -T ./linker.ld -o test.elf
|
22
test/linker.ld
Normal file
22
test/linker.ld
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
ENTRY(_start)
|
||||||
|
|
||||||
|
SECTIONS {
|
||||||
|
. = 0x100000;
|
||||||
|
|
||||||
|
.text : {
|
||||||
|
*(.text*)
|
||||||
|
}
|
||||||
|
|
||||||
|
.rodata : {
|
||||||
|
*(.rodata*)
|
||||||
|
}
|
||||||
|
|
||||||
|
.data : {
|
||||||
|
*(.data*)
|
||||||
|
}
|
||||||
|
|
||||||
|
.bss : {
|
||||||
|
*(.bss*)
|
||||||
|
*(COMMON)
|
||||||
|
}
|
||||||
|
}
|
4
test/qloader2.cfg
Normal file
4
test/qloader2.cfg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
KERNEL_DRIVE=128
|
||||||
|
KERNEL_PARTITION=0
|
||||||
|
KERNEL_PATH=test.elf
|
||||||
|
KERNEL_CMDLINE=none
|
10
test/test.asm
Normal file
10
test/test.asm
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
; This is a compliant "kernel" meant for testing purposes.
|
||||||
|
|
||||||
|
; Header
|
||||||
|
|
||||||
|
|
||||||
|
section .text
|
||||||
|
|
||||||
|
; Entry point
|
||||||
|
_start:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user