diff --git a/FIX b/FIX new file mode 100644 index 0000000..0b4bf17 --- /dev/null +++ b/FIX @@ -0,0 +1 @@ +libc __swbuf diff --git a/src/bin/edit/Makefile b/src/bin/edit/Makefile index 61736ff..4df4473 100644 --- a/src/bin/edit/Makefile +++ b/src/bin/edit/Makefile @@ -23,6 +23,8 @@ STARTUP = ../../lib/csu/*.o +CFLAGS += -ggdb + # Link The Binary $(BINARY) : $(OBJS) $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS) diff --git a/src/bin/edit/main.c b/src/bin/edit/main.c index f1cc47a..e79c04d 100644 --- a/src/bin/edit/main.c +++ b/src/bin/edit/main.c @@ -67,6 +67,7 @@ free(a); a = malloc(512); printf("[0x%X]\n",a); + putchar('A'); return(0); } diff --git a/src/bin/ls/Makefile b/src/bin/ls/Makefile index d3695ba..24360c2 100644 --- a/src/bin/ls/Makefile +++ b/src/bin/ls/Makefile @@ -23,6 +23,8 @@ STARTUP = ../../lib/csu/*.o +CFLAGS += -fno-strict-aliasing -pipe + # Link The Binary $(BINARY) : $(OBJS) $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS) diff --git a/src/bin/ls/ls.c b/src/bin/ls/ls.c index 0c62e7b..8d515a6 100644 --- a/src/bin/ls/ls.c +++ b/src/bin/ls/ls.c @@ -177,6 +177,8 @@ termwidth = atoi(p); } + printf("termwidth: %i\n",termwidth); + fts_options = FTS_PHYSICAL; while ((ch = getopt(argc, argv, "1ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx")) != -1) { diff --git a/src/bin/ls/print.c b/src/bin/ls/print.c index 37d3772..5616b2b 100644 --- a/src/bin/ls/print.c +++ b/src/bin/ls/print.c @@ -295,10 +295,13 @@ colwidth += 1; colwidth = (colwidth + tabwidth) & ~(tabwidth - 1); + printf("colwidth: %i\n",colwidth); if (termwidth < 2 * colwidth) { printscol(dp); return; } + + printf("termwidth: %i\n",termwidth); numcols = termwidth / colwidth; numrows = num / numcols; if (num % numcols) @@ -328,8 +331,6 @@ if (f_sortacross && col + 1 >= numcols) break; (void)putchar(f_notabs ? ' ' : '\t'); - //Hack - printf("%s",f_notabs ? ' ' : '\t'); chcnt = cnt; } endcol += colwidth; @@ -360,6 +361,8 @@ if (f_size) chcnt += printf("%*jd ", (int)sizefield, howmany(sp->st_blocks, blocksize)); + +printf("f_size: %i\n",f_size); #ifdef COLORLS if (f_color) color_printed = colortype(sp->st_mode); diff --git a/src/bin/ls/util.c b/src/bin/ls/util.c index ebed01d..e3f6026 100644 --- a/src/bin/ls/util.c +++ b/src/bin/ls/util.c @@ -96,6 +96,7 @@ memset(&mbs, 0, sizeof(mbs)); n = 0; while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) { + printf("CLEN: %i - %i - %i\n",clen,(size_t)-1,(size_t)-2); if (clen == (size_t)-1) { putchar('?'); s++; @@ -109,11 +110,13 @@ break; } if (!iswprint(wc)) { + printf("WTF?\n"); putchar('?'); s += clen; n++; continue; } + printf("HERE?\n"); for (i = 0; i < (int)clen; i++) putchar((unsigned char)s[i]); s += clen; diff --git a/src/include.new/stdio.h b/src/include.new/stdio.h index ef3f0ab..7be075e 100644 --- a/src/include.new/stdio.h +++ b/src/include.new/stdio.h @@ -385,7 +385,9 @@ * The __sfoo macros are here so that we can * define function versions in the C library. */ + #define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) +/* #if defined(__GNUC__) && defined(__STDC__) static __inline int __sputc(int _c, FILE *_p) { if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) @@ -394,6 +396,7 @@ return (__swbuf(_c, _p)); } #else +*/ /* * This has been tuned to generate reasonable code on the vax using pcc. */ @@ -405,7 +408,9 @@ __swbuf('\n', p) : \ __swbuf((int)(c), p) : \ (*(p)->_p = (c), (int)*(p)->_p++)) +/* #endif +*/ #define __sfeof(p) (((p)->_flags & __SEOF) != 0) #define __sferror(p) (((p)->_flags & __SERR) != 0) diff --git a/src/lib/libc/stdio/putchar.c b/src/lib/libc/stdio/putchar.c index 74e55ca..7be59d5 100644 --- a/src/lib/libc/stdio/putchar.c +++ b/src/lib/libc/stdio/putchar.c @@ -57,7 +57,8 @@ { int retval; FILE *so = stdout; -printf("putchar\n"); + +printf("[%c]",c); FLOCKFILE(so); /* Orientation set by __sputc() when buffer is full. */ diff --git a/src/lib/libc/stdio/wbuf.c b/src/lib/libc/stdio/wbuf.c index 3697be8..bb4a197 100644 --- a/src/lib/libc/stdio/wbuf.c +++ b/src/lib/libc/stdio/wbuf.c @@ -56,7 +56,10 @@ FILE *fp; { int n; - +/* HACK MUST FIX */ +printf("(%c)",c); +return(c); +printf("__swbuf!\n"); /* * In case we cannot write, or longjmp takes us out early, * make sure _w is 0 (if fully- or un-buffered) or -_bf._size diff --git a/src/sys/kernel/kern_descrip.c b/src/sys/kernel/kern_descrip.c index 45edcdd..e0815fc 100644 --- a/src/sys/kernel/kern_descrip.c +++ b/src/sys/kernel/kern_descrip.c @@ -183,11 +183,27 @@ * \returns NULL for now */ int ioctl(struct thread *td, struct ioctl_args *uap) { + short *tmpShort = 0x0; #ifdef NOTIMP kprintf("[%s:%i:%s]",__FILE__,__LINE__,__FUNCTION__); #endif - kprintf("ioctl: %i, 0x%X\n",uap->fd,uap->com); + if (uap->fd == 1) { + switch (uap->com) { + case 0x40087468: + tmpShort = uap->data; + tmpShort[0] = 0x25; + tmpShort[1] = 0x9B; + tmpShort[2] = 0x0; + tmpShort[3] = 0x0; + break; + default: + kprintf("Unknown Com: 0x%X\n",uap->com); + } + } + else { + kprintf("ioctl: %i, 0x%X\n",uap->fd,uap->com); + } td->td_retval[0] = 0x0; return(0x0);