00001 /***************************************************************************************** 00002 Copyright (c) 2002-2004 The UbixOS Project 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, are 00006 permitted provided that the following conditions are met: 00007 00008 Redistributions of source code must retain the above copyright notice, this list of 00009 conditions, the following disclaimer and the list of authors. Redistributions in binary 00010 form must reproduce the above copyright notice, this list of conditions, the following 00011 disclaimer and the list of authors in the documentation and/or other materials provided 00012 with the distribution. Neither the name of the UbixOS Project nor the names of its 00013 contributors may be used to endorse or promote products derived from this software 00014 without specific prior written permission. 00015 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 00017 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00018 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 00019 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00020 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00021 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00022 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 00023 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00024 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 00026 $Id: timer_8S-source.html 88 2016-01-12 00:11:29Z reddawg $ 00027 00028 *****************************************************************************************/ 00029 00030 .globl timerInt 00031 .text 00032 .code32 00033 timerInt: 00034 pusha /* Save all of the registers */ 00035 mov $0x20,%dx /* The Following Sends Our EOI To The MPIC */ 00036 mov $0x20,%ax 00037 outb %al,%dx 00038 movl systemVitals,%ecx /* Put Location Of System Vitals Into ECX */ 00039 incl 4(%ecx) /* Increment sysTicks our 1000ms counter */ 00040 movl 4(%ecx),%eax /* Increment our sysUptime by 1S if 1000MS */ 00041 movl $200,%ebx /* Have Passed */ 00042 xor %edx,%edx 00043 div %ebx 00044 test %edx,%edx 00045 jnz next 00046 incl 8(%ecx) 00047 next: 00048 movl 4(%ecx),%eax /* Test If quantum Has Passed If So Then */ 00049 movl 12(%ecx),%ebx /* We Can CALL sched */ 00050 xor %edx,%edx 00051 div %ebx 00052 test %edx,%edx 00053 jnz done 00054 call sched 00055 done: 00056 popa /* Restore Registers */ 00057 iret 00058 00059 /*** 00060 END 00061 ***/ 00062