Changeset 45669 in vbox for trunk/src/VBox
- Timestamp:
- Apr 22, 2013 3:37:42 PM (12 years ago)
- Location:
- trunk/src/VBox/Devices/PC/BIOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/orgs.asm
r44107 r45669 1552 1552 cmp ah, 0E8h 1553 1553 je int15_handler32 1554 cmp ah, 0d0h 1555 je int15_handler32 1554 1556 pusha 1555 1557 cmp ah, 53h ; APM function? -
trunk/src/VBox/Devices/PC/BIOS/system.c
r44528 r45669 192 192 "retf" \ 193 193 parm [ax] modify nomemory aborts; 194 194 195 195 // @todo: This method is silly. The RTC should be programmed to fire an interrupt 196 196 // instead of hogging the CPU with inaccurate code. … … 224 224 { 225 225 uint8_t oldval; 226 226 227 227 // Use PS/2 System Control port A to set A20 enable 228 228 229 229 // get current setting first 230 230 oldval = inb(0x92); 231 231 232 232 // change A20 status 233 233 if (val) … … 235 235 else 236 236 outb(0x92, oldval & 0xfd); 237 237 238 238 return((oldval & 0x02) != 0); 239 239 } … … 276 276 #define ECX r.gr.u.r32.ecx 277 277 #define EDX r.gr.u.r32.edx 278 #define ESI r.gr.u.r32.esi 279 #define EDI r.gr.u.r32.edi 278 280 #define ES r.es 279 281 … … 386 388 SET_AL(GET_AL() - 1); 387 389 } 388 390 389 391 break; 390 392 } … … 397 399 // +++ should probably have descriptor checks 398 400 // +++ should have exception handlers 399 401 400 402 // turn off interrupts 401 403 int_disable(); //@todo: aren't they disabled already? 402 404 403 405 prev_a20_enable = set_enable_a20(1); // enable A20 line 404 406 405 407 // 128K max of transfer on 386+ ??? 406 408 // source == destination ??? 407 409 408 410 // ES:SI points to descriptor table 409 411 // offset use initially comments … … 415 417 // 20..27 CS zeros filled in by BIOS 416 418 // 28..2f SS zeros filled in by BIOS 417 419 418 420 //es:si 419 421 //eeee0 420 422 //0ssss 421 423 //----- 422 424 423 425 // check for access rights of source & dest here 424 426 425 427 // Initialize GDT descriptor 426 428 base15_00 = (ES << 4) + SI; … … 433 435 write_byte(ES, SI+0x08+5, 0x93); // access 434 436 write_word(ES, SI+0x08+6, 0x0000); // base 31:24/reserved/limit 19:16 435 437 436 438 // Initialize CS descriptor 437 439 write_word(ES, SI+0x20+0, 0xffff);// limit 15:00 = normal 64K limit … … 440 442 write_byte(ES, SI+0x20+5, 0x9b); // access 441 443 write_word(ES, SI+0x20+6, 0x0000);// base 31:24/reserved/limit 19:16 442 444 443 445 // Initialize SS descriptor 444 446 ss = read_ss(); … … 450 452 write_byte(ES, SI+0x28+5, 0x93); // access 451 453 write_word(ES, SI+0x28+6, 0x0000); // base 31:24/reserved/limit 19:16 452 454 453 455 pm_stack_save(CX, ES, SI); 454 456 pm_enter(); … … 456 458 pm_exit(); 457 459 pm_stack_restore(); 458 460 459 461 set_enable_a20(prev_a20_enable); 460 462 461 463 // turn interrupts back on 462 464 int_enable(); 463 465 464 466 SET_AH(0); 465 467 CLEAR_CF(); … … 473 475 #else 474 476 AX = (inb_cmos(0x31) << 8) | inb_cmos(0x30); 475 477 476 478 // According to Ralf Brown's interrupt the limit should be 15M, 477 479 // but real machines mostly return max. 63M. 478 480 if(AX > 0xffc0) 479 481 AX = 0xffc0; 480 482 481 483 CLEAR_CF(); 482 484 #endif … … 488 490 // BH/BL contains starting interrupt numbers for PIC0/PIC1 489 491 // This subfunction does not return! 490 492 491 493 // turn off interrupts 492 494 int_disable(); //@todo: aren't they off already? 493 495 494 496 set_enable_a20(1); // enable A20 line; we're supposed to fail if that fails 495 497 496 498 // Initialize CS descriptor for BIOS 497 499 write_word(ES, SI+0x38+0, 0xffff);// limit 15:00 = normal 64K limit … … 592 594 timer_wait(DX, CX); 593 595 break; 594 596 597 case 0xd0: 598 if (GET_AL() != 0x4f) 599 goto int15_unimplemented; 600 if (EBX == 0x50524f43 && ECX == 0x4d4f4445 && ESI == 0 && EDI == 0) 601 { 602 CLEAR_CF(); 603 ESI = EBX; 604 EDI = ECX; 605 EAX = 0x49413332; 606 } 607 else 608 goto int15_unimplemented; 609 break; 610 595 611 case 0xe8: 596 612 switch(GET_AL()) { … … 766 782 // do we have any reason to fail here ? 767 783 CLEAR_CF(); 768 784 769 785 // my real system sets ax and bx to 0 770 786 // this is confirmed by Ralph Brown list … … 773 789 // regs.u.r16.ax = 0; 774 790 // regs.u.r16.bx = 0; 775 791 776 792 // Get the amount of extended memory (above 1M) 777 793 CX = (inb_cmos(0x31) << 8) | inb_cmos(0x30); 778 794 779 795 // limit to 15M 780 796 if(CX > 0x3c00) 781 797 CX = 0x3c00; 782 798 783 799 // Get the amount of extended memory above 16M in 64k blocks 784 800 DX = (inb_cmos(0x35) << 8) | inb_cmos(0x34); 785 801 786 802 // Set configured memory equal to extended memory 787 803 AX = CX;
Note:
See TracChangeset
for help on using the changeset viewer.