diff options
| author | Michal Idziorek <m.i@gmx.at> | 2015-05-14 10:44:00 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2015-05-14 10:44:00 +0200 |
| commit | dc7bf2f47d6f97407e3b50ae0b8ab59fd51079e5 (patch) | |
| tree | 1ed444c804d9ff55e23a7a007275c3d5c649a455 /xxx/boot2/vesa_setup_16.asm | |
| parent | 7df4060ae807dd27f3ae0a11f243897f36053ba1 (diff) | |
moving unused files folder
Diffstat (limited to 'xxx/boot2/vesa_setup_16.asm')
| -rw-r--r-- | xxx/boot2/vesa_setup_16.asm | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/xxx/boot2/vesa_setup_16.asm b/xxx/boot2/vesa_setup_16.asm new file mode 100644 index 0000000..5bee57c --- /dev/null +++ b/xxx/boot2/vesa_setup_16.asm @@ -0,0 +1,93 @@ +VESA_CHECK1: + db "VESA: get modes!",0 +VESA_CHECK2: + db "VESA: get info on target mode!",0 +VESA_CHECK3: + db "VESA: switching to target mode!",0 +VESA_PAUSE: + db "[Press any key to switch to VESA 0x114]",0 + +VesaSetup: + + pusha + + ;VESA: get all available vesa modes! + mov ax,0 ; set target address in es:di (0:offset) + mov es,ax + mov di,VESA_MODES + mov ax,0x4f00 ;vesa function: Get Controller Info + int 0x10 ; call the interrupt to get the data from the bios! + vesa_err: + mov bx, VESA_CHECK1 + call print_string + call print_nextline + cmp ax,0x004f + je vesa_ok + jmp vesa_err + vesa_ok: + ; + + + ;VESA: get vesa info on mode of interest + mov ax,0 ; set target address in es:di (0:offset) + mov es,ax + mov di,VESA_MODE_INFO + mov ax,0x4f01 ;vesa function: Get Mode Info + mov cx,VESA_MODE_SELECT + int 0x10 ; call the interrupt to get the data from the bios! + vesa_err2: + mov bx, VESA_CHECK2 + call print_string + call print_nextline + cmp ax,0x004f + je vesa_ok2 + jmp vesa_err2 + vesa_ok2: + + ;show press any key +; call print_nextline +; mov bx, VESA_PAUSE +; call print_string +; call print_nextline + + ;preempt keyboard buffer + + next_key: + + mov ah,0x1 ;get scnacode from kb (non-blocking) + int 0x16 + jnz get_key ; nothing to preempt + + jmp wait_key + + get_key: + mov ah,0 ;get key from buffer + int 0x16 + +; mov al,ah +; call print_hex_byte +; call print_nextline + + jmp next_key + + ;;;;;;;;;;;;;;;;; + wait_key: +; mov ah,0 ; block waiting for keyboard scancode +; int 0x16 + + + ;VESA: finally switch to the mode of choice! + mov ax,0x4f02 ;vesa function: Set Mode + mov bx,VESA_MODE_SELECT + + int 0x10 + cmp ax,0x004f + je vesa_ok3 + vesa_err3: + mov bx, VESA_CHECK3 + call print_string + call print_nextline + jmp vesa_err3 + vesa_ok3: + popa + ret |
