Commit Graph

13 Commits

Author SHA1 Message Date
Xin LI
561524cfb0 Remove prototype of x86emu_init_default.
It's removed in 3219f535d9 (r198251) as part of code refactor.

MFC after:	2 weeks
2022-02-27 15:11:17 -08:00
Jung-uk Kim
33b5cd539e Optimize ROL and ROR emulations and fix comments. 2016-02-18 23:03:37 +00:00
Jung-uk Kim
7de2983dd0 Silence VPS-Studio errors (V646). These is no functional change. 2016-02-18 23:00:01 +00:00
Xin LI
687a306f23 Sync with OpenBSD: Use volatile instead of __volatile__.
MFC after:	2 weeks
2015-04-13 20:23:46 +00:00
Xin LI
91342c6607 Fix decoding of near CALL when address-size prefix (67h) is present.
Submitted by:	Wolf Ramovsky <wolf.ramovsky gmail.com>
		via core (peter)
MFC after:	2 weeks
2014-06-11 20:38:14 +00:00
Xin LI
79d183e85f Fix decoding of LEA when address-size prefix (67h) is present.
This is loosly based on Xorg changeset f57bc0e by Christian
Zander.

Submitted by:	Wolf Ramovsky <wolf.ramovsky gmail.com>
		via core (peter)
MFC after:	2 weeks
2014-06-11 20:31:41 +00:00
Xin LI
5097605520 Fix decoding of MOVSX.
Submitted by:	Wolf Ramovsky <wolf.ramovsky gmail.com>
		via core (peter)
MFC after:	2 weeks
2014-06-11 20:22:14 +00:00
Xin LI
06325fe0dc Integrate OpenBSD rev 1.5 of x86emu.c. 2010-03-09 22:42:24 +00:00
Jung-uk Kim
3219f535d9 Rewrite x86bios and update its dependent drivers.
- Do not map entire real mode memory (1MB).  Instead, we map IVT/BDA and
ROM area separately.  Most notably, ROM area is mapped as device memory
(uncacheable) as it should be.  User memory is dynamically allocated and
free'ed with contigmalloc(9) and contigfree(9).  Remove now redundant and
potentially dangerous x86bios_alloc.c.  If this emulator ever grows to
support non-PC hardware, we may implement it with rman(9) later.
- Move all host-specific initializations from x86emu_util.c to x86bios.c and
remove now unnecessary x86emu_util.c.  Currently, non-PC hardware is not
supported.  We may use bus_space(9) later when the KPI is fixed.
- Replace all bzero() calls for emulated registers with more obviously named
x86bios_init_regs().  This function also initializes DS and SS properly.
- Add x86bios_get_intr().  This function checks if the interrupt vector is
available for the platform.  It is not necessary for PC-compatible hardware
but it may be needed later. ;-)
- Do not try turning off monitor if DPMS does not support the state.
- Allocate stable memory for VESA OEM strings instead of just holding
pointers to them.  They may or may not be accessible always.  Fix a memory
leak of video mode table while I am here.
- Add (experimental) BIOS POST call for vesa(4).  This function calls VGA
BIOS POST code from the current VGA option ROM.  Some video controllers
cannot save and restore the state properly even if it is claimed to be
supported.  Usually the symptom is blank display after resuming from suspend
state.  If the video mode does not match the previous mode after restoring,
we try BIOS POST and force the known good initial state.  Some magic was
taken from NetBSD (and it was taken from vbetool, I believe.)
- Add a loader tunable for vgapci(4) to give a hint to dpms(4) and vesa(4)
to identify who owns the VESA BIOS.  This is very useful for multi-display
adapter setup.  By default, the POST video controller is automatically
probed and the tunable "hw.pci.default_vgapci_unit" is set to corresponding
vgapci unit number.  You may override it from loader but it is very unlikely
to be necessary.  Unfortunately only AGP/PCI/PCI-E controllers can be
matched because ISA controller does not have necessary device IDs.
- Fix a long standing bug in state save/restore function.  The state buffer
pointer should be ES:BX, not ES:DI according to VBE 3.0.  If it ever worked,
that's because BX was always zero. :-)
- Clean up register initializations more clearer per VBE 3.0.
- Fix a lot of style issues with vesa(4).
2009-10-19 20:58:10 +00:00
Xin LI
0a2e9846fd Use __FBSDID to embed RCS ID. 2009-09-21 08:37:57 +00:00
Xin LI
205d67b00d Collapase interrupt supporting functions to a new module, and switch from
x86emu to this new module.

This changeset also brings a fix for bugs introduced with the initial
x86emu commit, which prevents the user from using some display mode or
cause instant reboots during mode switch.

Submitted by:	paradox <ddkprog yahoo com>
2009-09-21 08:17:57 +00:00
Xin LI
efba048eb5 - Port x86emu to FreeBSD.
- Connect x86emu to build.

Tested with:	make universe
Submitted by:	swell.k at gmail com
2009-09-09 05:53:26 +00:00
Xin LI
884e6d6087 Import x86emu from OpenBSD as of OPENBSD_4_6. 2009-09-09 01:19:26 +00:00