Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; -----------------------------------------------------------------------------------
- ;;
- ;; Copyright 2008, 2009, 2012, 2013, 2021 Shane Tyler Yorks, Jure Sah
- ;;
- ;; This stub is a part of LearnerKernel
- ;;
- ;; LearnerKernel is free software: you can redistribute it and/or modify
- ;; it under the terms of the GNU General Public License as published by
- ;; the Free Software Foundation, either version 3 of the License, or
- ;; (at your option) any later version.
- ;;
- ;; Please refer to the README file for additional information.
- ;;
- ; -----------------------------------------------------------------------------------
- flipISR:
- pushf ;Preserve flags register
- cli ;Disable interrupts incase they were enabled
- @@: mov dx, 0x3DA ;Move the hardware address of VGA Input Status Register #1 to dx register
- in al, dx ;Read the value of the VGA Input Status Register #1 into the al register.
- and al, 1000b ;Check if bit 3 (VRetrace/Vertical Retrace in progress)
- je @b ;If happening, retry until it is not happening
- @@: in al, dx ;Read again
- and al, 1000b ;Check if is or isn't happening
- jne @b ;If it's not happening, go back until it it is happening
- mov esi, dblBufLoc ;Load the string source register with the back buffer
- mov edi, dword [VESAInfo+0x28] ;Move the string destination register with the location of the front buffer the video card is sending to the screen
- mov ecx, scrsz/4 ;Load the size of the buffers (divided by 4, since we'll send 4 bytes at a time) into ECX
- rep movsd ;Move 4 bytes from source to the data of destination until ECX is empty
- popf ;restore the flags register (including interrupts if they were enabled)
- iret ;Return to our regularly scheduled program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement