History log of /freebsd-9.3-release/sys/compat/x86bios/
Revision Date Author Comments
267654 20-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


248085 09-Mar-2013 marius

MFC: r227309 (partial)

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


225736 23-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


219430 09-Mar-2011 jkim

Remove custom interrupt dispatcher. This is a pointless micro-optimization
and it may cause problems if SS and SP are modified by real-mode code.

MFC after: 1 month


213458 05-Oct-2010 jkim

Prefer pmap_unmapbios() over pmap_unmapdev(). The binary does not change
after this because pmap_unmapbios() is a macro for pmap_unmapdev() on amd64.


211824 25-Aug-2010 jkim

Add x86bios_set_intr() to set interrupt vectors for real mode and simplify
x86bios_get_intr() a little.


211823 25-Aug-2010 jkim

Check opcode for short jump as well. Some option ROMs do short jumps
(e.g., some NVIDIA video cards) and we were not able to do POST while
resuming because we only honored long jump.

MFC after: 3 days


211148 10-Aug-2010 jkim

Place spinlock_enter() and spinlock_exit() just around X86EMU calls.


211131 10-Aug-2010 jkim

Tidy up locking and memory allocation for the real mode emulator wrapper.
Now we use a regular mutex instead of a spin mutex. When we enter and exit
the emulator, spinlock_enter() and spinlock_exit() are additionally used.
Move some page table related stuff from x86bios_init() and x86bios_uninit()
to x86bios_map_mem() and x86bios_unmap_mem().


211120 09-Aug-2010 jkim

Tidy up printf() calls for debugging.


211114 09-Aug-2010 jkim

Initialize a variable just before its use.


211112 09-Aug-2010 jkim

Reduce diffs between VM86 and X86EMU wrappers for x86bios_alloc() and
x86bios_free(). Add strict sanity checks for VM86 wrapper and add strict
page table locking for X86EMU wrapper.


210993 07-Aug-2010 jkim

Do not block any I/O port on amd64.


210992 07-Aug-2010 jkim

Optimize interrupt vector lookup. There is no need to check the page table.


210938 06-Aug-2010 jkim

Consistently use architecture specific macros.


210934 06-Aug-2010 jkim

Fix allocation of multiple pages, which forgot to increase page number.
Particularly, it caused "vm86_addpage: overlap" panics under VirtualBox.
Add a safety check before freeing memory while I am here.


210887 05-Aug-2010 jkim

Re-add flag register for output. Some BIOS calls actually use it to return
success/failure status. Oops.


210885 05-Aug-2010 jkim

Do not copy stack pointer and flags. These registers are unconditionally
destroyed from vm86_prepcall().


210877 05-Aug-2010 jkim

Implement a simple native VM86 backend for X86BIOS. Now i386 uses native
VM86 calls instead of the real mode emulator as a backend. VM86 has been
proven reliable for very long time and it is actually few times faster than
emulation. Increase maximum number of page table entries per VM86 context
from 3 to 8 pages. It was (ridiculously) low and insufficient for new VM86
backend, which shares one context globally. Slighly rearrange and clean up
the emulator backend to accommodate new code. The only visible change here
is stack size, which is decreased from 64K to 4K bytes to sync. with VM86.
Actually, it seems there is no need for big stack in real mode.

MFC after: 1 month


209472 23-Jun-2010 jkim

Let x86bios_alloc() pass contigmalloc(9) flags. Use it to set M_WAITOK
from VESA BIOS initialization. All other malloc(9) uses in the function is
blocking any way.


207456 01-May-2010 jkim

Reduce MD code further. At least, it compiles on ia64 now (but it is not
connected to build). The idea/code was shamelessly taken from r207329.


207454 01-May-2010 jkim

Do not initialize mutex and return error if it cannot map memory.


205650 25-Mar-2010 jkim

Revert accidentally committed initial real mode %sp change of r205347.
Note I am keeping %ds change because X.org int10 handler does it and
it seems reasonable.


205649 25-Mar-2010 jkim

Optimize real mode page table lookup.


205647 25-Mar-2010 jkim

Fix stupid typos. Some VESA BIOSes directly call BIOS interrupt handlers
within the VBE interrupt handler. Unfortunately it was causing real mode
page faults because we were fetching instructions from bogus addresses.
Pass me the pointyhat, please.

PR: kern/144654
MFC after: 3 days


205455 22-Mar-2010 jkim

Support memory wraparound instead of high memory as VM86 mode does.

Suggested by: delphij


205452 22-Mar-2010 jkim

Fix i386 PAE kernel build.

Reported by: tinderbox


205347 19-Mar-2010 jkim

- Map EBDA if available and add 64KB above 1MB (high memory), just in case.
- Print the initial memory map when bootverbose is set.
- Change the page fault address format from linear to %cs:%ip style.
- Move duplicate code into a newly added function.
- Add strictly aligned memory access for distant future. ;-)


205297 18-Mar-2010 jkim

Detect illegal access to unmapped memory within real mode emulator to aid
debugging. Update copyright date while I am here.


200591 15-Dec-2009 jkim

Add two new debugging tunables for x86bios instead of abusing bootverbose,
i.e., debug.x86bios.call and debug.x86bios.int.


198252 19-Oct-2009 jkim

Fix a copy-and-pasto in the previous commit.


198251 19-Oct-2009 jkim

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).


197571 28-Sep-2009 delphij

Use a 2 clause BSD-style license instead of stating the code as public
domain, as requested by core@ and reviewed by the author.


197493 25-Sep-2009 jkim

- Reduce BIOS memory mapping. We want 1MB of physical memory, not 12MB[1].
- Remove CS and IP registers from x86bios.h. They have no use for us.
- Adjust register dump to make it little bit more useful for debugging.

Submitted by: paradox (ddkprog yahoo com)[1] (initial version)


197475 24-Sep-2009 jkim

Dump real mode registers under bootverbose to help debugging BIOS emulator.


197466 24-Sep-2009 jkim

- Use FreeBSD function naming convention.
- Change x86biosCall() to more appropriate x86bios_intr().[1]

Discussed with: delphij, paradox (ddkprog yahoo com)
Submitted by: paradox (ddkprog yahoo com)[1]


197444 23-Sep-2009 jkim

Move sys/dev/x86bios to sys/compat/x86bios.

It may not be optimal but it is clearly better than the old place.

OK'ed by: delphij, paradox (ddkprog yahoo com)


197442 23-Sep-2009 jkim

- Use spin lock instead of default mutex for safety. INT/IRET instructions
save/clear/restore flags but emulated flags have no effect on the host.
I believe BIOS writers never meant to run their code in emulated
environment with interrupt enabled. :-)
- Use memcpy(3) instead of copying individual members. I believe struct
x86regs was intentionally copied from the first half of struct x86emu_regs
for this very purpose.
- Fix some style nits and consistencies.

Reviewed by: delphij, paradox (ddkprog yahoo com)


197388 21-Sep-2009 delphij

To be safe, make this module initialize earlier by specifying SI_SUB_CPU
instead of SI_SUB_KLD. Note that we don't believe that there is any
consumers of x86bios that would be triggered in the early stage of boot,
so this is more or less just a safebelt.

Submitted by: swell.k at gmail.com


197387 21-Sep-2009 delphij

Style(9) fixes.

Submitted by: swell.k at gmail.com


197383 21-Sep-2009 delphij

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>