diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-08-27 15:56:52 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-08-27 15:56:52 +0200 |
| commit | d85b6209f37b4d886f9e85fd9592c9d7cf25deb9 (patch) | |
| tree | 83219e5d9ed5571ef20c8bf7bce21d595f3fcedc /boot/vesa_setup_16.asm | |
| parent | 62c211ade1606d82f9b262b68ef074ae07e26184 (diff) | |
further cleanup of bootloader
Diffstat (limited to 'boot/vesa_setup_16.asm')
| -rw-r--r-- | boot/vesa_setup_16.asm | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/boot/vesa_setup_16.asm b/boot/vesa_setup_16.asm new file mode 100644 index 0000000..4f276b5 --- /dev/null +++ b/boot/vesa_setup_16.asm @@ -0,0 +1,47 @@ +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 + 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 + cmp ax,0x004f + je vesa_ok2 + jmp vesa_err2 + vesa_ok2: + + ;VESA: finally switch to the mode of choice! + mov ax,0x4f02 ;vesa function: Set Mode + mov bx,VESA_MODE_SELECT + int 0x10 + vesa_err3: + mov bx, VESA_CHECK3 + call print_string + cmp ax,0x004f + je vesa_ok3 + jmp vesa_err3 + vesa_ok3: + popa + ret |
