From 3f0ea72ac985a7ff4803f72487d53b8e04ca09d1 Mon Sep 17 00:00:00 2001 From: Bernd Boeckmann Date: Wed, 22 May 2024 19:45:04 +0200 Subject: [PATCH] fix #85 FDISK not modifying partition type --- doc/fdisk/CHANGES.md | 16 ++++++++++++++++ source/fdisk/pcompute.c | 2 +- source/fdisk/ui.c | 7 ++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/doc/fdisk/CHANGES.md b/doc/fdisk/CHANGES.md index 7a1245b..157fd25 100644 --- a/doc/fdisk/CHANGES.md +++ b/doc/fdisk/CHANGES.md @@ -8,6 +8,22 @@ Bug classification: - LOW: Cosmetic bugs, like display issues etc. +Version 1.3.15 (2024-??-??) +--------------------------- +Fixes: + - HIGH: Fix FDISK not modifying partition type via command line /MODIFY + and via UI if FDISK is started in extended options mode /XO. + - HIGH: respect selected video page instead of hardcoding it to zero when + calling INT 10 routines. + +Changes: + - FDISK provided MBR bootloader does not require more than 128k of RAM + anymore. In fact it should run with as low as 64k of RAM (untested). + - Work around Xi8088 and Book8088 BIOS bug (bootloader and FDISK itself). + - Assume BIOS drive number of 0x80 to boot from if BIOS tells us it is + unit 0. This should be an error, because we boot from hard disk. + + Version 1.3.14 (2024-02-05) --------------------------- Fixes: diff --git a/source/fdisk/pcompute.c b/source/fdisk/pcompute.c index c6ce3c5..a0304a3 100644 --- a/source/fdisk/pcompute.c +++ b/source/fdisk/pcompute.c @@ -809,7 +809,7 @@ int Modify_Partition_Type( int partition_number, int type_number ) { Partition_Table *pDrive = &part_table[flags.drive_number - 0x80]; - if ( pDrive->usable ) { + if ( !pDrive->usable ) { return 99; } diff --git a/source/fdisk/ui.c b/source/fdisk/ui.c index c17ab04..f3cc070 100644 --- a/source/fdisk/ui.c +++ b/source/fdisk/ui.c @@ -1640,7 +1640,7 @@ void Display_Partition_Information( void ) input = (int)Input( 1, -1, -1, YN, 0, 0, ESCR, 1, 0, '1', '4' ); if ( ( ( input - 48 ) >= 1 ) && ( ( input - 48 ) <= 4 ) ) { - Modify_Primary_Partition_Information( ( input - 48 ) ); + Modify_Primary_Partition_Information( input - 48 ); goto Beginning; } } @@ -1982,9 +1982,10 @@ void Modify_Primary_Partition_Information( int partition_number ) unsigned long usage; Partition_Table *pDrive = &part_table[flags.drive_number - 0x80]; - Partition *p = &pDrive->pri_part[partition_number]; + Partition *p = NULL; partition_number--; /* Adjust partition number to start with 0. */ + p = &pDrive->pri_part[partition_number]; do { Clear_Screen( 0 ); @@ -1999,7 +2000,7 @@ void Modify_Primary_Partition_Information( int partition_number ) Print_At( 4, 8, svarlang_str( 10, 11 ) ); /* Drive Letter of Partition */ - if ( IsRecognizedFatPartition( p->num_type == 1 ) ) { + if ( IsRecognizedFatPartition( p->num_type ) ) { Print_At( 5, 9, "%c:", drive_lettering_buffer[( flags.drive_number - 128 )] [partition_number] );