This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1001174] New: i386 PC floppy boot fails in Bochs and with some real BIOSes


Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001174

           Summary: i386 PC floppy boot fails in Bochs and with some real
                    BIOSes
           Product: eCos
           Version: CVS
          Platform: pc (i386 PC target)
        OS/Version: IA32
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: low
         Component: Patches and contributions
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: horst@schirmeier.com
                CC: ecos-patches@ecos.sourceware.org
             Class: Advice Request


Created an attachment (id=1175)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1175)
pcmb.inc: enable interrupts before waiting for the BIOS

In Bochs (releases 2.3.7 and 2.4.5, and current SVN head -r10265) and on some
(but by far not all) tested PCs, eCos (2.0, 3.0, and CVS head as of 2011-03-16)
does not boot but stalls after printing a line of dots.  Further analysis
showed that the boot process is stuck in
packages/hal/i386/pcmb/current/include/pcmb.inc in this loop beginning at line
223 (as of eCos 3.0):

        /* Lets be nice and wait for the diskette drive motor to go off
         * before continuing. */

        movw    $0x40, %ax
        movw    %ax, %es
        movl    $0x40, %ebx
2:      es
        movb    (%bx), %al
        cmpb    $0, %al
        jne     2b

eCos polls for the BIOS data area variable at 0040:0040 to become zero, as an
indication that the INT08 handler has switched off the floppy drive motor. 
Unfortunately, the Bochs BIOS (and supposedly a number of real-world BIOSes,
too) passes control to boot sector with the Interrupt Enable Flag (IF) in
EFLAGS disabled, and the timer interrupt is never triggered.  Therefore the
variable won't turn 0, the drive motor never gets switched off, and eCos
stalls.

One fix is to enable interrupts right before entering the polling loop (see
attached patch), or to switch off the drive motor by yourself (out 0x0 to the
floppy drive's Digital Output Register 0x3F2, cf.
http://wiki.osdev.org/Floppy_Disk_Controller).  The latter variant would remove
the 2s waiting time until the BIOS counter times out.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]