asm() statements need to be volatile when:
a. They have side effects (other than value returned).
b. When the value returned can vary over time.
c. When they have ordering constraints that cannot be expressed to gcc.
In particular, the keyboard and timer reads were violating constraint (b),
which resulted in the keyboard/timeout poll getting
loop-invariant-removed when compiling with gcc 4.2.0.
Thanks to an anonymous bug reporter for pointing this out.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
When filling in the MBR signature array, the setup code failed to advance
boot_params.edd_mbr_sig_buf_entries, which resulted in the valid data
being ignored.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
At least one machine has been identified in the field which advertises
EDD for all drives but locks up if one attempts an extended read from
a non-primary drive.
The MBR is always at CHS 0-0-1, so there is no reason to use an
extended read, other than the possibility that the BIOS cannot handle
it.
Although this might break as many machines as it fixes (a small number
either way), the current state is a regression but the reverse is not.
Therefore revert to the previous state of not using extended read.
Quite probably the Right Thing to do is to read using plain (CHS) read
and extended read on failure, but that change would definitely have to
go through -mm first.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Add a missing =m constraint to the EDD-probing code, that could have
caused improper dead-code elimination.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Some BIOSes require that sector buffers not cross 64K
boundaries. As a result, we compute a dynamic address on the
setup heap. Unfortunately, this address computation was just
totally wrong.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Probe EDD and MBR signatures, in order to make it easier to map
physical hard drives to BIOS drives.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>