kernel/Makefile

26 lines
685 B
Makefile
Raw Permalink Normal View History

2023-06-18 05:37:30 +03:00
all: build/kernel-i386.elf
2023-06-12 11:46:47 +03:00
clean:
2023-09-19 19:51:51 +03:00
-@rm build/* 2> /dev/null || true
2023-06-12 11:46:47 +03:00
build/kernel-i386.elf: src/* build/
2023-09-19 19:51:51 +03:00
tcc -m32 -nostdlib -Wl,-Ttext,0x100000 -o build/kernel-i386.elf src/start32.s src/*.c
2023-06-22 02:13:20 +03:00
image: build/kernel-i386.elf mount
2023-09-19 19:51:51 +03:00
cp build/kernel-i386.elf mnt/roska/start32.elf
2023-06-22 02:13:20 +03:00
sync
2023-06-12 11:46:47 +03:00
2023-06-18 05:37:30 +03:00
qemu-multiboot: build/kernel-i386.elf
qemu-system-i386 -kernel build/kernel-i386.elf -serial stdio
2023-06-22 02:13:20 +03:00
qemu-image: image
2023-09-19 19:51:51 +03:00
qemu-system-i386 roska.img -serial stdio
2023-06-14 19:28:16 +03:00
2023-09-19 19:51:51 +03:00
mount: roska.img mnt/
2023-06-14 20:06:27 +03:00
@if ! mountpoint -q "mnt/"; then \
2023-09-19 19:51:51 +03:00
sudo mount -o loop,offset=1048576,umask=177,dmask=022,uid=$(shell id -u),gid=$(shell id -g) roska.img mnt/; \
2023-06-14 20:06:27 +03:00
fi;
2023-06-14 19:28:16 +03:00
umount:
2023-06-14 20:06:27 +03:00
@sudo umount mnt
2023-06-14 19:28:16 +03:00
mnt/:
2023-06-14 20:06:27 +03:00
@mkdir mnt
2023-06-18 05:37:30 +03:00
build/:
@mkdir build