public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugs.ecos.sourceware.org
To: ecos-patches@ecos.sourceware.org
Subject: [Bug 1001174] New: i386 PC floppy boot fails in Bochs and with some real BIOSes
Date: Wed, 16 Mar 2011 17:49:00 -0000	[thread overview]
Message-ID: <bug-1001174-104@http.bugs.ecos.sourceware.org/> (raw)

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.

             reply	other threads:[~2011-03-16 17:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 17:49 bugzilla-daemon [this message]
2011-03-18  8:22 ` [Bug 1001174] " bugzilla-daemon
2011-03-18  8:22 ` bugzilla-daemon
2011-03-20 15:29 ` bugzilla-daemon
2011-07-02 10:04 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-1001174-104@http.bugs.ecos.sourceware.org/ \
    --to=bugzilla-daemon@bugs.ecos.sourceware.org \
    --cc=ecos-patches@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).