diff --git a/Makefile b/Makefile index dffd002..59901a4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # $Id$ # The System Makefile (C) 2002 The UbixOS Project -all: kernel tools ubix_api libc_old ubix bin#csu libc libcpp +all: kernel tools ubix_api libc_old ubix csu libc libcpp bin # depend kernel tools csu: src diff --git a/src/bin/Makefile b/src/bin/Makefile index 677d709..7f14e27 100644 --- a/src/bin/Makefile +++ b/src/bin/Makefile @@ -1,7 +1,7 @@ # $Id$ # The System Makefile (C) 2002 The UbixOS Project -all: init-bin login-bin shell-bin clock-bin cp-bin fdisk-bin format-bin disklabel-bin ubistry-bin #edit-bin ld-bin ttyd-bin stat-bin cat-bin rtld-elf-bin tcc-bin +all: init-bin login-bin shell-bin clock-bin cp-bin fdisk-bin format-bin disklabel-bin ubistry-bin edit-bin ld-bin ttyd-bin stat-bin cat-bin rtld-elf-bin tcc-bin # test-bin pwd-bin cat-bin de-bin ls-bin goofball-bin mount-bin init-bin: init diff --git a/src/bin/Makefile.inc b/src/bin/Makefile.inc index 2101f00..e4a0946 100644 --- a/src/bin/Makefile.inc +++ b/src/bin/Makefile.inc @@ -1,6 +1,6 @@ # 'bin' options -CFLAGS = -nostdlib -nostdinc -fno-builtin +CFLAGS = -nostdlib -nostdinc -fno-builtin -O2 INCLUDES = -I../../include diff --git a/src/bin/cat/cat b/src/bin/cat/cat index 240c95e..5a0ca3d 100755 --- a/src/bin/cat/cat +++ b/src/bin/cat/cat Binary files differ diff --git a/src/bin/init/main.c b/src/bin/init/main.c index be6d6e8..284aa16 100644 --- a/src/bin/init/main.c +++ b/src/bin/init/main.c @@ -82,6 +82,7 @@ startup: i = fork(); + printf("We Forked\n"); if (0 == i) { printf("Starting Login Daemon.\n"); exec("sys:/bin/login",0x0); diff --git a/src/bin/ld/Makefile b/src/bin/ld/Makefile index 8038f81..d9713aa 100644 --- a/src/bin/ld/Makefile +++ b/src/bin/ld/Makefile @@ -8,6 +8,8 @@ #Linker LD = ld +CFLAGS += -fpic + #Binary File Name OUTPUT = ld.so @@ -24,16 +26,16 @@ # Compile the source files .cpp.o: - $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $< + $(CXX) -Wall $(CFLAGS) $(INCLUDES) -c -o $@ $< .cc.o: - $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $< + $(CXX) -Wall $(CFLAGS) $(INCLUDES) -c -o $@ $< .cc.s: - $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $< + $(CXX) -Wall $(CFLAGS) $(INCLUDES) -S -o $@ $< .c.o: - $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $< + $(CC) -Wall $(CFLAGS) $(INCLUDES) -c -o $@ $< .c.s: $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $< diff --git a/src/bin/ld/addlibrary.c b/src/bin/ld/addlibrary.c index 409a9c8..6a05e02 100644 --- a/src/bin/ld/addlibrary.c +++ b/src/bin/ld/addlibrary.c @@ -20,6 +20,7 @@ if (tmpLib->output == 0x0) { /* Hack because we have no ld path set */ sprintf(tmpFile,"sys:/lib/%s",lib); + printf("tmpFile: [%s]\n",tmpFile); linkerFd = fopen(tmpFile,"rb"); if (linkerFd->fd == 0x0) { printf("Could not open library: %s\n",lib); diff --git a/src/bin/ld/findfunc.c b/src/bin/ld/findfunc.c index 314cf8c..2f1103a 100644 --- a/src/bin/ld/findfunc.c +++ b/src/bin/ld/findfunc.c @@ -11,6 +11,7 @@ for (x = 0; x < lib_c;x++) { libPtr = ldFindLibrary(lib + lib_s[x]); if (libPtr == 0x0) { + printf("[%s][%s]\n",func,lib); libPtr = ldAddLibrary(lib + lib_s[x]); } @@ -18,7 +19,7 @@ if (!strcmp(func,(libPtr->linkerDynStr + libPtr->linkerRelSymTab[i].dynName))) { funcPtr = (uInt32 *)((uInt32)(libPtr->linkerRelSymTab[i].dynValue) + (uInt32)libPtr->output); if (funcPtr == 0x0) { - printf("[%s:0x%X]\n",func,funcPtr); + printf("[%s:0x%X]\n",func,(uInt32)funcPtr); } return((uInt32)funcPtr); break; diff --git a/src/bin/ld/main.c b/src/bin/ld/main.c index a9ab213..1a67a73 100644 --- a/src/bin/ld/main.c +++ b/src/bin/ld/main.c @@ -43,18 +43,20 @@ char *binaryDynStr = 0x0; elfDynSym *binaryRelSymTab = 0x0; static Elf32_Dyn *binaryElf32_Dyn = 0x0; -static elfPltInfo *binaryElfRelDyn = 0x0; +//static elfPltInfo *binaryElfRelDyn = 0x0; static elfPltInfo *binaryElfRel = 0x0; uInt32 ld(uInt32 got2,uInt32 entry) { int i = 0x0; int x = 0x0; - int y = 0x0; + //int y = 0x0; int rel = 0x0; - int relDyn = 0x0; + //int relDyn = 0x0; uInt32 *reMap = 0x0; FILE *binaryFd = 0x0; + printf("here?\n"); + if (binaryHeader == 0x0) { binaryFd = malloc(sizeof(FILE)); binaryFd->fd = (uInt32)got2; @@ -63,17 +65,21 @@ fread(binaryHeader,sizeof(elfHeader),1,binaryFd); } + printf("binarySectionHeader: [0x%X]\n",(uInt32)binarySectionHeader); + if (binarySectionHeader == 0x0) { + printf("b\n"); binarySectionHeader = (elfSectionHeader *)malloc(sizeof(elfSectionHeader)*binaryHeader->eShnum); fseek(binaryFd,binaryHeader->eShoff,0); fread(binarySectionHeader,sizeof(elfSectionHeader),binaryHeader->eShnum,binaryFd); - if (binaryShStr == 0x0) { - binaryShStr = (char *)malloc(binarySectionHeader[binaryHeader->eShstrndx].shSize); - fseek(binaryFd,binarySectionHeader[binaryHeader->eShstrndx].shOffset,0); - fread(binaryShStr,binarySectionHeader[binaryHeader->eShstrndx].shSize,1,binaryFd); - } + if (binaryShStr == 0x0) { + binaryShStr = (char *)malloc(binarySectionHeader[binaryHeader->eShstrndx].shSize); + fseek(binaryFd,binarySectionHeader[binaryHeader->eShstrndx].shOffset,0); + fread(binaryShStr,binarySectionHeader[binaryHeader->eShstrndx].shSize,1,binaryFd); + } + printf("eShnum: [%i]\n",binaryHeader->eShnum); for (i=0x0;ieShnum;i++) { switch (binarySectionHeader[i].shType) { case 3: @@ -89,8 +95,10 @@ binaryElf32_Dyn = (Elf32_Dyn *)malloc(binarySectionHeader[i].shSize); fseek(binaryFd,binarySectionHeader[i].shOffset,0); fread(binaryElf32_Dyn,binarySectionHeader[i].shSize,1,binaryFd); + printf("SHT_DYNAMIC\n"); for (x = 0;x < binarySectionHeader[i].shSize / sizeof(Elf32_Dyn);x++) { if (binaryElf32_Dyn[x].d_tag == 1) { + printf("[%s]\n",(uInt32)binaryElf32_Dyn[x].d_un.d_ptr); lib_s[lib_c] = binaryElf32_Dyn[x].d_un.d_ptr; lib_c++; } diff --git a/src/bin/login/main.c b/src/bin/login/main.c index e1bb267..a504211 100644 --- a/src/bin/login/main.c +++ b/src/bin/login/main.c @@ -127,6 +127,7 @@ fclose(fd); //chdir(data[i].path); chdir("sys:/bin/"); + printf("[%s]\n",data[i].shell); exec(data[i].shell,0x0); printf("Error: Problem Starting Shell\n"); exit(-1); diff --git a/src/bin/rtld-elf/Makefile b/src/bin/rtld-elf/Makefile index e790378..f67e858 100644 --- a/src/bin/rtld-elf/Makefile +++ b/src/bin/rtld-elf/Makefile @@ -7,8 +7,9 @@ INCLUDES = -I../../include.new -I./ +#-Werror CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -DPIC -CFLAGS = -O2 -fno-strict-aliasing -pipe -Wall -DFREEBSD_ELF -DIN_RTLD -I./ -fpic -elf -DPIC -std=gnu99 -Wformat=2 -Wno-format-extra-args -Werror -DDEBUG +CFLAGS = -O2 -fno-strict-aliasing -pipe -Wall -DFREEBSD_ELF -DIN_RTLD -I./ -fpic -elf -DPIC -std=gnu99 -Wformat=2 -Wno-format-extra-args -DDEBUG #Linker diff --git a/src/bin/shell/main.c b/src/bin/shell/main.c index 0be249a..19f9c16 100644 --- a/src/bin/shell/main.c +++ b/src/bin/shell/main.c @@ -35,9 +35,14 @@ int main() { + printf("Test\n"); +while(1); + char *buffer = (char *)malloc(512); inputBuffer *inBuf = (inputBuffer *)malloc(sizeof(inputBuffer)); + while (1); + machine = (char *)malloc(32); cwd = (char *)malloc(1024); diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index ef74983..a3471d6 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -3,6 +3,6 @@ LDFLAGS = -Bshareable #CFLAGS = -fpic -DPIC -O2 -fno-strict-aliasing -pipe -D__DBINTERFACE_PRIVATE -DPOSIX_MISTAKE -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -DYP -DHESIOD -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -CFLAGS = -fno-builtin -Wno-uninitialized -O2 -fno-strict-aliasing -pipe +CFLAGS = -fno-builtin -Wno-uninitialized -O2 -fno-strict-aliasing -pipe INCLUDES = -I../include -I../../../include -I../i386 -I../include diff --git a/src/lib/libc/isc/ev_timers.c b/src/lib/libc/isc/ev_timers.c index 18075cd..0736d0e 100644 --- a/src/lib/libc/isc/ev_timers.c +++ b/src/lib/libc/isc/ev_timers.c @@ -50,7 +50,7 @@ /* Forward. */ #ifdef _LIBC -static int __evOptMonoTime; +int __evOptMonoTime; #else static int due_sooner(void *, void *); static void set_index(void *, int); diff --git a/src/lib/libc/libc.inc b/src/lib/libc/libc.inc index a82ebad..99d2040 100644 --- a/src/lib/libc/libc.inc +++ b/src/lib/libc/libc.inc @@ -1,4 +1,4 @@ -CC = cc +CC = gcc32 REMOVE = rm -fr .if defined(PICA) diff --git a/src/lib/libc/resolv/res_debug.c b/src/lib/libc/resolv/res_debug.c index 4efb772..5ae1482 100644 --- a/src/lib/libc/resolv/res_debug.c +++ b/src/lib/libc/resolv/res_debug.c @@ -472,7 +472,7 @@ /* * Names of DNS rcodes. */ -static const struct res_sym __p_rcode_syms[] = { +const struct res_sym __p_rcode_syms[] = { {ns_r_noerror, "NOERROR", "no error"}, {ns_r_formerr, "FORMERR", "format error"}, {ns_r_servfail, "SERVFAIL", "server failed"}, diff --git a/src/sys/devfs/devfs.c b/src/sys/devfs/devfs.c index 0372934..4aaff11 100644 --- a/src/sys/devfs/devfs.c +++ b/src/sys/devfs/devfs.c @@ -92,7 +92,7 @@ devfsObj = (struct devfs_obj *)kmalloc(sizeof(struct devfs_obj)); fd->fsObj = devfsObj; device = device_find(tmpDev->devMajor,tmpDev->devMinor); - devfsObj->start = tmpDev; + devfsObj->start = (int)tmpDev; fd->size = device->devInfo->size; break; default: @@ -124,7 +124,7 @@ tmpDev = (void *)devfsObj->start; - if (tmpDev == -1) { + if ((u_int32_t)tmpDev == -1) { kprintf("Hi Ubie [%i]!!!\n", size); for (i = 0;i < size;i++) { data[i] = 'a'; diff --git a/src/sys/include/sys/video.h b/src/sys/include/sys/video.h index b90185e..73f4823 100644 --- a/src/sys/include/sys/video.h +++ b/src/sys/include/sys/video.h @@ -36,7 +36,7 @@ extern int printColor; -void clearScreen(); +void screenClear(); void kprint(char *string); void backSpace(); @@ -44,6 +44,9 @@ /*** $Log$ + Revision 1.1.1.1 2007/01/17 03:31:53 reddawg + UbixOS + Revision 1.1.1.1 2006/06/01 12:46:15 reddawg ubix2 diff --git a/src/sys/include/ubixos/exec.h b/src/sys/include/ubixos/exec.h index d48d56d..a3600a8 100644 --- a/src/sys/include/ubixos/exec.h +++ b/src/sys/include/ubixos/exec.h @@ -35,7 +35,7 @@ uInt32 execThread(void (* tproc)(void),uInt32,char *); void execFile(char *file,int argc,char **argv,int console); -void sys_exec(char *file,char *ap); +int sys_exec(char *file,char *ap); #endif diff --git a/src/sys/include/ubixos/syscalls.h b/src/sys/include/ubixos/syscalls.h index 349f746..0361e82 100644 --- a/src/sys/include/ubixos/syscalls.h +++ b/src/sys/include/ubixos/syscalls.h @@ -40,7 +40,7 @@ void sysGetpid(); void sysExit(); void sysExec(); -void sys_exec(); +int sys_exec(); void sysFork(); void sysCheckPid(); void sysGetFreePage(); @@ -139,6 +139,9 @@ /*** $Log$ + Revision 1.1.1.1 2007/01/17 03:31:52 reddawg + UbixOS + Revision 1.3 2006/12/19 14:12:54 reddawg rtld-elf almost workign diff --git a/src/sys/init/main.c b/src/sys/init/main.c index 6a954a8..8578b9e 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -112,9 +112,9 @@ /* New Root Mount Point */ //Old 2 new 10 //#ifdef DEBUG - kprintf("[0x%X][0x%X:0x%X:0x%X:0x%X:0x%X:0x%X]\n",B_ADAPTOR(rootdev),B_CONTROLLER(rootdev),B_SLICE(rootdev),B_UNIT(rootdev),B_PARTITION(rootdev),B_TYPE(rootdev)); + kprintf("[0x%X][0x%X:0x%X:0x%X:0x%X:0x%X:0x%X]\n",rootdev,B_ADAPTOR(rootdev),B_CONTROLLER(rootdev),B_SLICE(rootdev),B_UNIT(rootdev),B_PARTITION(rootdev),B_TYPE(rootdev)); //#endif - if (vfs_mount(0x1,B_PARTITION(rootdev)+2,0x0,0xAA,"sys","rw") != 0x0) { + if (vfs_mount(0x3,B_PARTITION(rootdev)+2,0x0,0xAA,"sys","rw") != 0x0) { kprintf("Problem Mounting sys Mount Point\n"); } @@ -132,7 +132,7 @@ kprintf("Free Pages: [%i]\n",systemVitals->freePages); kprintf("MemoryMap: [0x%X]\n",vmmMemoryMap); - kprintf("Starting OS\n"); + kprintf("Starting UbixOS\n"); sysTask = kmalloc(0x2000); if(sysTask == NULL) diff --git a/src/sys/init/static.c b/src/sys/init/static.c index 56b07bf..266e42a 100644 --- a/src/sys/init/static.c +++ b/src/sys/init/static.c @@ -1,5 +1,5 @@ /***************************************************************************************** - Copyright (c) 2002-2004 The UbixOS Project + Copyright (c) 2002-2004, 2007 The UbixOS Project All rights reserved. Redistribution and use in source and binary forms, with or without modification, are @@ -27,18 +27,16 @@ *****************************************************************************************/ -#include - /** * \brief Sets up the ctors */ int static_constructors(void) { + extern void (* __ctor_list)(); void (** l_ctor)() = &__ctor_list; int l_ctorCount = *(int *)l_ctor; -// kprintf("Calling static constructors\n"); l_ctor++; while(l_ctorCount) { (*l_ctor)(); diff --git a/src/sys/isa/fdc.c b/src/sys/isa/fdc.c index d25ad8d..ebe490f 100644 --- a/src/sys/isa/fdc.c +++ b/src/sys/isa/fdc.c @@ -128,8 +128,8 @@ bool fdcRw(int block,Int8 *blockBuffer,bool read,unsigned long numSectors) { int head = 0x0,track = 0x0,sector = 0x0,tries= 0x0, copyCount = 0x0; - unsigned char *p_tbaddr = (char *)0x80000; - unsigned char *p_blockbuff = blockBuffer; + unsigned char *p_tbaddr = (unsigned char *)0x80000; + unsigned char *p_blockbuff = (unsigned char *)blockBuffer; //kprintf("Block: [%i]\n",block); block2Hts(block,&head,&track,§or); motorOn(); @@ -187,8 +187,8 @@ } motorOff(); if (read && blockBuffer) { - p_blockbuff = blockBuffer; - p_tbaddr = (char *) 0x80000; + p_blockbuff = (unsigned char *)blockBuffer; + p_tbaddr = (unsigned char *) 0x80000; for (copyCount=0x0; copyCount<(numSectors*512); copyCount++) { *p_blockbuff = *p_tbaddr; p_blockbuff++; @@ -314,6 +314,9 @@ /*** $Log$ + Revision 1.1.1.1 2007/01/17 03:31:51 reddawg + UbixOS + Revision 1.1.1.1 2006/06/01 12:46:12 reddawg ubix2 diff --git a/src/sys/kernel/exec.c b/src/sys/kernel/exec.c index 0a395e4..990e05a 100644 --- a/src/sys/kernel/exec.c +++ b/src/sys/kernel/exec.c @@ -371,6 +371,8 @@ elfDynamic *elfDynamicS = 0x0; struct i386_frame *iFrame = 0x0; + kprint("Sys EXEC\n"); + /* Need to rewrite this routine? */ tmpFd = (struct fileDescriptorStruct *)kmalloc(sizeof(struct fileDescriptorStruct)); if (fopen(tmpFd,file,"r") == 0x0) { @@ -394,8 +396,9 @@ if ((binaryHeader = (elfHeader *)kmalloc(sizeof(elfHeader))) == 0x0) endTask(_current->id); - fread(binaryHeader,sizeof(elfHeader),1,tmpFd); - /* Set sectionHeader To Point To Loaded Binary To We Can Gather Info */ + + fread(binaryHeader,sizeof(elfHeader),1,tmpFd); + /* Set sectionHeader To Point To Loaded Binary To We Can Gather Info */ /* Check If App Is A Real Application */ if ((binaryHeader->eIdent[1] != 'E') && (binaryHeader->eIdent[2] != 'L') && (binaryHeader->eIdent[3] != 'F')) { @@ -575,8 +578,7 @@ * \brief New exec... * */ -void sys_exec(char *file,char *ap) { - int error = 0x0; +int sys_exec(char *file,char *ap) { int i = 0x0; int x = 0x0; int argc = 0x0; @@ -689,10 +691,10 @@ _current->td.vm_daddr = (char *)seg_addr; //! copy in arg strings - argv = ap; + argv = (char **)ap; if (argv[1] != 0x0) { - argc = argv[0]; + argc = (int)argv[0]; args = (char *)vmmGetFreeVirtualPage(_current->id,1,VM_TASK); memset(args,0x0,0x1000); x = 0x0; @@ -710,7 +712,7 @@ //! Adjust iframe - iFrame = _current->tss.esp0 - sizeof(struct i386_frame); + iFrame = (struct i386_frame *)_current->tss.esp0 - sizeof(struct i386_frame); iFrame->ebp = STACK_ADDR; iFrame->eip = eip; @@ -720,19 +722,19 @@ #ifdef DEBUG kprintf("\n\n\nuser_esp: [0x%X]\n",iFrame->user_esp); #endif - tmp = iFrame->user_esp; + tmp = (u_int32_t *)iFrame->user_esp; //! build argc and argv[] tmp[0] = argc; for (i = 0;i < argc;i++) { - tmp[i + 1] = argv[i]; + tmp[i + 1] = (u_int32_t)argv[i]; } //! Build ENV args = (char *)vmmGetFreeVirtualPage(_current->id,1,VM_TASK); memset(args,0x0,0x1000); strcpy(args,"LIBRARY_PATH=/lib"); - tmp[argc + 2] = args; + tmp[argc + 2] = (u_int32_t)args; #ifdef DEBUG kprintf("env: [0x%X][0x%X]\n",(uInt32)tmp + argc + 2,tmp[argc + 2]); #endif @@ -741,7 +743,7 @@ kprintf("env: [0x%X][0x%X]\n",(uInt32)tmp + argc + 2,tmp[argc + 2]); #endif - tmp = iFrame->user_esp; + tmp = (u_int32_t *)iFrame->user_esp; tmp += argc + 4; @@ -768,7 +770,7 @@ kprintf("AT_BASE: [0x%X]\n",auxargs->base); #endif - return; + return(0); } /*** diff --git a/src/sys/kernel/fork.c b/src/sys/kernel/fork.c index 6f3175c..5b03f65 100644 --- a/src/sys/kernel/fork.c +++ b/src/sys/kernel/fork.c @@ -87,10 +87,12 @@ newProcess->tss.ldt = 0x18; newProcess->tss.trace_bitmap = 0x0000; newProcess->tss.io_map = 0x8000; + /* Create A Copy Of The VM Space For New Task */ newProcess->tss.cr3 = (uInt32)vmmCopyVirtualSpace(newProcess->id); newProcess->state = FORK; + /* Fix gcc optimization problems */ while (tmpProcPtr->state == FORK) sched_yield(); @@ -132,8 +134,8 @@ int fork(struct thread *td,struct fork_args *uap) { td->td_retval[0] = 0x0; td->td_retval[1] = 0x0; - return(0x0); K_PANIC("Error: The new fork syscall is not yet implimented"); + return(0x0); } /*** diff --git a/src/sys/kernel/kpanic.c b/src/sys/kernel/kpanic.c index 7aae31b..49e8b7a 100644 --- a/src/sys/kernel/kpanic.c +++ b/src/sys/kernel/kpanic.c @@ -32,6 +32,7 @@ #include #include #include +#include /*! * \brief print panic message and halt system diff --git a/src/sys/kernel/ld.c b/src/sys/kernel/ld.c index 456447c..32282cf 100644 --- a/src/sys/kernel/ld.c +++ b/src/sys/kernel/ld.c @@ -62,6 +62,8 @@ if (ldFd == 0x0) { kprintf("Can not open ld.so\n"); } + + kprintf("Loading LD\n"); fseek(ldFd,0x0,0x0); binaryHeader = (elfHeader *)kmalloc(sizeof(elfHeader)); @@ -96,6 +98,7 @@ K_PANIC("vmmRemapPage: ld"); memset((void *)((programHeader[i].phVaddr & 0xFFFFF000) + x + LD_START),0x0,0x1000); } + kprintf("X: 0x%X\n",x); /* Now Load Section To Memory */ fseek(ldFd,programHeader[i].phOffset,0x0); fread(newLoc,programHeader[i].phFilesz,1,ldFd); @@ -132,13 +135,14 @@ elfRel = (elfPltInfo *)kmalloc(sectionHeader[i].shSize); fseek(ldFd,sectionHeader[i].shOffset,0x0); fread(elfRel,sectionHeader[i].shSize,1,ldFd); - +kprintf("LD_START: 0x%X\n",LD_START); for (x=0x0;xhdMask = retVal; hdd->hdSize = (hdd->hdSector[0x7B] * 256 * 256 * 256) + (hdd->hdSector[0x7A] * 256 * 256) + (hdd->hdSector[0x79] * 256) + hdd->hdSector[0x78]; hdd->hdEnable = 1; - kprintf("Drive: [0x%X/0x%X], Size: [%iSectors/%iKBytes]\n",hdd->hdPort,hdd->hdDev,hdd->hdSize,((hdd->hdSize*512)/1024)); + kprintf("Drive: [0x%X/0x%X], Size: [0x%X Sectors/0x%X KBytes]\n",hdd->hdPort,hdd->hdDev,hdd->hdSize,((hdd->hdSize*512)/1024)); dev->devInfo->size = hdd->hdSize*512; dev->devInfo->initialized = 0x1; return(0x0); @@ -347,6 +347,9 @@ /*** $Log$ + Revision 1.1.1.1 2007/01/17 03:31:55 reddawg + UbixOS + Revision 1.5 2006/10/12 15:00:26 reddawg More changes diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index be0d822..3c0e7de 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -383,7 +383,7 @@ kfree(tmpFd->buffer); kfree(tmpFd); //spinUnlock(&fdTable_lock); - kprintf("File Not Found? %s\n",file); + kprintf("File Not Found? %s\n\n",file); return (NULL); } diff --git a/src/sys/vmm/pagefault.c b/src/sys/vmm/pagefault.c index 1655b4c..006e468 100644 --- a/src/sys/vmm/pagefault.c +++ b/src/sys/vmm/pagefault.c @@ -104,7 +104,7 @@ else if (pageTable[pageTableIndex] != 0x0) { kprintf("Security failed pagetable not user permission\n"); kprintf("pageTable: [0x%X:0x%X:0x%X:0x%X]\n",pageTable[pageTableIndex],pageTableIndex,pageDirectoryIndex,eip); - kprintf("Segfault At Address: [0x%X][0x%X][%i][0x%X] Non Mapped\n",memAddr,esp,_current->id,eip); + kprintf("Segfault At Address: [0x%X], Stack Address: [0x%X], Proc: [%i],EIP: [0x%X] Non Mapped\n",memAddr,esp,_current->id,eip); spinUnlock(&pageFaultSpinLock); endTask(_current->id); } @@ -132,6 +132,9 @@ /*** $Log$ + Revision 1.2 2007/01/19 17:08:29 reddawg + Lots of fixes + Revision 1.1.1.1 2007/01/17 03:31:51 reddawg UbixOS diff --git a/src/sys/vmm/paging.c b/src/sys/vmm/paging.c index 403b4a9..200dc2f 100644 --- a/src/sys/vmm/paging.c +++ b/src/sys/vmm/paging.c @@ -38,7 +38,7 @@ #include #include -uInt32 *kernelPageDirectory = 0x0; +u_int32_t *kernelPageDirectory = 0x0; static spinLock_t fkpSpinLock = SPIN_LOCK_INITIALIZER; static spinLock_t rmpSpinLock = SPIN_LOCK_INITIALIZER; @@ -56,9 +56,9 @@ *****************************************************************************************/ -int vmm_pagingInit(){ - uInt32 i = 0x0; - uInt32 *pageTable = 0x0; +int vmm_pagingInit() { + u_int32_t i = 0x0; + u_int32_t *pageTable = 0x0; /* Allocate A Page Of Memory For Kernels Page Directory */ kernelPageDirectory = (uInt32 *) vmmFindFreePage(sysID); @@ -68,15 +68,15 @@ } /* end if */ /* Clear The Memory To Ensure There Is No Garbage */ - for (i = 0; i < pageEntries; i++) { - kernelPageDirectory[i] = 0x0; + for (i = 0x0; i < pageEntries; i++) { + kernelPageDirectory[i] = (u_int32_t)0x0; } /* end for */ /* Allocate a page for the first 4MB of memory */ - if ((pageTable = (uInt32 *) vmmFindFreePage(sysID)) == 0x0) + if ((pageTable = (u_int32_t *) vmmFindFreePage(sysID)) == 0x0) K_PANIC("Error: vmmFindFreePage Failed"); - kernelPageDirectory[0] = (uInt32) ((uInt32) (pageTable) | KERNEL_PAGE_DEFAULT); + kernelPageDirectory[0x0] = (u_int32_t) ((u_int32_t)pageTable | KERNEL_PAGE_DEFAULT); /* Make Sure The Page Table Is Clean */ memset(pageTable,0x0,0x1000); @@ -122,6 +122,7 @@ pageTable = (uInt32 *) (kernelPageDirectory[0] & 0xFFFFF000); pageTable[256] = (uInt32) ((uInt32) (kernelPageDirectory) | KERNEL_PAGE_DEFAULT); + /* Now Lets Turn On Paging With This Initial Page Table */ asm volatile( "movl %0,%%eax \n" @@ -495,7 +496,7 @@ if (uap->fd == -1) { /* NEED ROUND PAGE */ - td->td_retval[0] = vmmGetFreeVirtualPage(_current->id,(uap->len + 0xFFF)/0x1000,VM_TASK); + td->td_retval[0] = (int)vmmGetFreeVirtualPage(_current->id,(uap->len + 0xFFF)/0x1000,VM_TASK); } else { #ifdef VMMDEBUG @@ -517,7 +518,7 @@ fd->offset = uap->pos; fread(tmp,uap->len,0x1,fd); - td->td_retval[0] = tmp; + td->td_retval[0] = (int)tmp; } return(0x0); } diff --git a/ubixos.kdevelop b/ubixos.kdevelop index a9a82cd..239ac40 100644 --- a/ubixos.kdevelop +++ b/ubixos.kdevelop @@ -16,6 +16,7 @@ . false + ubixos @@ -143,11 +144,31 @@ 250 400 250 + false + 0 + true + true + false + std=_GLIBCXX_STD;__gnu_cxx=std + true + false + false + false + true + true + true + false + .; false 3 - + + 3 + EmbeddedKDevDesigner + /usr/local/bin/qmake + /usr/local/bin/designer + @@ -214,4 +235,11 @@ + + true + true + true + true + -C + diff --git a/ubixos.kdevelop.pcs b/ubixos.kdevelop.pcs index a5f0de5..89710c7 100644 --- a/ubixos.kdevelop.pcs +++ b/ubixos.kdevelop.pcs Binary files differ diff --git a/ubixos.kdevses b/ubixos.kdevses index fed7a9e..1ee05c9 100644 --- a/ubixos.kdevses +++ b/ubixos.kdevses @@ -1,36 +1,29 @@ - - - + + + - - + + - - + + - - + + - - - - - - - - - - - - + + + + +