Changeset 48446 in vbox
- Timestamp:
- Sep 12, 2013 11:17:10 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/orgs.asm
r48195 r48446 250 250 251 251 in_real_mode: 252 ;; TODO: This looks very iffy - we shouldn't mess with any 253 ;; hardware until after we've established that cold boot 254 ;; needs to be done. 252 ;; TODO: Check KBC system flag first 253 254 ;; read the CMOS shutdown status 255 mov al, 0Fh 256 out CMOS_ADDR, al 257 in al, CMOS_DATA 258 259 ;; save status 260 xchg ah, al 261 262 ;; reset the shutdown status in CMOS 263 mov al, 0Fh 264 out CMOS_ADDR, al 265 mov al, 0 266 out CMOS_DATA, al 267 268 ;; pre-check the shutdown status - shutdown codes 9/A leave 269 ;; the hardware alone 270 mov al, ah 271 cmp al, 09h 272 jz check_shutdown 273 cmp al, 0Ah 274 jz check_shutdown 255 275 256 xor a x, ax276 xor al, al 257 277 258 278 ;; reset the DMA controllers … … 266 286 out 0D4h, al ; unmask channel 4 267 287 268 ;; read the CMOS shutdown status 269 mov al, 0Fh 270 out CMOS_ADDR, al 271 in al, CMOS_DATA 272 273 ;; save status 274 mov bl, al 275 276 ;; reset the shutdown status in CMOS 277 mov al, 0Fh 278 out CMOS_ADDR, al 279 mov al, 0 280 out CMOS_DATA, al 281 288 check_shutdown: 282 289 ;; examine the shutdown status code 283 mov al, bl290 mov al, ah 284 291 cmp al, 0 285 292 jz normal_post 293 286 294 cmp al, 0Dh 287 295 jae normal_post 288 296 cmp al, 9 289 je normal_post ;; TODO: really?! 297 jne check_next_std 298 jmp return_blkmove 299 check_next_std: 290 300 291 301 ;; 05h = EOI + jump through 40:67 … … 482 492 call rom_scan 483 493 484 C_SETUP 485 ;; ATA/ATAPI driver setup 486 call _ata_init 487 call _ata_detect 488 489 ifdef VBOX_WITH_AHCI 490 ; AHCI driver setup 491 call _ahci_init 492 endif 493 494 ifdef VBOX_WITH_SCSI 495 ; SCSI driver setup 496 call _scsi_init 497 endif 498 499 ;; floppy setup 500 call floppy_post 501 502 ;; hard drive setup 503 call hard_drive_post 504 505 C_SETUP ; in case assembly code changed things 506 call _print_bios_banner 507 508 ;; El Torito floppy/hard disk emulation 509 call _cdemu_init 510 511 ; TODO: what's the point of enabling interrupts here?? 512 sti ; enable interrupts 513 int 19h 514 ;; does not return here 515 sti 516 wait_forever: 517 hlt 518 jmp wait_forever 519 cli 520 hlt 494 jmp norm_post_cont 521 495 522 496 … … 561 535 hard_drive_post endp 562 536 537 538 norm_post_cont: 539 C_SETUP 540 ;; ATA/ATAPI driver setup 541 call _ata_init 542 call _ata_detect 543 544 ifdef VBOX_WITH_AHCI 545 ; AHCI driver setup 546 call _ahci_init 547 endif 548 549 ifdef VBOX_WITH_SCSI 550 ; SCSI driver setup 551 call _scsi_init 552 endif 553 554 ;; floppy setup 555 call floppy_post 556 557 ;; hard drive setup 558 call hard_drive_post 559 560 C_SETUP ; in case assembly code changed things 561 call _print_bios_banner 562 563 ;; El Torito floppy/hard disk emulation 564 call _cdemu_init 565 566 ; TODO: what's the point of enabling interrupts here?? 567 sti ; enable interrupts 568 int 19h 569 ;; does not return here 570 sti 571 wait_forever: 572 hlt 573 jmp wait_forever 574 cli 575 hlt 576 577 578 ;; 579 ;; Return from block move (shutdown code 09h). Care must be taken to disturb 580 ;; register and memory state as little as possible. 581 ;; 582 return_blkmove: 583 mov ax, 40h 584 mov ds, ax 585 ;; restore user stack 586 mov ss, ds:[69h] 587 mov sp, ds:[67h] 588 ;; reset A20 gate 589 in al, 92h 590 and al, 0FDh 591 out 92h, al 592 ;; ensure proper real mode IDT 593 lidt fword ptr cs:_rmode_IDT 594 ;; restore user segments 595 pop ds 596 pop es 597 ;; set up BP 598 mov bp, sp 599 ;; restore status code 600 in al, 80h 601 mov [bp+15], al 602 ;; set ZF/CF 603 cmp ah,al ; AH is zero here! 604 ;; restore registers and return 605 popa 606 sti 607 retf 2 608 563 609 564 610 ;; --------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.