Subversion Repositories Kolibri OS

Rev

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

Rev 40 Rev 76
Line 342... Line 342...
342
        in      al,64h 
342
        in      al,64h 
343
        and     al,00000010b  ; ready flag
343
        and     al,00000010b  ; ready flag
344
; wait until 8042 controller is ready 
344
; wait until 8042 controller is ready 
345
        loopnz  wait_loop
345
        loopnz  wait_loop
Line -... Line 346...
-
 
346
 
-
 
347
; --------------- APM ---------------------
-
 
348
    push    0
-
 
349
    pop    es
-
 
350
    mov    word [es : 0x9044], 0        ; ver = 0.0 (APM not found)
-
 
351
    mov    ax, 0x5300
-
 
352
    xor    bx, bx
-
 
353
    int    0x15
-
 
354
    jc    apm_end                ; APM not found
-
 
355
    test    cx, 2
-
 
356
    jz    apm_end                ; APM 32-bit protected-mode interface not supported
-
 
357
    mov    [es : 0x9044], ax        ; Save APM Version
-
 
358
    mov    [es : 0x9046], cx        ; Save APM flags
-
 
359
    
-
 
360
    ; Write APM ver ----
-
 
361
    jmp    @f
-
 
362
msg_apm:db    ' APM x.x ', 0
-
 
363
@@:    and    ax, 0xf0f
-
 
364
    add    ax, '00'
-
 
365
    mov    [msg_apm - 0x10000 + 5], ah
-
 
366
    mov    [msg_apm - 0x10000 + 7], al
-
 
367
    _setcursor 0, 3
-
 
368
    mov    si, msg_apm - 0x10000
-
 
369
    call    printplain
-
 
370
    _setcursor d80x25_top_num,0
-
 
371
    ; ------------------
-
 
372
    
-
 
373
    mov    ax, 0x5304            ; Disconnect interface
-
 
374
    xor    bx, bx
-
 
375
    int    0x15
-
 
376
    mov    ax, 0x5303            ; Connect 32 bit mode interface
-
 
377
    xor    bx, bx
-
 
378
    int    0x15
-
 
379
    ; init selectors
-
 
380
    movzx    eax, ax ; real-mode segment base address of protected-mode 32-bit code segment
-
 
381
    shl    eax, 4
-
 
382
    mov    [apm_code_32 - 0x10000 + 2], ax
-
 
383
    shr    eax, 16
-
 
384
    mov    [apm_code_32 - 0x10000 + 4], al
-
 
385
    movzx    ecx, cx ; real-mode segment base address of protected-mode 16-bit code segment
-
 
386
    shl    ecx, 4
-
 
387
    mov    [apm_code_16 - 0x10000 + 2], cx
-
 
388
    shr    ecx, 16
-
 
389
    mov    [apm_code_16 - 0x10000 + 4], cl
-
 
390
    movzx    edx, dx ; real-mode segment base address of protected-mode 16-bit data segment
-
 
391
    shl    edx, 4
-
 
392
    mov    [apm_data_16 - 0x10000 + 2], dx
-
 
393
    shr    edx, 16
-
 
394
    mov    [apm_data_16 - 0x10000 + 4], dl
-
 
395
    mov    [es : 0x9040], ebx              ; offset of APM entry point
-
 
396
apm_end:
-
 
397
; -----------------------------------------        
346
 
398
 
Line 347... Line 399...
347
; DISPLAY VESA INFORMATION
399
; DISPLAY VESA INFORMATION
348
 
400
 
349
	push	0
401
    push    0