diff --git a/src/bin/shell/commands.c b/src/bin/shell/commands.c index 9fb7478..3ef353f 100644 --- a/src/bin/shell/commands.c +++ b/src/bin/shell/commands.c @@ -60,17 +60,19 @@ } } else if (memcmp(data->args->arg,"test2", 5) == 0) { - for (i=0x0;i<5;i++) { + for (i=0x0;i<3;i++) { cPid = fork(); if (cPid == 0x0) { printf("Pid: [%i:%i]\n",cPid,i); - sched_yield(); + exec("clock",0x0,0x0); exit(0x1); } else { printf("Childs Pid: [%i]\n",cPid); + /* while (pidStatus(cPid) > 0) sched_yield(); + */ } } } diff --git a/src/sys/include/ubixos/init.h b/src/sys/include/ubixos/init.h index 5d320b0..d6f9ad0 100644 --- a/src/sys/include/ubixos/init.h +++ b/src/sys/include/ubixos/init.h @@ -1,3 +1,4 @@ + /***************************************************************************************** Copyright (c) 2002-2004 The UbixOS Project All rights reserved. @@ -57,8 +58,10 @@ pit_init, atkbd_init, time_init, + /* net_init, ne2k_init, + */ devfs_init, ubixfs_init, fdc_init, @@ -70,6 +73,12 @@ /*** $Log$ + Revision 1.20 2004/07/21 23:05:05 reddawg + last round of fixed + main.c: removed kernel stack + start.S: added kernel stack thanks to tip off from BJ about .comm + init.h: re-enabled ipStack + Revision 1.19 2004/07/19 02:08:27 reddawg Cleaned out the rest of debuging code also temporarily disabled the ip stack to improve boot time diff --git a/src/sys/include/vmm/paging.h b/src/sys/include/vmm/paging.h index fa44146..ddef330 100644 --- a/src/sys/include/vmm/paging.h +++ b/src/sys/include/vmm/paging.h @@ -47,7 +47,7 @@ int vmmPagingInit(); int vmmClearVirtualPage(uInt32 pageAddr); -int vmmRemapPage(uInt32,uInt32); +int vmmRemapPage(const uInt32,const uInt32); void vmmUnmapPage(uInt32,int); void vmmUnmapPages(void *,uInt32); void vmmSetPageAttribute(uInt32,int); @@ -67,6 +67,9 @@ /*** $Log$ + Revision 1.2 2004/05/21 15:21:04 reddawg + Cleaned up + END ***/ diff --git a/src/sys/isa/fdc.c b/src/sys/isa/fdc.c index fe210fd..dfa1770 100644 --- a/src/sys/isa/fdc.c +++ b/src/sys/isa/fdc.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +41,8 @@ #include #include +static spinLock_t fdcSpinLock = SPIN_LOCK_INITIALIZER; + static volatile bool done = FALSE; static drvGeom geometry = { dg144Heads,dg144Tracks,dg144Spt }; static bool diskChange = FALSE; @@ -93,7 +96,6 @@ void floppyIsrhndlr() { done = TRUE; outportByte(0x20,0x20); - outportByte(0xA0,0x20); } void sendByte(int Int8) { @@ -296,7 +298,9 @@ } void fdcRead(void *info,void *baseAddr,uInt32 startSector,uInt32 sectorCount) { + spinLock(&fdcSpinLock); readBlock(startSector,baseAddr,sectorCount); + spinUnlock(&fdcSpinLock); return; } void fdcWrite(void *info,void *baseAddr,uInt32 startSector,uInt32 sectorCount){ @@ -307,6 +311,18 @@ /*** $Log$ + Revision 1.15 2004/07/21 10:02:09 reddawg + devfs: renamed functions + device system: renamed functions + fdc: fixed a few potential bugs and cleaned up some unused variables + strol: fixed definition + endtask: made it print out freepage debug info + kmalloc: fixed a huge memory leak we had some unhandled descriptor insertion so some descriptors were lost + ld: fixed a pointer conversion + file: cleaned up a few unused variables + sched: broke task deletion + kprintf: fixed ogPrintf definition + Revision 1.14 2004/07/17 02:38:31 reddawg Fixed a few problems diff --git a/src/sys/kernel/exec.c b/src/sys/kernel/exec.c index 10e655e..1e6f75e 100644 --- a/src/sys/kernel/exec.c +++ b/src/sys/kernel/exec.c @@ -221,13 +221,13 @@ eStart = binaryHeader->eEntry; /* Now Lets Make A Clean Stack */ - newLoc = (char *)0x5DB000; i = 0x5DD000; vmmRemapPage(vmmFindFreePage(_current->id),0x5DC000); vmmSetPageAttribute(0x5DC000,(pageDefault | pageStack)); vmmRemapPage(vmmFindFreePage(_current->id),0x5DB000); vmmSetPageAttribute(0x5DB000,(pageDefault | pageStack)); + /* vmmRemapPage(vmmFindFreePage(_current->id),0x5DA000); vmmSetPageAttribute(0x5DA000,(pageDefault | pageStack)); vmmRemapPage(vmmFindFreePage(_current->id),0x5D9000); @@ -236,6 +236,7 @@ vmmSetPageAttribute(0x5D3000,(pageDefault | pageStack)); vmmRemapPage(vmmFindFreePage(_current->id),0x5D2000); vmmSetPageAttribute(0x5D2000,(pageDefault | pageStack)); + */ vmmRemapPage(vmmFindFreePage(_current->id),0x5D1000); vmmSetPageAttribute(0x5D1000,(pageDefault | pageStack)); vmmRemapPage(vmmFindFreePage(_current->id),0x5D0000); @@ -243,7 +244,7 @@ /* Set All The Proper Information For The Task */ _current->tss.back_link = 0x0; - _current->tss.esp0 = 0x5D4000; + _current->tss.esp0 = 0x5D2000; _current->tss.ss0 = 0x10; _current->tss.esp1 = 0x0; _current->tss.ss1 = 0x0; @@ -406,9 +407,14 @@ /* Jump To Start Of New Binary */ asm volatile( + "pusha \n" + "pushf \n" + "pushl $0x2B \n" + "pushl %0 \n" "pushl %1 \n" "pushl %%eax \n" - "call *%0 \n" + /* "call *%0 \n" */ + "iret\n" : : "g" (eStart),"g" (argv),"a" (argc) ); @@ -416,6 +422,9 @@ /*** $Log$ + Revision 1.44 2004/07/20 22:29:55 reddawg + assert: remade assert + Revision 1.43 2004/07/20 21:35:09 reddawg Let me commit before we start to overlap diff --git a/src/sys/kernel/timer.S b/src/sys/kernel/timer.S index d4db062..f2bb4ed 100644 --- a/src/sys/kernel/timer.S +++ b/src/sys/kernel/timer.S @@ -37,8 +37,8 @@ mov $0x20,%dx /* The Following Sends Our EOI To The MPIC */ mov $0x20,%ax outb %al,%dx - mov $0xA0,%dx /* The Following Sends Our EOI To The SPID */ - outb %al,%dx + //mov $0xA0,%dx /* The Following Sends Our EOI To The SPID */ + //outb %al,%dx movl 4(%ecx),%eax /* Increment our sysUptime by 1S if 1000MS */ movl $1000,%ebx /* Have Passed */ xor %edx,%edx @@ -60,6 +60,9 @@ /*** $Log$ + Revision 1.2 2004/07/16 04:06:32 reddawg + Tune ups this stuff should of been taken care of months ago + 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 diff --git a/src/sys/vmm/paging.c b/src/sys/vmm/paging.c index 718bd5e..446e5a1 100644 --- a/src/sys/vmm/paging.c +++ b/src/sys/vmm/paging.c @@ -154,11 +154,11 @@ ************************************************************************/ int -vmmRemapPage(uInt32 source, uInt32 dest) +vmmRemapPage(const uInt32 source,const uInt32 dest) { - uInt16 destPageDirectoryIndex = 0, destPageTableIndex = 0; - uInt32 *pageDir, *pageTable; - int i = 0x0; + uInt16 destPageDirectoryIndex = 0, destPageTableIndex = 0; + uInt32 *pageDir = 0x0, *pageTable = 0x0; + short i = 0x0; /* * Set Pointer pageDirectory To Point To The Virtual Mapping Of The Page @@ -167,29 +167,33 @@ pageDir = (uInt32 *) parentPageDirAddr; /* Check To See If Page Table Exists */ assert(dest); - destPageDirectoryIndex = (dest / (1024 * 4096)); + + /* Get Index Into The Page Directory */ + destPageDirectoryIndex = (dest / 0x400000); + if ((pageDir[destPageDirectoryIndex] & pagePresent) != pagePresent) { /* If Page Table Is Non Existant Then Set It Up */ pageDir[destPageDirectoryIndex] = (uInt32) vmmFindFreePage(_current->id) | pageDefault; - i = 1; + /* Also Add It To Virtual Space So We Can Make Changes Later */ - pageTable = (uInt32 *) (tablesBaseAddress + (4096 * 767)); + pageTable = (uInt32 *) (tablesBaseAddress + 0x2FF000); pageTable[destPageDirectoryIndex] = pageDir[destPageDirectoryIndex]; /* Reload Page Directory */ asm volatile( - "movl %cr3,%eax\n" - "movl %eax,%cr3\n" + "push %eax \n" + "mov %cr3,%eax \n" + "mov %eax,%cr3 \n" + "pop %eax \n" ); + pageTable = (uInt32 *) (tablesBaseAddress + (0x1000 * destPageDirectoryIndex)); + for (i = 0x0;i < pageEntries;i++) + pageTable[i] = 0x0; } /* Set Address To Page Table */ - pageTable = (uInt32 *) (tablesBaseAddress + (4096 * destPageDirectoryIndex)); - if (i != 0x0) { - for (i=0x0;i