vgabios: Add debug message if x86emu leal check triggers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
edd: Move EDD get drive parameters (int 1348) logic from disk.c to block.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
edd: Use sectors==-1 to detect removable media.

Don't look for DTYPE_ATA_ATAPI to determine if a removable media (such
as a cdrom) is present, instead look for a -1 in the sector count.
This improves the results for cdroms on controllers other than ATA
ATAPI.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
edd: Separate out ATA and virtio specific parts of fill_edd().

This also changes DTYPE_VIRTIO_SCSI drives to report that they are
using a "SCSI" bus instead of an "ATA" bus - it was obviously
incorrect before.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
cdemu: store internal cdemu fields in standard "el-torito" spec format.

Store the fields necessary to export the "el-torito" spec information
directly in an internal copy of the "el-torito" struct.  This
simplifies the interface and obviates the need for an internal home
grown struct with the same info.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move cdemu call interface and disk_ret helper code to disk.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Run all hard drive ops in 32 bit.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Run keyboard and mouse commands always in 32bit mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Run all hardware interrupt handlers in 32bit mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
smm: Replace SMI assembler code with C code.

Convert the SMI handler from assembly to C.  This makes the handler
easier to understand and enhance.

The new handler will use references to the reserved memory at
0xf0000-0x100000.  If the physical memory in that range is modified at
runtime, then the SMI handler will cease to function properly (and may
allow unintended code to run in SMM mode).  However, that area is
marked as reserved and is normally made read-only at runtime, so there
is little risk in relying on it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Implement call32 mechanism using SMIs.

This is a work in progress.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
smp: Replace QEMU SMP init assembler code with C; run only in 32bit mode.

Change the multi-processor init code to trampoline into 32bit mode on
each of the additional processors.  Implement an atomic lock so that
each processor performs its initialization serially.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>