~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Devices/PC/BIOS/rombios.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10039
10039
pci_real_f02: ;; find pci device
10040
10040
  push esi
10041
10041
  push edi
 
10042
  push edx
10042
10043
  cmp al, #0x02
10043
10044
  jne pci_real_f03
10044
10045
  shl ecx, #16
10081
10082
  inc ebx
10082
10083
  cmp ebx, #0x10000
10083
10084
  jne pci_real_devloop2
10084
 
  mov dx, cx
10085
 
  shr ecx, #16
10086
10085
  mov ax, #0x8603
10087
10086
  jmp pci_real_fail
10088
10087
pci_real_f08: ;; read configuration byte
10196
10195
pci_real_unknown:
10197
10196
  mov ah, #0x81
10198
10197
pci_real_fail:
 
10198
  pop edx
10199
10199
  pop edi
10200
10200
  pop esi
10201
10201
  stc
10202
10202
  ret
10203
10203
pci_real_ok:
10204
10204
  xor ah, ah
 
10205
  pop edx
10205
10206
  pop edi
10206
10207
  pop esi
10207
10208
  clc
10208
10209
  ret
10209
10210
 
 
10211
;; prepare from reading the PCI config space; on input:
 
10212
;; bx = bus/dev/fn
 
10213
;; di = offset into config space header
 
10214
;; destroys eax and may modify di
10210
10215
pci_real_select_reg:
10211
10216
  push dx
10212
10217
  mov eax, #0x800000
11135
11140
  mov  ds, ax
11136
11141
  ret
11137
11142
 
 
11143
#define LVT0    0xFEE00350
 
11144
#define LVT1    0xFEE00360
 
11145
 
 
11146
;; Program LVT0/LVT1 entries in the local APIC. Some Linux kernels (e.g., RHEL4
 
11147
;; SMP 32-bit) expect the entries to be unmasked in virtual wire mode.
 
11148
 
 
11149
setup_lapic:
 
11150
  pushf
 
11151
  cli               ;; Interrupts would kill us!
 
11152
  call pmode_enter
 
11153
  mov  esi, #LVT0   ;; Program LVT0 to ExtINT and unmask
 
11154
  mov  eax, [esi]
 
11155
  and  eax, #0xfffe00ff
 
11156
  or   ah,  #0x07
 
11157
  mov  [esi], eax
 
11158
  mov  esi, #LVT1   ;; Program LVT1 to NMI and unmask
 
11159
  mov  eax, [esi]
 
11160
  and  eax, #0xfffe00ff
 
11161
  or   ah,  #0x04
 
11162
  mov  [esi], eax
 
11163
  call pmode_exit
 
11164
  popf
 
11165
  ret
 
11166
 
 
11167
;; Enter and exit minimal protected-mode environment. May only be called from
 
11168
;; the F000 segment (16-bit). Does not switch stacks. Must be run with disabled
 
11169
;; interrupts(!). On return from pmode_enter, DS contains a selector which can
 
11170
;;  address the entire 4GB address space.
 
11171
 
 
11172
pmode_enter:
 
11173
  push cs
 
11174
  pop  ds
 
11175
  lgdt [pmbios_gdt_desc]
 
11176
  mov  eax, cr0
 
11177
  or   al, #0x1
 
11178
  mov  cr0, eax
 
11179
  JMP_AP(0x20, really_enter_pm)
 
11180
really_enter_pm:
 
11181
  mov  ax, #0x18
 
11182
  mov  ds, ax
 
11183
  ret
 
11184
 
 
11185
pmode_exit:
 
11186
  mov  eax, cr0
 
11187
  and  al, #0xfe
 
11188
  mov  cr0, eax
 
11189
  JMP_AP(0xF000, really_exit_pm)
 
11190
really_exit_pm:
 
11191
  ret
 
11192
 
 
11193
pmbios_gdt_desc:
 
11194
  dw 0x30
 
11195
  dw pmbios_gdt
 
11196
  dw 0x000f
 
11197
 
 
11198
pmbios_gdt:
 
11199
  dw 0, 0, 0, 0
 
11200
  dw 0, 0, 0, 0
 
11201
  dw 0xffff, 0, 0x9b00, 0x00cf ; 32 bit flat code segment (0x10)
 
11202
  dw 0xffff, 0, 0x9300, 0x00cf ; 32 bit flat data segment (0x18)
 
11203
  dw 0xffff, 0, 0x9b0f, 0x0000 ; 16 bit code segment base=0xf0000 limit=0xffff
 
11204
  dw 0xffff, 0, 0x9300, 0x0000 ; 16 bit data segment base=0x0 limit=0xffff
 
11205
 
11138
11206
;; for 'C' strings and other data, insert them here with
11139
11207
;; a the following hack:
11140
11208
;; DATA_SEG_DEFS_HERE
11194
11262
  cmp al, #0x05
11195
11263
  je  eoi_jmp_post
11196
11264
 
 
11265
#ifdef VBOX
 
11266
  ;; just ignore all other CMOS shutdown status values (OpenSolaris sets it to 0xA for some reason in certain cases)
 
11267
  ;; (shutdown_status_panic just crashes the VM as it calls int 0x10 before the IDT table has been initialized)
 
11268
  jmp normal_post
 
11269
#else
11197
11270
  ;; Examine CMOS shutdown status.
11198
11271
  ;;  0x01,0x02,0x03,0x04,0x06,0x07,0x08, 0x0a, 0x0b, 0x0c = Unimplemented shutdown status.
11199
11272
  push bx
11200
11273
  call _shutdown_status_panic
 
11274
#endif
11201
11275
 
11202
11276
#if 0
11203
11277
  HALT(__LINE__)
11463
11537
  call pcibios_init_iomem_bases
11464
11538
  call pcibios_init_irqs
11465
11539
#endif
 
11540
  call setup_lapic
11466
11541
  call rom_scan
11467
11542
 
11468
11543
#if BX_USE_ATADRV