diff --git a/BUGS b/BUGS index 937a905..1c96a4f 100644 --- a/BUGS +++ b/BUGS @@ -7,3 +7,6 @@ 10/12/06 - UFS is hacked to get correct file size + +10/12/06 - + usrland ld.so forces path sys:/lib/ must make more automated diff --git a/src/bin/fdisk/main.c b/src/bin/fdisk/main.c index 5113abf..cfbdb0d 100644 --- a/src/bin/fdisk/main.c +++ b/src/bin/fdisk/main.c @@ -70,6 +70,11 @@ printf("Drive Info (ad0):\n"); fd = fopen("devfs:ad0","rb"); } + if (fd->size == 0x0) { + printf("Invalid Device\n"); + exit(0x1); + } + fseek(fd,0,0); fread(data,512,1,fd); @@ -103,6 +108,7 @@ fwrite(data,512,1,fd); } else { + printf("Partition Table:\n"); for (i=0;i<4;i++) { if (d[i].dp_type != 0x0) { printf("d[%i].dp_type: 0x%X\n",i,d[i].dp_type); @@ -119,6 +125,9 @@ /*** $Log$ + Revision 1.1.1.1 2006/06/01 12:46:09 reddawg + ubix2 + Revision 1.2 2005/10/12 00:13:28 reddawg Removed diff --git a/src/bin/ld/addlibrary.c b/src/bin/ld/addlibrary.c index 4652367..2e6059e 100644 --- a/src/bin/ld/addlibrary.c +++ b/src/bin/ld/addlibrary.c @@ -9,6 +9,7 @@ uInt32 *reMap = 0x0; char *newLoc = 0x0; FILE *linkerFd = 0x0; + char tmpFile[1024]; ldLibrary *tmpLib = 0x0; if ((tmpLib = (ldLibrary *)malloc(sizeof(ldLibrary))) == 0x0) { @@ -16,7 +17,9 @@ exit(0x1); } if (tmpLib->output == 0x0) { - linkerFd = fopen(lib,"rb"); + /* Hack because we have no ld path set */ + sprintf(tmpFile,"sys:/lib/%s",lib); + linkerFd = fopen(tmpFile,"rb"); if (linkerFd->fd == 0x0) { printf("Could not open library: %s\n",lib); exit(-1); diff --git a/src/bin/login/main.c b/src/bin/login/main.c index 3b7b25b..a8fa813 100644 --- a/src/bin/login/main.c +++ b/src/bin/login/main.c @@ -134,7 +134,7 @@ } fclose(fd); //chdir(data[i].path); - chdir("sys:/"); + chdir("sys:/bin/"); exec(data[i].shell,0x0,0x0); printf("Error: Problem Starting Shell\n"); exit(-1); diff --git a/src/bin/shell/exec.c b/src/bin/shell/exec.c index 1a34679..d3eec3f 100644 --- a/src/bin/shell/exec.c +++ b/src/bin/shell/exec.c @@ -29,10 +29,12 @@ #include "shell.h" void execProgram(inputBuffer *data) { + char file[1024]; int cPid = 0x0; cPid = fork(); if (!cPid) { - exec(data->argv[0],data->argc,data->argv); + sprintf(file,"%s%s",cwd,data->argv[0]); + exec(file,data->argc,data->argv); printf("%s: Command Not Found.\n",data->argv[0]); exit(-1); } diff --git a/src/sys/devfs/devfs.c b/src/sys/devfs/devfs.c index c564f23..0f0e6aa 100644 --- a/src/sys/devfs/devfs.c +++ b/src/sys/devfs/devfs.c @@ -70,7 +70,8 @@ spinUnlock(&devfsSpinLock); return(0x1); } - + if (file[0] == '/') + file++; for (tmpDev = fsInfo->deviceList;tmpDev != 0x0;tmpDev = tmpDev->next) { if (strcmp(tmpDev->devName,file) == 0x0) { switch ((fd->mode & 0x3)) { diff --git a/src/sys/kernel/exec.c b/src/sys/kernel/exec.c index 17919d3..b8e420d 100644 --- a/src/sys/kernel/exec.c +++ b/src/sys/kernel/exec.c @@ -314,7 +314,6 @@ _current->imageFd = tmpFd; /* If We Dont Find the File Return */ if (tmpFd == 0x0) { - kprintf("Couldn't open file %s\n",file); return; } if (tmpFd->perms == 0) { diff --git a/src/sys/pci/hd.c b/src/sys/pci/hd.c index c358a33..8710425 100644 --- a/src/sys/pci/hd.c +++ b/src/sys/pci/hd.c @@ -78,7 +78,7 @@ if (device_add(0,'c',devInfo) == 0x0) { kprintf("ad0 - Start: [0x0], Size: [0x%x/0x%X]\n",hdd->hdSize,hdd->hdSize*512); - devfs_makeNode("ad0",'c',0x1,0x0); + devfs_makeNode("ad0",'b',0x1,0x0); hdRead(devInfo->info,data,0x0,0x1); for (i = 0x0;i < 0x4;i++) { if (d[i].dp_type != 0x0) { @@ -92,7 +92,7 @@ if (device_add(minor,'c',devInfo2) == 0x0) { sprintf(name,"ad0s%i",i + 1); kprintf("%s - Type: [0x%X], Start: [0x%X], Size: [0x%X]\n",name,d[i].dp_type,d[i].dp_start,d[i].dp_size); - devfs_makeNode(name,'c',0x1,0x1); + devfs_makeNode(name,'c',0x1,minor); if (d[i].dp_type == 0xA5) { //Why do i need to add 1? hdRead(devInfo->info,data2,d[i].dp_start + 1,0x1); @@ -109,6 +109,7 @@ devInfo2->info = hdd2; minor++; device_add(minor,'c',devInfo2); + devfs_makeNode(name,'c',0x1,minor); kprintf("%s - Type: [%s], Start: [0x%X], Size: [0x%X], MM: [%i:%i]\n",name,fstypenames[bsdd->d_partitions[x].p_fstype],bsdd->d_partitions[x].p_offset,bsdd->d_partitions[x].p_size,devInfo->major,minor); } } @@ -286,6 +287,7 @@ short transactionCount = 0x0; short *tmp = (short *)baseAddr; startSector += hdd->parOffset; + if (hdd->hdEnable == 0x0) { kprintf("Invalid Drive\n"); return; @@ -345,6 +347,9 @@ /*** $Log$ + Revision 1.4 2006/10/10 14:14:01 reddawg + UFS Reading + Revision 1.3 2006/10/09 02:58:05 reddawg Fixing UFS diff --git a/src/sys/ufs/ufs.c b/src/sys/ufs/ufs.c index ca7b687..e1d25e3 100644 --- a/src/sys/ufs/ufs.c +++ b/src/sys/ufs/ufs.c @@ -269,8 +269,6 @@ fd->offset = 0x0; fd->ino = ino; if (ino == 0x0) { - kprintf("File Not Found\n"); - while (1); return(-1); }