From afd7ad08b87794aa028d03968f2361ae9f8c5cbb Mon Sep 17 00:00:00 2001 From: Gregory Haerr Date: Tue, 17 Dec 2024 21:02:07 -0700 Subject: [PATCH] [build] Fix hd64mbr-minix image build and setboot partition write bug (#2143) * [build] Fix hd64mbr-minix image build and setboot partition write bug * Correct cylinder count is 130 for 64M --- elks/tools/setboot/setboot.c | 2 +- image/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/elks/tools/setboot/setboot.c b/elks/tools/setboot/setboot.c index dcbe9687c..c307dca53 100644 --- a/elks/tools/setboot/setboot.c +++ b/elks/tools/setboot/setboot.c @@ -77,7 +77,7 @@ static void writePartition(unsigned char *buf) p->head = 1; p->sector = 1; /* next cylinder after MBR, standard*/ p->cyl = 0; - p->start_sect = NumTracks; /* zero-relative start sector here*/ + p->start_sect = SecPerTrk; /* zero-relative start sector here*/ nr_sects -= SecPerTrk; #else p->head = 0; diff --git a/image/Makefile b/image/Makefile index a07da8286..5f15687df 100644 --- a/image/Makefile +++ b/image/Makefile @@ -208,7 +208,7 @@ hd32mbr-minix: hd32-minix hd64mbr-minix: hd64-minix dd if=/dev/zero bs=512 count=63 | cat - hd64-minix.img > hd64mbr-minix.img - setboot hd64mbr-minix.img -P63,16,63 -Sm $(HD_MBR_BOOT) + setboot hd64mbr-minix.img -P63,16,130 -Sm $(HD_MBR_BOOT) hd32mbr-fat: hd32-fat dd if=/dev/zero bs=512 count=63 | cat - hd32-fat.img > hd32mbr-fat.img