Skip to content

Commit 9669aa8

Browse files
committed
update makefile
1 parent e5938af commit 9669aa8

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
commit e5938af8bbd46f55f02675b3a8472222fed177ab
2+
Author: Alexeev Bronislav <[email protected]>
3+
Date: Thu Sep 4 21:13:39 2025 +0700
4+
5+
fix memory issues
6+
17
commit 5a4b8669db2a956a70c60ea9cd800ad03056739b
28
Author: Alexeev Bronislav <[email protected]>
39
Date: Thu Sep 4 20:59:32 2025 +0700

Makefile

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ BIN_DIR = bin
1010
DISKIMG_DIR = diskimgs
1111
DISKIMG_NAME = kintsugi_floppy_i386.img
1212
HDDIMG_NAME = kintsugi_hdd_i386.img
13+
ISO_NAME = KintsugiOS.iso
14+
15+
# Tools for ISO creation
16+
MKISOFS = genisoimage
17+
XORRISO = xorriso
1318

1419
CFLAGS = -g -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs -Wall -Wextra -ffreestanding -I$(SRC_DIR)/kernel/include
1520
ASMFLAGS_BIN = -f bin
@@ -69,10 +74,26 @@ $(DISKIMG_DIR)/$(HDDIMG_NAME):
6974
@mkdir -p $(DISKIMG_DIR)
7075
@dd if=/dev/zero of=$@ bs=512 count=10000 # ~5MB disk
7176

77+
check-iso-tools:
78+
@if ! command -v $(MKISOFS) >/dev/null 2>&1 && ! command -v $(XORRISO) >/dev/null 2>&1; then \
79+
echo "Error: Neither genisoimage nor xorriso found. Install one of them to create ISO."; \
80+
exit 1; \
81+
fi
82+
83+
$(DISKIMG_DIR)/$(ISO_NAME): $(DISKIMG_DIR)/$(DISKIMG_NAME) check-iso-tools
84+
@printf "$(BLUE)[ISO] Creating ISO image %-50s -> %s$(RESET)\n" "$(DISKIMG_DIR)/$(DISKIMG_NAME)" "$@"
85+
@if command -v $(MKISOFS) >/dev/null 2>&1; then \
86+
$(MKISOFS) -quiet -V 'KINTSUGI_OS' -input-charset iso8859-1 -o $@ -b $(DISKIMG_NAME) -hide boot.catalog -boot-load-size 4 -no-emul-boot $(DISKIMG_DIR); \
87+
elif command -v $(XORRISO) >/dev/null 2>&1; then \
88+
$(XORRISO) -as mkisofs -b $(DISKIMG_NAME) -o $@ $(DISKIMG_DIR); \
89+
fi
90+
7291
diskimg: $(DISKIMG_DIR)/$(DISKIMG_NAME)
7392

7493
hddimg: $(DISKIMG_DIR)/$(HDDIMG_NAME)
7594

95+
iso: $(DISKIMG_DIR)/$(ISO_NAME)
96+
7697
run_bin: $(BIN_DIR)/kintsugios.bin
7798
@printf "$(GREEN)[QEMU] Run bin %-50s$(RESET)\n" "$(BIN_DIR)/kintsugios.bin"
7899
@qemu-system-i386 -fda $(BIN_DIR)/kintsugios.bin
@@ -85,6 +106,10 @@ run: $(DISKIMG_DIR)/$(DISKIMG_NAME) $(DISKIMG_DIR)/$(HDDIMG_NAME)
85106
@printf "$(GREEN)[QEMU] Run with HDD %-50s$(RESET)\n" "$<"
86107
@qemu-system-i386 -fda $< -hda $(DISKIMG_DIR)/$(HDDIMG_NAME) -boot a -m 16
87108

109+
run_iso: $(DISKIMG_DIR)/$(ISO_NAME) $(DISKIMG_DIR)/$(HDDIMG_NAME)
110+
@printf "$(GREEN)[QEMU] Run ISO %-50s$(RESET)\n" "$<"
111+
@qemu-system-i386 -hda ${DISKIMG_DIR}/$(HDDIMG_NAME) -cdrom $< -boot d -m 16
112+
88113
debug_fda: $(DISKIMG_DIR)/$(DISKIMG_NAME)
89114
@printf "$(GREEN)[QEMU] Debug img %-50s$(RESET)\n" "$<"
90115
@qemu-system-i386 -fda $< -boot a -s -S -m 16
@@ -93,8 +118,12 @@ debug: $(DISKIMG_DIR)/$(DISKIMG_NAME) $(DISKIMG_DIR)/$(HDDIMG_NAME)
93118
@printf "$(GREEN)[QEMU] Debug with HDD %-50s$(RESET)\n" "$<"
94119
@qemu-system-i386 -fda $< -hda $(DISKIMG_DIR)/$(HDDIMG_NAME) -boot a -s -S -m 16
95120

121+
debug_iso: $(DISKIMG_DIR)/$(ISO_NAME)
122+
@printf "$(GREEN)[QEMU] Debug ISO %-50s$(RESET)\n" "$<"
123+
@qemu-system-i386 -cdrom $< -boot d -s -S -m 16
124+
96125
clean:
97126
@printf "$(RED)[RM] Clean $(BIN_DIR) and $(DISKIMG_DIR)$(RESET)\n"
98127
@rm -rf $(BIN_DIR)/* $(DISKIMG_DIR)/*
99128

100-
.PHONY: all diskimg hddimg run run_bin run_hdd debug debug_hdd clean
129+
.PHONY: all diskimg hddimg iso run run_bin run_fda run_iso debug debug_fda debug_iso clean check-iso-tools

0 commit comments

Comments
 (0)