Skip to content

Commit

Permalink
fix #85 FDISK not modifying partition type
Browse files Browse the repository at this point in the history
  • Loading branch information
boeckmann committed May 22, 2024
1 parent 196f4a0 commit 3f0ea72
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
16 changes: 16 additions & 0 deletions doc/fdisk/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion source/fdisk/pcompute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 4 additions & 3 deletions source/fdisk/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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 );
Expand All @@ -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] );
Expand Down

0 comments on commit 3f0ea72

Please sign in to comment.