diff --git a/src/sys/include/isa/pit.h b/src/sys/include/isa/pit.h index 0f4762d..accba67 100644 --- a/src/sys/include/isa/pit.h +++ b/src/sys/include/isa/pit.h @@ -30,7 +30,7 @@ #ifndef _PIT_H #define _PIT_H -#include +#define PIT_TIMER 1000 int pit_init(); @@ -38,6 +38,9 @@ /*** $Log$ + Revision 1.4 2004/07/16 01:08:58 reddawg + Whew we work once again + Revision 1.3 2004/07/09 13:29:15 reddawg pit: pitInit to pit_init Adjusted initialization routines diff --git a/src/sys/isa/pit.c b/src/sys/isa/pit.c index 4b8a112..37d48ba 100644 --- a/src/sys/isa/pit.c +++ b/src/sys/isa/pit.c @@ -62,13 +62,12 @@ *****************************************************************************************/ int pit_init() { - int timerHz = 1000; outportByteP(0x43,0x36); - outportByteP(0x40,((1193180/timerHz) & 0xFF)); - outportByte(0x40,(((1193180/timerHz) >> 8) & 0xFF)); + outportByteP(0x40,((1193180/PIT_TIMER) & 0xFF)); + outportByte(0x40,(((1193180/PIT_TIMER) >> 8) & 0xFF)); /* Print out information on the PIT */ - kprintf("pit0 - Port [0x%X], Timer Hz: [%iHz]\n",0x43,timerHz); + kprintf("pit0 - Port [0x%X], Timer Hz: [%iHz]\n",0x43,PIT_TIMER); /* Return so we know everything went well */ return(0x0); @@ -76,6 +75,9 @@ /*** $Log$ + Revision 1.6 2004/07/16 01:08:58 reddawg + Whew we work once again + Revision 1.5 2004/07/09 13:29:15 reddawg pit: pitInit to pit_init Adjusted initialization routines diff --git a/src/sys/kernel/timer.S b/src/sys/kernel/timer.S index fa7a06e..d4db062 100644 --- a/src/sys/kernel/timer.S +++ b/src/sys/kernel/timer.S @@ -31,11 +31,8 @@ .text .code32 timerInt: - pushl %edx /* Push Register That We Are Going To Touch */ - pushl %ecx - pushl %ebx - pushl %eax - movl systemVitals,%ecx /* Put Location Of System Vitals Into ECX */ + pusha /* Save all of the registers */ + movl systemVitals,%ecx /* Put Location Of System Vitals Into ECX */ incl 4(%ecx) /* Increment sysTicks our 1000ms counter */ mov $0x20,%dx /* The Following Sends Our EOI To The MPIC */ mov $0x20,%ax @@ -58,14 +55,15 @@ jnz done call sched done: - popl %eax /* Restore Register And IRET */ - popl %ebx - popl %ecx - popl %edx + popa /* Restore Registers */ iret /*** $Log$ + Revision 1.1 2004/06/17 12:11:14 reddawg + timerInt: removed from src/sys/sys/idt.c and moved into a file by itself + in src/sys/kernel/timer.S + END ***/ diff --git a/src/sys/sys/idt.c b/src/sys/sys/idt.c index b51a3d2..9857232 100644 --- a/src/sys/sys/idt.c +++ b/src/sys/sys/idt.c @@ -41,8 +41,6 @@ #define FP_TO_LINEAR(seg, off) ((void*) ((((uInt16) (seg)) << 4) + ((uInt16) (off)))) -static void mathStateRestore(); - static ubixDescriptorTable(ubixIDT, 256) { }; static struct { @@ -387,22 +385,7 @@ while (1); } -void _int7(); -__asm__ ( - ".globl _int7 \n" - "_int7: \n" - " pushl %eax \n" - " clts \n" - " movl _current,%eax \n" - " cmpl _usedMath,%eax \n" - " je mathDone \n" - " call mathStateRestore \n" - "mathDone: \n" - " popl %eax \n" - " iret \n" - ); - -void mathStateRestore() { +static void mathStateRestore() { if (_usedMath != 0x0) { asm( "fnsave %0" @@ -427,8 +410,27 @@ //Return } +void _int7(); +asm( + ".globl _int7 \n" + "_int7: \n" + " pushl %eax \n" + " clts \n" + " movl _current,%eax \n" + " cmpl _usedMath,%eax \n" + " je mathDone \n" + " call mathStateRestore \n" + "mathDone: \n" + " popl %eax \n" + " iret \n" + ); + /*** $Log$ + Revision 1.17 2004/07/09 13:16:41 reddawg + idt: idtInit to idt_init + Adjusted Startup Routines + Revision 1.16 2004/07/05 23:05:32 reddawg New Syscalls diff --git a/src/sys/sys/video.c b/src/sys/sys/video.c index 7278314..4810d2c 100644 --- a/src/sys/sys/video.c +++ b/src/sys/sys/video.c @@ -35,9 +35,7 @@ int printColor = defaultColor; -void -backSpace() -{ +void backSpace() { uInt32 bufferOffset = 0x0; outportByte(0x3d4, 0x0e); bufferOffset = inportByte(0x3d5); @@ -61,8 +59,6 @@ { unsigned int bufferOffset = 0x0, character = 0x0, i = 0x0; - videoBuffer = (char *)0xB8000; - /* We Need To Get The Y Position */ outportByte(0x3D4, 0x0e); bufferOffset = inportByte(0x3D5); @@ -108,7 +104,6 @@ { unsigned int i = 0x0; - videoBuffer = (char *)0xB8000; for (i = 0x0; i < (80 * 25); i++) { /* Fill the screen with */ /* background Color */ videoBuffer[i * 2] = 0x20; @@ -123,6 +118,9 @@ /*** $Log$ + Revision 1.4 2004/06/29 11:41:44 reddawg + Fixed some global variables + Revision 1.3 2004/06/15 12:10:31 reddawg Cleaned Up