Subversion Repositories Kolibri OS

Rev

Rev 1508 | Rev 1700 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1508 Rev 1683
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: 1508 $
14
$Revision: 1683 $
15
 
15
 
16
 
16
 
Line 178... Line 178...
178
 
178
 
179
; set videomode
179
; set videomode
180
        mov     ax, 3
180
	mov	ax, 3
Line 181... Line -...
181
        int     0x10
-
 
182
 
-
 
183
if lang eq ru
-
 
184
 ; Load & set russian VGA font (RU.INC)
-
 
185
        mov     bp, RU_FNT1             ; RU_FNT1 - First part
-
 
186
        mov     bx, 1000h               ; 768 bytes
-
 
187
        mov     cx, 30h                 ; 48 symbols
-
 
188
        mov     dx, 80h                 ; 128 - position of first symbol
-
 
189
        mov     ax, 1100h
-
 
190
        int     10h
-
 
191
 
-
 
192
        mov     bp, RU_FNT2             ; RU_FNT2 -Second part
-
 
193
        mov     bx, 1000h               ; 512 bytes
-
 
194
        mov     cx, 20h                 ; 32 symbols
-
 
195
        mov     dx, 0E0h                ; 224 - position of first symbol
-
 
196
        mov     ax, 1100h
-
 
197
        int     10h
-
 
198
 ; End set VGA russian font
-
 
199
end if
181
	int	0x10
200
 
182
 
201
; draw frames
183
; draw frames
202
        push    0xb800
184
	push	0xb800
203
        pop     es
185
	pop	es
Line 306... Line 288...
306
        and     cx, 0xFFF0      ; clear address decode type
288
	and	cx, 0xFFF0	; clear address decode type
307
        mov     [es:0x9031], cx
289
	mov	[es:0x9031], cx
308
.nopci:
290
.nopci:
309
; \end{Mario79}
291
; \end{Mario79}
Line 310... Line -...
310
 
-
 
311
;        mov     al, 0xf6        ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå
-
 
312
;        out     0x60, al
-
 
313
;        xor     cx, cx
-
 
314
;wait_loop:       ; variant 2
-
 
315
; reading state of port of 8042 controller
-
 
316
;        in      al, 64h
-
 
317
;        and     al, 00000010b  ; ready flag
-
 
318
; wait until 8042 controller is ready
-
 
319
;        loopnz  wait_loop
-
 
320
 
-
 
321
;;;/diamond   5.02.2008
-
 
322
; set keyboard typematic rate & delay
-
 
323
;        mov     al, 0xf3
-
 
324
;        out     0x60, al
-
 
325
;        xor     cx, cx
-
 
326
;@@:
-
 
327
;        in      al, 64h
-
 
328
;        test    al, 2
-
 
329
;        loopnz  @b
-
 
330
;        mov     al, 0
-
 
331
;        out     0x60, al
-
 
332
;        xor     cx, cx
-
 
333
;@@:
-
 
334
;        in      al, 64h
-
 
335
;        test    al, 2
-
 
336
;        loopnz  @b
-
 
337
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
292
 
338
; --------------- APM ---------------------
293
; --------------- APM ---------------------
339
        and     word [es:0x9044], 0     ; ver = 0.0 (APM not found)
294
	and	word [es:0x9044], 0	; ver = 0.0 (APM not found)
340
        mov     ax, 0x5300
295
	mov	ax, 0x5300
341
        xor     bx, bx
296
	xor	bx, bx
Line 494... Line 449...
494
        pop     es
449
	pop	es
495
        push    dword [es:8*4]
450
	push	dword [es:8*4]
496
        pop     dword [.oldtimer]
451
	pop	dword [.oldtimer]
497
        push    dword [.timer]
452
	push	dword [.timer]
498
        pop     dword [es:8*4]    
453
	pop	dword [es:8*4]
499
;        mov     eax, [es:8*4]
-
 
500
;        mov     [.oldtimer], eax
-
 
501
;        mov     eax, [.timer]
-
 
502
;        mov     [es:8*4], eax
-
 
503
        sti
454
	sti
504
; wait for keypressed
455
; wait for keypressed
505
        xor     ax,ax
456
	xor	ax,ax
506
        int     16h
457
	int	16h
507
        push    ax
458
	push	ax
508
; restore timer interrupt
459
; restore timer interrupt
509
;        push    0
-
 
510
;        pop     es
-
 
511
        mov     eax, [.oldtimer]
460
	mov	eax, [.oldtimer]
512
        mov     [es:8*4], eax
461
	mov	[es:8*4], eax
513
        mov     [.timer], eax
462
	mov	[.timer], eax
Line 514... Line 463...
514
 
463
 
Line 558... Line 507...
558
.loops:
507
.loops:
559
        call    draw_vmodes_table
508
	call	draw_vmodes_table
560
        _setcursor 25,0         ; out of screen
509
	_setcursor 25,0 	; out of screen
561
        xor     ax,ax
510
	xor	ax,ax
562
        int     0x16
511
	int	0x16
563
;        call    clear_table_cursor             ;clear current position of cursor
-
 
Line 564... Line 512...
564
 
512
 
Line 565... Line 513...
565
        mov     si,word [cursor_pos]
513
	mov	si,word [cursor_pos]
566
 
514
 
Line 629... Line 577...
629
        
577
 
Line 630... Line 578...
630
        jmp    .d
578
	jmp    .d
631
 
579
 
632
.change_b:
-
 
633
        _setcursor 15,0
-
 
634
;        mov     si, ask_dma
-
 
635
;        call    print
-
 
636
;        mov     bx, '13'
-
 
637
;        call    getkey
580
.change_b:
638
;        mov     [preboot_dma], al
581
	_setcursor 15,0
639
        mov     si, ask_bd
582
	mov	si, ask_bd
640
        call    print
583
	call	print
641
        mov     bx, '12'
584
	mov	bx, '12'
Line 690... Line 633...
690
        neg     ax
633
	neg	ax
691
        add     ax, 18-1
634
	add	ax, 18-1
692
        mov     bx, 18
635
	mov	bx, 18
693
        xor     dx, dx
636
	xor	dx, dx
694
        div     bx
637
	div	bx
695
if lang eq ru
-
 
696
; ¯®¤®¦¤¨â¥ 5 ᥪ㭤, 4/3/2 ᥪ㭤ë, 1 ᥪ㭤ã
-
 
697
        cmp     al, 5
-
 
698
        mov     cl, ' '
-
 
699
        jae     @f
-
 
700
        cmp     al, 1
-
 
701
        mov     cl, 'ã'
-
 
702
        jz      @f
-
 
703
        mov     cl, 'ë'
-
 
704
@@:     mov     [time_str+9], cl
-
 
705
else if lang eq et
-
 
706
        cmp     al, 1
-
 
707
        ja      @f
-
 
708
        mov     [time_str+9], ' '
-
 
709
        mov     [time_str+10],' '
-
 
710
@@:
638
 
711
else
-
 
712
; wait 5/4/3/2 seconds, 1 second
639
; wait 5/4/3/2 seconds, 1 second
713
        cmp     al, 1
640
	cmp	al, 1
714
        mov     cl, 's'
641
	mov	cl, 's'
715
        ja      @f
642
	ja	@f
716
        mov     cl, ' '
643
	mov	cl, ' '
717
@@:     mov     [time_str+9], cl
644
@@:	mov	[time_str+9], cl
718
end if
-
 
719
        add     al, '0'
645
	add	al, '0'
720
        mov     [time_str+1], al
646
	mov	[time_str+1], al
721
        mov     si, time_msg
647
	mov	si, time_msg
722
        _setcursor 7,0
648
	_setcursor 7,0
723
        call    print
649
	call	print
Line 1142... Line 1068...
1142
; SET GRAPHICS
1068
; SET GRAPHICS
Line 1143... Line 1069...
1143
 
1069
 
1144
        xor     ax, ax
1070
	xor	ax, ax
Line 1145... Line 1071...
1145
        mov     es, ax
1071
	mov	es, ax
1146
 
1072
 
1147
        mov     ax, [es:0x9008]         ; vga & 320x200
1073
	mov	bx, [es:0x9008] 	; vga & 320x200
1148
        mov     bx, ax
1074
;        mov     bx, ax
1149
        cmp     ax, 0x13
1075
;      cmp     ax, 0x13
1150
        je      setgr
1076
;        je      setgr
1151
        cmp     ax, 0x12
1077
;        cmp     ax, 0x12
1152
        je      setgr
1078
;        je      setgr
1153
        mov     ax, 0x4f02              ; Vesa
1079
	mov	ax, 0x4f02		; Vesa
1154
setgr:
1080
setgr:
1155
        int     0x10
1081
	int	0x10
1156
        test    ah, ah
1082
	test	ah, ah
1157
        mov     si, fatalsel
1083
	mov	si, fatalsel
1158
        jnz     v_mode_error
1084
	jnz	v_mode_error
1159
; set mode 0x12 graphics registers:
1085
; set mode 0x12 graphics registers:
1160
        cmp     bx, 0x12
-
 
1161
        jne     gmok2
1086
;        cmp     bx, 0x12
1162
 
1087
;        jne     gmok2
1163
        mov     al, 0x05
1088
;        mov     al, 0x05
1164
        mov     dx, 0x03ce
1089
;        mov     dx, 0x03ce
1165
        push    dx
1090
;        push    dx
1166
        out     dx, al      ; select GDC mode register
1091
;        out     dx, al      ; select GDC mode register
1167
        mov     al, 0x02
1092
;        mov     al, 0x02
1168
        inc     dx
-
 
1169
        out     dx, al      ; set write mode 2
1093
;        inc     dx
1170
 
1094
;        out     dx, al      ; set write mode 2
1171
        mov     al, 0x02
1095
;        mov     al, 0x02
1172
        mov     dx, 0x03c4
1096
;        mov     dx, 0x03c4
1173
        out     dx, al      ; select VGA sequencer map mask register
1097
;        out     dx, al      ; select VGA sequencer map mask register
1174
        mov     al, 0x0f
1098
;        mov     al, 0x0f
1175
        inc     dx
-
 
1176
        out     dx, al      ; set mask for all planes 0-3
1099
;        inc     dx
1177
 
1100
;        out     dx, al      ; set mask for all planes 0-3
1178
        mov     al, 0x08
1101
;        mov     al, 0x08
1179
        pop     dx
1102
;        pop     dx
1180
        out     dx, al      ; select GDC bit mask register
1103
;        out     dx, al      ; select GDC bit mask register
1181
                           ; for writes to 0x03cf
1104
			   ; for writes to 0x03cf
1182
gmok2:
1105
gmok2: