2023-08-02 13:49:16 +03:00
|
|
|
all: start32.bin
|
2023-06-12 11:46:47 +03:00
|
|
|
clean:
|
2023-07-24 04:20:54 +03:00
|
|
|
-@rm *.bin 2> /dev/null || true
|
2023-06-12 11:46:47 +03:00
|
|
|
|
2023-07-24 21:48:21 +03:00
|
|
|
start32.bin: src/*
|
2023-07-24 04:20:54 +03:00
|
|
|
fasm src/start32.asm start32.bin
|
2024-08-16 18:22:30 +03:00
|
|
|
image: start32.bin mount grub-cfg roska.img mnt/roska/
|
2023-08-01 21:05:36 +03:00
|
|
|
cp start32.bin mnt/roska/
|
2023-06-22 02:13:20 +03:00
|
|
|
sync
|
2023-06-12 11:46:47 +03:00
|
|
|
|
2024-08-17 19:16:53 +03:00
|
|
|
qemu-run: image roska.img
|
2023-08-01 21:05:36 +03:00
|
|
|
qemu-system-i386 roska.img -serial stdio
|
2024-08-17 19:16:53 +03:00
|
|
|
bochs-run: image roska.img
|
|
|
|
bochs -qf bochsrc.txt
|
2023-08-01 21:05:36 +03:00
|
|
|
mount: roska.img mnt/
|
2023-06-14 20:06:27 +03:00
|
|
|
@if ! mountpoint -q "mnt/"; then \
|
2023-08-01 21:05:36 +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:
|
2024-08-16 18:22:30 +03:00
|
|
|
@if mountpoint -q "mnt/"; then \
|
|
|
|
sudo umount mnt/; \
|
|
|
|
fi;
|
2023-06-14 19:28:16 +03:00
|
|
|
mnt/:
|
2024-08-16 18:22:30 +03:00
|
|
|
@mkdir -p mnt
|
|
|
|
mnt/roska/: mount roska.img
|
|
|
|
@mkdir -p mnt/roska
|
2023-06-18 05:37:30 +03:00
|
|
|
build/:
|
|
|
|
@mkdir build
|
2024-08-16 18:22:30 +03:00
|
|
|
|
|
|
|
roska.img: mnt/
|
2024-08-17 19:16:53 +03:00
|
|
|
dd if=/dev/zero of=roska.img bs=1k count=16128
|
2024-08-16 18:22:30 +03:00
|
|
|
echo 'type=83' | sudo sfdisk roska.img
|
|
|
|
sudo losetup /dev/loop0 roska.img
|
|
|
|
sudo losetup /dev/loop1 roska.img -o1048576
|
|
|
|
sudo mkdosfs -F32 -f 2 /dev/loop1
|
|
|
|
sudo mount /dev/loop1 mnt/
|
|
|
|
sudo grub-install --target=i386-pc --root-directory=mnt --boot-directory=mnt/boot --no-floppy --modules="normal part_msdos multiboot" /dev/loop0
|
|
|
|
sudo umount mnt/
|
|
|
|
sudo losetup -d /dev/loop1
|
|
|
|
sudo losetup -d /dev/loop0
|
|
|
|
grub-cfg: grub.cfg mount
|
|
|
|
cp grub.cfg mnt/boot/grub/grub.cfg
|
|
|
|
lo-unsetup: umount
|
|
|
|
sudo losetup -d /dev/loop1
|
|
|
|
sudo losetup -d /dev/loop0
|