Changeset 4f42d52 in mainline
- Timestamp:
- 2007-05-04T17:35:16Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5c8ba05
- Parents:
- 07bd231e
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/boot/boot.S
r07bd231e r4f42d52 304 304 #define VESA_INFO_SIZE 1024 305 305 306 #define VESA_MODE_ATTRIBUTES_OFFSET 0 306 307 #define VESA_MODE_LIST_PTR_OFFSET 14 308 #define VESA_MODE_SCANLINE_OFFSET 16 307 309 #define VESA_MODE_WIDTH_OFFSET 18 308 310 #define VESA_MODE_HEIGHT_OFFSET 20 309 311 #define VESA_MODE_BPP_OFFSET 25 310 #define VESA_MODE_SCANLINE_OFFSET 16311 312 #define VESA_MODE_PHADDR_OFFSET 40 312 313 … … 318 319 #define VESA_GET_MODE_INFO 0x4f01 319 320 #define VESA_SET_MODE 0x4f02 321 #define VESA_SET_PALETTE 0x4f09 320 322 321 323 #define CONFIG_VESA_BPP_a 255 322 324 323 325 #if CONFIG_VESA_BPP == 24 324 #undef CONFIG_VESA_BPP_a 325 #define CONFIG_VESA_BPP_a 32 326 #define CONFIG_VESA_BPP_VARIANT 32 326 327 #endif 327 328 328 329 mov $VESA_GET_INFO, %ax 329 330 mov $e_vesa_init - vesa_init, %di … … 340 341 341 342 add $VESA_INFO_SIZE, %di 342 343 343 344 1:# Try next mode 344 345 mov %gs:(%si), %cx … … 370 371 mov $CONFIG_VESA_BPP, %al 371 372 cmp VESA_MODE_BPP_OFFSET(%di), %al 373 374 #ifdef CONFIG_VESA_BPP_VARIANT 372 375 jz 2f 373 376 374 mov $CONFIG_VESA_BPP_ a, %al377 mov $CONFIG_VESA_BPP_VARIANT, %al 375 378 cmp VESA_MODE_BPP_OFFSET(%di), %al 379 #endif 376 380 jnz 1b 377 381 … … 387 391 cmp $VESA_OK, %al 388 392 jnz 0f 393 394 #if CONFIG_VESA_BPP == 8 395 396 # Set 3:2:3 VGA palette 397 398 mov VESA_MODE_ATTRIBUTES_OFFSET(%di), %ax 399 push %di 400 mov $vga323 - vesa_init, %di 401 mov $0x100, %ecx 402 403 bt $5, %ax # Test if VGA compatible registers are present 404 jnc vga_compat 405 406 # Try VESA routine to set palette 407 408 mov $VESA_SET_PALETTE, %ax 409 xor %bl, %bl 410 xor %dx, %dx 411 int $0x10 412 413 jmp vga_not_compat 414 415 vga_compat: 416 417 # Try VGA registers to set palette 418 419 movw $0x3c6, %dx # Set palette mask 420 movb $0xff, %al 421 outb %al, %dx 422 423 movw $0x3c8, %dx # First index to set 424 xor %al, %al 425 outb %al, %dx 426 427 movw $0x3c9, %dx # Data port 428 vga_loop: 429 movb %es:2(%di), %al 430 outb %al, %dx 431 432 movb %es:1(%di), %al 433 outb %al, %dx 434 435 movb %es:(%di), %al 436 outb %al, %dx 437 438 addw $4, %di 439 loop vga_loop 440 441 vga_not_compat: 442 443 pop %di 444 445 #endif 389 446 390 447 mov VESA_MODE_PHADDR_OFFSET(%di), %esi … … 428 485 xor %ax, %ax 429 486 jz 8b # Force relative jump 430 487 488 vga323: 489 #include "vga323.pal" 431 490 432 491 .code32 … … 578 637 579 638 long_mode_msg: 580 .asci i "64 bit long mode not supported. System halted.\0"639 .asciz "64 bit long mode not supported. System halted." -
kernel/arch/ia32/src/boot/boot.S
r07bd231e r4f42d52 354 354 #define VESA_INFO_SIZE 1024 355 355 356 #define VESA_MODE_ATTRIBUTES_OFFSET 0 356 357 #define VESA_MODE_LIST_PTR_OFFSET 14 358 #define VESA_MODE_SCANLINE_OFFSET 16 357 359 #define VESA_MODE_WIDTH_OFFSET 18 358 360 #define VESA_MODE_HEIGHT_OFFSET 20 359 361 #define VESA_MODE_BPP_OFFSET 25 360 #define VESA_MODE_SCANLINE_OFFSET 16361 362 #define VESA_MODE_PHADDR_OFFSET 40 362 363 … … 368 369 #define VESA_GET_MODE_INFO 0x4f01 369 370 #define VESA_SET_MODE 0x4f02 370 371 #define CONFIG_VESA_BPP_a 255 371 #define VESA_SET_PALETTE 0x4f09 372 372 373 373 #if CONFIG_VESA_BPP == 24 374 #undef CONFIG_VESA_BPP_a 375 #define CONFIG_VESA_BPP_a 32 374 #define CONFIG_VESA_BPP_VARIANT 32 376 375 #endif 377 376 … … 414 413 jnz 1b 415 414 416 mov $CONFIG_VESA_HEIGHT, %ax415 mov $CONFIG_VESA_HEIGHT, %ax 417 416 cmp VESA_MODE_HEIGHT_OFFSET(%di), %ax 418 417 jnz 1b … … 420 419 mov $CONFIG_VESA_BPP, %al 421 420 cmp VESA_MODE_BPP_OFFSET(%di), %al 421 422 #ifdef CONFIG_VESA_BPP_VARIANT 422 423 jz 2f 423 424 424 mov $CONFIG_VESA_BPP_ a, %al425 mov $CONFIG_VESA_BPP_VARIANT, %al 425 426 cmp VESA_MODE_BPP_OFFSET(%di), %al 427 #endif 426 428 jnz 1b 427 429 428 430 2: 429 431 … … 437 439 cmp $VESA_OK, %al 438 440 jnz 0f 441 442 #if CONFIG_VESA_BPP == 8 443 444 # Set 3:2:3 VGA palette 445 446 mov VESA_MODE_ATTRIBUTES_OFFSET(%di), %ax 447 push %di 448 mov $vga323 - vesa_init, %di 449 mov $0x100, %ecx 450 451 bt $5, %ax # Test if VGA compatible registers are present 452 jnc vga_compat 453 454 # Try VESA routine to set palette 455 456 mov $VESA_SET_PALETTE, %ax 457 xor %bl, %bl 458 xor %dx, %dx 459 int $0x10 460 461 jmp vga_not_compat 462 463 vga_compat: 464 465 # Try VGA registers to set palette 466 467 movw $0x3c6, %dx # Set palette mask 468 movb $0xff, %al 469 outb %al, %dx 470 471 movw $0x3c8, %dx # First index to set 472 xor %al, %al 473 outb %al, %dx 474 475 movw $0x3c9, %dx # Data port 476 vga_loop: 477 movb %es:2(%di), %al 478 outb %al, %dx 479 480 movb %es:1(%di), %al 481 outb %al, %dx 482 483 movb %es:(%di), %al 484 outb %al, %dx 485 486 addw $4, %di 487 loop vga_loop 488 489 vga_not_compat: 490 491 pop %di 492 493 #endif 439 494 440 495 mov VESA_MODE_PHADDR_OFFSET(%di), %esi … … 478 533 xor %ax, %ax 479 534 jz 8b # Force relative jump 480 535 536 vga323: 537 #include "vga323.pal" 481 538 482 539 .code32 … … 510 567 511 568 pse_msg: 512 .asci i "Page Size Extension not supported. System halted.\0"569 .asciz "Page Size Extension not supported. System halted."
Note:
See TracChangeset
for help on using the changeset viewer.