diff --git a/src/lib/objgfx40/objgfx40.cpp b/src/lib/objgfx40/objgfx40.cpp index e6ce3ce..4cbc6ab 100644 --- a/src/lib/objgfx40/objgfx40.cpp +++ b/src/lib/objgfx40/objgfx40.cpp @@ -2054,7 +2054,7 @@ * and then we copy it to where it needs to go. */ #ifdef __UBIXOS_KERNEL__ - srcPtr = kmalloc(xCount,sysID); // allocate space + srcPtr = kmalloc(xCount); // allocate space #else srcPtr = malloc(xCount); // allocate space #endif @@ -2171,7 +2171,7 @@ // and then we copy it to where it needs to go. #ifdef __UBIXOS_KERNEL__ - srcPtr = kmalloc(xCount,sysID); // allocate space + srcPtr = kmalloc(xCount); // allocate space #else srcPtr = malloc(xCount); // allocate space #endif @@ -2305,7 +2305,7 @@ newLSize = _yRes * sizeof(uInt32); // number of scan lines * sizeof(uInt32) #ifdef __UBIXOS_KERNEL__ - newBuffer = kmalloc(newBSize,sysID); + newBuffer = kmalloc(newBSize); #else newBuffer = malloc(newBSize); #endif @@ -2914,8 +2914,8 @@ xWidth = (maxX+1)*bytesPerPix; #ifdef __UBIXOS_KERNEL__ - tmpBuf1 = kmalloc(xWidth,sysID); - tmpBuf2 = kmalloc(xWidth,sysID); + tmpBuf1 = kmalloc(xWidth); + tmpBuf2 = kmalloc(xWidth); #else tmpBuf1 = malloc(xWidth); tmpBuf2 = malloc(xWidth); diff --git a/src/sys/devfs/devfs.c b/src/sys/devfs/devfs.c index 2187b75..2a3380a 100644 --- a/src/sys/devfs/devfs.c +++ b/src/sys/devfs/devfs.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.6 2004/04/28 21:10:40 reddawg + Lots Of changes to make it work with existing os + Revision 1.5 2004/04/28 03:05:35 reddawg Cleaned up some debug'n code @@ -72,7 +75,7 @@ void devFSInit(struct mountPoints *mp) { struct devFsInfo *fsInfo = 0x0; - mp->fsInfo = (struct devFsInfo *)kmalloc(sizeof(struct devFsInfo),-2); + mp->fsInfo = (struct devFsInfo *)kmalloc(sizeof(struct devFsInfo)); fsInfo = mp->fsInfo; fsInfo->deviceList = 0x0; @@ -182,7 +185,7 @@ fsInfo = mp->fsInfo; - tmpDev = (struct devFsDevices *)kmalloc(sizeof(struct devFsDevices),-2); + tmpDev = (struct devFsDevices *)kmalloc(sizeof(struct devFsDevices)); tmpDev->devType = type; tmpDev->devMajor = major; diff --git a/src/sys/include/lib/kmalloc.h b/src/sys/include/lib/kmalloc.h index 907793a..6acdc75 100644 --- a/src/sys/include/lib/kmalloc.h +++ b/src/sys/include/lib/kmalloc.h @@ -39,13 +39,12 @@ void *baseAddr; //4 uInt32 limit; //4 uInt8 status; //1 - pidType pid; //4 char reserved[11]; //11 }; void kfree(void *baseAddr); -void *kmalloc(uInt32 len,pidType pid); -void initMalloc(pidType pid); +void *kmalloc(uInt32 len); +void initMalloc(); void *getEmptyDesc(); void insertFreeDesc(struct memDescriptor *freeDesc); void mergeMemBlocks(); diff --git a/src/sys/init/main.c b/src/sys/init/main.c index b365575..ac83596 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -169,7 +169,7 @@ kprintf("Problem Mounting HD Mount Point\n"); } */ - execThread(idleTask,(uInt32)(kmalloc(0x2000,sysID)+0x2000),0x0); + execThread(idleTask,(uInt32)(kmalloc(0x2000)+0x2000),0x0); execFile("init@sys",0x0,0x0,0x0); //execFile("shell@sys",0x0,0x0,0x0); kprintf("Free Pages: [%i]\n",freePages); @@ -230,6 +230,9 @@ /*** $Log$ + Revision 1.23 2004/05/19 03:35:02 reddawg + Fixed A Few Ordering Issues In The Service Startup Routine + Revision 1.22 2004/05/19 01:21:29 reddawg Tweaked diff --git a/src/sys/isa/atkbd.c b/src/sys/isa/atkbd.c index 56054cf..92b90fa 100644 --- a/src/sys/isa/atkbd.c +++ b/src/sys/isa/atkbd.c @@ -354,7 +354,7 @@ tmpTask = schedFindTask(0); if (tmpTask->oInfo.stdin == 0x0) { - tmpTask->oInfo.stdin = (char *)kmalloc(256,tmpTask->id); + tmpTask->oInfo.stdin = (char *)kmalloc(256); } /* Control Key */ if (key == 0x1D && !(tmpTask->oInfo.controlKeys & controlKey)) { @@ -457,6 +457,9 @@ /*** $Log$ + Revision 1.2 2004/05/10 02:23:24 reddawg + Minor Changes To Source Code To Prepare It For Open Source Release + Revision 1.1.1.1 2004/04/15 12:07:09 reddawg UbixOS v1.0 diff --git a/src/sys/isa/ne2k.c b/src/sys/isa/ne2k.c index ba2f6c1..b7da4b8 100644 --- a/src/sys/isa/ne2k.c +++ b/src/sys/isa/ne2k.c @@ -63,7 +63,7 @@ ************************************************************************/ int ne2kInit(uInt32 ioAddr) { - struct device *dev = (struct device *)kmalloc(sizeof(struct device),sysID); + struct device *dev = (struct device *)kmalloc(sizeof(struct device)); dev->ioAddr = 0x280; dev->irq = 3; @@ -191,7 +191,7 @@ void ne2kHandler() { uInt16 isr = 0x0; uInt16 status = 0x0; - struct device *dev = (struct device *)kmalloc(sizeof(struct device),sysID); + struct device *dev = (struct device *)kmalloc(sizeof(struct device)); dev->ioAddr = 0x280; dev->irq = 4; isr = inportByte(dev->ioAddr + NE_ISR); @@ -312,19 +312,19 @@ struct nicBuffer *ne2kAllocBuffer(int length) { struct nicBuffer *tmpBuf = 0x0; if (ne2kBuffer == 0x0) { - ne2kBuffer = (struct nicBuffer *)kmalloc(sizeof(struct nicBuffer),sysID); + ne2kBuffer = (struct nicBuffer *)kmalloc(sizeof(struct nicBuffer)); ne2kBuffer->next = 0x0; ne2kBuffer->length = length; - ne2kBuffer->buffer = (char *)kmalloc(length,sysID); + ne2kBuffer->buffer = (char *)kmalloc(length); return(ne2kBuffer); } else { for (tmpBuf = ne2kBuffer;tmpBuf->next != 0x0;tmpBuf = tmpBuf->next); - tmpBuf->next = (struct nicBuffer *)kmalloc(sizeof(struct nicBuffer),sysID); + tmpBuf->next = (struct nicBuffer *)kmalloc(sizeof(struct nicBuffer)); tmpBuf = tmpBuf->next; tmpBuf->next = 0x0; tmpBuf->length = length; - tmpBuf->buffer = (char *)kmalloc(length,sysID); + tmpBuf->buffer = (char *)kmalloc(length); return(tmpBuf); } return(0x0); @@ -346,6 +346,9 @@ /*** $Log$ + Revision 1.10 2004/05/10 02:23:24 reddawg + Minor Changes To Source Code To Prepare It For Open Source Release + END ***/ diff --git a/src/sys/kernel/bioscall.c b/src/sys/kernel/bioscall.c index 025223c..da5a504 100644 --- a/src/sys/kernel/bioscall.c +++ b/src/sys/kernel/bioscall.c @@ -55,7 +55,7 @@ newProcess = schedNewTask(); newProcess->tss.back_link = 0x0; - newProcess->tss.esp0 = (uInt32)kmalloc(0x2000,newProcess->id)+0x2000; + newProcess->tss.esp0 = (uInt32)kmalloc(0x2000)+0x2000; newProcess->tss.ss0 = 0x10; newProcess->tss.esp1 = 0x0; newProcess->tss.ss1 = 0x0; @@ -92,6 +92,9 @@ /*** $Log$ + Revision 1.2 2004/05/15 02:30:28 reddawg + Lots of changes + END ***/ diff --git a/src/sys/kernel/exec.c b/src/sys/kernel/exec.c index 317c200..8b592b9 100644 --- a/src/sys/kernel/exec.c +++ b/src/sys/kernel/exec.c @@ -299,7 +299,7 @@ } /* Load ELF Header */ - binaryHeader = (elfHeader *)kmalloc(sizeof(elfHeader),_current->id); + binaryHeader = (elfHeader *)kmalloc(sizeof(elfHeader)); fread(binaryHeader,sizeof(elfHeader),1,tmpFd); /* Set sectionHeader To Point To Loaded Binary To We Can Gather Info */ /* sectionHeader = (elfSectionheader *)(0x7C0000 + binaryHeader->eShoff); */ @@ -328,11 +328,11 @@ } /* Load The Program Header(s) */ - programHeader = (elfProgramheader *)kmalloc(sizeof(elfProgramheader)*binaryHeader->ePhnum,_current->id); + programHeader = (elfProgramheader *)kmalloc(sizeof(elfProgramheader)*binaryHeader->ePhnum); fseek(tmpFd,binaryHeader->ePhoff,0); fread(programHeader,(sizeof(elfProgramheader)*binaryHeader->ePhnum),1,tmpFd); - sectionHeader = (elfSectionheader *)kmalloc(sizeof(elfSectionheader)*binaryHeader->eShnum,_current->id); + sectionHeader = (elfSectionheader *)kmalloc(sizeof(elfSectionheader)*binaryHeader->eShnum); fseek(tmpFd,binaryHeader->eShoff,0); fread(sectionHeader,sizeof(elfSectionheader)*binaryHeader->eShnum,1,tmpFd); @@ -359,13 +359,13 @@ fread(newLoc,programHeader[i].phFilesz,1,tmpFd); } else if (programHeader[i].phType == 3) { - linker = (char *)kmalloc(programHeader[i].phMemsz,_current->id); + linker = (char *)kmalloc(programHeader[i].phMemsz); fseek(tmpFd,programHeader[i].phOffset,0); fread(linker,programHeader[i].phFilesz,1,tmpFd); //kprintf("Linker: [%s]\n",linker); } } - _current->oInfo.shstrtab = (char *)kmalloc(sectionHeader[binaryHeader->eShstrndx].shSize,_current->id); + _current->oInfo.shstrtab = (char *)kmalloc(sectionHeader[binaryHeader->eShstrndx].shSize); fseek(tmpFd,sectionHeader[binaryHeader->eShstrndx].shOffset,0); fread(_current->oInfo.shstrtab,sectionHeader[binaryHeader->eShstrndx].shSize,1,tmpFd); kprintf("SIZE: [%i]\n",sectionHeader[binaryHeader->eShstrndx].shSize); @@ -400,6 +400,9 @@ /*** $Log$ + Revision 1.5 2004/05/19 01:21:29 reddawg + Tweaked + Revision 1.4 2004/05/15 02:30:28 reddawg Lots of changes diff --git a/src/sys/kernel/sched.c b/src/sys/kernel/sched.c index a816207..8fee631 100644 --- a/src/sys/kernel/sched.c +++ b/src/sys/kernel/sched.c @@ -58,7 +58,7 @@ int schedInit() { /* Allocate memory for task list */ - taskList = (kTask_t *)kmalloc(sizeof(kTask_t),sysID); + taskList = (kTask_t *)kmalloc(sizeof(kTask_t)); if (taskList == 0x0) { kpanic("Error: kmalloc failed for taskList\n"); return(0x1); @@ -120,7 +120,7 @@ } /* sched() */ kTask_t *schedNewTask() { - kTask_t *tmpTask = (kTask_t *)kmalloc(sizeof(kTask_t),sysID); + kTask_t *tmpTask = (kTask_t *)kmalloc(sizeof(kTask_t)); kTask_t *listLoop = 0x0; for (listLoop = taskList; listLoop; listLoop = listLoop->next) { @@ -138,7 +138,7 @@ tmpTask->id = nextID++; tmpTask->state = NEW; //tmpTask->oInfo.container = findMount("s"); - tmpTask->oInfo.cwd = (char *)kmalloc(1024,tmpTask->id); + tmpTask->oInfo.cwd = (char *)kmalloc(1024); return(tmpTask); } /* schedNewTask() */ @@ -213,6 +213,9 @@ /*** $Log$ + Revision 1.3 2004/05/15 02:30:28 reddawg + Lots of changes + END ***/ diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index 72680ef..3eb8411 100644 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -155,7 +155,7 @@ void sysStartSDE() { int i = 0x0; - execThread(sdeThread,(uInt32)(kmalloc(0x2000,sysID)+0x2000),0x0); + execThread(sdeThread,(uInt32)(kmalloc(0x2000)+0x2000),0x0); for (i=0;i<500;i++) { schedYield(); } @@ -164,6 +164,9 @@ /*** $Log$ + Revision 1.5 2004/05/19 01:21:29 reddawg + Tweaked + Revision 1.4 2004/05/15 02:30:28 reddawg Lots of changes diff --git a/src/sys/kernel/ubthread.c b/src/sys/kernel/ubthread.c index 02d12dc..ad5f5d3 100644 --- a/src/sys/kernel/ubthread.c +++ b/src/sys/kernel/ubthread.c @@ -44,7 +44,7 @@ } int ubthread_cond_init(ubthread_cond_t *cond,const uInt32 attr) { - ubthread_cond_t ubcond = kmalloc(sizeof(struct ubthread_cond),sysID); + ubthread_cond_t ubcond = kmalloc(sizeof(struct ubthread_cond)); ubcond->id = (int)cond; ubcond->locked = UNLOCKED; *cond = ubcond; @@ -52,7 +52,7 @@ } int ubthread_mutex_init(ubthread_mutex_t *mutex,const uInt32 attr) { - ubthread_mutex_t ubmutex = kmalloc(sizeof(struct ubthread_mutex),sysID); + ubthread_mutex_t ubmutex = kmalloc(sizeof(struct ubthread_mutex)); ubmutex->id = (int)mutex; ubmutex->locked = UNLOCKED; *mutex = ubmutex; @@ -72,7 +72,7 @@ } int ubthread_create(kTask_t **thread,const uInt32 *attr,void *start_routine, void *arg) { - *thread = (void *)execThread((void *)start_routine,(uInt32)(kmalloc(0x2000,sysID)+0x2000),arg); + *thread = (void *)execThread((void *)start_routine,(uInt32)(kmalloc(0x2000)+0x2000),arg); return(0x0); } @@ -128,6 +128,9 @@ /*** $Log$ + Revision 1.3 2004/05/19 01:21:29 reddawg + Tweaked + Revision 1.2 2004/05/15 02:30:28 reddawg Lots of changes diff --git a/src/sys/kernel/vitals.c b/src/sys/kernel/vitals.c index 0e1fa03..d812dfe 100644 --- a/src/sys/kernel/vitals.c +++ b/src/sys/kernel/vitals.c @@ -47,7 +47,7 @@ ************************************************************************/ int initVitals() { /* Initialize Memory For The System Vitals Node */ - systemVitals = (vitalsNode *) kmalloc(sizeof(vitalsNode), sysID); + systemVitals = (vitalsNode *) kmalloc(sizeof(vitalsNode)); /* If malloc Failed Then Error */ if (systemVitals == 0x0) { @@ -74,6 +74,9 @@ /*** $Log$ + Revision 1.2 2004/05/15 02:30:28 reddawg + Lots of changes + END ***/ diff --git a/src/sys/lib/atan.c b/src/sys/lib/atan.c index 579d7a8..c929a75 100644 --- a/src/sys/lib/atan.c +++ b/src/sys/lib/atan.c @@ -30,11 +30,14 @@ #include double atan(double x) { - return(x); /* Quick Hack To Make This Work + return(x); /* Quick Hack To Make This Work */ } /*** $Log$ + Revision 1.2 2004/05/19 03:46:32 reddawg + A Few Quick Hacks To Make Things Work + Revision 1.1.1.1 2004/04/15 12:07:10 reddawg UbixOS v1.0 diff --git a/src/sys/lib/kmalloc.c b/src/sys/lib/kmalloc.c index a1e5b41..e6ec214 100644 --- a/src/sys/lib/kmalloc.c +++ b/src/sys/lib/kmalloc.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.2 2004/04/20 00:53:16 reddawg + Works + Revision 1.1.1.1 2004/04/15 12:07:10 reddawg UbixOS v1.0 @@ -49,11 +52,11 @@ int mallocLock = 0x0; -void initMalloc(pidType pid) { +void initMalloc() { int i=0; struct memDescriptor *tmpDesc1 = 0x0; struct memDescriptor *tmpDesc2 = 0x0; - emptyKernDesc = (struct memDescriptor *)vmmGetFreeKernelPage(pid,4); + emptyKernDesc = (struct memDescriptor *)vmmGetFreeKernelPage(sysID,4); tmpDesc1 = emptyKernDesc; tmpDesc1->prev = 0x0; tmpDesc1->status = 0x0; @@ -88,7 +91,6 @@ emptyKernDesc->prev = 0x0; tmpDesc->next = 0x0; tmpDesc->prev = 0x0; - tmpDesc->pid = 0x0; return(tmpDesc); } kpanic("Error Finding Empty Descriptor!\n"); @@ -97,7 +99,7 @@ /************************************************************************ -Function: void *kmalloc(uInt32 len,pidType pid) +Function: void *kmalloc(uInt32 len) Description: Allocate Kernel Memory Notes: @@ -105,7 +107,7 @@ 02/17/03 - Do I Still Need To Pass In The Pid? ************************************************************************/ -void *kmalloc(uInt32 len,pidType pid) { +void *kmalloc(uInt32 len) { struct memDescriptor *tmpDesc1 = 0x0; struct memDescriptor *tmpDesc2 = 0x0; char *buf = 0x0; @@ -117,7 +119,7 @@ mallocLock = sysID;// _current->id; //If Kernel Descriptor Is NULL Initialize Malloc if (emptyKernDesc == 0x0) { - initMalloc(pid); + initMalloc(); } len = (len + 15) & 0xFFFFFFF0; if (len == 0x0) { @@ -149,7 +151,6 @@ tmpDesc2->prev = 0x0; insertFreeDesc(tmpDesc2); } - tmpDesc1->pid = pid; mallocLock = 0x0; buf = (char *)tmpDesc1->baseAddr; for (i=0;ilimit;i++) { @@ -160,7 +161,7 @@ } tmpDesc1 = getEmptyDesc(); if (tmpDesc1 != 0x0) { - tmpDesc1->baseAddr = (struct memDescriptor *)vmmGetFreeKernelPage(pid,((len + 4095)/4096)); + tmpDesc1->baseAddr = (struct memDescriptor *)vmmGetFreeKernelPage(sysID,((len + 4095)/4096)); tmpDesc1->limit = len; tmpDesc1->status = 0x1; tmpDesc1->next = kernDesc; @@ -176,7 +177,6 @@ tmpDesc2->next = 0x0; insertFreeDesc(tmpDesc2); } - tmpDesc1->pid = pid; mallocLock = 0x0; buf = (char *)tmpDesc1->baseAddr; for (i=0;ilimit;i++) { @@ -360,6 +360,7 @@ while (1) asm("nop"); } + /* mallocLock = sysID;//_current->id; for (tmpDesc1=kernDesc;tmpDesc1;tmpDesc1=tmpDesc1->next) { if (tmpDesc1->pid == pid) { @@ -385,7 +386,9 @@ //mergeMemBlocks(); } } + */ mallocLock = 0x0; + return; } diff --git a/src/sys/lib/libcpp.cc b/src/sys/lib/libcpp.cc index c2ab222..007dd45 100644 --- a/src/sys/lib/libcpp.cc +++ b/src/sys/lib/libcpp.cc @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:07:10 reddawg + UbixOS v1.0 + Revision 1.2 2004/04/13 16:36:33 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -45,7 +48,7 @@ void * operator new[](unsigned size) { - return kmalloc(size,sysID); + return kmalloc(size); } void operator delete[](void * ptr) @@ -57,7 +60,7 @@ void * operator new(unsigned size) { - void * ptr = kmalloc(size, sysID); + void * ptr = kmalloc(size); //kprintf("Malloced: %08x\n", ptr); diff --git a/src/sys/net/net/shell.c b/src/sys/net/net/shell.c index 8fb7747..34ec235 100644 --- a/src/sys/net/net/shell.c +++ b/src/sys/net/net/shell.c @@ -97,9 +97,9 @@ static void shell_thread(void *arg) { struct netconn *conn, *newconn; - char *str = (char *)kmalloc(64,sysID); + char *str = (char *)kmalloc(64); - buffer = (char *)kmalloc(1024,sysID); + buffer = (char *)kmalloc(1024); conn = netconn_new(NETCONN_TCP); netconn_bind(conn, NULL, 23); diff --git a/src/sys/net/net/sys_arch.c b/src/sys/net/net/sys_arch.c index b867209..dd139cc 100644 --- a/src/sys/net/net/sys_arch.c +++ b/src/sys/net/net/sys_arch.c @@ -35,6 +35,9 @@ * Modified to work with the ubix operating system * * $Log$ + * Revision 1.2 2004/05/19 03:35:02 reddawg + * Fixed A Few Ordering Issues In The Service Startup Routine + * * Revision 1.1.1.1 2004/04/15 12:07:14 reddawg * UbixOS v1.0 * @@ -143,13 +146,13 @@ struct sys_thread *thread; struct thread_start_param *thread_param; - thread = kmalloc(sizeof(struct sys_thread),sysID); + thread = kmalloc(sizeof(struct sys_thread)); thread->next = threads; thread->timeouts.next = NULL; thread->ubthread = 0; threads = thread; - thread_param = kmalloc(sizeof(struct thread_start_param),sysID); + thread_param = kmalloc(sizeof(struct thread_start_param)); thread_param->function = function; thread_param->arg = arg; @@ -163,7 +166,7 @@ struct sys_mbox *sys_mbox_new() { struct sys_mbox *mbox; - mbox = kmalloc(sizeof(struct sys_mbox),sysID); + mbox = kmalloc(sizeof(struct sys_mbox)); mbox->first = mbox->last = 0; mbox->mail = sys_sem_new_(0); mbox->mutex = sys_sem_new_(1); @@ -258,7 +261,7 @@ static struct sys_sem *sys_sem_new_(uInt8 count) { struct sys_sem *sem; - sem = kmalloc(sizeof(struct sys_sem),sysID); + sem = kmalloc(sizeof(struct sys_sem)); sem->c = count; ubthread_cond_init(&(sem->cond), NULL); diff --git a/src/sys/net/netif/ethernetif.c b/src/sys/net/netif/ethernetif.c index d4223b4..f3c343f 100644 --- a/src/sys/net/netif/ethernetif.c +++ b/src/sys/net/netif/ethernetif.c @@ -81,7 +81,7 @@ struct ethernetif *ethernetif; ethernetif = netif->state; - dev = (struct device *)kmalloc(sizeof(struct device),sysID); + dev = (struct device *)kmalloc(sizeof(struct device)); dev->ioAddr = 0x280; dev->irq = 3; diff --git a/src/sys/pci/hd.c b/src/sys/pci/hd.c index ef2324a..36d67aa 100644 --- a/src/sys/pci/hd.c +++ b/src/sys/pci/hd.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.6 2004/04/28 21:10:40 reddawg + Lots Of changes to make it work with existing os + Revision 1.5 2004/04/28 02:37:34 reddawg More updates for using the new driver subsystem @@ -64,11 +67,11 @@ struct driveInfo *hdd3; void initHardDisk() { - hdd0 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); - hdd0s1 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); - hdd1 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); - hdd2 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); - hdd3 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); + hdd0 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo)); + hdd0s1 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo)); + hdd1 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo)); + hdd2 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo)); + hdd3 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo)); hdd0->hdPort = 0x1F0; hdd0->hdDev = 0x40; hdd0->parOffset = 0x0; diff --git a/src/sys/sde/sde.cc b/src/sys/sde/sde.cc index 1f42094..3e58b61 100644 --- a/src/sys/sde/sde.cc +++ b/src/sys/sde/sde.cc @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:07:17 reddawg + UbixOS v1.0 + Revision 1.12 2004/04/13 16:36:33 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -106,7 +109,7 @@ newBuf->alphaShifter = oldBuf->alphaShifter; newBuf->lastError = oldBuf->lastError; newBuf->dataState = oldBuf->dataState; - tmp = (struct sdeWindows *)kmalloc(sizeof(struct sdeWindows),sysID); + tmp = (struct sdeWindows *)kmalloc(sizeof(struct sdeWindows)); tmp->buf = newBuf; tmp->status = registerWindow; tmp->pid = _current->id; diff --git a/src/sys/sys/device.c b/src/sys/sys/device.c index 8062fbf..8311534 100644 --- a/src/sys/sys/device.c +++ b/src/sys/sys/device.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.2 2004/04/27 12:05:12 reddawg + Updates To Driver Subsystem + Revision 1.1 2004/04/27 03:49:41 reddawg Start of new driver system @@ -39,7 +42,7 @@ static struct deviceNode *devices = 0x0; void deviceAdd(int major,int minor,char type,void *read,void *write,void *reset,void *init,void *ioctl,void *stop,void *start,void *standby,void *info) { - struct deviceNode *tmpDev = kmalloc(sizeof(struct deviceNode),sysID); + struct deviceNode *tmpDev = kmalloc(sizeof(struct deviceNode)); tmpDev->prev = 0x0; tmpDev->major = major; tmpDev->minor = minor; diff --git a/src/sys/ubixfs/directory.c b/src/sys/ubixfs/directory.c index cb4b8f0..ec280dc 100644 --- a/src/sys/ubixfs/directory.c +++ b/src/sys/ubixfs/directory.c @@ -24,6 +24,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.2 2004/04/28 02:22:55 reddawg + This is a fiarly large commit but we are starting to use new driver model + all around + Revision 1.1.1.1 2004/04/15 12:07:07 reddawg UbixOS v1.0 @@ -49,14 +53,14 @@ uInt32 entries = 0x0; struct directoryEntry *tmp = 0x0; - tmp = (struct directoryEntry *)kmalloc(fd->size,sysMalloc); + tmp = (struct directoryEntry *)kmalloc(fd->size); readUbixFS(fd,(char *)tmp,fd->offset,fd->size); entries = fd->size/sizeof(struct directoryEntry); for (i=0;(tmp[i].attributes != 0x0) && (i < entries);i++); if (i == entries) { - tmp = (struct directoryEntry *)kmalloc(0x1000,sysMalloc); + tmp = (struct directoryEntry *)kmalloc(0x1000); i = 0x0; } else { @@ -80,8 +84,8 @@ block = getFreeBlocks(1,fd); if (block != 0x0) { - dir = (struct directoryEntry *)kmalloc(blockByteSize,sysMalloc); - entry = (struct directoryEntry *)kmalloc(sizeof(struct directoryEntry),sysMalloc); + dir = (struct directoryEntry *)kmalloc(blockByteSize); + entry = (struct directoryEntry *)kmalloc(sizeof(struct directoryEntry)); entry->startCluster = block; entry->size = blockByteSize; diff --git a/src/sys/ubixfs/ubixfs.c b/src/sys/ubixfs/ubixfs.c index fee90c1..b81979a 100644 --- a/src/sys/ubixfs/ubixfs.c +++ b/src/sys/ubixfs/ubixfs.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.5 2004/04/29 15:45:19 reddawg + Fixed some bugs so now the automade images will work correctly + Revision 1.4 2004/04/28 21:10:40 reddawg Lots Of changes to make it work with existing os @@ -74,11 +77,11 @@ void initUbixFS(struct mountPoints *mp) { struct ubixFsInfo *fsInfo = 0x0; - mp->fsInfo = (struct ubixFsInfo *)kmalloc(sizeof(struct ubixFsInfo),sysID); + mp->fsInfo = (struct ubixFsInfo *)kmalloc(sizeof(struct ubixFsInfo)); fsInfo = mp->fsInfo; //mp->diskLabel->partitions[mp->partition].pOffset -= 63; if ((mp->diskLabel->magicNum == UBIXDISKMAGIC) && (mp->diskLabel->magicNum2 == UBIXDISKMAGIC)) { - fsInfo->blockAllocationTable = (struct blockAllocationTableEntry *)kmalloc(mp->diskLabel->partitions[mp->partition].pBatSize*512,-2); + fsInfo->blockAllocationTable = (struct blockAllocationTableEntry *)kmalloc(mp->diskLabel->partitions[mp->partition].pBatSize*512); /* fsInfo->blockAllocationTable[0].nextBlock = 100; */ fsInfo->batEntries = ((mp->diskLabel->partitions[mp->partition].pBatSize*512)/sizeof(struct blockAllocationTableEntry)); kprintf("C"); @@ -97,7 +100,7 @@ int openFileUbixFS(char *file,fileDescriptor *fd) { int x=0; - struct directoryEntry *dirEntry = (struct directoryEntry *)kmalloc(4096,_current->id); + struct directoryEntry *dirEntry = (struct directoryEntry *)kmalloc(4096); struct ubixFsInfo *fsInfo = fd->mp->fsInfo; fd->mp->device->read(fd->mp->device->info,dirEntry,(fd->mp->diskLabel->partitions[fd->mp->partition].pOffset+fsInfo->blockAllocationTable[0].realSector),8); if ((fd->mode & fileRead) == fileRead) { @@ -188,7 +191,7 @@ } if (offset > fd->size) { fd->size = offset; - dirEntry = (struct directoryEntry *)kmalloc(4096,-2); + dirEntry = (struct directoryEntry *)kmalloc(4096); fd->mp->device->read(fd->mp->device->info,dirEntry,(fd->mp->diskLabel->partitions[fd->mp->partition].pOffset+fsInfo->blockAllocationTable[fd->dirBlock].realSector),8); for (i=0x0;i<(4096/sizeof(struct directoryEntry));i++) { if ((int)!kstrcmp(dirEntry[i].fileName,fd->fileName)) @@ -304,7 +307,7 @@ if (offset > fd->size) { fd->size = offset; - dirEntry = (struct directoryEntry *)kmalloc(4096,-2); + dirEntry = (struct directoryEntry *)kmalloc(4096); fd->mp->device->read(fd->mp->device->info,dirEntry,(fd->mp->diskLabel->partitions[fd->mp->partition].pOffset+fsInfo->blockAllocationTable[fd->dirBlock].realSector),blockSize); for (i=0x0;i<(4096/sizeof(struct directoryEntry));i++) { if ((int)!kstrcmp(dirEntry[i].fileName,fd->fileName)) @@ -321,7 +324,7 @@ void ubixFSUnlink(char *path,struct mountPoints *mp) { int x=0; - struct directoryEntry *dirEntry = (struct directoryEntry *)kmalloc(0x1000,_current->id); + struct directoryEntry *dirEntry = (struct directoryEntry *)kmalloc(0x1000); struct ubixFsInfo *fsInfo = mp->fsInfo; mp->device->read(mp->device->info,dirEntry,(mp->diskLabel->partitions[mp->partition].pOffset+fsInfo->blockAllocationTable[0].realSector),8); diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index d9d3a21..dd3f0c0 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:06:53 reddawg + UbixOS v1.0 + Revision 1.12 2004/04/13 16:36:34 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -57,7 +60,7 @@ /* Allocate Memory For File Descriptor */ - tmpFd = (fileDescriptor *)kmalloc(sizeof(fileDescriptor),sysMalloc); + tmpFd = (fileDescriptor *)kmalloc(sizeof(fileDescriptor)); tmpFd->mode = fileRead; dir = (char *)strtok((char *)path,"@"); @@ -74,7 +77,7 @@ return(0x1); } if (tmpFd->mp->fs->vfsOpenFile(":",tmpFd) == 1) { - tmpFd->buffer = (char *)kmalloc(4096,_current->id); + tmpFd->buffer = (char *)kmalloc(4096); sprintf(tmpFd->fileName,"%s",":"); /* Set Its Status To Open */ tmpFd->status = fdOpen; @@ -140,7 +143,7 @@ fileDescriptor *tmpFd = 0x0; char *path = 0x0,*mountPoint = 0x0; /* Allocate Memory For File Descriptor */ - tmpFd = (fileDescriptor *)kmalloc(sizeof(fileDescriptor),sysID); + tmpFd = (fileDescriptor *)kmalloc(sizeof(fileDescriptor)); path = (char *)strtok((char *)file,"@"); mountPoint = strtok(NULL,"\n"); @@ -182,7 +185,7 @@ /* Search For The File */ if (tmpFd->mp->fs->vfsOpenFile((char *)file,tmpFd) == 1) { /* If The File Is Found Then Set Up The Descriptor */ - tmpFd->buffer = (char *)kmalloc(4096,_current->id); + tmpFd->buffer = (char *)kmalloc(4096); sprintf(tmpFd->fileName,"%s",file); /* Set Its Status To Open */ tmpFd->status = fdOpen; diff --git a/src/sys/vfs/mount.c b/src/sys/vfs/mount.c index f252d04..1350a1e 100644 --- a/src/sys/vfs/mount.c +++ b/src/sys/vfs/mount.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.4 2004/04/29 15:45:19 reddawg + Fixed some bugs so now the automade images will work correctly + Revision 1.3 2004/04/28 21:10:40 reddawg Lots Of changes to make it work with existing os @@ -64,7 +67,7 @@ struct deviceNode *device = 0x0; /* Allocate Memory For Mount Point */ - mp = (struct mountPoints *)kmalloc(sizeof(struct mountPoints),sysID); + mp = (struct mountPoints *)kmalloc(sizeof(struct mountPoints)); /* Copy Mount Point Into Buffer */ sprintf(mp->mountPoint,mountPoint); @@ -78,7 +81,7 @@ mp->partition = partition; mp->perms = *perms; if (device != 0x0) { - mp->diskLabel = (struct ubixDiskLabel *)kmalloc(512,sysID); + mp->diskLabel = (struct ubixDiskLabel *)kmalloc(512); mp->device->read(mp->device->info,mp->diskLabel,1,1); kprintf("READING SECTOR"); } diff --git a/src/sys/vfs/vfs.c b/src/sys/vfs/vfs.c index cdc2517..7b42b6e 100644 --- a/src/sys/vfs/vfs.c +++ b/src/sys/vfs/vfs.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:06:53 reddawg + UbixOS v1.0 + Revision 1.7 2004/04/13 16:36:34 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -80,7 +83,7 @@ struct fileSystem *tmpFs = 0x0; /* Allocate Memory */ - tmpFs = (struct fileSystem *)kmalloc(sizeof(struct fileSystem),-2); + tmpFs = (struct fileSystem *)kmalloc(sizeof(struct fileSystem)); if (tmpFs == 0x0) { /* Memory Allocation Failed */ return(0x1);