Rev 2455 | Rev 3274 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2455 | Rev 2466 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | ;; KolibriOS 16-bit loader, ;; |
9 | ;; KolibriOS 16-bit loader, ;; |
10 | ;; based on bootcode for MenuetOS ;; |
10 | ;; based on bootcode for MenuetOS ;; |
11 | ;; ;; |
11 | ;; ;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 13... | Line 13... | ||
13 | 13 | ||
Line 14... | Line 14... | ||
14 | $Revision: 2455 $ |
14 | $Revision: 2466 $ |
15 | 15 | ||
16 | 16 | ||
Line 385... | Line 385... | ||
385 | ; set up esp |
385 | ; set up esp |
386 | movzx esp, sp |
386 | movzx esp, sp |
Line 387... | Line 387... | ||
387 | 387 | ||
388 | push 0 |
388 | push 0 |
389 | pop es |
389 | pop es |
390 | and word [es:0x9031], 0 |
390 | and word [es:BOOT_IDE_BASE_ADDR], 0 |
391 | ; \begin{Mario79} |
391 | ; \begin{Mario79} |
392 | ; find HDD IDE DMA PCI device |
392 | ; find HDD IDE DMA PCI device |
393 | ; check for PCI BIOS |
393 | ; check for PCI BIOS |
394 | mov ax, 0xB101 |
394 | mov ax, 0xB101 |
Line 422... | Line 422... | ||
422 | mov ax, 0xB10A |
422 | mov ax, 0xB10A |
423 | mov di, 0x20 ; memory base is config register at 0x20 |
423 | mov di, 0x20 ; memory base is config register at 0x20 |
424 | int 0x1A |
424 | int 0x1A |
425 | jc .nopci |
425 | jc .nopci |
426 | and cx, 0xFFF0 ; clear address decode type |
426 | and cx, 0xFFF0 ; clear address decode type |
427 | mov [es:0x9031], cx |
427 | mov [es:BOOT_IDE_BASE_ADDR], cx |
428 | .nopci: |
428 | .nopci: |
429 | ; \end{Mario79} |
429 | ; \end{Mario79} |
Line 430... | Line 430... | ||
430 | 430 | ||
431 | mov al, 0xf6 ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå |
431 | mov al, 0xf6 ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå |
Line 454... | Line 454... | ||
454 | in al, 64h |
454 | in al, 64h |
455 | test al, 2 |
455 | test al, 2 |
456 | loopnz @b |
456 | loopnz @b |
457 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
457 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
458 | ; --------------- APM --------------------- |
458 | ; --------------- APM --------------------- |
459 | and word [es:0x9044], 0 ; ver = 0.0 (APM not found) |
459 | and word [es:BOOT_APM_VERSION], 0 ; ver = 0.0 (APM not found) |
460 | mov ax, 0x5300 |
460 | mov ax, 0x5300 |
461 | xor bx, bx |
461 | xor bx, bx |
462 | int 0x15 |
462 | int 0x15 |
463 | jc apm_end ; APM not found |
463 | jc apm_end ; APM not found |
464 | test cx, 2 |
464 | test cx, 2 |
465 | jz apm_end ; APM 32-bit protected-mode interface not supported |
465 | jz apm_end ; APM 32-bit protected-mode interface not supported |
466 | mov [es:0x9044], ax ; Save APM Version |
466 | mov [es:BOOT_APM_VERSION], ax ; Save APM Version |
467 | mov [es:0x9046], cx ; Save APM flags |
467 | mov [es:BOOT_APM_FLAGS], cx ; Save APM flags |
Line 468... | Line 468... | ||
468 | 468 | ||
469 | ; Write APM ver ---- |
469 | ; Write APM ver ---- |
470 | and ax, 0xf0f |
470 | and ax, 0xf0f |
471 | add ax, '00' |
471 | add ax, '00' |
Line 481... | Line 481... | ||
481 | int 0x15 |
481 | int 0x15 |
482 | mov ax, 0x5303 ; Connect 32 bit mode interface |
482 | mov ax, 0x5303 ; Connect 32 bit mode interface |
483 | xor bx, bx |
483 | xor bx, bx |
484 | int 0x15 |
484 | int 0x15 |
Line 485... | Line 485... | ||
485 | 485 | ||
486 | mov [es:0x9040], ebx |
486 | mov [es:BOOT_APM_ENTRY], ebx |
487 | mov [es:0x9050], ax |
487 | mov [es:BOOT_APM_CODE_32], ax |
488 | mov [es:0x9052], cx |
488 | mov [es:BOOT_APM_CODE_16], cx |
Line 489... | Line 489... | ||
489 | mov [es:0x9054], dx |
489 | mov [es:BOOT_APM_DATA_16], dx |
490 | 490 | ||
Line 491... | Line 491... | ||
491 | apm_end: |
491 | apm_end: |
Line 945... | Line 945... | ||
945 | 945 | ||
Line 946... | Line 946... | ||
946 | call set_vmode |
946 | call set_vmode |
947 | 947 | ||
948 | ; GRAPHICS ACCELERATION |
948 | ; GRAPHICS ACCELERATION |
Line 949... | Line 949... | ||
949 | ; force yes |
949 | ; force yes |
Line 950... | Line 950... | ||
950 | mov [es:0x901C], byte 1 |
950 | mov [es:BOOT_MTRR], byte 1 |
951 | 951 | ||
Line 952... | Line 952... | ||
952 | ; DMA ACCESS TO HD |
952 | ; DMA ACCESS TO HD |
953 | 953 | ||
954 | mov al, [preboot_dma] |
954 | mov al, [preboot_dma] |
955 | mov [es:0x901F], al |
955 | mov [es:BOOT_DMA], al |
956 | - | ||
Line 957... | Line 956... | ||
957 | ;; VRR_M USE |
956 | |
Line 958... | Line 957... | ||
958 | ; |
957 | ;; VRR_M USE |
959 | ; mov al,[preboot_vrrm] |
958 | ; |
Line 1335... | Line 1334... | ||
1335 | ; SET GRAPHICS |
1334 | ; SET GRAPHICS |
Line 1336... | Line 1335... | ||
1336 | 1335 | ||
1337 | xor ax, ax |
1336 | xor ax, ax |
Line 1338... | Line 1337... | ||
1338 | mov es, ax |
1337 | mov es, ax |
1339 | 1338 | ||
1340 | mov ax, [es:0x9008] ; vga & 320x200 |
1339 | mov ax, [es:BOOT_VESA_MODE] ; vga & 320x200 |
1341 | mov bx, ax |
1340 | mov bx, ax |
1342 | cmp ax, 0x13 |
1341 | cmp ax, 0x13 |
1343 | je setgr |
1342 | je setgr |