bugGNU GRUB - Bugs: bug #482, geometry doesn't work with floppies

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #482: geometry doesn't work with floppies

Submitted by:  Yoshinori K. Okuji <okuji>
Submitted on:  Tue 28 May 2002 08:53:10 PM UTC  
 
Category: Disk & PartitionSeverity: Minor
Priority: 1 - LaterItem Group: Software Error
Status: PostponedPrivacy: Public
Assigned to: Yoshinori K. Okuji <okuji>Originator Name: 
Open/Closed: ClosedRelease: 0.92
Release: NoneReproducibility: Every Time
Planned Release: None

Sat 15 Dec 2007 11:07:07 AM UTC, comment #2:

Does not affect GRUB 2, closing.

Robert Millan <robertmh>
Project Administrator
Thu 05 Feb 2004 02:08:29 PM UTC, comment #1:

Stage 1 has two flaws related to this bug:
1. stage1.S, Line 234

mov $8,%ah
int $13
jnc final_init

Int 13, function 8, returns the capacities of the device rather than that of the inserted floppy. Thus, if you insert a 1.44 MB 3.25" floppy disk into a 2.88 MB drive, this call returns the CHS value 7F/1/24 (valid for a 2.88 disk), and following load commands translating LBA will get the wrong sectors from the 18th on.
You must check the BL register for floppy drives:

pushw %dx /* save drive number in DL */
mov $8,%ah
int $13
popw %ax
jc jump_and_die /* unrecoverable error */
or %al,%al
js final_init /* HDD */
cmp $6,%bl
jle floppy_probe /* sort out floppy drives */
final_init:

The current implementation hardly ever probes a floppy, because the drive parameters (at least for drive 0 and 1) are read from CMOS, and INT 13 should succeed as long as the drive exists. Therefore, the following bug in the floppy_probe area now is rarely triggered, but it should be fixed before making the above changes:
2. stage1.S Line 478

1:
/* perform read */
movw $STAGE1_BUFFERSEG,%bx

There is some confusion about what a segment is throughout stage 1. For instance, STAGE1_STACKSEG is loaded into %sp and is thus rather an offset (in segment %ss=0000) than a segment. STAGE1_BUFFERSEG is once used as a true segment (Line 337,338), and, on the other hand, in line 478 as an offset into a segment (%es) setup by int 13, function 8, pointing to the disk drive parameter table. Segment and offset are completely unrelated. The BIOS presumely loaded something like 0000 or 0040 into %es, the default value for STAGE1_BUFFERSEG is 0x7000, the requested buffer size is 32 KB, so having the BIOS use this buffer may result in complete destruction of the running code at 0x7C00!!
Use

movw $STAGE1_BUFFERSEG,%bx
movw %bx,%es
xorw %bx,%bx

instead.

Wolf Lammen <wolflammen>
Tue 28 May 2002 08:53:10 PM UTC, original submission:

The command "geometry" doesn't work with floppies quite well.
This bug was incorporated after the rewrite of the partition scanning
code by okuji.

This won't be fixed anytime soon, because this is not critical at all.

Okuji

Yoshinori K. Okuji <okuji>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by robertmh (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 15 Dec 2007 11:07:07 AM UTCrobertmhOpen/ClosedOpen=>Closed
    Thu 30 May 2002 05:21:53 PM UTCokujiRelease=>
      Planned Release=>
    Tue 28 May 2002 08:54:02 PM UTCokujiStatusNone=>(Error - Not Found)

    Back to the top


    Powered by Savane 3.1-cleanup1