a cow based x86_64 operating system, using limine and stivale2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
1.7 KiB

.PHONY: clean all run disk kernel force_look threaded_build
HDD_ROOT := disc_root
HDD_FILE := disk.hdd
PARTITION := /dev/nvme0n1p5
1 year ago
USED_LOOPBACK := /dev/loop2
LIMINE_INSTALL := ./limine-bootloader/limine-install-linux-x86_64
12 months ago
QEMU_PATH := qemu-system-x86_64 -accel kvm
1 year ago
QEMU_ARGS := -monitor stdio \
-bios /usr/share/ovmf/OVMF.fd \
1 year ago
-m 8192 \
-M q35 \
-vga virtio \
1 year ago
-no-reboot \
-D qemu.log \
12 months ago
-device nvme,drive=NVME1,serial=nvme-1 \
-drive format=raw,if=none,id=NVME1,file=
12 months ago
# -usb \
# -device usb-host \
1 year ago
12 months ago
QEMU_DEBUG_ARGS:= -no-shutdown -d int $(QEMU_ARGS)
1 year ago
run: all
prun: kernel $(PARTITION)
1 year ago
debug: all
12 months ago
pdebug: $(PARTITION)
all: diskfile
make -j all
$(PARTITION): kernel
sudo cp -r disk_root/* /media/bincows/
$(HDD_FILE): kernel/entry.c
dd if=/dev/zero bs=1M count=0 seek=64 of=$(HDD_FILE)
sudo /sbin/parted -s $(HDD_FILE) mklabel gpt
sudo /sbin/parted -s $(HDD_FILE) mkpart ESP fat32 2048s 100%
sudo /sbin/parted -s $(HDD_FILE) set 1 esp on
diskfile: kernel $(HDD_FILE)
sudo losetup -P $(USED_LOOPBACK) $(HDD_FILE)
sudo mkfs.fat -F 32 $(USED_LOOPBACK)p1
mkdir -p img_mount
sudo mount $(USED_LOOPBACK)p1 img_mount
sudo cp -r disk_root/* img_mount/
sudo umount img_mount
sudo /sbin/losetup -d $(USED_LOOPBACK)
rm -rf img_mount
kernel: force_look
$(MAKE) -C ./kernel/
cd ./kernel/ && make clean
rm -f $(HDD_FILE)