summaryrefslogtreecommitdiffstats
path: root/sys/compat/x86bios
Commit message (Collapse)AuthorAgeFilesLines
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+2
| | | | | | 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.
* Remove custom interrupt dispatcher. This is a pointless micro-optimizationjkim2011-03-091-23/+0
| | | | | | and it may cause problems if SS and SP are modified by real-mode code. MFC after: 1 month
* Prefer pmap_unmapbios() over pmap_unmapdev(). The binary does not changejkim2010-10-051-1/+1
| | | | after this because pmap_unmapbios() is a macro for pmap_unmapdev() on amd64.
* Add x86bios_set_intr() to set interrupt vectors for real mode and simplifyjkim2010-08-252-3/+15
| | | | x86bios_get_intr() a little.
* Check opcode for short jump as well. Some option ROMs do short jumpsjkim2010-08-251-1/+2
| | | | | | | (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
* Place spinlock_enter() and spinlock_exit() just around X86EMU calls.jkim2010-08-101-4/+4
|
* Tidy up locking and memory allocation for the real mode emulator wrapper.jkim2010-08-101-36/+26
| | | | | | | 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().
* Tidy up printf() calls for debugging.jkim2010-08-091-46/+30
|
* Initialize a variable just before its use.jkim2010-08-091-1/+1
|
* Reduce diffs between VM86 and X86EMU wrappers for x86bios_alloc() andjkim2010-08-091-23/+29
| | | | | x86bios_free(). Add strict sanity checks for VM86 wrapper and add strict page table locking for X86EMU wrapper.
* Do not block any I/O port on amd64.jkim2010-08-071-4/+8
|
* Optimize interrupt vector lookup. There is no need to check the page table.jkim2010-08-071-1/+1
|
* Consistently use architecture specific macros.jkim2010-08-061-3/+3
|
* Fix allocation of multiple pages, which forgot to increase page number.jkim2010-08-061-1/+5
| | | | | Particularly, it caused "vm86_addpage: overlap" panics under VirtualBox. Add a safety check before freeing memory while I am here.
* Re-add flag register for output. Some BIOS calls actually use it to returnjkim2010-08-051-0/+1
| | | | success/failure status. Oops.
* Do not copy stack pointer and flags. These registers are unconditionallyjkim2010-08-051-6/+0
| | | | destroyed from vm86_prepcall().
* Implement a simple native VM86 backend for X86BIOS. Now i386 uses nativejkim2010-08-052-76/+266
| | | | | | | | | | | | | 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
* Let x86bios_alloc() pass contigmalloc(9) flags. Use it to set M_WAITOKjkim2010-06-232-3/+3
| | | | | from VESA BIOS initialization. All other malloc(9) uses in the function is blocking any way.
* Reduce MD code further. At least, it compiles on ia64 now (but it is notjkim2010-05-011-36/+78
| | | | connected to build). The idea/code was shamelessly taken from r207329.
* Do not initialize mutex and return error if it cannot map memory.jkim2010-05-011-13/+13
|
* Revert accidentally committed initial real mode %sp change of r205347.jkim2010-03-251-2/+0
| | | | | Note I am keeping %ds change because X.org int10 handler does it and it seems reasonable.
* Optimize real mode page table lookup.jkim2010-03-251-5/+4
|
* Fix stupid typos. Some VESA BIOSes directly call BIOS interrupt handlersjkim2010-03-251-2/+2
| | | | | | | | | 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
* Support memory wraparound instead of high memory as VM86 mode does.jkim2010-03-221-14/+4
| | | | Suggested by: delphij
* Fix i386 PAE kernel build.jkim2010-03-221-1/+1
| | | | Reported by: tinderbox
* - Map EBDA if available and add 64KB above 1MB (high memory), just in case.jkim2010-03-191-33/+113
| | | | | | | - 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. ;-)
* Detect illegal access to unmapped memory within real mode emulator to aidjkim2010-03-181-9/+44
| | | | debugging. Update copyright date while I am here.
* Add two new debugging tunables for x86bios instead of abusing bootverbose,jkim2009-12-151-4/+15
| | | | i.e., debug.x86bios.call and debug.x86bios.int.
* Fix a copy-and-pasto in the previous commit.jkim2009-10-191-1/+1
|
* Rewrite x86bios and update its dependent drivers.jkim2009-10-193-169/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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).
* Use a 2 clause BSD-style license instead of stating the code as publicdelphij2009-09-282-4/+49
| | | | domain, as requested by core@ and reviewed by the author.
* - Reduce BIOS memory mapping. We want 1MB of physical memory, not 12MB[1].jkim2009-09-252-14/+12
| | | | | | | - 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)
* Dump real mode registers under bootverbose to help debugging BIOS emulator.jkim2009-09-241-0/+10
|
* - Use FreeBSD function naming convention.jkim2009-09-243-10/+10
| | | | | | | - Change x86biosCall() to more appropriate x86bios_intr().[1] Discussed with: delphij, paradox (ddkprog yahoo com) Submitted by: paradox (ddkprog yahoo com)[1]
* Move sys/dev/x86bios to sys/compat/x86bios.jkim2009-09-233-0/+403
It may not be optimal but it is clearly better than the old place. OK'ed by: delphij, paradox (ddkprog yahoo com)
OpenPOWER on IntegriCloud