Rev 713 | Rev 730 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 713 | Rev 726 | ||
---|---|---|---|
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: 713 $ |
14 | $Revision: 726 $ |
15 | 15 | ||
16 | 16 | ||
Line 365... | Line 365... | ||
365 | 365 | ||
366 | ; determine default settings |
366 | ; determine default settings |
Line 367... | Line 367... | ||
367 | mov [.bSettingsChanged], 0 |
367 | mov [.bSettingsChanged], 0 |
- | 368 | ||
- | 369 | ;.preboot_gr_end: |
|
- | 370 | mov di, preboot_device |
|
- | 371 | ; if image in memory is present and [preboot_device] is uninitialized, |
|
- | 372 | ; set it to use this preloaded image |
|
- | 373 | cmp byte [di], 0 |
|
- | 374 | jnz .preboot_device_inited |
|
- | 375 | cmp [.loader_block], -1 |
|
- | 376 | jz @f |
|
- | 377 | les bx, [.loader_block] |
|
- | 378 | test byte [es:bx+1], 1 |
|
- | 379 | jz @f |
|
- | 380 | mov byte [di], 3 |
|
- | 381 | jmp .preboot_device_inited |
|
- | 382 | @@: |
|
- | 383 | ; otherwise, set [preboot_device] to 1 (default value - boot from floppy) |
|
368 | 384 | mov byte [di], 1 |
|
369 | ;.preboot_gr_end: |
385 | .preboot_device_inited: |
370 | ; following 6 lines set variables to 1 if its current value is 0 |
386 | ; following 6 lines set variables to 1 if its current value is 0 |
371 | cmp byte[preboot_dma], 1 |
387 | cmp byte [di+preboot_dma-preboot_device], 1 |
372 | adc byte[preboot_dma], 0 |
388 | adc byte [di+preboot_dma-preboot_device], 0 |
373 | cmp byte[preboot_vrrm], 1 |
389 | cmp byte [di+preboot_biosdisk-preboot_device], 1 |
374 | adc byte[preboot_vrrm], 0 |
390 | adc byte [di+preboot_biosdisk-preboot_device], 0 |
375 | cmp byte[preboot_device], 1 |
391 | cmp byte [di+preboot_vrrm-preboot_device], 1 |
376 | adc byte[preboot_device], 0 |
392 | adc byte [di+preboot_vrrm-preboot_device], 0 |
Line 377... | Line 393... | ||
377 | ; notify user |
393 | ; notify user |
378 | _setcursor 5,2 |
394 | _setcursor 5,2 |
Line 407... | Line 423... | ||
407 | call print |
423 | call print |
408 | mov al, [preboot_device] |
424 | mov al, [preboot_device] |
409 | and eax, 7 |
425 | and eax, 7 |
410 | mov si, [preboot_device_msgs+eax*2] |
426 | mov si, [preboot_device_msgs+eax*2] |
411 | call printplain |
427 | call printplain |
- | 428 | .show_remarks: |
|
- | 429 | ; show remarks in gray color |
|
- | 430 | mov di, ((21-num_remarks)*80 + 2)*2 |
|
- | 431 | push 0xB800 |
|
- | 432 | pop es |
|
- | 433 | mov cx, num_remarks |
|
- | 434 | mov si, remarks |
|
- | 435 | .write_remarks: |
|
- | 436 | lodsw |
|
- | 437 | push si |
|
- | 438 | xchg ax, si |
|
- | 439 | mov ah, 1*16+7 ; background: blue (1), foreground: gray (7) |
|
- | 440 | push di |
|
- | 441 | .write_remark: |
|
- | 442 | lodsb |
|
- | 443 | test al, al |
|
- | 444 | jz @f |
|
- | 445 | stosw |
|
- | 446 | jmp .write_remark |
|
- | 447 | @@: |
|
- | 448 | pop di |
|
- | 449 | pop si |
|
- | 450 | add di, 80*2 |
|
- | 451 | loop .write_remarks |
|
412 | .wait: |
452 | .wait: |
413 | _setcursor 25,0 ; out of screen |
453 | _setcursor 25,0 ; out of screen |
414 | ; set timer interrupt handler |
454 | ; set timer interrupt handler |
415 | cli |
455 | cli |
416 | push 0 |
456 | push 0 |
Line 435... | Line 475... | ||
435 | mov [es:8*4], eax |
475 | mov [es:8*4], eax |
436 | mov [.timer], eax |
476 | mov [.timer], eax |
437 | _setcursor 7,0 |
477 | _setcursor 7,0 |
438 | mov si, space_msg |
478 | mov si, space_msg |
439 | call printplain |
479 | call printplain |
- | 480 | ; clear remarks and restore normal attributes |
|
- | 481 | push es |
|
- | 482 | mov di, ((21-num_remarks)*80 + 2)*2 |
|
- | 483 | push 0xB800 |
|
- | 484 | pop es |
|
- | 485 | mov cx, num_remarks |
|
- | 486 | mov ax, ' ' + (1*16 + 15)*100h |
|
- | 487 | @@: |
|
- | 488 | push cx |
|
- | 489 | mov cx, 76 |
|
- | 490 | rep stosw |
|
- | 491 | pop cx |
|
- | 492 | add di, 4*2 |
|
- | 493 | loop @b |
|
- | 494 | pop es |
|
440 | pop ax |
495 | pop ax |
441 | ; switch on key |
496 | ; switch on key |
442 | cmp al, 13 |
497 | cmp al, 13 |
443 | jz .continue |
498 | jz .continue |
444 | or al, 20h |
499 | or al, 20h |
Line 447... | Line 502... | ||
447 | cmp al, 'b' |
502 | cmp al, 'b' |
448 | jz .change_b |
503 | jz .change_b |
449 | cmp al, 'c' |
504 | cmp al, 'c' |
450 | jz .change_c |
505 | jz .change_c |
451 | cmp al, 'd' |
506 | cmp al, 'd' |
452 | jnz .wait |
507 | jnz .show_remarks |
453 | _setcursor 15,0 |
508 | _setcursor 15,0 |
454 | mov si, bdev |
509 | mov si, bdev |
455 | call print |
510 | call print |
456 | mov bx, '14' |
511 | mov bx, '14' |
457 | call getkey |
512 | call getkey |