diff --git a/compile/Makefile b/compile/Makefile index 45ba89e..3d78e64 100644 --- a/compile/Makefile +++ b/compile/Makefile @@ -17,13 +17,13 @@ $(error PLATFORM is not set. Edit your Makedefs file and add 'PLATFORM=arm-qemu' endif ifeq ($(PLATFORM),arm-qemu) - PLAT_CFLAGS = -DARM_QEMU -mcpu=arm1176jz-s -ggdb3 + PLAT_CFLAGS = -DARM_QEMU -mcpu=arm1176jz-s -ggdb3 PLAT_LOADADDR = 0x00010000 else ifeq ($(PLATFORM),arm-bbb) - PLAT_CFLAGS = -DARM_BBB -mcpu=cortex-a8 + PLAT_CFLAGS = -DARM_BBB -mcpu=cortex-a8 PLAT_LOADADDR = 0x81000000 else ifeq ($(PLATFORM),x86-galileo) - PLAT_CFLAGS = + PLAT_CFLAGS = endif TOPDIR = .. @@ -56,7 +56,7 @@ REBUILDFLAGS += -s $(TOPDIR)/device/tty \ -s $(TOPDIR)/device/lfs \ -s $(TOPDIR)/device/uart \ -s $(TOPDIR)/device/uart-pl011 \ - -s $(TOPDIR)/device/loopback + -s $(TOPDIR)/device/loopback else ifeq ($(PLATFORM),arm-bbb) REBUILDFLAGS += -s $(TOPDIR)/device/tty \ @@ -138,7 +138,7 @@ uboot-tool/mkimage: uboot-tool/mkimage.c @echo making mkimage @(cd uboot-tool; make) -$(BLDDIRS): +$(BLDDIRS): @mkdir -p $(BLDDIRS) objects: $(LD_LIST) @@ -179,7 +179,7 @@ etags: @(cd $(TOPDIR); find . -name '*.[chS]' -exec etags -a {} \;) qemu: xinu - export QEMU_AUDIO_DRV=wav; export QEMU_WAV_PATH=$(TOPDIR)/compile/.wav.wav; qemu-system-arm -M versatilepb -m 512M -nographic -cpu arm1176 -kernel xinu.boot + export QEMU_AUDIO_DRV=wav; export QEMU_WAV_PATH=$(TOPDIR)/compile/.wav.wav; qemu-system-arm -M versatilepb -m 512M -nographic -cpu arm1176 -kernel xinu.boot qemu-gdb: xinu export QEMU_AUDIO_DRV=wav; export QEMU_WAV_PATH=$(TOPDIR)/compile/.wav.wav;qemu-system-arm -M versatilepb -m 512M -nographic -cpu arm1176 -kernel xinu.boot -S -gdb tcp::${GPORT} diff --git a/device/rds/rdsinit.c b/device/rds/rdsinit.c index b06533c..5881706 100644 --- a/device/rds/rdsinit.c +++ b/device/rds/rdsinit.c @@ -15,7 +15,7 @@ devcall rdsinit ( struct rdscblk *rdptr; /* Ptr to device contol block */ struct rdbuff *bptr; /* Ptr to buffer in memory */ /* used to form linked list */ - struct rdbuff *pptr; /* Ptr to previous buff on list */ + struct rdbuff *pptr = NULL; /* Ptr to previous buff on list */ struct rdbuff *buffend; /* Last address in buffer memory*/ uint32 size; /* Total size of memory needed */ /* buffers */ @@ -28,7 +28,7 @@ devcall rdsinit ( rdptr->rd_state = RD_FREE; rdptr->rd_id[0] = NULLCH; - + /* Set initial message sequence number */ rdptr->rd_seq = 1; @@ -68,7 +68,10 @@ devcall rdsinit ( pptr->rd_status = RD_INVALID; /* Buffer is empty */ pptr->rd_next = bptr; /* Point to next buffer */ } - pptr->rd_next = (struct rdbuff *) NULL; /* Last buffer on list */ + + if (pptr != NULL) { + pptr->rd_next = (struct rdbuff *) NULL; /* Last buffer on list */ + } /* Create the request list and available buffer semaphores */ diff --git a/device/rfs/rflputc.c b/device/rfs/rflputc.c index e09290b..d7e06e3 100644 --- a/device/rfs/rflputc.c +++ b/device/rfs/rflputc.c @@ -11,10 +11,6 @@ devcall rflputc( char ch /* Character to write */ ) { - struct rflcblk *rfptr; /* Pointer to rfl control block */ - - rfptr = &rfltab[devptr->dvminor]; - if (rflwrite(devptr, &ch, 1) != 1) { return SYSERR; } diff --git a/device/rfs/rfscomm.c b/device/rfs/rfscomm.c index bd48aac..834c10e 100644 --- a/device/rfs/rfscomm.c +++ b/device/rfs/rfscomm.c @@ -18,7 +18,6 @@ int32 rfscomm ( int32 retval; /* Return value */ int32 seq; /* Sequence for this exchange */ int16 rtype; /* Reply type in host byte order*/ - int32 slot; /* UDP slot */ /* For the first time after reboot, register the server port */ diff --git a/device/uart/kvprintf.c b/device/uart/kvprintf.c index 863f274..1c0da57 100644 --- a/device/uart/kvprintf.c +++ b/device/uart/kvprintf.c @@ -9,6 +9,9 @@ #include #include +void _doprnt(const char *, va_list, int (*)(int, int), int); +int kputc(int, int); + /** * @ingroup uartgeneric * @@ -26,14 +29,13 @@ */ syscall kvprintf(const char *format, va_list ap) { - int retval; intmask im; /* Note: it isn't strictly necessary to disable global interrupts here, but * it prevents kprintf()'s from stepping on each other toes if you happen to * call kprintf() from an interrupt handler. */ im = disable(); - retval = _doprnt(format, ap, (int (*)(int, int))kputc, (int)&devtab[SERIAL0]); + _doprnt(format, ap, (int (*)(int, int))kputc, (int)&devtab[SERIAL0]); restore(im); - return retval; + return OK; } diff --git a/include/dns.h b/include/dns.h index a13f3f7..6bb1706 100644 --- a/include/dns.h +++ b/include/dns.h @@ -47,3 +47,5 @@ struct dns_rr { uint16 *rdlen; /* RR RD Length */ char *rdata; /* RR Data */ }; + +uint32 dns_qa(char* dname); diff --git a/include/interrupt.h b/include/interrupt.h index 19800aa..bb3fdb8 100644 --- a/include/interrupt.h +++ b/include/interrupt.h @@ -48,6 +48,8 @@ void restore(intmask); void enable_irq(intmask); void disable_irq(intmask); +int32 initintc(void); + #define INTC_SYSCONFIG_SOFTRESET 0x00000002 #define INTC_SYSSTATUS_RESETDONE 0x00000001 diff --git a/include/kernel.h b/include/kernel.h index 9079c67..7a9c7c1 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -65,4 +65,3 @@ extern qid16 readylist; /* global ID for list of ready processes*/ /* Size of the stack for the null process */ #define NULLSTK 8192 /* stack size for null process */ - diff --git a/include/prototypes.h b/include/prototypes.h index bf32551..3ad5eeb 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -117,6 +117,8 @@ extern syscall getc(did32); /* in file getitem.c */ extern pid32 getfirst(qid16); +pid32 getitem(pid32); + /* in file getmem.c */ extern char *getmem(uint32); @@ -365,6 +367,11 @@ extern syscall ptsend(int32, umsg32); /* in file putc.c */ extern syscall putc(did32, char); +/* in file queue.c */ + +pid32 dequeue(qid16); +pid32 enqueue(pid32, qid16); + /* in file ramclose.c */ extern devcall ramclose(struct dentry *); @@ -629,7 +636,7 @@ devcall loopbackGetc(struct dentry *); devcall loopbackPutc(struct dentry *, char); devcall loopbackControl(struct dentry *, int, long, long); -syscall kputc(uchar c, struct dentry *devptr); +syscall kprintf(char *fmt, ...); #endif /* ARM_QEMU */ #ifdef ARM_BBB diff --git a/include/string.h b/include/string.h index 43ba7ec..3087017 100644 --- a/include/string.h +++ b/include/string.h @@ -6,5 +6,6 @@ extern int32 strncmp(const char *, const char *, int32); extern char *strchr(const char *, int32); extern char *strrchr(const char *, int32); extern char *strstr(const char *, const char *); -extern int32 strnlen(const char *, uint32); +extern int32 strnlen(const char *, uint32); extern int strlen(char *str); +int strcpy(char *tar, char *src); diff --git a/lib/doscan.c b/lib/doscan.c index 677375f..8bebb30 100644 --- a/lib/doscan.c +++ b/lib/doscan.c @@ -160,7 +160,7 @@ static int _innum(int **ptr, int type, int len, int size, register char *np; char numbuf[64]; register char c, base; - int expseen, negflg, c1, ndigit; + int negflg, c1, ndigit; long lcval; if (type == 'c' || type == 's' || type == '[') @@ -181,7 +181,6 @@ static int _innum(int **ptr, int type, int len, int size, base = 16; } np = numbuf; - expseen = 0; negflg = 0; while ((c = (*getch) (arg1, arg2)) == ' ' || c == '\t' || c == '\n') {; diff --git a/shell/xsh_mmu.c b/shell/xsh_mmu.c index 6aad89e..1a7ca26 100644 --- a/shell/xsh_mmu.c +++ b/shell/xsh_mmu.c @@ -5,14 +5,14 @@ #include void function1(){ - int *num = 0x10900000; + int *num = (int*)0x10900000; *num = 300; printf("[process ID=%d]Value at address 0x%x is %d\n",currpid,num,*num); } shellcmd xsh_mmu(int32 args,char *argv[]) { - int *num = 0x10900000; - int *num1 = 0x11C00000; + int *num = (int*)0x10900000; + int *num1 = (int*)0x11C00000; *num = 100; *num1 = 200; printf("[process ID=%d]Value at address 0x%x is %d\n",currpid,num,*num); diff --git a/system/evec.c b/system/evec.c index 1e267cb..5b19af3 100644 --- a/system/evec.c +++ b/system/evec.c @@ -81,8 +81,8 @@ void irq_dispatch() /* If a handler is set for the interrupt, call it */ - if(intc_vector[xnum]) { - handler = intc_vector[xnum]; + if (intc_vector[xnum]) { + handler = (interrupt(*)(void))intc_vector[xnum]; handler(xnum); } diff --git a/system/platform/arm-bbb/clkhandler.c b/system/platform/arm-bbb/clkhandler.c index ffd2be3..2d5e67d 100644 --- a/system/platform/arm-bbb/clkhandler.c +++ b/system/platform/arm-bbb/clkhandler.c @@ -10,7 +10,7 @@ void clkhandler() { static uint32 count1000 = 1000; /* variable to count 1000ms */ - volatile struct am335x_timer1ms *csrptr = 0x44E31000; + volatile struct am335x_timer1ms *csrptr = (struct am335x_timer1ms *)0x44E31000; /* Pointer to timer CSR */ /* If there is no interrupt, return */ diff --git a/system/platform/arm-bbb/xsh_ping.c b/system/platform/arm-bbb/xsh_ping.c index a678c9b..b83b596 100644 --- a/system/platform/arm-bbb/xsh_ping.c +++ b/system/platform/arm-bbb/xsh_ping.c @@ -3,6 +3,7 @@ #include #include #include +#include /*------------------------------------------------------------------------ * xsh_ping - shell command to ping a remote host diff --git a/system/platform/arm-qemu/gettime.c b/system/platform/arm-qemu/gettime.c index 34c3c0c..e1d853a 100644 --- a/system/platform/arm-qemu/gettime.c +++ b/system/platform/arm-qemu/gettime.c @@ -22,9 +22,6 @@ status gettime( uint32 *timvar /* Location to store the result */ ) { - uint32 now; /* Current time (UCT) */ - int32 retval; /* Return value from call */ - /* Get current time in UCT representation (GMT) */ //retval = getutime(&now); diff --git a/system/platform/arm-qemu/kprintf.c b/system/platform/arm-qemu/kprintf.c index d52d8cd..9a61cfb 100644 --- a/system/platform/arm-qemu/kprintf.c +++ b/system/platform/arm-qemu/kprintf.c @@ -7,6 +7,8 @@ #include #include +syscall kvprintf(const char *format, va_list ap); + /** * @ingroup uartgeneric *