Subversion Repositories Kolibri OS

Rev

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

Rev 2373 Rev 2540
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
4
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
4
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;                                                              ;;
6
;;                                                              ;;
7
;;  BOOTCODE.INC                                                ;;
7
;;  BOOTCODE.INC                                                ;;
8
;;                                                              ;;
8
;;                                                              ;;
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: 2373 $
14
$Revision $
15
 
15
 
16
 
16
 
Line 272... Line 272...
272
; set up esp
272
; set up esp
273
        movzx   esp, sp
273
        movzx   esp, sp
Line 274... Line 274...
274
 
274
 
275
        push    0
275
        push    0
276
        pop     es
276
        pop     es
277
        and     word [es:0x9031], 0
277
        and     word [es:BOOT_IDE_BASE_ADDR], 0
278
; \begin{Mario79}
278
; \begin{Mario79}
279
; find HDD IDE DMA PCI device
279
; find HDD IDE DMA PCI device
280
; check for PCI BIOS
280
; check for PCI BIOS
281
        mov     ax, 0xB101
281
        mov     ax, 0xB101
Line 309... Line 309...
309
        mov     ax, 0xB10A
309
        mov     ax, 0xB10A
310
        mov     di, 0x20        ; memory base is config register at 0x20
310
        mov     di, 0x20        ; memory base is config register at 0x20
311
        int     0x1A
311
        int     0x1A
312
        jc      .nopci
312
        jc      .nopci
313
        and     cx, 0xFFF0      ; clear address decode type
313
        and     cx, 0xFFF0      ; clear address decode type
314
        mov     [es:0x9031], cx
314
        mov     [es:BOOT_IDE_BASE_ADDR], cx
315
.nopci:
315
.nopci:
316
; \end{Mario79}
316
; \end{Mario79}
Line 317... Line 317...
317
 
317
 
318
        mov     al, 0xf6        ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå
318
        mov     al, 0xf6        ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå
Line 341... Line 341...
341
        in      al, 64h
341
        in      al, 64h
342
        test    al, 2
342
        test    al, 2
343
        loopnz  @b
343
        loopnz  @b
344
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
344
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
345
; --------------- APM ---------------------
345
; --------------- APM ---------------------
346
        and     word [es:0x9044], 0     ; ver = 0.0 (APM not found)
346
        and     word [es:BOOT_APM_VERSION], 0     ; ver = 0.0 (APM not found)
347
        mov     ax, 0x5300
347
        mov     ax, 0x5300
348
        xor     bx, bx
348
        xor     bx, bx
349
        int     0x15
349
        int     0x15
350
        jc      apm_end                 ; APM not found
350
        jc      apm_end                 ; APM not found
351
        test    cx, 2
351
        test    cx, 2
352
        jz      apm_end                 ; APM 32-bit protected-mode interface not supported
352
        jz      apm_end                 ; APM 32-bit protected-mode interface not supported
353
        mov     [es:0x9044], ax         ; Save APM Version
353
        mov     [es:BOOT_APM_VERSION], ax         ; Save APM Version
354
        mov     [es:0x9046], cx         ; Save APM flags
354
        mov     [es:BOOT_APM_FLAGS], cx           ; Save APM flags
Line 355... Line 355...
355
 
355
 
356
        ; Write APM ver ----
356
        ; Write APM ver ----
357
        and     ax, 0xf0f
357
        and     ax, 0xf0f
358
        add     ax, '00'
358
        add     ax, '00'
Line 368... Line 368...
368
        int     0x15
368
        int     0x15
369
        mov     ax, 0x5303              ; Connect 32 bit mode interface
369
        mov     ax, 0x5303              ; Connect 32 bit mode interface
370
        xor     bx, bx
370
        xor     bx, bx
371
        int     0x15
371
        int     0x15
Line 372... Line 372...
372
 
372
 
373
        mov     [es:0x9040], ebx
373
        mov     [es:BOOT_APM_ENTRY], ebx
374
        mov     [es:0x9050], ax
374
        mov     [es:BOOT_APM_CODE_32], ax
375
        mov     [es:0x9052], cx
375
        mov     [es:BOOT_APM_CODE_16], cx
Line 376... Line 376...
376
        mov     [es:0x9054], dx
376
        mov     [es:BOOT_APM_DATA_16], dx
377
 
377
 
Line 378... Line 378...
378
apm_end:
378
apm_end:
Line 1149... Line 1149...
1149
; SET GRAPHICS
1149
; SET GRAPHICS
Line 1150... Line 1150...
1150
 
1150
 
1151
        xor     ax, ax
1151
        xor     ax, ax
Line 1152... Line 1152...
1152
        mov     es, ax
1152
        mov     es, ax
1153
 
1153
 
1154
        mov     ax, [es:0x9008]         ; vga & 320x200
1154
        mov     ax, [es:BOOT_VESA_MODE]         ; vga & 320x200
1155
        mov     bx, ax
1155
        mov     bx, ax
1156
        cmp     ax, 0x13
1156
        cmp     ax, 0x13
1157
        je      setgr
1157
        je      setgr