From 8d7480748e08559ce92cbf9c90e256a110b783ca Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sun, 16 Jan 2022 21:30:11 +0500 Subject: [PATCH] Create partition --- src/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main.c b/src/main.c index 622cb4b..c34ef52 100644 --- a/src/main.c +++ b/src/main.c @@ -103,6 +103,19 @@ bool create_mbr_file( mbr.info.magic = MBR_MAGIC; mbr.info.disk_id = disk_id; mbr.info.reserved = 0; + + // 00 + mbr.info.entries[0].drive_attributes = 0; + // 00 02 00 + mbr.info.entries[0].start_chs_address = 0x0200; + // 01 + mbr.info.entries[0].partition_type = 1; + // 02 03 00 + mbr.info.entries[0].last_chs_address = 0x0302; + // 01 00 00 00 + mbr.info.entries[0].start_lba = 0x01; + // 80 00 00 00 + mbr.info.entries[0].sectors_count = 0x80; } if (bootstrap_filename) {