diff --git a/BUGS b/BUGS index fc14b77..937a905 100644 --- a/BUGS +++ b/BUGS @@ -1,5 +1,9 @@ -$Id$ - -Bugs: - -Tons? ;) \ No newline at end of file +$Id$ + +Bugs: + +10/12/06 - + If you disable the FDC the keyboard also becomes disabled + +10/12/06 - + UFS is hacked to get correct file size diff --git a/src/bin/init/main.c b/src/bin/init/main.c index 7be38fb..86d6144 100644 --- a/src/bin/init/main.c +++ b/src/bin/init/main.c @@ -83,7 +83,7 @@ i = fork(); if (0 == i) { printf("Starting Login Daemon.\n"); - exec("sys:/ubix/login",0x0,0x0); + exec("sys:/bin/login",0x0,0x0); printf("Error Starting System\n"); exit(0x0); } diff --git a/src/bin/ld/addlibrary.c b/src/bin/ld/addlibrary.c index 71eec3b..4652367 100644 --- a/src/bin/ld/addlibrary.c +++ b/src/bin/ld/addlibrary.c @@ -15,7 +15,6 @@ printf("malloc failed: tmpLib\n"); exit(0x1); } - if (tmpLib->output == 0x0) { linkerFd = fopen(lib,"rb"); if (linkerFd->fd == 0x0) { @@ -62,8 +61,7 @@ /* Not sure... */ break; default: - printf("Unhandled Header : %08x\n", - tmpLib->linkerProgramHeader[i].phType); + printf("Unhandled Header (ld.so) : %08x\n", tmpLib->linkerProgramHeader[i].phType); break; } } diff --git a/src/bin/login/main.c b/src/bin/login/main.c index 7c3b5c7..3b7b25b 100644 --- a/src/bin/login/main.c +++ b/src/bin/login/main.c @@ -66,7 +66,6 @@ int foo; - printf("HI"); if ((getuid() != 0x0) && (getgid() != 0x0)) { printf("This Application Must Be Run As Root.\n"); exit(-1); @@ -76,7 +75,7 @@ exit(0x1); } - fd = fopen("sys:/userdb","r"); + fd = fopen("sys:/etc/userdb","r"); if (fd->fd == 0x0) { printf("file not found!!!\n"); exit(0x1); @@ -124,7 +123,7 @@ printf("Set GID Failed\n"); } fd = 0x0; - fd = fopen("sys:/motd","r"); + fd = fopen("sys:/etc/motd","r"); //if ((fd = fopen("sys:/motd","r")) == 0x0) { if (fd == 0x0) { printf("No MOTD"); diff --git a/src/sys/Makefile b/src/sys/Makefile index 0a80e95..4cbf51d 100644 --- a/src/sys/Makefile +++ b/src/sys/Makefile @@ -68,9 +68,10 @@ (cd compile;make) install: - (cd compile;cp ./ubix.elf /mnts/ubix/boot/loader) +# (cd compile;cp ./ubix.elf /mnts/ubix/boot/loader) # (cd boot;make install) # (cd ../tools/;make format-dsk) + (cd ../tools/;make install-ubix) clean: (cd init;make clean) diff --git a/src/sys/include/ubixos/init.h b/src/sys/include/ubixos/init.h index 8c3596a..934df5f 100644 --- a/src/sys/include/ubixos/init.h +++ b/src/sys/include/ubixos/init.h @@ -68,7 +68,7 @@ devfs_init, //pci_init, ubixfs_init, - //fdc_init, + fdc_init, tty_init, ufs_init, initHardDisk, diff --git a/src/sys/init/main.c b/src/sys/init/main.c index f98aa8d..3f97453 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -120,7 +120,7 @@ execThread(systemTask, (uInt32)sysTask+0x2000,0x0); - execFile("sys:/ubix/init",0x0,0x0,0x0); /* OS Initializer */ + execFile("sys:/bin/init",0x0,0x0,0x0); /* OS Initializer */ irqEnable(0x0); diff --git a/src/sys/kernel/exec.c b/src/sys/kernel/exec.c index 7a7c64f..17919d3 100644 --- a/src/sys/kernel/exec.c +++ b/src/sys/kernel/exec.c @@ -310,9 +310,7 @@ elfProgramHeader *programHeader = 0x0; elfSectionHeader *sectionHeader = 0x0; elfDynamic *elfDynamicS = 0x0; - kprintf("HI!!! [%s]\n", file); tmpFd = fopen(file,"r"); - kprintf("OH!!!\n"); _current->imageFd = tmpFd; /* If We Dont Find the File Return */ if (tmpFd == 0x0) { diff --git a/src/sys/kernel/ld.c b/src/sys/kernel/ld.c index 1357c76..ad95697 100644 --- a/src/sys/kernel/ld.c +++ b/src/sys/kernel/ld.c @@ -56,7 +56,7 @@ elfPltInfo *elfRel = 0x0; /* Open our dynamic linker */ - ldFd = fopen("sys:/ld.so","rb"); + ldFd = fopen("sys:/lib/ld.so","rb"); if (ldFd == 0x0) { kprintf("Can not open ld.so\n"); @@ -108,7 +108,7 @@ /* Not sure... */ break; default: - kprintf("Unhandled Header : %08x\n", programHeader[i].phType); + kprintf("Unhandled Header (kernel) : %08x\n", programHeader[i].phType); break; } } diff --git a/src/sys/ufs/ufs.c b/src/sys/ufs/ufs.c index 0d7cc15..ca7b687 100644 --- a/src/sys/ufs/ufs.c +++ b/src/sys/ufs/ufs.c @@ -64,8 +64,6 @@ static int sblock_try[] = SBLOCKSEARCH; -static int blah = 0x0; - #if defined(UFS2_ONLY) #define DIP(field) dp2.field #elif defined(UFS1_ONLY) @@ -146,7 +144,8 @@ } s = buf; size = DIP(di_size); - kprintf("Size: [%i]\n",size); + fd->size = size; + //kprintf("Size: [%i]\n",size); n = size - fd->offset; if (nbyte > n) nbyte = n; @@ -263,19 +262,23 @@ static int ufs_openFile(const char *file, fileDescriptor *fd) { + char tmp[2]; int ino = 0; - kprintf("ufs.c: openFile\n"); fd->dmadat = (struct dmadat *)kmalloc(sizeof(struct dmadat)); ino = lookup(file,fd); fd->offset = 0x0; fd->ino = ino; - if (ino == 0x0) + if (ino == 0x0) { + kprintf("File Not Found\n"); + while (1); return(-1); + } + /* Quick Hack for file size */ + fsread(fd->ino,&tmp,1,fd); + fd->offset = 0; /* Return */ fd->perms = 0x1; - kprintf("[%i]\n",blah); - blah++; return(0x1); } diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index e7cb2aa..192db9c 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -271,7 +271,6 @@ char fileName[1024]; fileDescriptor *tmpFd = 0x0; - kprintf("NO?\n"); /* Allocate Memory For File Descriptor */ if((tmpFd = (fileDescriptor *)kmalloc(sizeof(fileDescriptor))) == 0x0) { kprintf("Error: tmpFd == NULL, File: %s, Line: %i\n",__FILE__,__LINE__); @@ -279,7 +278,6 @@ } sprintf(fileName,"%s",file); - kprintf("file.c: fopen\n"); if (strstr(fileName,":")) { mountPoint = (char *)strtok((char *)&fileName,":"); path = strtok(NULL,"\n"); @@ -334,7 +332,6 @@ break; } } - kprintf("file.c: a [%s]\n",tmpFd->fileName); /* Search For The File */ if (tmpFd->mp->fs->vfsOpenFile(tmpFd->fileName,tmpFd) == 0x1) { /* If The File Is Found Then Set Up The Descriptor */ @@ -350,7 +347,6 @@ spinUnlock(&fdTable_lock); return 0x1; } - kprintf("file.c: b\n"); /* Set Its Status To Open */ tmpFd->status = fdOpen; diff --git a/src/tools/Makefile b/src/tools/Makefile index 4f2ee0d..c3ac050 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -36,6 +36,18 @@ clean: $(REMOVE) $(OBJS) $(BINARY) *.core +install-ubix: + (cp ../sys/compile/ubix.elf /mnts/ubix/boot/loader) + (cp ../bin/init/init /mnts/ubix/bin) + (cp ../bin/login/login /mnts/ubix/bin) + (cp ../bin/shell/shell /mnts/ubix/bin) + (cp ../bin/clock/clock /mnts/ubix/bin) + (cp ../bin/fdisk/fdisk /mnts/ubix/bin) + (cp ../bin/ld/ld.so /mnts/ubix/lib) + (cp ../lib/libc_old/libc_old.so /mnts/ubix/lib) + (cp ./userdb /mnts/ubix/etc) + (cp ./motd /mnts/ubix/etc) + format-dsk: (cp ../sys/compile/ubix.elf ./) (cp ../sys/compile/ubix.elf /ubixos) diff --git a/src/tools/Makefile.old b/src/tools/Makefile.old new file mode 100644 index 0000000..4f2ee0d --- /dev/null +++ b/src/tools/Makefile.old @@ -0,0 +1,77 @@ +# $Id$ +# Kernel Makefile (C) 2002 The UbixOS Project + +# Include Global 'Source' Options +include ../Makefile.inc + +CC=gcc + +#Kernel File Name +BINARY = format + +#Objects +OBJS = format.o + +# Link the kernel statically with fixed text+data address @1M +$(BINARY) : $(OBJS) + $(CC) -o $@ $(OBJS) + +# Compile the source files +.cc.o: + $(CXX) -Wall -fomit-frame-pointer -O -I../sys/include -c -o $@ $< + +.cc.s: + $(CXX) -Wall -fomit-frame-pointer -O -I../sys/include -S -o $@ $< + +.c.o: + $(CC) -Wall -O -c -o $@ $< + +.c.s: + $(CC) -Wall -fomit-frame-pointer -O -I../sys/include -S -o $@ $< + +.S.o: + $(CC) -Wall -fomit-frame-pointer -c -o $@ $< + +# Clean up the junk +clean: + $(REMOVE) $(OBJS) $(BINARY) *.core + +format-dsk: + (cp ../sys/compile/ubix.elf ./) + (cp ../sys/compile/ubix.elf /ubixos) + (cp ../bin/init/init ./) + (cp ../bin/stat/stat ./) + (cp ../bin/login/login ./) + (cp ../bin/shell/shell ./) + (cp ../bin/ls/ls ./) + (cp ../bin/clock/clock ./) + (cp ../lib/libc_old/libc_old.so ./) + (cp ../bin/fdisk/fdisk ./) + (cp ../bin/cp/cp ./) + #(cp ../bin/format/format ./) + (cp ../bin/ubistry/ubistry ./) + (cp ../sys/boot/mbr/mbr ./) + (cp ../bin/ld/ld.so ./) + #(cp /lib/libc.so.5 ./) + (cp ../bin/ttyd/ttyd ./) + (./format 50 2000 ${FD_DEVICE} ubix.elf 0 login 3754 init 3754 stat 3754 ubistry 3754 shell 3754 userdb 3754 ls 3754 motd 3754 fdisk 3754 cp 3754 clock 3754 libc_old.so 3754 ld.so 3754 ttyd 3754 ) +# (./format 50 7000 ${FD_DEVICE} ubix.elf 0 login 3754 init 3754 ubistry 3754 shell 3754 userdb 3754 motd 3754 libc_old.so 3754 ld.so 3754 test 3754 libc.so.5 3754) + + #(./format 263 204361 /dev/md1 ubix.elf 0 format 3754 fdisk 3754 ROM8X14.DPF 3754 init 3754 login 3754 shell 3754 userdb 3754 ls 3754 motd 3754 cp 3754) + #(./format 1064 2000 ${FD_DEVICE} shell 3754 clock 3754) + #(./format 200 2000 /dev/md1 ubix.elf 0 shell 3754 motd 3754 libc_old.so 3754) + (rm -fr ubix.elf) + (rm -fr login) + (rm -fr init) + (rm -fr shell) + (rm -fr ls) + (rm -fr clock) + (rm -fr libc_old.so) + (rm -fr cp) + (rm -fr fdisk) + #(rm -fr format) + + (rm -fr ubistry) + (rm -fr ld.so) + (rm -fr libc.so.5) + (rm -fr ttyd) diff --git a/src/tools/makeuser.c b/src/tools/makeuser.c index 29d6ce5..5f5086c 100644 --- a/src/tools/makeuser.c +++ b/src/tools/makeuser.c @@ -18,21 +18,21 @@ out = fopen("./userdb","wbb"); sprintf(password[0].username,"root"); sprintf(password[0].passwd,"user"); - sprintf(password[0].shell,"shell@sys"); + sprintf(password[0].shell,"sys:/bin/shell"); sprintf(password[0].realname,"Root User"); sprintf(password[0].path,"root"); password[0].uid = 0; password[0].gid = 0; sprintf(password[1].username,"guest"); sprintf(password[1].passwd,"user"); - sprintf(password[1].shell,"shell@sys"); + sprintf(password[1].shell,"sys:/bin/shell"); sprintf(password[1].realname,"Guest User"); sprintf(password[1].path,"guest"); password[1].uid = 1; password[1].gid = 1; sprintf(password[2].username,"reddawg"); sprintf(password[2].passwd,"temp123"); - sprintf(password[2].shell,"shell@sys"); + sprintf(password[2].shell,"sys:/bin/shell"); sprintf(password[2].realname,"Christopher"); sprintf(password[2].path,"reddawg"); password[2].uid = 1000; diff --git a/src/tools/userdb b/src/tools/userdb index af82415..ed464e7 100644 --- a/src/tools/userdb +++ b/src/tools/userdb Binary files differ