From 6f0cd91423b588fd20a434db7eb0af4580fbda3d Mon Sep 17 00:00:00 2001 From: Rafael Zurita Date: Sun, 17 May 2020 23:45:52 -0300 Subject: [PATCH] Compila y llego a nulluser --- LICENSE | 20 + README.md | 34 + compile/.defs | 318 +++ compile/.deps | 2683 ++++++++++++++++++++++ compile/.vers_num | 1 + compile/DAC_OUT_PUT1.txt | 1 + compile/DAC_OUT_PUT2.txt | 1 + compile/Makefile | 199 ++ compile/bin/build-make | 710 ++++++ compile/bin/mkvers | 27 + compile/binaries/getchar.o | Bin 0 -> 900 bytes compile/binaries/putchar.o | Bin 0 -> 900 bytes compile/binaries/qsort.o | Bin 0 -> 2024 bytes compile/original/Makefile.orig | 189 ++ compile/original/flash.sh | 1 + compile/original/ld.script | 135 ++ compile/original/ld.script.avr | 135 ++ compile/original/ld.script.avr.baremetal | 105 + compile/original/ld.script.avr2 | 149 ++ compile/original/ld.script.stm32 | 55 + compile/version | 1 + compile/xinu.hex | 1108 +++++++++ compile/xinu.map | 1332 +++++++++++ config/Configuration | 119 + config/Configuration.orig | 106 + config/DESCRIPTION | 111 + config/Makefile | 41 + config/conf.c | 44 + config/conf.h | 50 + config/config.l | 40 + config/config.y | 754 ++++++ device/eth/ethcontrol.c | 35 + device/eth/ethhandler.c | 123 + device/eth/ethinit.c | 403 ++++ device/eth/ethread.c | 69 + device/eth/ethwrite.c | 84 + device/lfs/lfdballoc.c | 40 + device/lfs/lfdbfree.c | 25 + device/lfs/lfflush.c | 42 + device/lfs/lfgetmode.c | 61 + device/lfs/lfiballoc.c | 33 + device/lfs/lfibclear.c | 22 + device/lfs/lfibget.c | 31 + device/lfs/lfibput.c | 43 + device/lfs/lflclose.c | 38 + device/lfs/lflcontrol.c | 47 + device/lfs/lflgetc.c | 52 + device/lfs/lflinit.c | 46 + device/lfs/lflputc.c | 64 + device/lfs/lflread.c | 39 + device/lfs/lflseek.c | 41 + device/lfs/lflwrite.c | 29 + device/lfs/lfscheck.c | 40 + device/lfs/lfsckfmt.c | 65 + device/lfs/lfscreate.c | 74 + device/lfs/lfsetup.c | 122 + device/lfs/lfsinit.c | 32 + device/lfs/lfsopen.c | 185 ++ device/lfs/lftruncate.c | 104 + device/movidos/gpio/gpiocontrol.c | 64 + device/movidos/gpio/gpiohandler.c | 85 + device/movidos/gpio/gpioinit.c | 42 + device/movidos/gpio/gpioread.c | 27 + device/movidos/gpio/gpioselect.c | 25 + device/movidos/gpio/gpiowrite.c | 31 + device/movidos/ram/ramclose.c | 14 + device/movidos/ram/raminit.c | 19 + device/movidos/ram/ramopen.c | 19 + device/movidos/ram/ramread.c | 21 + device/movidos/ram/ramwrite.c | 21 + device/movidos/tty/ttycontrol.c | 58 + device/movidos/tty/ttygetc.c | 41 + device/movidos/tty/ttyhandle_in.c | 267 +++ device/movidos/tty/ttyhandle_out.c | 83 + device/movidos/tty/ttyhandler.c | 114 + device/movidos/tty/ttyinit.c | 83 + device/movidos/tty/ttykickout.c | 19 + device/movidos/tty/ttyputc.c | 44 + device/movidos/tty/ttyread.c | 68 + device/movidos/tty/ttywrite.c | 29 + device/nam/mount.c | 76 + device/nam/naminit.c | 93 + device/nam/nammap.c | 135 ++ device/nam/namopen.c | 29 + device/rds/rdsbufalloc.c | 50 + device/rds/rdsclose.c | 60 + device/rds/rdscomm.c | 124 + device/rds/rdscontrol.c | 131 ++ device/rds/rdsinit.c | 108 + device/rds/rdsopen.c | 93 + device/rds/rdsprocess.c | 212 ++ device/rds/rdsread.c | 130 ++ device/rds/rdswrite.c | 97 + device/rfs/rflclose.c | 32 + device/rfs/rflgetc.c | 23 + device/rfs/rflinit.c | 29 + device/rfs/rflputc.c | 19 + device/rfs/rflread.c | 100 + device/rfs/rflseek.c | 33 + device/rfs/rflwrite.c | 97 + device/rfs/rfscomm.c | 85 + device/rfs/rfscontrol.c | 114 + device/rfs/rfsgetmode.c | 63 + device/rfs/rfsinit.c | 39 + device/rfs/rfsndmsg.c | 46 + device/rfs/rfsopen.c | 114 + device/spi/spicontrol.c | 19 + device/spi/spiinit.c | 36 + device/spi/spiputc.c | 21 + include/arp.h | 50 + include/bufpool.h | 27 + include/clk.h | 82 + include/cortexm3.h | 27 + include/ctype.h | 33 + include/date.h | 67 + include/debug.h | 8 + include/delay.h | 25 + include/device.h | 7 + include/dhcp.h | 58 + include/dns.h | 61 + include/ether.h | 116 + include/ethloop.h | 65 + include/file.h | 20 + include/flash.h | 263 +++ include/gpio.h | 154 ++ include/gpioselect.h | 160 ++ include/icmp.h | 31 + include/icu.h | 9 + include/interrupt.h | 34 + include/ip.h | 25 + include/kernel.h | 95 + include/lfilesys.h | 176 ++ include/limits.h | 30 + include/mark.h | 16 + include/memory.h | 38 + include/messages.h | 14 + include/name.h | 22 + include/net.h | 69 + include/ports.h | 31 + include/process.h | 63 + include/prototypes.h | 633 +++++ include/queue.h | 36 + include/ramdisk.h | 12 + include/rdisksys.h | 235 ++ include/resched.h | 16 + include/rfilesys.h | 292 +++ include/semaphore.h | 22 + include/serial_avr.h | 21 + include/shell.h | 77 + include/shprototypes.h | 74 + include/spi.h | 37 + include/stdarg.h | 15 + include/stddef.h | 7 + include/stdio.h | 34 + include/stdlib.h | 19 + include/string.h | 10 + include/syscall.h | 60 + include/testsuite.h | 38 + include/tftp.h | 67 + include/timer.h | 37 + include/tty.h | 84 + include/uart.h | 45 + include/udp.h | 33 + include/userland.h | 6 + include/xinu.h | 51 + lib/ctype_.c | 32 + lib/doprnt.c | 432 ++++ lib/doscan.c | 406 ++++ lib/messages.c | 14 + lib/original/abs.c | 14 + lib/original/atoi.c | 34 + lib/original/atol.c | 35 + lib/original/bzero.c | 24 + lib/original/fdoprnt.c | 371 +++ lib/original/fgetc.c | 28 + lib/original/fgets.c | 43 + lib/original/fprintf.c | 28 + lib/original/fputc.c | 30 + lib/original/fputs.c | 27 + lib/original/fscanf.c | 69 + lib/original/getchar.c | 15 + lib/original/labs.c | 14 + lib/original/memchr.c | 0 lib/original/memcmp.c | 26 + lib/original/memcpy.c | 23 + lib/original/memset.c | 23 + lib/original/printf.c | 28 + lib/original/putchar.c | 15 + lib/original/qsort.c | 162 ++ lib/original/rand.c | 38 + lib/original/sprintf.c | 43 + lib/original/sscanf.c | 50 + lib/original/strchr.c | 27 + lib/original/strcmp.c | 25 + lib/original/strcpy.c | 16 + lib/original/strlen.c | 20 + lib/original/strncat.c | 28 + lib/original/strncmp.c | 23 + lib/original/strncpy.c | 30 + lib/original/strnlen.c | 20 + lib/original/strrchr.c | 30 + lib/original/strstr.c | 38 + lib/userland.c | 43 + lib/userland.c.orig | 40 + screenshot.png | Bin 0 -> 22649 bytes shell.orig/addargs.c | 93 + shell.orig/lexan.c | 148 ++ shell.orig/shell.c | 303 +++ shell.orig/xsh_argecho.c | 21 + shell.orig/xsh_cat.c | 59 + shell.orig/xsh_clear.c | 22 + shell.orig/xsh_date.c | 69 + shell.orig/xsh_devdump.c | 36 + shell.orig/xsh_echo.c | 24 + shell.orig/xsh_exit.c | 13 + shell.orig/xsh_help.c | 124 + shell.orig/xsh_kill.c | 66 + shell.orig/xsh_memdump.c | 165 ++ shell.orig/xsh_memstat.c | 115 + shell.orig/xsh_ps.c | 69 + shell.orig/xsh_rdstest.c | 118 + shell.orig/xsh_sleep.c | 58 + shell.orig/xsh_uptime.c | 76 + shell/addargs.c | 93 + shell/lexan.c | 148 ++ shell/shell.c | 35 + system/ascdate.c | 231 ++ system/blink_avr.c | 21 + system/bufinit.c | 16 + system/chprio.c | 28 + system/clkhandler.c | 63 + system/clkinit.c | 63 + system/close.c | 26 + system/control.c | 29 + system/create.c | 118 + system/debug.c | 78 + system/evec.c | 150 ++ system/evec.c.orig | 117 + system/exit.c | 12 + system/freebuf.c | 39 + system/freemem.c | 70 + system/getbuf.c | 43 + system/getc.c | 26 + system/getdev.c | 26 + system/getitem.c | 58 + system/getmem.c | 50 + system/getpid.c | 12 + system/getprio.c | 24 + system/getstk.c | 52 + system/getticks.c | 14 + system/gettime.c | 28 + system/init.c | 26 + system/initialize.c | 283 +++ system/initialize.c.orig | 261 +++ system/insert.c | 36 + system/insertd.c | 42 + system/intr.S | 60 + system/intr.S.orig | 60 + system/ioerr.c | 12 + system/ionull.c | 12 + system/kill.c | 59 + system/kprintf.c | 57 + system/main.c | 31 + system/mark.c | 47 + system/meminit.c | 39 + system/mkbufpool.c | 55 + system/newqueue.c | 30 + system/open.c | 41 + system/panic.c | 16 + system/platinit.c | 85 + system/ptclear.c | 50 + system/ptcount.c | 44 + system/ptcreate.c | 46 + system/ptdelete.c | 27 + system/ptinit.c | 45 + system/ptrecv.c | 48 + system/ptreset.c | 27 + system/ptsend.c | 60 + system/putc.c | 27 + system/queue.c | 52 + system/read.c | 28 + system/ready.c | 30 + system/receive.c | 25 + system/recvclr.c | 25 + system/recvtime.c | 45 + system/resched.c | 146 ++ system/resched.c.orig | 138 ++ system/resume.c | 35 + system/seek.c | 27 + system/semcount.c | 26 + system/semcreate.c | 50 + system/semdelete.c | 36 + system/semreset.c | 35 + system/send.c | 41 + system/serial_avr.c | 130 ++ system/signal.c | 31 + system/signaln.c | 37 + system/sleep.c | 54 + system/start.S | 53 + system/start.S.avr | 51 + system/start.S.orig | 94 + system/suspend.c | 41 + system/syscall.c | 102 + system/syscall.c.orig | 101 + system/unsleep.c | 47 + system/userret.c | 12 + system/wait.c | 39 + system/wakeup.c | 19 + system/write.c | 28 + system/xdone.c | 14 + system/yield.c | 17 + xinu-avr-port.txt | 26 + 312 files changed, 26551 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 compile/.defs create mode 100644 compile/.deps create mode 100644 compile/.vers_num create mode 100644 compile/DAC_OUT_PUT1.txt create mode 100644 compile/DAC_OUT_PUT2.txt create mode 100644 compile/Makefile create mode 100755 compile/bin/build-make create mode 100755 compile/bin/mkvers create mode 100644 compile/binaries/getchar.o create mode 100644 compile/binaries/putchar.o create mode 100644 compile/binaries/qsort.o create mode 100644 compile/original/Makefile.orig create mode 100755 compile/original/flash.sh create mode 100644 compile/original/ld.script create mode 100644 compile/original/ld.script.avr create mode 100644 compile/original/ld.script.avr.baremetal create mode 100644 compile/original/ld.script.avr2 create mode 100644 compile/original/ld.script.stm32 create mode 100644 compile/version create mode 100644 compile/xinu.hex create mode 100644 compile/xinu.map create mode 100644 config/Configuration create mode 100644 config/Configuration.orig create mode 100644 config/DESCRIPTION create mode 100644 config/Makefile create mode 100644 config/conf.c create mode 100644 config/conf.h create mode 100644 config/config.l create mode 100644 config/config.y create mode 100644 device/eth/ethcontrol.c create mode 100644 device/eth/ethhandler.c create mode 100755 device/eth/ethinit.c create mode 100755 device/eth/ethread.c create mode 100644 device/eth/ethwrite.c create mode 100644 device/lfs/lfdballoc.c create mode 100644 device/lfs/lfdbfree.c create mode 100644 device/lfs/lfflush.c create mode 100644 device/lfs/lfgetmode.c create mode 100644 device/lfs/lfiballoc.c create mode 100644 device/lfs/lfibclear.c create mode 100644 device/lfs/lfibget.c create mode 100644 device/lfs/lfibput.c create mode 100644 device/lfs/lflclose.c create mode 100644 device/lfs/lflcontrol.c create mode 100644 device/lfs/lflgetc.c create mode 100644 device/lfs/lflinit.c create mode 100644 device/lfs/lflputc.c create mode 100644 device/lfs/lflread.c create mode 100644 device/lfs/lflseek.c create mode 100644 device/lfs/lflwrite.c create mode 100644 device/lfs/lfscheck.c create mode 100644 device/lfs/lfsckfmt.c create mode 100644 device/lfs/lfscreate.c create mode 100644 device/lfs/lfsetup.c create mode 100644 device/lfs/lfsinit.c create mode 100644 device/lfs/lfsopen.c create mode 100644 device/lfs/lftruncate.c create mode 100644 device/movidos/gpio/gpiocontrol.c create mode 100644 device/movidos/gpio/gpiohandler.c create mode 100644 device/movidos/gpio/gpioinit.c create mode 100644 device/movidos/gpio/gpioread.c create mode 100644 device/movidos/gpio/gpioselect.c create mode 100644 device/movidos/gpio/gpiowrite.c create mode 100644 device/movidos/ram/ramclose.c create mode 100644 device/movidos/ram/raminit.c create mode 100644 device/movidos/ram/ramopen.c create mode 100644 device/movidos/ram/ramread.c create mode 100644 device/movidos/ram/ramwrite.c create mode 100644 device/movidos/tty/ttycontrol.c create mode 100644 device/movidos/tty/ttygetc.c create mode 100644 device/movidos/tty/ttyhandle_in.c create mode 100644 device/movidos/tty/ttyhandle_out.c create mode 100644 device/movidos/tty/ttyhandler.c create mode 100644 device/movidos/tty/ttyinit.c create mode 100644 device/movidos/tty/ttykickout.c create mode 100644 device/movidos/tty/ttyputc.c create mode 100644 device/movidos/tty/ttyread.c create mode 100644 device/movidos/tty/ttywrite.c create mode 100644 device/nam/mount.c create mode 100644 device/nam/naminit.c create mode 100644 device/nam/nammap.c create mode 100644 device/nam/namopen.c create mode 100644 device/rds/rdsbufalloc.c create mode 100644 device/rds/rdsclose.c create mode 100644 device/rds/rdscomm.c create mode 100644 device/rds/rdscontrol.c create mode 100644 device/rds/rdsinit.c create mode 100644 device/rds/rdsopen.c create mode 100644 device/rds/rdsprocess.c create mode 100644 device/rds/rdsread.c create mode 100644 device/rds/rdswrite.c create mode 100644 device/rfs/rflclose.c create mode 100644 device/rfs/rflgetc.c create mode 100644 device/rfs/rflinit.c create mode 100644 device/rfs/rflputc.c create mode 100644 device/rfs/rflread.c create mode 100644 device/rfs/rflseek.c create mode 100644 device/rfs/rflwrite.c create mode 100644 device/rfs/rfscomm.c create mode 100644 device/rfs/rfscontrol.c create mode 100644 device/rfs/rfsgetmode.c create mode 100644 device/rfs/rfsinit.c create mode 100644 device/rfs/rfsndmsg.c create mode 100644 device/rfs/rfsopen.c create mode 100644 device/spi/spicontrol.c create mode 100644 device/spi/spiinit.c create mode 100644 device/spi/spiputc.c create mode 100644 include/arp.h create mode 100644 include/bufpool.h create mode 100644 include/clk.h create mode 100644 include/cortexm3.h create mode 100644 include/ctype.h create mode 100644 include/date.h create mode 100644 include/debug.h create mode 100644 include/delay.h create mode 100644 include/device.h create mode 100644 include/dhcp.h create mode 100644 include/dns.h create mode 100644 include/ether.h create mode 100644 include/ethloop.h create mode 100644 include/file.h create mode 100644 include/flash.h create mode 100644 include/gpio.h create mode 100644 include/gpioselect.h create mode 100644 include/icmp.h create mode 100644 include/icu.h create mode 100644 include/interrupt.h create mode 100644 include/ip.h create mode 100644 include/kernel.h create mode 100644 include/lfilesys.h create mode 100644 include/limits.h create mode 100644 include/mark.h create mode 100644 include/memory.h create mode 100644 include/messages.h create mode 100644 include/name.h create mode 100644 include/net.h create mode 100644 include/ports.h create mode 100644 include/process.h create mode 100644 include/prototypes.h create mode 100644 include/queue.h create mode 100644 include/ramdisk.h create mode 100644 include/rdisksys.h create mode 100644 include/resched.h create mode 100644 include/rfilesys.h create mode 100644 include/semaphore.h create mode 100644 include/serial_avr.h create mode 100644 include/shell.h create mode 100644 include/shprototypes.h create mode 100644 include/spi.h create mode 100644 include/stdarg.h create mode 100644 include/stddef.h create mode 100644 include/stdio.h create mode 100644 include/stdlib.h create mode 100644 include/string.h create mode 100644 include/syscall.h create mode 100644 include/testsuite.h create mode 100644 include/tftp.h create mode 100644 include/timer.h create mode 100644 include/tty.h create mode 100644 include/uart.h create mode 100644 include/udp.h create mode 100644 include/userland.h create mode 100644 include/xinu.h create mode 100644 lib/ctype_.c create mode 100644 lib/doprnt.c create mode 100644 lib/doscan.c create mode 100644 lib/messages.c create mode 100644 lib/original/abs.c create mode 100644 lib/original/atoi.c create mode 100644 lib/original/atol.c create mode 100644 lib/original/bzero.c create mode 100644 lib/original/fdoprnt.c create mode 100644 lib/original/fgetc.c create mode 100644 lib/original/fgets.c create mode 100644 lib/original/fprintf.c create mode 100644 lib/original/fputc.c create mode 100644 lib/original/fputs.c create mode 100644 lib/original/fscanf.c create mode 100644 lib/original/getchar.c create mode 100644 lib/original/labs.c create mode 100644 lib/original/memchr.c create mode 100644 lib/original/memcmp.c create mode 100644 lib/original/memcpy.c create mode 100644 lib/original/memset.c create mode 100644 lib/original/printf.c create mode 100644 lib/original/putchar.c create mode 100644 lib/original/qsort.c create mode 100644 lib/original/rand.c create mode 100644 lib/original/sprintf.c create mode 100644 lib/original/sscanf.c create mode 100644 lib/original/strchr.c create mode 100644 lib/original/strcmp.c create mode 100644 lib/original/strcpy.c create mode 100644 lib/original/strlen.c create mode 100644 lib/original/strncat.c create mode 100644 lib/original/strncmp.c create mode 100644 lib/original/strncpy.c create mode 100644 lib/original/strnlen.c create mode 100644 lib/original/strrchr.c create mode 100644 lib/original/strstr.c create mode 100644 lib/userland.c create mode 100644 lib/userland.c.orig create mode 100644 screenshot.png create mode 100644 shell.orig/addargs.c create mode 100644 shell.orig/lexan.c create mode 100644 shell.orig/shell.c create mode 100644 shell.orig/xsh_argecho.c create mode 100644 shell.orig/xsh_cat.c create mode 100644 shell.orig/xsh_clear.c create mode 100644 shell.orig/xsh_date.c create mode 100644 shell.orig/xsh_devdump.c create mode 100644 shell.orig/xsh_echo.c create mode 100644 shell.orig/xsh_exit.c create mode 100644 shell.orig/xsh_help.c create mode 100644 shell.orig/xsh_kill.c create mode 100644 shell.orig/xsh_memdump.c create mode 100644 shell.orig/xsh_memstat.c create mode 100644 shell.orig/xsh_ps.c create mode 100644 shell.orig/xsh_rdstest.c create mode 100644 shell.orig/xsh_sleep.c create mode 100644 shell.orig/xsh_uptime.c create mode 100644 shell/addargs.c create mode 100644 shell/lexan.c create mode 100644 shell/shell.c create mode 100644 system/ascdate.c create mode 100644 system/blink_avr.c create mode 100644 system/bufinit.c create mode 100644 system/chprio.c create mode 100644 system/clkhandler.c create mode 100644 system/clkinit.c create mode 100644 system/close.c create mode 100644 system/control.c create mode 100644 system/create.c create mode 100644 system/debug.c create mode 100644 system/evec.c create mode 100644 system/evec.c.orig create mode 100644 system/exit.c create mode 100644 system/freebuf.c create mode 100644 system/freemem.c create mode 100644 system/getbuf.c create mode 100644 system/getc.c create mode 100644 system/getdev.c create mode 100644 system/getitem.c create mode 100644 system/getmem.c create mode 100644 system/getpid.c create mode 100644 system/getprio.c create mode 100644 system/getstk.c create mode 100644 system/getticks.c create mode 100644 system/gettime.c create mode 100644 system/init.c create mode 100644 system/initialize.c create mode 100644 system/initialize.c.orig create mode 100644 system/insert.c create mode 100644 system/insertd.c create mode 100644 system/intr.S create mode 100644 system/intr.S.orig create mode 100644 system/ioerr.c create mode 100644 system/ionull.c create mode 100644 system/kill.c create mode 100644 system/kprintf.c create mode 100644 system/main.c create mode 100644 system/mark.c create mode 100644 system/meminit.c create mode 100644 system/mkbufpool.c create mode 100644 system/newqueue.c create mode 100644 system/open.c create mode 100644 system/panic.c create mode 100644 system/platinit.c create mode 100644 system/ptclear.c create mode 100644 system/ptcount.c create mode 100644 system/ptcreate.c create mode 100644 system/ptdelete.c create mode 100644 system/ptinit.c create mode 100644 system/ptrecv.c create mode 100644 system/ptreset.c create mode 100644 system/ptsend.c create mode 100644 system/putc.c create mode 100644 system/queue.c create mode 100644 system/read.c create mode 100644 system/ready.c create mode 100644 system/receive.c create mode 100644 system/recvclr.c create mode 100644 system/recvtime.c create mode 100644 system/resched.c create mode 100644 system/resched.c.orig create mode 100644 system/resume.c create mode 100644 system/seek.c create mode 100644 system/semcount.c create mode 100644 system/semcreate.c create mode 100644 system/semdelete.c create mode 100644 system/semreset.c create mode 100644 system/send.c create mode 100644 system/serial_avr.c create mode 100644 system/signal.c create mode 100644 system/signaln.c create mode 100644 system/sleep.c create mode 100644 system/start.S create mode 100644 system/start.S.avr create mode 100644 system/start.S.orig create mode 100644 system/suspend.c create mode 100644 system/syscall.c create mode 100644 system/syscall.c.orig create mode 100644 system/unsleep.c create mode 100644 system/userret.c create mode 100644 system/wait.c create mode 100644 system/wakeup.c create mode 100644 system/write.c create mode 100644 system/xdone.c create mode 100644 system/yield.c create mode 100644 xinu-avr-port.txt diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0864627 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Portions of this software are covered by the following copyright: + + Copyright (c) 2012, 2015 Douglas E. Comer and CRC Press, Inc. + All rights reserved. + +Redistribution and use in source and binary forms are permitted +provided that this notice is preserved and that due credit is given +to the copyright holders. The names of the copyright holders +may not be used to endorse or promote products derived from this +software without specific prior written permission. This software +is provided `as is'' without express or implied warranty. The author +assumes no liability for damages incidental or consequential, nor is the +software warranted for correctness or suitability for any purpose. + Portions of this software are documented in the book: + + Operating System Design -- The Xinu Approach, CRC Press, + Boca Raton, FL, Linksys version 2012, Second Edition 2015. + +This software may not be sold or published in printed form without written +permission from the copyright holders. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9fab1de --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +## What is Xinu? +Xinu stands for Xinu Is Not Unix -- although it shares concepts and even names with Unix, the internal design differs completely. Xinu is a small, elegant operating system that supports dynamic process creation, dynamic memory allocation, network communication, local and remote file systems, a shell, and device-independent I/O functions. The small size makes Xinu suitable for embedded environments. + +## What is Xinu for STM32 +Xinu for STM32 is a port of the ARM version of Xinu. The STM32 family of 32-bit microcontrollers is a popular SoC based on the Arm Cortex-M processor. +Besides porting the original version, Xinu for STM32 is extended with the following specific Cortex-M* features: + +* Shadowed Stack Pointer: Two stack pointers are available. The MSP is used +for the OS Kernel and interrupt handlers. The PSP is used by application +tasks. +* PendSV exception for scheduling: If Xinu decides that context switching is needed, +it sets the pending status of the PendSV, and delays the context-switching +request until all other IRQ handlers have completed their processing before +carrying out the PendSV exception + +## Supported Peripherals (currently) +* UART (Serial) +* GPIO +* SPI + +## Tested boards +1. STM32F103* - https://stm32-base.org/boards/STM32F103RCT6-STM32-Mini-V2.0 +2. Qemu for STM32 - https://github.com/beckus/qemu_stm32 + +## How to build and run +Xinu for STM32 uses simple Makefiles. The source code should be compiled with a cross compiler (i.e. Ubuntu's standard package: GCC cross compiler for ARM Cortex-A/R/M processors) +STM32Flash (https://sourceforge.net/projects/stm32flash) can be used for flashing the compiled code to the device's flash ROM. Use `qemu make` to run Xinu for STM32 in Qemu. Please note that this version of qemu should be manually build (see https://github.com/beckus/qemu_stm32) + + +## Screenshots +![Screenshot](https://github.com/robinkrens/xinu-for-stm32/raw/master/screenshot.png "bootscreen") + +More general information about Xinu can be found at https://xinu.cs.purdue.edu/ + diff --git a/compile/.defs b/compile/.defs new file mode 100644 index 0000000..c4a77d6 --- /dev/null +++ b/compile/.defs @@ -0,0 +1,318 @@ +#-------------------------------------------------------------------------------# +# # +# Definitions generated by build-make on dom may 17 23:40:51 -03 2020 # +# # +#-------------------------------------------------------------------------------# + +SRC_CFILES = +SRC_SFILES = + + + +#------------------------------------------------------------------ +# +# Directory ../system +# +#------------------------------------------------------------------ + +SYSTEM_SFILES = \ + intr.S start.S + +SYSTEM_CFILES = \ + ascdate.c blink_avr.c bufinit.c chprio.c clkhandler.c \ + clkinit.c close.c conf.c control.c create.c \ + debug.c evec.c exit.c freebuf.c freemem.c \ + getbuf.c getc.c getdev.c getitem.c getmem.c \ + getpid.c getprio.c getstk.c getticks.c gettime.c \ + init.c initialize.c insert.c insertd.c ioerr.c \ + ionull.c kill.c kprintf.c main.c mark.c \ + meminit.c mkbufpool.c newqueue.c open.c panic.c \ + platinit.c ptclear.c ptcount.c ptcreate.c ptdelete.c \ + ptinit.c ptrecv.c ptreset.c ptsend.c putc.c \ + queue.c read.c ready.c receive.c recvclr.c \ + recvtime.c resched.c resume.c seek.c semcount.c \ + semcreate.c semdelete.c semreset.c send.c serial_avr.c \ + signal.c signaln.c sleep.c suspend.c syscall.c \ + unsleep.c userret.c wait.c wakeup.c write.c \ + xdone.c yield.c + +SRC_CFILES += ${SYSTEM_CFILES} +SRC_SFILES += ${SYSTEM_SFILES} +SYSTEM_CFULL += ${SYSTEM_CFILES:%=../system/%} +SYSTEM_SFULL += ${SYSTEM_SFILES:%=../system/%} +SRC_CFULL += ${SYSTEM_CFULL} +SRC_SFULL += ${SYSTEM_SFULL} + + +#------------------------------------------------------------------ +# +# Directory ../lib +# +#------------------------------------------------------------------ + +LIB_CFILES = \ + ctype_.c doprnt.c doscan.c messages.c userland.c + +SRC_CFILES += ${LIB_CFILES} +LIB_CFULL += ${LIB_CFILES:%=../lib/%} +SRC_CFULL += ${LIB_CFULL} + + +#------------------------------------------------------------------ +# +# Directory ../device/nam +# +#------------------------------------------------------------------ + +DEVICE_NAM_CFILES = \ + mount.c naminit.c nammap.c namopen.c + +SRC_CFILES += ${DEVICE_NAM_CFILES} +DEVICE_NAM_CFULL += ${DEVICE_NAM_CFILES:%=../device/nam/%} +SRC_CFULL += ${DEVICE_NAM_CFULL} + + +#------------------------------------------------------------------ +# +# Directory ../shell +# +#------------------------------------------------------------------ + +SHELL_CFILES = \ + addargs.c lexan.c shell.c + +SRC_CFILES += ${SHELL_CFILES} +SHELL_CFULL += ${SHELL_CFILES:%=../shell/%} +SRC_CFULL += ${SHELL_CFULL} + + +#-------------------------------------------------------------------------------# +# # +# Rules For Generating Object Files # +# # +#-------------------------------------------------------------------------------# + +OBJ_TMP = ${patsubst %.s,%.o,$(SRC_SFILES)} # substitute .s => .o +OBJ_SFILES = ${patsubst %.S,%.o,$(OBJ_TMP)} # substitute .S => .o +OBJ_CFILES = ${patsubst %.c,%.o,$(SRC_CFILES)} # substitute .c => .o +OBJ_LIST = ${OBJ_CFILES} ${OBJ_SFILES} +OBJ_FILES = ${OBJ_LIST:%=binaries/%} +SRC_FULL = ${SRC_CFULL} ${SRC_SFULL} + +#------------------------------------------------------------------ +# Rules for files in directory ../system +#------------------------------------------------------------------ + +binaries/intr.o: ../system/intr.S + ${CC} ${CFLAGS} -o binaries/intr.o ../system/intr.S +binaries/start.o: ../system/start.S + ${CC} ${CFLAGS} -o binaries/start.o ../system/start.S +binaries/ascdate.o: ../system/ascdate.c + ${CC} ${CFLAGS} -o binaries/ascdate.o ../system/ascdate.c +binaries/blink_avr.o: ../system/blink_avr.c + ${CC} ${CFLAGS} -o binaries/blink_avr.o ../system/blink_avr.c +binaries/bufinit.o: ../system/bufinit.c + ${CC} ${CFLAGS} -o binaries/bufinit.o ../system/bufinit.c +binaries/chprio.o: ../system/chprio.c + ${CC} ${CFLAGS} -o binaries/chprio.o ../system/chprio.c +binaries/clkhandler.o: ../system/clkhandler.c + ${CC} ${CFLAGS} -o binaries/clkhandler.o ../system/clkhandler.c +binaries/clkinit.o: ../system/clkinit.c + ${CC} ${CFLAGS} -o binaries/clkinit.o ../system/clkinit.c +binaries/close.o: ../system/close.c + ${CC} ${CFLAGS} -o binaries/close.o ../system/close.c +binaries/conf.o: ../system/conf.c + ${CC} ${CFLAGS} -o binaries/conf.o ../system/conf.c +binaries/control.o: ../system/control.c + ${CC} ${CFLAGS} -o binaries/control.o ../system/control.c +binaries/create.o: ../system/create.c + ${CC} ${CFLAGS} -o binaries/create.o ../system/create.c +binaries/debug.o: ../system/debug.c + ${CC} ${CFLAGS} -o binaries/debug.o ../system/debug.c +binaries/evec.o: ../system/evec.c + ${CC} ${CFLAGS} -o binaries/evec.o ../system/evec.c +binaries/exit.o: ../system/exit.c + ${CC} ${CFLAGS} -o binaries/exit.o ../system/exit.c +binaries/freebuf.o: ../system/freebuf.c + ${CC} ${CFLAGS} -o binaries/freebuf.o ../system/freebuf.c +binaries/freemem.o: ../system/freemem.c + ${CC} ${CFLAGS} -o binaries/freemem.o ../system/freemem.c +binaries/getbuf.o: ../system/getbuf.c + ${CC} ${CFLAGS} -o binaries/getbuf.o ../system/getbuf.c +binaries/getc.o: ../system/getc.c + ${CC} ${CFLAGS} -o binaries/getc.o ../system/getc.c +binaries/getdev.o: ../system/getdev.c + ${CC} ${CFLAGS} -o binaries/getdev.o ../system/getdev.c +binaries/getitem.o: ../system/getitem.c + ${CC} ${CFLAGS} -o binaries/getitem.o ../system/getitem.c +binaries/getmem.o: ../system/getmem.c + ${CC} ${CFLAGS} -o binaries/getmem.o ../system/getmem.c +binaries/getpid.o: ../system/getpid.c + ${CC} ${CFLAGS} -o binaries/getpid.o ../system/getpid.c +binaries/getprio.o: ../system/getprio.c + ${CC} ${CFLAGS} -o binaries/getprio.o ../system/getprio.c +binaries/getstk.o: ../system/getstk.c + ${CC} ${CFLAGS} -o binaries/getstk.o ../system/getstk.c +binaries/getticks.o: ../system/getticks.c + ${CC} ${CFLAGS} -o binaries/getticks.o ../system/getticks.c +binaries/gettime.o: ../system/gettime.c + ${CC} ${CFLAGS} -o binaries/gettime.o ../system/gettime.c +binaries/init.o: ../system/init.c + ${CC} ${CFLAGS} -o binaries/init.o ../system/init.c +binaries/initialize.o: ../system/initialize.c + ${CC} ${CFLAGS} -o binaries/initialize.o ../system/initialize.c +binaries/insert.o: ../system/insert.c + ${CC} ${CFLAGS} -o binaries/insert.o ../system/insert.c +binaries/insertd.o: ../system/insertd.c + ${CC} ${CFLAGS} -o binaries/insertd.o ../system/insertd.c +binaries/ioerr.o: ../system/ioerr.c + ${CC} ${CFLAGS} -o binaries/ioerr.o ../system/ioerr.c +binaries/ionull.o: ../system/ionull.c + ${CC} ${CFLAGS} -o binaries/ionull.o ../system/ionull.c +binaries/kill.o: ../system/kill.c + ${CC} ${CFLAGS} -o binaries/kill.o ../system/kill.c +binaries/kprintf.o: ../system/kprintf.c + ${CC} ${CFLAGS} -o binaries/kprintf.o ../system/kprintf.c +binaries/main.o: ../system/main.c + ${CC} ${CFLAGS} -o binaries/main.o ../system/main.c +binaries/mark.o: ../system/mark.c + ${CC} ${CFLAGS} -o binaries/mark.o ../system/mark.c +binaries/meminit.o: ../system/meminit.c + ${CC} ${CFLAGS} -o binaries/meminit.o ../system/meminit.c +binaries/mkbufpool.o: ../system/mkbufpool.c + ${CC} ${CFLAGS} -o binaries/mkbufpool.o ../system/mkbufpool.c +binaries/newqueue.o: ../system/newqueue.c + ${CC} ${CFLAGS} -o binaries/newqueue.o ../system/newqueue.c +binaries/open.o: ../system/open.c + ${CC} ${CFLAGS} -o binaries/open.o ../system/open.c +binaries/panic.o: ../system/panic.c + ${CC} ${CFLAGS} -o binaries/panic.o ../system/panic.c +binaries/platinit.o: ../system/platinit.c + ${CC} ${CFLAGS} -o binaries/platinit.o ../system/platinit.c +binaries/ptclear.o: ../system/ptclear.c + ${CC} ${CFLAGS} -o binaries/ptclear.o ../system/ptclear.c +binaries/ptcount.o: ../system/ptcount.c + ${CC} ${CFLAGS} -o binaries/ptcount.o ../system/ptcount.c +binaries/ptcreate.o: ../system/ptcreate.c + ${CC} ${CFLAGS} -o binaries/ptcreate.o ../system/ptcreate.c +binaries/ptdelete.o: ../system/ptdelete.c + ${CC} ${CFLAGS} -o binaries/ptdelete.o ../system/ptdelete.c +binaries/ptinit.o: ../system/ptinit.c + ${CC} ${CFLAGS} -o binaries/ptinit.o ../system/ptinit.c +binaries/ptrecv.o: ../system/ptrecv.c + ${CC} ${CFLAGS} -o binaries/ptrecv.o ../system/ptrecv.c +binaries/ptreset.o: ../system/ptreset.c + ${CC} ${CFLAGS} -o binaries/ptreset.o ../system/ptreset.c +binaries/ptsend.o: ../system/ptsend.c + ${CC} ${CFLAGS} -o binaries/ptsend.o ../system/ptsend.c +binaries/putc.o: ../system/putc.c + ${CC} ${CFLAGS} -o binaries/putc.o ../system/putc.c +binaries/queue.o: ../system/queue.c + ${CC} ${CFLAGS} -o binaries/queue.o ../system/queue.c +binaries/read.o: ../system/read.c + ${CC} ${CFLAGS} -o binaries/read.o ../system/read.c +binaries/ready.o: ../system/ready.c + ${CC} ${CFLAGS} -o binaries/ready.o ../system/ready.c +binaries/receive.o: ../system/receive.c + ${CC} ${CFLAGS} -o binaries/receive.o ../system/receive.c +binaries/recvclr.o: ../system/recvclr.c + ${CC} ${CFLAGS} -o binaries/recvclr.o ../system/recvclr.c +binaries/recvtime.o: ../system/recvtime.c + ${CC} ${CFLAGS} -o binaries/recvtime.o ../system/recvtime.c +binaries/resched.o: ../system/resched.c + ${CC} ${CFLAGS} -o binaries/resched.o ../system/resched.c +binaries/resume.o: ../system/resume.c + ${CC} ${CFLAGS} -o binaries/resume.o ../system/resume.c +binaries/seek.o: ../system/seek.c + ${CC} ${CFLAGS} -o binaries/seek.o ../system/seek.c +binaries/semcount.o: ../system/semcount.c + ${CC} ${CFLAGS} -o binaries/semcount.o ../system/semcount.c +binaries/semcreate.o: ../system/semcreate.c + ${CC} ${CFLAGS} -o binaries/semcreate.o ../system/semcreate.c +binaries/semdelete.o: ../system/semdelete.c + ${CC} ${CFLAGS} -o binaries/semdelete.o ../system/semdelete.c +binaries/semreset.o: ../system/semreset.c + ${CC} ${CFLAGS} -o binaries/semreset.o ../system/semreset.c +binaries/send.o: ../system/send.c + ${CC} ${CFLAGS} -o binaries/send.o ../system/send.c +binaries/serial_avr.o: ../system/serial_avr.c + ${CC} ${CFLAGS} -o binaries/serial_avr.o ../system/serial_avr.c +binaries/signal.o: ../system/signal.c + ${CC} ${CFLAGS} -o binaries/signal.o ../system/signal.c +binaries/signaln.o: ../system/signaln.c + ${CC} ${CFLAGS} -o binaries/signaln.o ../system/signaln.c +binaries/sleep.o: ../system/sleep.c + ${CC} ${CFLAGS} -o binaries/sleep.o ../system/sleep.c +binaries/suspend.o: ../system/suspend.c + ${CC} ${CFLAGS} -o binaries/suspend.o ../system/suspend.c +binaries/syscall.o: ../system/syscall.c + ${CC} ${CFLAGS} -o binaries/syscall.o ../system/syscall.c +binaries/unsleep.o: ../system/unsleep.c + ${CC} ${CFLAGS} -o binaries/unsleep.o ../system/unsleep.c +binaries/userret.o: ../system/userret.c + ${CC} ${CFLAGS} -o binaries/userret.o ../system/userret.c +binaries/wait.o: ../system/wait.c + ${CC} ${CFLAGS} -o binaries/wait.o ../system/wait.c +binaries/wakeup.o: ../system/wakeup.c + ${CC} ${CFLAGS} -o binaries/wakeup.o ../system/wakeup.c +binaries/write.o: ../system/write.c + ${CC} ${CFLAGS} -o binaries/write.o ../system/write.c +binaries/xdone.o: ../system/xdone.c + ${CC} ${CFLAGS} -o binaries/xdone.o ../system/xdone.c +binaries/yield.o: ../system/yield.c + ${CC} ${CFLAGS} -o binaries/yield.o ../system/yield.c + +#------------------------------------------------------------------ +# Rules for files in directory ../lib +#------------------------------------------------------------------ + +binaries/ctype_.o: ../lib/ctype_.c + ${CC} ${CFLAGS} -o binaries/ctype_.o ../lib/ctype_.c +binaries/doprnt.o: ../lib/doprnt.c + ${CC} ${CFLAGS} -o binaries/doprnt.o ../lib/doprnt.c +binaries/doscan.o: ../lib/doscan.c + ${CC} ${CFLAGS} -o binaries/doscan.o ../lib/doscan.c +binaries/messages.o: ../lib/messages.c + ${CC} ${CFLAGS} -o binaries/messages.o ../lib/messages.c +binaries/userland.o: ../lib/userland.c + ${CC} ${CFLAGS} -o binaries/userland.o ../lib/userland.c + +#------------------------------------------------------------------ +# Rules for files in directory ../device/nam +#------------------------------------------------------------------ + +binaries/mount.o: ../device/nam/mount.c + ${CC} ${CFLAGS} -o binaries/mount.o ../device/nam/mount.c +binaries/naminit.o: ../device/nam/naminit.c + ${CC} ${CFLAGS} -o binaries/naminit.o ../device/nam/naminit.c +binaries/nammap.o: ../device/nam/nammap.c + ${CC} ${CFLAGS} -o binaries/nammap.o ../device/nam/nammap.c +binaries/namopen.o: ../device/nam/namopen.c + ${CC} ${CFLAGS} -o binaries/namopen.o ../device/nam/namopen.c + +#------------------------------------------------------------------ +# Rules for files in directory ../shell +#------------------------------------------------------------------ + +binaries/addargs.o: ../shell/addargs.c + ${CC} ${CFLAGS} -o binaries/addargs.o ../shell/addargs.c +binaries/lexan.o: ../shell/lexan.c + ${CC} ${CFLAGS} -o binaries/lexan.o ../shell/lexan.c +binaries/shell.o: ../shell/shell.c + ${CC} ${CFLAGS} -o binaries/shell.o ../shell/shell.c + +objs: ${OBJ_FILES} + +list_obj: + @echo ${OBJ_FILES} + +list_csrc: + @echo ${SRC_CFILES} + +list_ssrc: + @echo ${SRC_SFILES} + +# Export variables for recursive make calls (such as the library) + +export + diff --git a/compile/.deps b/compile/.deps new file mode 100644 index 0000000..4c6e4a0 --- /dev/null +++ b/compile/.deps @@ -0,0 +1,2683 @@ +ascdate.o: ../system/ascdate.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +bufinit.o: ../system/bufinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +chprio.o: ../system/chprio.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +clkhandler.o: ../system/clkhandler.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +clkinit.o: ../system/clkinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +close.o: ../system/close.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +conf.o: ../system/conf.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +control.o: ../system/control.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +create.o: ../system/create.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +evec.o: ../system/evec.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +exit.o: ../system/exit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +freebuf.o: ../system/freebuf.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +freemem.o: ../system/freemem.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getbuf.o: ../system/getbuf.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getc.o: ../system/getc.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getdev.o: ../system/getdev.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getitem.o: ../system/getitem.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getmem.o: ../system/getmem.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getpid.o: ../system/getpid.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getprio.o: ../system/getprio.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getstk.o: ../system/getstk.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getticks.o: ../system/getticks.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +gettime.o: ../system/gettime.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +getutime.o: ../system/getutime.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +init.o: ../system/init.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +initialize.o: ../system/initialize.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +insert.o: ../system/insert.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +insertd.o: ../system/insertd.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ioerr.o: ../system/ioerr.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ionull.o: ../system/ionull.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +kill.o: ../system/kill.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +kprintf.o: ../system/kprintf.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/stdarg.h +main.o: ../system/main.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +mark.o: ../system/mark.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +meminit.o: ../system/meminit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +mkbufpool.o: ../system/mkbufpool.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +newqueue.o: ../system/newqueue.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +open.o: ../system/open.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +panic.o: ../system/panic.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +platinit.o: ../system/platinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ptclear.o: ../system/ptclear.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ptcount.o: ../system/ptcount.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ptcreate.o: ../system/ptcreate.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ptdelete.o: ../system/ptdelete.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ptinit.o: ../system/ptinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ptrecv.o: ../system/ptrecv.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ptreset.o: ../system/ptreset.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ptsend.o: ../system/ptsend.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +putc.o: ../system/putc.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +queue.o: ../system/queue.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +read.o: ../system/read.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ready.o: ../system/ready.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +receive.o: ../system/receive.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +recvclr.o: ../system/recvclr.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +recvtime.o: ../system/recvtime.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +resched.o: ../system/resched.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +resume.o: ../system/resume.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +seek.o: ../system/seek.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +semcount.o: ../system/semcount.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +semcreate.o: ../system/semcreate.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +semdelete.o: ../system/semdelete.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +semreset.o: ../system/semreset.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +send.o: ../system/send.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +signal.o: ../system/signal.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +signaln.o: ../system/signaln.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +sleep.o: ../system/sleep.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +suspend.o: ../system/suspend.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +unsleep.o: ../system/unsleep.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +userret.o: ../system/userret.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +wait.o: ../system/wait.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +wakeup.o: ../system/wakeup.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +write.o: ../system/write.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xdone.o: ../system/xdone.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +yield.o: ../system/yield.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +abs.o: ../lib/abs.c +atoi.o: ../lib/atoi.c +atol.o: ../lib/atol.c +bzero.o: ../lib/bzero.c +ctype_.o: ../lib/ctype_.c ../include/ctype.h +doprnt.o: ../lib/doprnt.c ../include/stdarg.h +doscan.o: ../lib/doscan.c ../include/ctype.h +fdoprnt.o: ../lib/fdoprnt.c ../include/stdarg.h +fgetc.o: ../lib/fgetc.c +fgets.o: ../lib/fgets.c +fprintf.o: ../lib/fprintf.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/stdarg.h +fputc.o: ../lib/fputc.c +fputs.o: ../lib/fputs.c +fscanf.o: ../lib/fscanf.c +getchar.o: ../lib/getchar.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +labs.o: ../lib/labs.c +memchr.o: ../lib/memchr.c +memcmp.o: ../lib/memcmp.c +memcpy.o: ../lib/memcpy.c +memset.o: ../lib/memset.c +printf.o: ../lib/printf.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/stdarg.h +putchar.o: ../lib/putchar.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +qsort.o: ../lib/qsort.c +rand.o: ../lib/rand.c ../include/stdlib.h +sprintf.o: ../lib/sprintf.c ../include/stdarg.h +sscanf.o: ../lib/sscanf.c +strchr.o: ../lib/strchr.c +strcmp.o: ../lib/strcmp.c +strcpy.o: ../lib/strcpy.c +strlen.o: ../lib/strlen.c +strncat.o: ../lib/strncat.c +strncmp.o: ../lib/strncmp.c +strncpy.o: ../lib/strncpy.c +strnlen.o: ../lib/strnlen.c +strrchr.o: ../lib/strrchr.c +strstr.o: ../lib/strstr.c +ttycontrol.o: ../device/tty/ttycontrol.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ttygetc.o: ../device/tty/ttygetc.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ttyhandle_in.o: ../device/tty/ttyhandle_in.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ttyhandle_out.o: ../device/tty/ttyhandle_out.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ttyhandler.o: ../device/tty/ttyhandler.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ttyinit.o: ../device/tty/ttyinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ttykickout.o: ../device/tty/ttykickout.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ttyputc.o: ../device/tty/ttyputc.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ttyread.o: ../device/tty/ttyread.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ttywrite.o: ../device/tty/ttywrite.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +mount.o: ../device/nam/mount.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +naminit.o: ../device/nam/naminit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +nammap.o: ../device/nam/nammap.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +namopen.o: ../device/nam/namopen.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ethcontrol.o: ../device/eth/ethcontrol.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ethhandler.o: ../device/eth/ethhandler.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ethinit.o: ../device/eth/ethinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ethread.o: ../device/eth/ethread.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ethwrite.o: ../device/eth/ethwrite.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rdsbufalloc.o: ../device/rds/rdsbufalloc.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rdsclose.o: ../device/rds/rdsclose.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rdscomm.o: ../device/rds/rdscomm.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rdscontrol.o: ../device/rds/rdscontrol.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rdsinit.o: ../device/rds/rdsinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rdsopen.o: ../device/rds/rdsopen.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rdsprocess.o: ../device/rds/rdsprocess.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rdsread.o: ../device/rds/rdsread.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rdswrite.o: ../device/rds/rdswrite.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ramclose.o: ../device/ram/ramclose.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +raminit.o: ../device/ram/raminit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/ramdisk.h +ramopen.o: ../device/ram/ramopen.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ramread.o: ../device/ram/ramread.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/ramdisk.h +ramwrite.o: ../device/ram/ramwrite.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/ramdisk.h +lfdballoc.o: ../device/lfs/lfdballoc.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfdbfree.o: ../device/lfs/lfdbfree.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfflush.o: ../device/lfs/lfflush.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfgetmode.o: ../device/lfs/lfgetmode.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfiballoc.o: ../device/lfs/lfiballoc.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfibclear.o: ../device/lfs/lfibclear.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfibget.o: ../device/lfs/lfibget.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfibput.o: ../device/lfs/lfibput.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lflclose.o: ../device/lfs/lflclose.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lflcontrol.o: ../device/lfs/lflcontrol.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lflgetc.o: ../device/lfs/lflgetc.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lflinit.o: ../device/lfs/lflinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lflputc.o: ../device/lfs/lflputc.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lflread.o: ../device/lfs/lflread.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lflseek.o: ../device/lfs/lflseek.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lflwrite.o: ../device/lfs/lflwrite.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfscheck.o: ../device/lfs/lfscheck.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/ramdisk.h +lfsckfmt.o: ../device/lfs/lfsckfmt.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/ramdisk.h +lfscreate.o: ../device/lfs/lfscreate.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/ramdisk.h +lfsetup.o: ../device/lfs/lfsetup.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfsinit.o: ../device/lfs/lfsinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lfsopen.o: ../device/lfs/lfsopen.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +lftruncate.o: ../device/lfs/lftruncate.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rflclose.o: ../device/rfs/rflclose.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rflgetc.o: ../device/rfs/rflgetc.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rflinit.o: ../device/rfs/rflinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rflputc.o: ../device/rfs/rflputc.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rflread.o: ../device/rfs/rflread.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rflseek.o: ../device/rfs/rflseek.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rflwrite.o: ../device/rfs/rflwrite.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rfscomm.o: ../device/rfs/rfscomm.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rfscontrol.o: ../device/rfs/rfscontrol.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rfsgetmode.o: ../device/rfs/rfsgetmode.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rfsinit.o: ../device/rfs/rfsinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rfsndmsg.o: ../device/rfs/rfsndmsg.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +rfsopen.o: ../device/rfs/rfsopen.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +spicontrol.o: ../device/spi/spicontrol.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +spiinit.o: ../device/spi/spiinit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +gpiocontrol.o: ../device/gpio/gpiocontrol.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +gpiohandler.o: ../device/gpio/gpiohandler.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +gpioinit.o: ../device/gpio/gpioinit.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +gpioread.o: ../device/gpio/gpioread.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +gpioselect.o: ../device/gpio/gpioselect.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +gpiowrite.o: ../device/gpio/gpiowrite.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +arp.o: ../net/arp.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +dhcp.o: ../net/dhcp.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +dns.o: ../net/dns.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/dns.h +dot2ip.o: ../net/dot2ip.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +hexdump.o: ../net/hexdump.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +icmp.o: ../net/icmp.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ip.o: ../net/ip.c ../include/xinu.h ../include/kernel.h ../include/conf.h \ + ../include/process.h ../include/queue.h ../include/resched.h \ + ../include/semaphore.h ../include/memory.h ../include/bufpool.h \ + ../include/clock.h ../include/mark.h ../include/ports.h \ + ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +net.o: ../net/net.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +pdump.o: ../net/pdump.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +tftp.o: ../net/tftp.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h ../include/stdlib.h +udp.o: ../net/udp.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +addargs.o: ../shell/addargs.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h \ + ../include/shprototypes.h +lexan.o: ../shell/lexan.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +shell.o: ../shell/shell.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h \ + ../include/shprototypes.h +xsh_argecho.o: ../shell/xsh_argecho.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_arp.o: ../shell/xsh_arp.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_cat.o: ../shell/xsh_cat.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_clear.o: ../shell/xsh_clear.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_date.o: ../shell/xsh_date.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_devdump.o: ../shell/xsh_devdump.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_echo.o: ../shell/xsh_echo.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_exit.o: ../shell/xsh_exit.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_help.o: ../shell/xsh_help.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_kill.o: ../shell/xsh_kill.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_memdump.o: ../shell/xsh_memdump.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_memstat.o: ../shell/xsh_memstat.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_netinfo.o: ../shell/xsh_netinfo.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_ping.o: ../shell/xsh_ping.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_ps.o: ../shell/xsh_ps.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_sleep.o: ../shell/xsh_sleep.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_udpdump.o: ../shell/xsh_udpdump.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_udpecho.o: ../shell/xsh_udpecho.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_udpserver.o: ../shell/xsh_udpserver.c ../include/xinu.h \ + ../include/kernel.h ../include/conf.h ../include/process.h \ + ../include/queue.h ../include/resched.h ../include/semaphore.h \ + ../include/memory.h ../include/bufpool.h ../include/clock.h \ + ../include/mark.h ../include/ports.h ../include/uart.h ../include/tty.h \ + ../include/gpio.h ../include/gpioselect.h ../include/device.h \ + ../include/interrupt.h ../include/file.h ../include/rfilesys.h \ + ../include/rdisksys.h ../include/lfilesys.h ../include/spi.h \ + ../include/ether.h ../include/net.h ../include/ip.h ../include/arp.h \ + ../include/udp.h ../include/dhcp.h ../include/icmp.h ../include/tftp.h \ + ../include/name.h ../include/shell.h ../include/date.h \ + ../include/prototypes.h ../include/delay.h ../include/stdio.h \ + ../include/string.h ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +xsh_uptime.o: ../shell/xsh_uptime.c ../include/xinu.h ../include/kernel.h \ + ../include/conf.h ../include/process.h ../include/queue.h \ + ../include/resched.h ../include/semaphore.h ../include/memory.h \ + ../include/bufpool.h ../include/clock.h ../include/mark.h \ + ../include/ports.h ../include/uart.h ../include/tty.h ../include/gpio.h \ + ../include/gpioselect.h ../include/device.h ../include/interrupt.h \ + ../include/file.h ../include/rfilesys.h ../include/rdisksys.h \ + ../include/lfilesys.h ../include/spi.h ../include/ether.h \ + ../include/net.h ../include/ip.h ../include/arp.h ../include/udp.h \ + ../include/dhcp.h ../include/icmp.h ../include/tftp.h ../include/name.h \ + ../include/shell.h ../include/date.h ../include/prototypes.h \ + ../include/delay.h ../include/stdio.h ../include/string.h \ + ../include/am335x_control.h ../include/am335x_eth.h \ + ../include/am335x_watchdog.h ../include/armv7a.h +ctxsw.o: ../system/ctxsw.S +intr.o: ../system/intr.S ../include/armv7a.h +start.o: ../system/start.S ../include/armv7a.h diff --git a/compile/.vers_num b/compile/.vers_num new file mode 100644 index 0000000..1b1c131 --- /dev/null +++ b/compile/.vers_num @@ -0,0 +1 @@ +280 diff --git a/compile/DAC_OUT_PUT1.txt b/compile/DAC_OUT_PUT1.txt new file mode 100644 index 0000000..ea3b9ba --- /dev/null +++ b/compile/DAC_OUT_PUT1.txt @@ -0,0 +1 @@ +****DAC_OUT_PUT1 : Result of conversion DAC channel 1**** diff --git a/compile/DAC_OUT_PUT2.txt b/compile/DAC_OUT_PUT2.txt new file mode 100644 index 0000000..e443c1c --- /dev/null +++ b/compile/DAC_OUT_PUT2.txt @@ -0,0 +1 @@ +****DAC_OUT_PUT2 : Result of conversion DAC channel 2**** diff --git a/compile/Makefile b/compile/Makefile new file mode 100644 index 0000000..67985dd --- /dev/null +++ b/compile/Makefile @@ -0,0 +1,199 @@ +######################################################################### +# # +# # +# Makefile for STM32 version of the Xinu operating system # +# # +# includes: .deps and .defs # +# # +# # +######################################################################### + +COMPILER_ROOT = avr- +PNAME = ATMEGA328P +PLAT = Platform_$(PNAME) +TOPDIR = .. + +CC = ${COMPILER_ROOT}gcc +LD = ${COMPILER_ROOT}gcc +OBJCOPY = ${COMPILER_ROOT}objcopy +OBJDUMP = ${COMPILER_ROOT}objdump +QEMU = /home/lechnerm/rafa/xinu/qemu_stm32/arm-softmmu/qemu-system-arm +XINU = $(TOPDIR)/compile/xinu.elf +XINUBIN = $(TOPDIR)/compile/xinu.bin +XINUHEX = $(TOPDIR)/compile/xinu.hex +XINUBOOT = $(TOPDIR)/compile/xinu +BUILDMAKE = $(TOPDIR)/compile/bin/build-make +MKVERS = $(TOPDIR)/compile/bin/mkvers + +MAKEDEP = $(CC) -M -MG + +DEPSFILE = .deps +DEFSFILE = .defs +VERSIONFILE = version +LDSCRIPT = ld.script +MKVERS = $(TOPDIR)/compile/bin/mkvers + + + # RAFA -s $(TOPDIR)/device/ram \ +REBUILDFLAGS = -s $(TOPDIR)/system debug.c \ + #-s $(TOPDIR)/device/gpio \ + #-s $(TOPDIR)/device/spi \ + -s $(TOPDIR)/device/tty \ + # +REBUILDFLAGS = -s $(TOPDIR)/system \ + -s $(TOPDIR)/lib \ + -s $(TOPDIR)/device/nam \ + -s $(TOPDIR)/shell 'xsh_rdstest*' + +INCLUDE = -I$(TOPDIR)/include +# RAFA DEFS = -DBSDURG -DVERSION=\""`cat $(VERSIONFILE)`"\" +DEFS = -DVERSION=\""Rafa"\" + +# Compiler flags +# CFLAGS = -mcpu=cortex-m3 -mno-unaligned-access -mthumb -fno-builtin -fno-stack-protector -nostdlib -c -Wall -O ${DEFS} ${INCLUDE} +# CFLAGS = -DF_CPU=16000000UL -mmcu=atmega328p -mrelax -fno-builtin -fno-stack-protector -nostdlib -c -Wall -Os ${DEFS} ${INCLUDE} +CFLAGS = -DF_CPU=16000000UL -mmcu=atmega328p -fno-builtin -c -Wall -Os ${DEFS} ${INCLUDE} +SFLAGS = ${INCLUDE} + +# Loader flags + +# RAFA LDFLAGS = -Wl,--wrap,malloc,--wrap,free,--wrap,realloc,--wrap,fdevopen +# LDFLAGS = -mmcu=atmega328p -nostartfiles -T ld.script -Wl,-Map,xinu.map +LDFLAGS = -mmcu=atmega328p -Wl,-Map,xinu.map + +all: xinu + +#-------------------------------------------------------------------------------- +# Handle generation of a new version string when initialize is recompiled +#-------------------------------------------------------------------------------- + +newversion: + @echo creating new version + @$(MKVERS) $(PNAME) > version + +#-------------------------------------------------------------------------------- +# Include generic make targets and rules from the file generated by build-make +#-------------------------------------------------------------------------------- +-include $(DEFSFILE) + +#-------------------------------------------------------------------------------- +# Add files that require special rules and place start.o at the front +#-------------------------------------------------------------------------------- +# RAFA quitamos el start.S y start.o porque intentaremos el startup de avr +LD_LIST = binaries/start.o $(filter-out binaries/start.o,$(OBJ_FILES)) +# LD_LIST = $(filter-out binaries/start.o,$(OBJ_FILES)) + +#------------------------------------------------------------ +# Rules for files that need special handling +#------------------------------------------------------------ + +# Define variables for the Configuration file and generated files + +CONFFILE = $(TOPDIR)/config/Configuration +CONFH = $(TOPDIR)/include/conf.h +CONFC = $(TOPDIR)/system/conf.c + +# Define variables for the config program and its sources + +CONFPGM = $(TOPDIR)/config/config +CONFL = $(TOPDIR)/config/config.l +CONFY = $(TOPDIR)/config/config.y + +# Set up the required build directory structure + +BLDDIRS = binaries +export + +#-------------------------------------------------------------------------------- +# Specific additional rules and exceptions +#-------------------------------------------------------------------------------- + +xinu: Makefile rebuild $(BLDDIRS) $(DEFSFILE) $(DEPSFILE) $(CONFH) $(CONFC) $(LD_LIST) + @echo;echo 'Loading object files to produce xinu' + # RAFA original : @$(LD) $(LDFLAGS) $(LD_LIST) -o $(XINU) -L/usr/lib/gcc/arm-none-eabi/6.3.1/ --print-memory-usage + @$(LD) $(LDFLAGS) $(LD_LIST) -o $(XINU) + @echo "Creating Binary..." + @$(OBJCOPY) -O binary $(XINU) $(XINUBIN) + +examine-all: + $(OBJDUMP) -D $(XINU) | less + +examine-header: + $(OBJDUMP) -x $(XINU) | less + +flash: + avr-objcopy -O ihex -R .eeprom $(XINU) $(XINUHEX) + avrdude -p atmega328p -c arduino -P /dev/ttyUSB0 -b 57600 -D -U flash:w:$(XINUHEX):i + # avrdude -p atmega328p -c arduino -P /dev/ttyUSB0 -b 115200 -D -U flash:w:$(FIRMWARE):i + + +qemu: + $(QEMU) -serial stdio -M stm32-f103c8 -kernel $(XINUBIN) +monitor: + $(QEMU) -monitor stdio -serial stdio -M stm32-f103c8 -kernel $(XINUBIN) + +$(BLDDIRS): + @mkdir -p $(BLDDIRS) + +objects: $(LD_LIST) + +$(CONFH): $(CONFFILE) $(CONFPGM) + @echo making $(CONFH) + @make configure + +$(CONFC): $(CONFFILE) $(CONFPGM) + @echo making $(CONFC) + @make configure + +$(CONFPGM): $(CONFL) $(CONFY) + @echo making the config program + @make -C $(TOPDIR)/config clean all install + +configure: + @echo forcing a rebuild of conf.h and conf.c + @make newversion + @(cd $(TOPDIR)/config; make install) + +clean: + @echo removing .o files + @rm -f ${LD_LIST} + @echo removing configuration files ... + @rm -f $(CONFH) $(CONFC) + @(cd $(TOPDIR)/config; make clean) + @echo removing xinu ... + @rm -f $(XINU) + @rm -f $(XINUBIN) + @rm -f $(XINUBOOT) + +#-------------------------------------------------------------------------------- +# Locations of source directories and exceptions (.c and .[sS] files to exclude) +#-------------------------------------------------------------------------------- + +$(DEFSFILE): + @rm -f $(DEFSFILE) + @echo "" > $(DEFSFILE) + @make rebuild + +$(DEPSFILE): + @rm -f $(DEPSFILE) + @echo "" > $(DEPSFILE) + @make depend + +rebuild: $(CONFC) + @echo Rebuilding the $(DEFSFILE) file + @$(BUILDMAKE) $(REBUILDFLAGS) > $(DEFSFILE) + +defclean: + rm -f $(DEFSFILE) + echo "" > $(DEFSFILE) + +depend: $(DEFSFILE) + @echo;echo Making all dependencies in $(DEPSFILE) + @$(MAKEDEP) ${INCLUDE} ${SRC_FULL} > $(DEPSFILE) + @echo;echo Finished making dependencies + +depclean: + rm -f $(DEPSFILE) + echo "" > $(DEPSFILE) + +-include $(DEPSFILE) diff --git a/compile/bin/build-make b/compile/bin/build-make new file mode 100755 index 0000000..f930488 --- /dev/null +++ b/compile/bin/build-make @@ -0,0 +1,710 @@ +#!/bin/sh +######################################################################### +# # +# build-make - build entries for a makefile # +# # +# use: build-make dir_spec... # +# # +# where each dir_spec, which specifies one of the source # +# directories to include has the form: # +# # +# -s source_dir_path [pattern...] # +# # +# Build-make generates rules for a Makefile that will compile # +# the source files from the specified set of source directories. # +# Build-make is run in the directory that will hold the Makefile, # +# and assumes .o files will be placed in the ./binaries # +# directory in the same file as the Makefile. # +# # +# # +# A directory specification begins with a -s srgument that is # +# followed by a source directory name (a relative path is # +# recommended, but not required), and a list of zero or more # +# patterns. The patterns are used to specify which files # +# from source directory should be omitted from consideration. # +# Build-make starts by making a list of all C and assembly # +# language files in the directory (i.e. files that match *.c and # +# *.[Ss]). It then uses the set of patterns (if any are present) # +# to decide which of the files to exclude from further # +# processing. A pattern can contain literal characters plus one # +# asterisk, which indicates a wild card match. For example, # +# 'xxx', 'xxx*', '*xxx', 'xxx*yyy' are legal forms of patterns. # +# Note: any pattern argument that contains an asterisk must be # +# enclosed in quotes on the command line to prevent the shell # +# from interpreting it. For example, to omit files that start # +# with 'debug', one would specify: 'debug*' in quotes. Omitting # +# files has two purposes. First, it allows files to be left in # +# the soruce directory that are not normally needed (e.g., # +# debug.c). Second, a programmer can specify a set of files # +# for which standard compilation rules are insufficient. Of # +# course, if a programmer omits a file, the programmer must # +# insert a compilation rule into the Makefile. # +# # +# Build-make does not create a complete Makefile. Instead, # +# build-make writes text output to stdout and allows the # +# programmer to use the output to construct a Makefile. # +# Typically, a programmer runs: # +# # +# build-make > Makedefs # +# # +# and then inserts the line # +# # +# include Makedefs # +# # +# into a Makefile. Doing so allows the Makedefs to be recreated # +# easily if the contents of the source directories change. # +# # +# Build-make generates two variables: SOURCE_FILES that contains # +# a list of all source file names, and OBJECT_FILES that lists # +# all the object files. it also generates a list of rules # +# for generating object files. For example, a rule might # +# be: # +# # +# binaries/aaa.o: ../../system/aaa.c # +# $(CC) $(CFLAGS) -o binaries/aaa.o ../../system/aaa.c # +# # +######################################################################### + +MSG1='use is: build-make dir_spec...' +MSG2=' where dir_spec is -s source_dir_path [pattern...]' + +# +# Define prefixes shared by this script and the awk program +# +PRE_ERR='+ERROR:' +PRE_DIR='+DIR:' +PRE_OMIT='+OMIT:' +PRE_CFILE='+CFILE:' +PRE_SFILE='+SFILE:' + +export PRE_ERR PRE_DIR PRE_OMIT PRE_CFILE PRE_SFILE + +TMP1=".,BUILDM1-$$" +TMP2=".,BUILDM2-$$" +trap "rm -f $TMP1 $TMP2; exit" 1 2 3 + +# +# Parse arguments and generate input to the script below +# + +if test $# -lt 2; then + echo "$MSG1" >&2 + echo "$MSG2" >&2 + exit 1 +fi + +# iterate through dirspecs + +( + > $TMP1 + > $TMP2 + + while test $# -gt 0; do + + # parse -s and get directory name + + if test $# -lt 2; then + echo "$PRE_ERR" + echo "$MSG1" >&2 + echo "$MSG2" >&2 + exit 1 + fi + + case "x$1" in + x-s) DIR="$2" + # verify that directory exists + if test -d $DIR; then + echo "$PRE_DIR$DIR" + else + echo "$PRE_ERR" + echo "cannot find a source directory named $DIR" >&2 + exit 1 + fi + shift; shift + ;; + *) echo 'expecting -s at start of directory specification' >&2 + echo "$PRE_ERR" + echo "$MSG1" >&2 + echo "$MSG2" >&2 + ;; + esac + + # + # See if DIR contains any .c or .[sS] files + # + if test "x$DIR" = "x."; then + CFILES=`ls *.c 2>$TMP1` + SFILES=`ls *.[sS] 2>$TMP2` + else + CFILES=`ls $DIR/*.c 2>$TMP1` + SFILES=`ls $DIR/*.[sS] 2>$TMP2` + fi + + if test -s $TMP1 -a -s $TMP2; then + (echo;echo "Warning: directory $DIR does not contain any .c or .[sS] files to compile";echo) >&2 + fi + rm -f $TMP1 $TMP2 + + # arguments up to the next -s as patterns that specify omitted files + + LOOKING=true + while $LOOKING; do + if test $# -eq 0; then + LOOKING=false + elif test "x$1" = "x-s"; then + LOOKING=false + else + echo "$PRE_OMIT$1" + shift + fi + done + + # output .s and .S files for this directory + + if test "x$SFILES" != "x"; then + for i in $SFILES; do + echo "$PRE_SFILE$i" + done + fi + + # output .c files for this directory + + if test "x$CFILES" != "x"; then + for i in $CFILES; do + echo "$PRE_CFILE$i" + done + fi + + done +) | + +gawk ' + +######################################################################### +# # +# # +# Start of awk script # +# # +# # +######################################################################### + +#################### +# +# function ftmlist - format a list of file names +# +# args are: number of names, array of names, maximum name length, +# directory name, prefix to use +# +#################### + +function fmtlist(n,items,maxl,dname, pfix) { + + if (n <= 0) { + return; + } + + if (doneheading == 0) { + printf("\n\n%s\n%s\n%sDirectory %s\n%s\n%s\n",hdr4, hdr5, hdr6, dname, hdr5, hdr4); + doneheading = 1; + } + fmt2 = sprintf("\n%%-%ds\\\n",maxwid-1); + printf(fmt2, pfix " ="); + + namwid = maxl + 2; + # + # compute number of names per line allowing 2 blanks between them + # and not taking more than actwid characters + # + nperline = int( (actwid+2)/(maxl+2) ); + extrabl = actwid-(nperline*maxl + 2*(nperline-1))+1; + cnt = 1; + fmt = sprintf("%%-%ds",maxl); + for (i=1; i<=n ; i++) { + if (cnt > nperline) { + for (b=1; b<=extrabl; b++) { + printf(" "); + } + printf("\\\n"); + cnt = 1; + } + if (cnt == 1) { + printf("%s", tb); + } else { + printf(" "); + } + printf(fmt, items[i]); + cnt++; + } + printf("\n"); + return; +} + +#################### +# +# function isomitted - check a file name against the list of omitted patters +# for the current directory and report 1 if the file +# name is omitted +# +# arg: file name to check +# +# globals used: nomits, omits[] list of omitted patterns (1 through nomits) +# +#################### + +function isomitted(io_fname) { + + io_flen = length(io_fname); + + # + # Iterate through all omit patterns for the current directory + # + + for (io_j=1; io_j <= nomits; io_j++) { + + # Get pattern to check + io_omit = omits[io_j]; + + # length of omit pattern + io_olen = length(io_omit); + + # Find where "*" occurs in the pattern and set prefix length + + io_plen = index(io_omit, "*") - 1; + + if (io_plen < 0) { # No * in the pattern, so check exact match + + if (io_fname == io_omit) { + return 1; + } else { + continue; + } + + } + + # At least one * occurs in the pattern + + if (io_olen == 1) { # Pattern is just a *, so omit everything + return 1; + } + + if (io_plen > 1) { # if fixed prefix exists, check for match + + # A file name shorter than the prefix is not omitted + + if (io_flen < io_plen) { + continue; + } + + # If prefix does not match, name is not omitted + + if ( substr(io_omit, 1, io_plen) != substr(io_fname, 1, io_plen) ) { + continue; + } + } + + # Prefix has matched; check suffix + + io_slen = io_olen - io_plen -1; + + if (io_slen <= 0) { # If no suffix, pattern matches + return 1; + } + + # A file name shorter than the suffix is not omitted + + if (io_flen < io_slen) { + continue; + } + + # If suffix in omit pattern exactly matches the suffix of the + # file name, this file name is omitted + + if ( substr(io_omit, io_olen - (io_slen - 1)) == \ + substr(io_fname, length(io_fname) - (io_slen - 1)) ) { + return 1; + } + + } + + # The file name does not match any omitted pattern, so keep it + + return 0; +} + +#################### +# +# getbasename - extract the basename from a path name and return it +# +# arg: path name +# +#################### + +function getbasename(gb_path) { + + for (gb_pos = length(gb_path); gb_pos > 0; gb_pos--) { + if (substr(gb_path, gb_pos, 1) == "/") { + break; + } + } + if (gb_pos > 0) { + return substr(gb_path, gb_pos+1); + } else { + return gb_path; + } +} + + +#################### +# +# Initialize variables for the awk script +# +#################### + +BEGIN { + ndirs = 0; # Number of directories found so far + maxwid = 81; # Maximum width of formatted line + actwid = maxwid - 10; # Actual width for names (line width minus 8 for tab indent and + # 2 for " \" at the end of the line) + + tb = " "; # Tab character + plen_err = length("'$PRE_ERR'"); + plen_dir = length("'$PRE_DIR'"); + plen_omt = length("'$PRE_OMIT'"); + plen_cfl = length("'$PRE_CFILE'"); + plen_sfl = length("'$PRE_SFILE'"); + + + hdr1 = "#-------------------------------------------------------------------------------#"; + hdr2 = "# #"; + hdr3 = "# Definitions generated by build-make on '"`date`"' #"; + hdr4 = "#------------------------------------------------------------------"; + hdr5 = "#"; + hdr6 = "# "; + hdr7 = "# Rules For Generating Object Files #"; + hdr8 = "# Rules for files in directory "; + + msg1 = "SRC_CFILES ="; + msg2 = "SRC_SFILES ="; + msg3 = "OBJ_FILES ="; +} + +# +# Skip blank lines in input +# +/^ *$/ { + next; +} + +# +# Handle errors +# +/^\'${PRE_ERR}'/ { + exit(1); +} + +# +# Start a new directory +# + +/^\'$PRE_DIR'/ { + + ndirs++; + dirs[ndirs] = substr($0,plen_dir+1); + + # Initialize counts for this directory + + ncfiles[ndirs] = 0; + nsfiles[ndirs] = 0; + nomits = 0; + next; +} + +# +# Collect list of omitted files for this directory (must occur in the input before +# any C or S files for the directory) +# + +/^\'$PRE_OMIT'/ { + + nomits++; + omits[nomits] = substr($0,plen_omt+1); + next; +} + +# +# Handle a C file from the current directory +# + +/^\'$PRE_CFILE'/ { + + fullname = substr($0,plen_cfl+1); + basename = getbasename(fullname); + + # Skip omitted files + + if (isomitted(basename) > 0) { + next; + } + + ncfiles[ndirs]++; + cpath[ndirs "%" ncfiles[ndirs]] = fullname; + cfile[ndirs "%" ncfiles[ndirs]] = basename; + + next; +} + +# +# Handle as S file from the current directory +# + +/^\'$PRE_SFILE'/ { + + fullname = substr($0,plen_sfl+1); + basename = getbasename(fullname); + + # Skip omitted files + + if (isomitted(basename) > 0) { + next; + } + + nsfiles[ndirs]++; + spath[ndirs "%" nsfiles[ndirs]] = fullname; + sfile[ndirs "%" nsfiles[ndirs]] = basename; + + next; +} + + +# +# Any other input line is unexpected +# + +{ + print "Error: unexpected input line ->", $0; + exit 1; +} + +END { + ################################################################# + # # + # Do all the work of formatting and printing the makefile # + # rules. Start by printing an initial comment block and the # + # variable initializtion statements. # + # # + ################################################################# + + printf("%s\n%s\n%s\n%s\n%s\n\n",hdr1, hdr2, hdr3, hdr2, hdr1); + printf("%s\n%s\n\n",msg1, msg2, msg3); + + totlen = 0; # max over valid source file names in all directories + + ################################################################# + # # + # Iterate over all directories and generate a unique prefix # + # to be used on make variables for each directory # + # # + ################################################################# + + totlen = 0; # max file name length across all directories + + for (d=1; d<=ndirs; d++) { + + # Generate a unique variable name prefix for this directory + + dirpath = dirs[d]; + strt = 1; + str = toupper(dirpath); + finish = length(str); + ch = substr(str,strt,1); + while ( (ch == ".") || (ch == "/") ) { + strt++; + if (strt > finish) { + break; + } + ch = substr(str,strt,1); + } + if (strt > finish) { + if (substr(str,1,1) == ".") { + prefix = "DOT"; + } else { + prefix = "SLASH"; + } + for (i=2; i<=finish; i++) { + if (substr(str,i,1) == ".") { + prefix = prefix "_DOT"; + } else { + prefix = prefix "_SLASH"; + } + } + } else { + prefix = ""; + for (i=strt; i<=finish; i++) { + ch = substr(str,i,1); + if (ch == "/") { + prefix = prefix "_"; + } else { + prefix = prefix ch; + } + } + } + pref[d] = prefix; + + doneheading = 0; + + # + # Compute the maximum length of a file name in this directory + # and update the max length across all directories + # + + maxlen = 0; # max file name length for this directory + + # Check S files first + + for (i = 1; i <= nsfiles[d]; i++) { + srcsfiles[i] = sfile[d "%" i] + l = length(srcsfiles[i]); + if (l > maxlen) { + maxlen = l; + } + } + if (maxlen > totlen) { # update global max across all directories + totlen = maxlen; + } + + # Check C files + + for (i = 1; i <= ncfiles[d]; i++) { + srccfiles[i] = cfile[d "%" i] + l = length(srccfiles[i]); + if (l > maxlen) { + maxlen = l; + } + } + if (maxlen > totlen) { # update global max across all directories + totlen = maxlen; + } + + # Format the list of S files for this directory + + fmtlist(nsfiles[d], srcsfiles, maxlen, dirs[d], pref[d] "_SFILES"); + + # Format the list of C files for this directory + + fmtlist(ncfiles[d], srccfiles, maxlen, dirs[d], pref[d] "_CFILES"); + + printf("\n"); + + # + # Generate assignments for Makefile variables + # + + nasn = 0; + + # + # Generate assignments for variables SRC_CFILES and SRC_SFILES + # + if (ncfiles[d] > 0) { + nasn++; + asnl[nasn] = "SRC_CFILES"; + asnr[nasn] = sprintf("+= ${%s_CFILES}", pref[d]); + } + if (nsfiles[d] > 0) { + nasn++; + asnl[nasn] = "SRC_SFILES"; + asnr[nasn] = sprintf("+= ${%s_SFILES}", pref[d]); + } + + # + # Generate assignments for variables prefix_CFULL and prefix_SFULL + # + + if (ncfiles[d] > 0) { + nasn++; + asnl[nasn] = sprintf("%s_CFULL", prefix); + asnr[nasn] = sprintf("+= ${%s_CFILES:%%=%s/%%}", pref[d], dirs[d]); + } + if (nsfiles[d] > 0) { + nasn++; + asnl[nasn] = sprintf("%s_SFULL", prefix); + asnr[nasn] = sprintf("+= ${%s_SFILES:%%=%s/%%}", pref[d], dirs[d]); + } + + # + # Generate assignments for variables SRC_CFULL and SRC_SFULL + # + + if (ncfiles[d] > 0) { + nasn++; + asnl[nasn] = "SRC_CFULL"; + asnr[nasn] = sprintf("+= ${%s_CFULL}", pref[d]); + } + if (nsfiles[d] > 0) { + nasn++; + asnl[nasn] = "SRC_SFULL"; + asnr[nasn] = sprintf("+= ${%s_SFULL}", pref[d]); + } + wid = 0; + for (i=1; i<=nasn; i++) { + n = length(asnl[i]); + if (n > wid) { + wid = n; + } + } + fmt3 = sprintf("%%-%ds %%s\n", wid); + for (i=1; i<=nasn; i++) { + printf(fmt3, asnl[i], asnr[i]); + } + } + + printf("\n\n%s\n%s\n%s\n%s\n%s\n\n", hdr1, hdr2, hdr7, hdr2, hdr1); + + printf("OBJ_TMP = ${patsubst %%.s,%%.o,$(SRC_SFILES)} # substitute .s => .o\n"); + printf("OBJ_SFILES = ${patsubst %%.S,%%.o,$(OBJ_TMP)} # substitute .S => .o\n"); + printf("OBJ_CFILES = ${patsubst %%.c,%%.o,$(SRC_CFILES)} # substitute .c => .o\n"); + printf("OBJ_LIST = ${OBJ_CFILES} ${OBJ_SFILES}\n"); + printf("OBJ_FILES = ${OBJ_LIST:%%=binaries/%%}\n"); + printf("SRC_FULL = ${SRC_CFULL} ${SRC_SFULL}\n"); + + fmt4c = sprintf("%%-%ds%%s\n\t${CC} ${CFLAGS} -o %%s %%s\n",9+totlen+3); + fmt4s = sprintf("%%-%ds%%s\n\t${CC} ${CFLAGS} -o %%s %%s\n",9+totlen+3); + for (d=1; d<=ndirs; d++) { + needheadings = 1; + + # print dependencies for .s files + + for (i = 1; i <= nsfiles[d]; i++) { + if (needheadings > 0) { + printf("\n%s\n%s%s\n%s\n\n", hdr4, hdr8, dirs[d], hdr4); + needheadings = 0; + } + fname = sfile[d "%" i]; + tmpobj = "binaries/" substr(fname, 1, length(fname)-2) ".o"; + tmpsrc = dirs[d] "/" fname; + printf(fmt4s, tmpobj ":", tmpsrc, tmpobj, tmpsrc); + } + + # print dependencies for .c files + + for (i = 1; i <= ncfiles[d]; i++) { + if (needheadings > 0) { + printf("\n%s\n%s%s\n%s\n\n", hdr4, hdr8, dirs[d], hdr4); + needheadings = 0; + } + fname = cfile[d "%" i]; + tmpobj = "binaries/" substr(fname, 1, length(fname)-2) ".o"; + tmpsrc = dirs[d] "/" fname; + printf(fmt4c, tmpobj ":", tmpsrc, tmpobj, tmpsrc); + } + + } + printf("\nobjs: ${OBJ_FILES}\n"); + + printf("\nlist_obj:\n\t@echo ${OBJ_FILES}\n"); + + printf("\nlist_csrc:\n\t@echo ${SRC_CFILES}\n"); + + printf("\nlist_ssrc:\n\t@echo ${SRC_SFILES}\n"); + + printf("\n# Export variables for recursive make calls (such as the library)\n\nexport\n\n"); +} ' diff --git a/compile/bin/mkvers b/compile/bin/mkvers new file mode 100755 index 0000000..2055392 --- /dev/null +++ b/compile/bin/mkvers @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Generate a new version string to be printed at startup +# +# Use is: mkvers platform_name + +VERS_NUM_FILE=.vers_num + +case $# in + 1) PLAT="$1" + ;; + *) echo 'use is: mkvers platform_name' >&2 + exit 1 + ;; +esac + +if test -s $VERS_NUM_FILE; then + OLD_VERS=`cat $VERS_NUM_FILE` + VERS=`expr $OLD_VERS + 1` +else + VERS=1 +fi +echo $VERS > $VERS_NUM_FILE +if test "x$USER" = "x"; then + USER=`who am i | sed 's/ .*//'` +fi +echo "Xinu for $PLAT -- version #$VERS ($USER) `date`" diff --git a/compile/binaries/getchar.o b/compile/binaries/getchar.o new file mode 100644 index 0000000000000000000000000000000000000000..a81fb8dfae6797246b992d68a698424a39770f15 GIT binary patch literal 900 zcma)4K}!Nr5T4b|vMf?M1QmFQFo;KmU4%*yvxAfr(J8id-85)Zc3)6kI!PxFLG(NN zNz$pK{sQ~P-KU$E`e1gxnfYek+xOl}v3#Uy8YyUWPUDDZHA2)zF*_7wC{8izz7f5C zeMfp)a=lyW<=dT)PU0PcQlXGbXG$j*o9R7~729fP$cJa^)E|UO6#ca_A&!R2h;*7m z=3tcV50=39L-88;VJO}haVGu2F23VEOs+pQ>RpB|1!alb0xZIxssNtj%ZZrkwzL|i zD=adM^NMk77(OZc;Q}v(>mWVh zFUl@H@ACz?*?{wzq&UG4-jl-c(j-y!JQ7yZaqN5PcmL~~ zhKkQL7O1oEe0~b*yjPIWVfmo&i2}coX&7s`#{a~3#<9BnGI$tj-WHNGu)lOW&~T4> zk3260Q{Wm~5~gNxt&3!iNdVR`*z-LoT!Zvrycd3-{2%-_;;`_%3L3AFQ&97M02HZN ARR910 literal 0 HcmV?d00001 diff --git a/compile/binaries/putchar.o b/compile/binaries/putchar.o new file mode 100644 index 0000000000000000000000000000000000000000..8a831414ec72b99edc17a8001a816e2aa0940d5f GIT binary patch literal 900 zcma)4!A`CrQ8Yq4n5YQ{qnMbD8oZFGBn0b$D3KUXrj}B{#7fhaM7?Cy{t-%$W>^2l!6*FunfFxOWx043rwTg;<8akO4f$*HbY$9p7vj zt}sd0YgPSB*8@@s$Yog@5#M%n*J_UVi{-Y%AnYcyS_iXb7;rVXhTavlfgCTtD$tTe;e1k;Y^GKL&+qNG4p!;9n zEL41^iBO$~=kt@0=e>r63M+<%Zxr~A%)(g1HU1~QGmho$SHPo?^LCM(gZ-u3hlYFP zd*pc;m;~3@(l9xTYh5G@OhT}R!Jh9y;ufS2K~%bKN2vN30& zN$W>tu-)9O){f1HND(Iv{IRMO7UmfKP&&{bf?`EP#6N2>%nyd~d6IL}JN@Gup1jZd zah~&@n{zX{|4^4wN-R^-FYA#=qEh4)6a$5Z7O9p>xud>SiIj)|oN;HGyvg>IKmB0( zm#u$Rsho3mIlYp;qkjEQ*RG^L-JaTA>Rd@Jr<}7p%?`8I44M&h(mZQs%**CgbJ<)m zZ<%@1oo-4~O>WA~FBiXGY*!Dcgn^xb>uSb5-*kTZ_37=+4>z~e?{;2OuQtq8&up2m zlvT-&CQl_do)a0lIIc!7uDVVFwaq`fe)kNjYp$<6uc?WtBU7i77m{Z-XDTH315UFF zEUM~RnNztRUB7u273)-y>|9>5jAm-)8!t?so|de&;)?oQuW{BiG&14}*XG6w&QZUm zq0*7Nlvql<=laBB?T6=t-Uan>p?7KO($sM!*(;^}I3cr=B`faCIaSV7-fjMSxSFS( z+M2F%tbU~TJeW9~knEArL-9f0=&K7jRJ_#R*ZB8>YB`SpH;B`cQ- zd8QPJYyy8C$YE^@d>z)0{i`m=Vv%UvHzdJee_!xGFjypqisXs?-31a4j|Zcn7Yh7T zC>qhhu~_Kj5EMc&e8r304>}Ychs^Qe(G%gw@W^POxCv6jk>Jo+XdoIKjKu_Rw}``0 z9B6~)d{!Qy3=f3!x9U8c@L95-JzW5M9)*tr<=}C6g8T%00jse@3y)0{WuCxAV-;a7n=Ho$TKHNSxWLv!j>0#<$lxTU#K zb86OuQ_}~(9k4X-*Lf#=D?pt%{6ji_6n>xP&%*ZrTYuAHo}&zYYHeKuzAqx4^0SCisFa|A8(4sm^=Rb6w}T*KKf~o#*{ab4bbGn!^?L zw|={N6s>*57ke=r9~gv>M~i;MV$smpfDhL&F23P`_<;C$%X~wTa5!|7_u~JW7mb{O z_mdU?JRDFPYc#(5IEL&6XqylO&{qY{9@bpI4juEnv_6{_V@t0U+zHtGs9~Aa=SPB^ z?*ol`{9m$+HKG=7R1MMNvX6ez}M;b=Zh9qa<>%bZ4`Cn+)JBQ#U version + +#-------------------------------------------------------------------------------- +# Include generic make targets and rules from the file generated by build-make +#-------------------------------------------------------------------------------- +-include $(DEFSFILE) + +#-------------------------------------------------------------------------------- +# Add files that require special rules and place start.o at the front +#-------------------------------------------------------------------------------- +# RAFA quitamos el start.S y start.o porque intentaremos el startup de avr +# RAFA LD_LIST = binaries/start.o $(filter-out binaries/start.o,$(OBJ_FILES)) +LD_LIST = $(filter-out binaries/start.o,$(OBJ_FILES)) + +#------------------------------------------------------------ +# Rules for files that need special handling +#------------------------------------------------------------ + +# Define variables for the Configuration file and generated files + +CONFFILE = $(TOPDIR)/config/Configuration +CONFH = $(TOPDIR)/include/conf.h +CONFC = $(TOPDIR)/system/conf.c + +# Define variables for the config program and its sources + +CONFPGM = $(TOPDIR)/config/config +CONFL = $(TOPDIR)/config/config.l +CONFY = $(TOPDIR)/config/config.y + +# Set up the required build directory structure + +BLDDIRS = binaries +export + +#-------------------------------------------------------------------------------- +# Specific additional rules and exceptions +#-------------------------------------------------------------------------------- + +xinu: Makefile rebuild $(BLDDIRS) $(DEFSFILE) $(DEPSFILE) $(CONFH) $(CONFC) $(LD_LIST) + @echo;echo 'Loading object files to produce xinu' + # RAFA original : @$(LD) $(LDFLAGS) $(LD_LIST) -o $(XINU) -L/usr/lib/gcc/arm-none-eabi/6.3.1/ --print-memory-usage + @$(LD) $(LDFLAGS) -T ld.script $(LD_LIST) -o $(XINU) + @echo "Creating Binary..." + @$(OBJCOPY) -O binary $(XINU) $(XINUBIN) + +examine-all: + $(OBJDUMP) -D $(XINU) | less + +examine-header: + $(OBJDUMP) -x $(XINU) | less + +flash: + stm32flash -w $(XINUBIN) -v /dev/ttyUSB0 + +qemu: + $(QEMU) -serial stdio -M stm32-f103c8 -kernel $(XINUBIN) +monitor: + $(QEMU) -monitor stdio -serial stdio -M stm32-f103c8 -kernel $(XINUBIN) + +$(BLDDIRS): + @mkdir -p $(BLDDIRS) + +objects: $(LD_LIST) + +$(CONFH): $(CONFFILE) $(CONFPGM) + @echo making $(CONFH) + @make configure + +$(CONFC): $(CONFFILE) $(CONFPGM) + @echo making $(CONFC) + @make configure + +$(CONFPGM): $(CONFL) $(CONFY) + @echo making the config program + @make -C $(TOPDIR)/config clean all install + +configure: + @echo forcing a rebuild of conf.h and conf.c + @make newversion + @(cd $(TOPDIR)/config; make install) + +clean: + @echo removing .o files + @rm -f ${LD_LIST} + @echo removing configuration files ... + @rm -f $(CONFH) $(CONFC) + @(cd $(TOPDIR)/config; make clean) + @echo removing xinu ... + @rm -f $(XINU) + @rm -f $(XINUBIN) + @rm -f $(XINUBOOT) + +#-------------------------------------------------------------------------------- +# Locations of source directories and exceptions (.c and .[sS] files to exclude) +#-------------------------------------------------------------------------------- + +$(DEFSFILE): + @rm -f $(DEFSFILE) + @echo "" > $(DEFSFILE) + @make rebuild + +$(DEPSFILE): + @rm -f $(DEPSFILE) + @echo "" > $(DEPSFILE) + @make depend + +rebuild: $(CONFC) + @echo Rebuilding the $(DEFSFILE) file + @$(BUILDMAKE) $(REBUILDFLAGS) > $(DEFSFILE) + +defclean: + rm -f $(DEFSFILE) + echo "" > $(DEFSFILE) + +depend: $(DEFSFILE) + @echo;echo Making all dependencies in $(DEPSFILE) + @$(MAKEDEP) ${INCLUDE} ${SRC_FULL} > $(DEPSFILE) + @echo;echo Finished making dependencies + +depclean: + rm -f $(DEPSFILE) + echo "" > $(DEPSFILE) + +-include $(DEPSFILE) diff --git a/compile/original/flash.sh b/compile/original/flash.sh new file mode 100755 index 0000000..61178bd --- /dev/null +++ b/compile/original/flash.sh @@ -0,0 +1 @@ +~/rafa/stm32flash/stm32flash -w xinu.bin -S 0x8000000 -v -g 0x8000000 -b 115200 /dev/ttyUSB0 diff --git a/compile/original/ld.script b/compile/original/ld.script new file mode 100644 index 0000000..45e7543 --- /dev/null +++ b/compile/original/ld.script @@ -0,0 +1,135 @@ +/* Linker script for ATMEL(R) AVR(R) ATmega328P. */ + +OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") +OUTPUT_ARCH(avr:5) + +/* The beginning and end of the program ROM area. */ +/* Leave 4 bytes for the 32-bit checksum plus 0x10 extra bytes free. */ +_rom_begin = 0x00000000; +_rom_end = 0x00007FEC; + +/* The beginning and end (i.e., top) of the stack */ +/* Set up a stack with a size of (1/2)K */ +_stack_begin = 0x800500; +_stack_end = 0x8008FF; /* RAFA, en atmega328 el fin de la RAM */ + +/* The end of the 2K RAM stack */ +__initial_stack_pointer = 0x8008FF; + +MEMORY +{ + ROM(rx) : ORIGIN = 0, LENGTH = 32K + RAM(rw!x) : ORIGIN = 0x800100, LENGTH = 2K +} + +SECTIONS +{ + . = 0x0; + . = ALIGN(2); + + .text : + { + /* RAFA _*/ + text = ABSOLUTE(.); /* text: beginning of text segment */ + + *(.vectors) + KEEP(*(.vectors)) + + /*Init sections were here*/ + /* From this point on, we don't bother about wether the insns are + below or above the 16 bits boundary. */ + *(.init0) /* Start here after reset. */ + __ctors_end = .; + KEEP (*(.init0)) + *(.init1) + KEEP (*(.init1)) + *(.init2) /* Clear __zero_reg__, set up stack pointer. */ + KEEP (*(.init2)) + *(.init3) + KEEP (*(.init3)) + *(.init4) /* Initialize data and BSS. */ + KEEP (*(.init4)) + *(.init5) + KEEP (*(.init5)) + *(.init6) /* C++ constructors. */ + KEEP (*(.init6)) + *(.init7) + KEEP (*(.init7)) + *(.init8) + KEEP (*(.init8)) + *(.init9) /* Call main(). */ + KEEP (*(.init9)) + + *(.def_isr) + KEEP(*(.def_isr)) + + + + + + + *(.progmem*) + . = ALIGN(2); + *(.text) + . = ALIGN(2); + *(.text*) + . = ALIGN(2); + etext = ABSOLUTE(.) ; /* etext: end of text */ + + + } > ROM + + .text : + { + . = ALIGN(0x10); + } > ROM = 0xAAAA + + .= 0x800100; + . = ALIGN(2); + + /* The ROM-to-RAM initialized data section */ + .data : + { + data = ABSOLUTE(.); /* data: beginning of data segment */ + __data = ABSOLUTE(.); /* data: beginning of data segment */ + + _data_begin = .; + *(.data) + . = ALIGN(2); + KEEP (*(.data)) + *(.data*) + . = ALIGN(2); + KEEP (*(.data*)) + *(.rodata) /* Do *NOT* move this! Include .rodata here if gcc is used with -fdata-sections. */ + . = ALIGN(2); + KEEP (*(.rodata)) + *(.rodata*) + . = ALIGN(2); + KEEP (*(.rodata*)) + __data_end = .; + + __data_start = .; + __data_load_start = .; + __bss_start = .; + + } > RAM AT > ROM + + /* The uninitialized (zero-cleared) data section */ + .bss : + { + __bss = ABSOLUTE(.); /* bss: beginning of bss segment */ + + *(.bss) + . = ALIGN(2); + KEEP (*(.bss)) + *(.bss*) + . = ALIGN(2); + KEEP (*(.bss*)) + + __bss_end = ABSOLUTE(.); /* _end: end of image */ + + } > RAM + + _rom_data_begin = LOADADDR(.data); + __data_load = LOADADDR(.data); +} diff --git a/compile/original/ld.script.avr b/compile/original/ld.script.avr new file mode 100644 index 0000000..70438e0 --- /dev/null +++ b/compile/original/ld.script.avr @@ -0,0 +1,135 @@ +/* Linker script for ATMEL(R) AVR(R) ATmega328P. */ + +OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") +OUTPUT_ARCH(avr:5) + +/* The beginning and end of the program ROM area. */ +/* Leave 4 bytes for the 32-bit checksum plus 0x10 extra bytes free. */ +_rom_begin = 0x00000000; +_rom_end = 0x00007FEC; + +/* The beginning and end (i.e., top) of the stack */ +/* Set up a stack with a size of (1/2)K */ +_stack_begin = 0x800500; +_stack_end = 0x8008FF; /* RAFA, en atmega328 el fin de la RAM */ + +/* The end of the 2K RAM stack */ +__initial_stack_pointer = 0x8008FF; + +MEMORY +{ + ROM(rx) : ORIGIN = 0, LENGTH = 32K + RAM(rw!x) : ORIGIN = 0x800100, LENGTH = 2K +} + +SECTIONS +{ + . = 0x0; + /* RAFA . = ALIGN(2); */ + + /* ISR vectors */ + .isr_vector : + { + *(.isr_vector) + . = ALIGN(0x10); + KEEP(*(.isr_vector)) + } > ROM = 0xAAAA + + /* Startup code */ + .startup : + { + *(.startup) + . = ALIGN(0x10); + KEEP(*(.startup)) + } > ROM = 0xAAAA + + /* Program code (text), read-only data and static ctors */ + .text : + { + /* RAFA _*/ + text = ABSOLUTE(.); /* text: beginning of text segment */ + + __muluhisi3 = .; + start = .; + __do_copy_data = .; + __do_clear_bss = .; + _/* _data_end = .; */ + __data_load_start = .; + __bss_end = .; + __bss_start = .; + __data_start = .; + + /* FIN DE RAFA */ + _ctors_begin = .; + *(.ctors) + . = ALIGN(2); + KEEP (*(SORT(.ctors))) + _ctors_end = .; + *(.progmem*) + . = ALIGN(2); + *(.trampolines*) + . = ALIGN(2); + *(.text) + . = ALIGN(2); + *(.text*) + . = ALIGN(2); + etext = ABSOLUTE(.) ; /* etext: end of text */ + + } > ROM + + .text : + { + . = ALIGN(0x10); + } > ROM = 0xAAAA + + .= 0x800100; + . = ALIGN(2); + + /* The ROM-to-RAM initialized data section */ + .data : + { + data = ABSOLUTE(.); /* data: beginning of data segment */ + + _data_begin = .; + *(.data) + /* rafa . = ALIGN(2); */ + . = ALIGN(1); + KEEP (*(.data)) + *(.data*) + /* RAafa . = ALIGN(2); todos los demas tambien */ + . = ALIGN(1); + KEEP (*(.data*)) + *(.rodata) /* Do *NOT* move this! Include .rodata here if gcc is used with -fdata-sections. */ + . = ALIGN(1); + KEEP (*(.rodata)) + *(.rodata*) + . = ALIGN(1); + KEEP (*(.rodata*)) + _data_end = .; + + edata = ABSOLUTE(.) ; /* edata: end of data */ + } > RAM AT > ROM + + /* The uninitialized (zero-cleared) data section */ + .bss : + { + bss = ABSOLUTE(.); /* bss: beginning of bss segment */ + + _bss_begin = .; + *(.bss) + . = ALIGN(1); + KEEP (*(.bss)) + *(.bss*) + . = ALIGN(1); + KEEP (*(.bss*)) + _bss_end = .; + + ebss = ABSOLUTE(.) ; /* ebss: end of bss */ + + end = ABSOLUTE(.); /* end: end of image */ + _end = ABSOLUTE(.); /* _end: end of image */ + + } > RAM + + _rom_data_begin = LOADADDR(.data); +} diff --git a/compile/original/ld.script.avr.baremetal b/compile/original/ld.script.avr.baremetal new file mode 100644 index 0000000..422686c --- /dev/null +++ b/compile/original/ld.script.avr.baremetal @@ -0,0 +1,105 @@ +/* Linker script for ATMEL(R) AVR(R) ATmega328P. */ + +OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") +OUTPUT_ARCH(avr:5) + +/* The beginning and end of the program ROM area. */ +/* Leave 4 bytes for the 32-bit checksum plus 0x10 extra bytes free. */ +_rom_begin = 0x00000000; +_rom_end = 0x00007FEC; + +/* The beginning and end (i.e., top) of the stack */ +/* Set up a stack with a size of (1/2)K */ +_stack_begin = 0x800500; +_stack_end = 0x800800; + +/* The end of the 2K RAM stack */ +__initial_stack_pointer = 0x800800; + +MEMORY +{ + ROM(rx) : ORIGIN = 0, LENGTH = 32K - 0x14 + RAM(rw!x) : ORIGIN = 0x800100, LENGTH = 0x0800 +} + +SECTIONS +{ + . = 0x0; + . = ALIGN(2); + + /* ISR vectors */ + .isr_vector : + { + *(.isr_vector) + . = ALIGN(0x10); + KEEP(*(.isr_vector)) + } > ROM = 0xAAAA + + /* Startup code */ + .startup : + { + *(.startup) + . = ALIGN(0x10); + KEEP(*(.startup)) + } > ROM = 0xAAAA + + /* Program code (text), read-only data and static ctors */ + .text : + { + _ctors_begin = .; + *(.ctors) + . = ALIGN(2); + KEEP (*(SORT(.ctors))) + _ctors_end = .; + *(.progmem*) + . = ALIGN(2); + *(.trampolines*) + . = ALIGN(2); + *(.text) + . = ALIGN(2); + *(.text*) + . = ALIGN(2); + } > ROM + + .text : + { + . = ALIGN(0x10); + } > ROM = 0xAAAA + + .= 0x800100; + . = ALIGN(2); + + /* The ROM-to-RAM initialized data section */ + .data : + { + _data_begin = .; + *(.data) + . = ALIGN(2); + KEEP (*(.data)) + *(.data*) + . = ALIGN(2); + KEEP (*(.data*)) + *(.rodata) /* Do *NOT* move this! Include .rodata here if gcc is used with -fdata-sections. */ + . = ALIGN(2); + KEEP (*(.rodata)) + *(.rodata*) + . = ALIGN(2); + KEEP (*(.rodata*)) + _data_end = .; + } > RAM AT > ROM + + /* The uninitialized (zero-cleared) data section */ + .bss : + { + _bss_begin = .; + *(.bss) + . = ALIGN(2); + KEEP (*(.bss)) + *(.bss*) + . = ALIGN(2); + KEEP (*(.bss*)) + _bss_end = .; + } > RAM + + _rom_data_begin = LOADADDR(.data); +} diff --git a/compile/original/ld.script.avr2 b/compile/original/ld.script.avr2 new file mode 100644 index 0000000..848f647 --- /dev/null +++ b/compile/original/ld.script.avr2 @@ -0,0 +1,149 @@ +/* Linker script for ATMEL(R) AVR(R) ATmega328P. */ + +OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") +OUTPUT_ARCH(avr:5) + +/* The beginning and end of the program ROM area. */ +/* Leave 4 bytes for the 32-bit checksum plus 0x10 extra bytes free. */ +_rom_begin = 0x00000000; +_rom_end = 0x00007FEC; + +/* The beginning and end (i.e., top) of the stack */ +/* Set up a stack with a size of (1/2)K */ +_stack_begin = 0x800500; +_stack_end = 0x8008FF; /* RAFA, en atmega328 el fin de la RAM */ + +/* The end of the 2K RAM stack */ +__initial_stack_pointer = 0x8008FF; + +MEMORY +{ + ROM(rx) : ORIGIN = 0, LENGTH = 32K + RAM(rw!x) : ORIGIN = 0x800100, LENGTH = 2K +} + +SECTIONS +{ + . = 0x0; + . = ALIGN(2); + + .text : + { + /* RAFA _*/ + text = ABSOLUTE(.); /* text: beginning of text segment */ + + *(.vectors) + KEEP(*(.vectors)) + + /*Init sections were here*/ + /* From this point on, we don't bother about wether the insns are + below or above the 16 bits boundary. */ + *(.init0) /* Start here after reset. */ + KEEP (*(.init0)) + *(.init1) + KEEP (*(.init1)) + *(.init2) /* Clear __zero_reg__, set up stack pointer. */ + KEEP (*(.init2)) + *(.init3) + KEEP (*(.init3)) + *(.init4) /* Initialize data and BSS. */ + KEEP (*(.init4)) + *(.init5) + KEEP (*(.init5)) + *(.init6) /* C++ constructors. */ + KEEP (*(.init6)) + *(.init7) + KEEP (*(.init7)) + *(.init8) + KEEP (*(.init8)) + *(.init9) /* Call main(). */ + KEEP (*(.init9)) + + *(.def_isr) + KEEP(*(.def_isr)) + + + + __muluhisi3 = .; + start = .; + __do_copy_data = .; + __do_clear_bss = .; + _/* _data_end = .; */ + __data_load_start = .; + __bss_end = .; + __bss_start = .; + __data_start = .; + + /* FIN DE RAFA */ + _ctors_begin = .; + *(.ctors) + . = ALIGN(2); + KEEP (*(SORT(.ctors))) + _ctors_end = .; + *(.progmem*) + . = ALIGN(2); + *(.trampolines*) + . = ALIGN(2); + *(.text) + . = ALIGN(2); + *(.text*) + . = ALIGN(2); + etext = ABSOLUTE(.) ; /* etext: end of text */ + + } > ROM + + .text : + { + . = ALIGN(0x10); + } > ROM = 0xAAAA + + .= 0x800100; + . = ALIGN(2); + + /* The ROM-to-RAM initialized data section */ + .data : + { + data = ABSOLUTE(.); /* data: beginning of data segment */ + + _data_begin = .; + *(.data) + . = ALIGN(2); + KEEP (*(.data)) + *(.data*) + . = ALIGN(2); + KEEP (*(.data*)) + *(.rodata) /* Do *NOT* move this! Include .rodata here if gcc is used with -fdata-sections. */ + . = ALIGN(2); + KEEP (*(.rodata)) + *(.rodata*) + . = ALIGN(2); + KEEP (*(.rodata*)) + _data_end = .; + __data_end = .; + + edata = ABSOLUTE(.) ; /* edata: end of data */ + } > RAM AT > ROM + + /* The uninitialized (zero-cleared) data section */ + .bss : + { + bss = ABSOLUTE(.); /* bss: beginning of bss segment */ + + _bss_begin = .; + *(.bss) + . = ALIGN(2); + KEEP (*(.bss)) + *(.bss*) + . = ALIGN(2); + KEEP (*(.bss*)) + _bss_end = .; + + ebss = ABSOLUTE(.) ; /* ebss: end of bss */ + + end = ABSOLUTE(.); /* end: end of image */ + _end = ABSOLUTE(.); /* _end: end of image */ + + } > RAM + + _rom_data_begin = LOADADDR(.data); +} diff --git a/compile/original/ld.script.stm32 b/compile/original/ld.script.stm32 new file mode 100644 index 0000000..b968a92 --- /dev/null +++ b/compile/original/ld.script.stm32 @@ -0,0 +1,55 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* OUTPUT_ARCH(arm) */ +ENTRY(start) + +physbase = 0x08000000; + +MEMORY +{ + /* FLASH (xr) : ORIGIN = 0x08000000, LENGTH = 512K */ + FLASH (xr) : ORIGIN = 0x8000000, LENGTH = 128K + /* SRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K */ + SRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K +} + +SECTIONS +{ + . = 0x0; /* Image starts here */ + .text : ALIGN(4) { + text = ABSOLUTE(.); /* text: beginning of text segment */ + *(.text .text.*) /* asm text, then C text */ + *(.rodata .rodata.*) /* asm and C read-only data */ + etext = ABSOLUTE(.) ; /* etext: end of text */ + } + . = 0x20000000; + .data : AT(etext) + { + data = ABSOLUTE(.); /* data: beginning of data segment */ + *(.data .data.*) + edata = ABSOLUTE(.) ; /* edata: end of data */ + } + .bss ALIGN(4) : + { + bss = ABSOLUTE(.); /* bss: beginning of bss segment */ + *(.bss .bss.*) + *(COMMON) /* extra sections that are common */ + ebss = ABSOLUTE(.) ; /* ebss: end of bss */ + . = ALIGN(8); */ + end = ABSOLUTE(.); /* end: end of image */ + _end = ABSOLUTE(.); /* _end: end of image */ + . = ALIGN(8); + } +} diff --git a/compile/version b/compile/version new file mode 100644 index 0000000..fdb67c1 --- /dev/null +++ b/compile/version @@ -0,0 +1 @@ +Xinu for ATMEGA328P -- version #280 (lechnerm) dom may 17 23:40:51 -03 2020 diff --git a/compile/xinu.hex b/compile/xinu.hex new file mode 100644 index 0000000..764ba9c --- /dev/null +++ b/compile/xinu.hex @@ -0,0 +1,1108 @@ +:100000000C944F010C946E010C946E010C946E01D3 +:100010000C946E010C946E010C946E010C946E01A4 +:100020000C946E010C946E010C946E010C946E0194 +:100030000C946E010C946E010C946E010C946E0184 +:100040000C946E010C946E010C946E010C946E0174 +:100050000C946E010C946E010C946E010C946E0164 +:100060000C946E010C946E010C944F010C946E0173 +:100070000C946E010C946E010C946E010C946E0144 +:100080000C946E010C946E010C946E010C946E0134 +:100090000C946E010C946E010C946E010C946E0124 +:1000A0000C946E010C946E010C946E010C946E0114 +:1000B0000C946E010C946E010C946E010C946E0104 +:1000C0000C946E010C946E010C946E010C946E01F4 +:1000D00000000000434F4E534F4C4500000000000D +:1000E000000000009F099F099F099F099F099D0922 +:1000F0009F099F099F0900389F0935010000004EA4 +:10010000554C4C4445560000000000000000009F84 +:10011000099F099F099F099F099D099F099F099DA3 +:100120000900009D0900020000004E414D4553505A +:1001300041434500000000000000211B771C9D0981 +:100140009D099D099D099D099D099D0900009D0925 +:100150000000202020202020202020080808080857 +:10016000202020202020202020202020202020208F +:100170002020081010101010101010101010101067 +:1001800010100404040404040404040410101010E7 +:1001900010101041414141414101010101010101A2 +:1001A0000101010101010101010101010110101012 +:1001B0001010104242424242420202020202020275 +:1001C00002020202020202020202020202101010E5 +:1001D000102043616E2774207374617274757020EF +:1001E00073797374656D006E616D657370616365BD +:1001F0003A20646576696365206E616D65202573BC +:1002000020746F6F206C6F6E670D0A006E616D65F4 +:1002100073706163653A2063616E6E6F74206D6FF9 +:10022000756E74206465766963652025640D0A0027 +:100230000A0A416C6C20757365722070726F636579 +:1002400073736573206861766520636F6D706C658C +:100250007465642E0A0A00506F7274207379737487 +:10026000656D2072616E206F7574206F66206D65FC +:100270007373616765206E6F646573000A0A4D6170 +:10028000696E2070726F6365737320726563726547 +:100290006174696E67207368656C6C0A0A001124CA +:1002A0001FBECFEFD8E0DEBFCDBF12E0A0E0B1E0CF +:1002B000E4E8F3E402C005900D92A839B107D9F73C +:1002C00025E0A8E9B2E001C01D92AF39B207E1F71D +:1002D0000C94E2070E94E81D0C946D050C9400003C +:1002E00081E008950F931F93CF93DF9300D000D048 +:1002F000CDB7DEB719821A821B821C8219821A823C +:100300001B821C8209811A812B813C8106171707E9 +:100310002807390770F4000009811A812B813C817C +:100320000F5F1F4F2F4F3F4F09831A832B833C834F +:10033000E9CF0F900F900F900F90DF91CF911F9109 +:100340000F91089580E284B92D9A60E47DE083E006 +:1003500090E00E9472012D9860E47DE083E090E0DF +:100360000C9472011092B30281E00895CF93DF9351 +:10037000C82FD62F0E94E81DC43050F497E2C9025E +:10038000F0011124E754FC4F20813181232B21F40B +:100390000E94E81D8FEF05C0C281D2830E94E81D34 +:1003A0008C2FDF91CF9108958091080090910900E2 +:1003B0008E7F90930900809308008091B7029091FE +:1003C000B80201969093B8028093B702883E93409A +:1003D00068F08091B9029091BA0201969093BA02A6 +:1003E0008093B9021092B8021092B702E091B40261 +:1003F00084E0E802F0011124EE53FB4FE281E43087 +:100400007CF424E0E202F0011124EE53FB4F8081E2 +:100410009181019791838083892B11F40E9413139A +:100420008091B5029091B602019711F481E090E0BD +:100430009093B6028093B5020895CF93DF930E9404 +:10044000500B8093B40281E090E09093B6028093C9 +:10045000B5021092BA021092B9021092B80210922C +:10046000B702E0E0F0E1868597858160978786870F +:10047000C0E0D0E08881998184609983888387E097 +:1004800090E09D8B8C8BFF8BEE8B8E819F818160AA +:100490009F838E8364ED71E08CE290E00E945D05A5 +:1004A00067E97FE08EE090E00E945D058881998198 +:1004B000816099838883DF91CF910895CF93DF93F3 +:1004C000C82F0E94E81DD82FC33020F00E94E81DDD +:1004D000CFEF10C02BE2C202C001112480539F4F06 +:1004E000DC015896ED91FC9159970995C82F8D2FF5 +:1004F0000E94E81D8C2FDF91CF910895CF92DF925B +:10050000EF92FF920F931F93CF93DF93C82F8B012E +:100510007A0169010E94E81DD82FC33020F00E94A3 +:10052000E81DCFEF13C02BE2C202C001112480539B +:100530009F4FDC019496ED91FC9195979601A70150 +:10054000B8010995C82F8D2F0E94E81D8C2FDF91CF +:10055000CF911F910F91FF90EF90DF90CF90089572 +:100560007F928F929F92AF92BF92CF92DF92EF9243 +:10057000FF920F931F93CF93DF93CDB7DEB7EA8837 +:10058000FB887C888D889E880E94E81D082F24E6C1 +:10059000E216F10418F484E6E82EF12C33E0E30EC1 +:1005A000F11C57018CEFA82244E050E0B4018BEB22 +:1005B00092E00E94D11EC5010E944C077C01019669 +:1005C00009F4BDC01091980224E030E087E213786E +:1005D00017FF03C011501C6F1F5FC12E012E000CAE +:1005E000DD088C9DF0018D9DF00D1124E754FC4F2A +:1005F0004081518191E0910F452B29F4909398020D +:100600001F3FA9F49CC0192F2150310901F7909385 +:10061000980244E050E067E971E08BEB92E00E94C1 +:10062000C31E892B09F08BC00E94E10788C01714F4 +:100630000CF085C0809155049091560401969093DA +:1006400056048093550485E090E091838083728204 +:10065000F682E582B086A782108EF401B7E21B0213 +:10066000A001112480E090E02191DC01A40FB51FCE +:10067000A754BC4F19962C93222321F001968F305A +:10068000910591F727E22C9DC0012D9D900D11241D +:10069000FC01E754FC4F5F018FEF818F0E942F0711 +:1006A000D5015A968C935A975C961C925C975E96ED +:1006B0001C921E925D9790961C921E925F97929646 +:1006C0001C921E929197F7017C9797012C53310948 +:1006D000AE01475E5F4F6F89788D4F0180E090E0FB +:1006E0008617970751F0DA01AD90BD90AD01D401A6 +:1006F000AD92BD924D010196F3CF89ED92E19387C2 +:100700008287888999899587848717861686BCE2AF +:10071000EB1AF108F90111921192EE16FF06D9F7C2 +:1007200087E28C9DF0018D9DF00D1124E754FC4F64 +:1007300034832383802F0E94E81D812F04C0802FE3 +:100740000E94E81D8FEFDF91CF911F910F91FF90D5 +:10075000EF90DF90CF90BF90AF909F908F907F9061 +:1007600008952F923F924F925F926F927F928F9255 +:100770009F92AF92BF92CF92DF92EF92FF920F9330 +:100780001F93CF93DF9300D01F92CDB7DEB76C01DC +:100790003B01498380E190E07C01E61AF70ADB82A5 +:1007A000CA828B018CE9482E81E0582E9AEA292EC4 +:1007B00091E0392E8A819B818C199D0986159705B8 +:1007C00008F022C12B812F933A813F935F924F9281 +:1007D0002091B80337E22303F0011124E754FC4FC2 +:1007E00080A18F93878D8F930E94E81E0F900F90AA +:1007F0000F900F900F900F90AA80BB80812C912CAE +:10080000C40187709927892BA1F43F922F922091E0 +:10081000B80337E22303F0011124E754FC4F80A111 +:100820008F93878D8F930E94E81E0F900F900F90EB +:100830000F90F50181915F011F928F9322EA31E0C1 +:100840003F932F932091B80337E22303F001112443 +:10085000E754FC4F80A18F93878D8F930E94E81EF1 +:100860008FEF881A980A0F900F900F900F900F90AB +:100870000F900815190529F090E18916910409F0E7 +:10088000BFCF0031110510F5A12CB12C1CC0A11453 +:10089000B104D9F588EA91E09F938F932091B80332 +:1008A00037E22303F0011124E754FC4F80A18F931A +:1008B000878D8F930E94E81E8FEFA81AB80A0F90B9 +:1008C0000F900F900F90AE14BF0408F3E981E13050 +:1008D00009F079C0ECEAF1E0FF93EF932091B803BF +:1008E00037E22303F0011124E754FC4F80A18F93DA +:1008F000878D8F930E94E81E0F900F900F900F909E +:100900008A809B80A12CB12C3FC0C501877099279C +:10091000892B09F0BFCF3F922F922091B80337E285 +:100920002303F0011124E754FC4F80A18F93878D9E +:100930008F930E94E81E0F900F900F900F90AACFF8 +:100940001F928F932FEA31E03F932F932091B803AA +:1009500037E22303F0011124E754FC4F80A18F9369 +:10096000878D8F930E94E81E8FEFA81AB80A0F9008 +:100970000F900F900F900F900F900A151B0569F0C4 +:1009800090E1A916B10449F0F40181914F0190EE74 +:10099000980F9F35A8F28EE2D3CFEDEAF1E0FF93F6 +:1009A000EF932091B80337E22303F0011124E754B9 +:1009B000FC4F80A18F93878D8F930E94E81E0F902C +:1009C0000F900F900F908EED91E09F938F93209159 +:1009D000B80337E22303F0011124E754FC4F80A150 +:1009E0008F93878D8F930E94E81E005111098A8191 +:1009F0009B8140969B838A8390E1E90EF11C0F90C6 +:100A00000F900F900F90D6CE0F900F900F90DF9118 +:100A1000CF911F910F91FF90EF90DF90CF90BF90FB +:100A2000AF909F908F907F906F905F904F903F908E +:100A30002F900895CF93DF93CDB7DEB767970FB6AA +:100A4000F894DEBF0FBECDBF843148F4E1E0F0E0A2 +:100A5000EC0FFD1FE80FF11D8591949102C082EB10 +:100A600091E067960FB6F894DEBF0FBECDBFDF9161 +:100A7000CF91089548EB50E060E070E080E093E0B3 +:100A80000E94BC1EE2E0F3E08AE195E0819391933D +:100A900023E0E238F207D1F7809112ED909113ED47 +:100AA000909313ED809312ED80E093E0909305ED29 +:100AB000809304ED81E090E008958D35910550F428 +:100AC000880F991FFC01E050FD4F7183608381E026 +:100AD00090E008958FEF9FEF08950E942F070C94E8 +:100AE000A1091F93CF93DF93182FD92F0E94E81DE0 +:100AF000C82FA12FBD2FEE91E7FD04C08091B30256 +:100B0000E8172CF08C2F0E94E81D8FEF14C085E0B1 +:100B1000E802F0011124E656FD4F80819181119683 +:100B20009C938E93B183A08382810E947D118C2F30 +:100B30000E94E81D81E0DF91CF911F9108950F93EE +:100B40001F93CF93DF93EC018B010E94E81D0115E9 +:100B5000110579F12091960430919704C217D307BB +:100B600040F120919804309199042C173D0708F129 +:100B7000B801695F7F4F687FE0916704F091680476 +:100B8000A7E6B4E0309741F0EC17FD07C8F4DF01A9 +:100B90000190F081E02DF6CF94E0A736B907E9F097 +:100BA00012962D913C9113972A0F3B1FC217D30722 +:100BB00020F40E94E81D8FEF46C0309739F40FC033 +:100BC00094E0A736B90761F720E030E0AE01460FA8 +:100BD000571FE417F50718F4ECCF20E030E0409100 +:100BE000690450916A04460F571F50936A0440935A +:100BF0006904C217D30761F412962D913C911397A3 +:100C0000620F731F13967C936E931297ED0106C0CB +:100C1000F983E8837B836A83CD93DC932A813B81CC +:100C2000AE01420F531FE417F50751F4428153817F +:100C3000240F351F3B832A83208131813983288308 +:100C40000E94E81D81E0DF91CF911F910F910895DF +:100C5000EF92FF920F931F93CF93DF93F82E0E9492 +:100C6000E81DE82EF7FC04C08091B302F81634F0BA +:100C70008E2D0E94E81D8FEF9FEF17C08F2D95E0FE +:100C800089028001112406561D4FF80182810E94BD +:100C9000DD12F801C081D18188819981918380839F +:100CA000F9928E2D0E94E81DCE01DF91CF911F9108 +:100CB0000F91FF90EF900895CF93DF93C82F0E947C +:100CC000E81DD82FC33020F00E94E81DCFEF10C0E0 +:100CD0002BE2C202C001112480539F4FDC01909689 +:100CE000ED91FC9191970995C82F8D2F0E94E81DD9 +:100CF0008C2FDF91CF910895EF92FF920F931F9366 +:100D0000CF93DF937C010E94E81DD82F04ED10E003 +:100D1000C0E040E150E0B801C7010E94C31E892B2A +:100D200029F08D2F0E94E81D8C2F09C0CF5F055D33 +:100D30001F4FC33071F78D2F0E94E81D8FEFDF9199 +:100D4000CF911F910F91FF90EF90089524E08202C0 +:100D5000D0011124AE53BB4F1296EC91129713960B +:100D60009C9124E09202D0011124AE53BB4F129605 +:100D7000EC9324E0E202F0011124EE53FB4F938345 +:100D8000089524E08202C0011124FC01EE53FB4FC0 +:100D90008281843014F40C94A6068FEF089594E0B9 +:100DA0008902F0011124EE53FB4F9281943054F4E8 +:100DB0008F5F94E08902F0011124EE53FB4F838191 +:100DC0000C94A6068FEF0895CF93DF93EC010E9459 +:100DD000E81D2097E9F19E01295F3F4F287FC091D0 +:100DE0006704D0916804E7E6F4E0209789F14A812E +:100DF0005B812417350729F4488159815183408349 +:100E000013C024173507F8F4DE01A20FB31FB18316 +:100E1000A0836881798111967C936E93421B530B5A +:100E200013965C934E9312974091690450916A0413 +:100E3000BA01621B730B70936A04609369040E9489 +:100E4000E81DCE0109C0FE010990D881C02DCDCF8B +:100E50000E94E81D8FEF9FEFDF91CF910895809161 +:100E6000B8030895CF93C82F0E94E81DC43050F4F2 +:100E700097E2C902F0011124E754FC4F208131812F +:100E8000232B21F40E94E81DCFEF03C0C2810E94F2 +:100E9000E81D8C2FCF9108950F931F93CF93DF936D +:100EA000EC010E94E81D2097E9F02796C87FE091A9 +:100EB0006704F0916804A0E0B0E000E010E027E6ED +:100EC00034E0309761F0428153814C175D0710F098 +:100ED000D9018F019F010190F081E02DF2CF011522 +:100EE000110529F40E94E81D8FEF9FEF22C0F80141 +:100EF00022813381C217D30729F4208131812D93B8 +:100F00003C9307C02C1B3D0BF80133832283020F57 +:100F1000131F2091690430916A042C1B3D0B309300 +:100F20006A04209369040E94E81DCE010297800F95 +:100F3000911FDF91CF911F910F91089580E090E074 +:100F400008958FEF0895CF93DF93C82F0E94E81D77 +:100F5000D82FC33020F00E94E81DCFEF10C02BE245 +:100F6000C202C001112480539F4FDC015496ED91C1 +:100F7000FC9155970995C82F8D2F0E94E81D8C2F45 +:100F8000DF91CF9108951F921F921F921F928AEBBB +:100F900091E09F938F9384E18F9384E08F931F92CE +:100FA00088EE9DE19F938F930E94B0020E94F80FFC +:100FB0008DB79EB70B960FB6F8949EBF0FBE8DBF30 +:100FC000FFCF0895CF93DF931F92CDB7DEB7F8948C +:100FD0000E94A2010E94321181E40E94471182E422 +:100FE0000E9447110E944E118983CE0101960E94F2 +:100FF000951E8C0188E50E944711F801E050FF4FD3 +:1010000080810E9447110E94B90B87EC91E09F9369 +:101010008F930E94510A85ED91E09F938F938AED03 +:1010200091E09F938F930E94510A0E94AC0A109204 +:101030005604109255041092040510920305E9EB32 +:10104000F3E085E594E00F900F900F900F900F90D4 +:101050000F90118210821186168215821282B79625 +:101060008E179F07B1F707E514E097E6E92E94E0A5 +:10107000F92EF8011082128211820E94500BF801A1 +:1010800083830C5F1F4FE016F10699F70E94B201AF +:101090000E94500B8093020580E00E94A30781E02C +:1010A0000E94A30782E00E94A307009167041091A9 +:1010B0006804F801309721F00190F081E02DFACF1B +:1010C00080EEE82E81E0F82E01151105C1F0F8013F +:1010D000828193810197800F911F9F938F931F931C +:1010E0000F93FF92EF920E94510AF8010081118143 +:1010F0000F900F900F900F900F900F90E5CF1F92D1 +:101100001F921F921F928FEF91E09F938F938AE01F +:101110008F9384E08F931F9283EC97E09F938F933C +:101120000E94B002F7E28F02C0011124FC01E754D3 +:10113000FC4F81E090E0918380830E94E81D0E9433 +:101140001D0282ED91E00E94A90B0FB6F894DEBF5C +:101150000FBECDBFFFCF82ED91E00C94A90B9F9302 +:101160008F938CE092E09F938F930E94510A0F908F +:101170000F900F900F90FFCFCF93DF9300D000D050 +:10118000CDB7DEB7880F991F092E000CAA0BBB0B39 +:1011900089839A83AB83BC8389819A81AB81BC812B +:1011A000181619061A061B0644F489819A81AB8128 +:1011B000BC810197A109B109EBCF81E090E00F90CC +:1011C0000F900F900F90DF91CF9108959CEF960FA5 +:1011D0009B30E0F58430D0F5E82F082E000CFF0B93 +:1011E00027E28202D0011124A754BC4F2D913C91DB +:1011F000232B61F194E06902D0011124AE53BB4F5F +:1012000012962C9194E02902D0011124AE53BB4FC9 +:101210006D917C9111976417750794F713969C91C3 +:101220001397EE0FFF1FEE0FFF1FEE53FB4F2283AE +:1012300093835183408324E09202F0011124EE5302 +:10124000FB4F828313968C9381E008958FEF08956E +:101250000F931F93CF93DF939CEF960F9B3008F073 +:1012600066C0843008F063C0E82F082E000CFF0B26 +:1012700097E28902D0011124A754BC4F2D913C91D3 +:10128000232B09F454C0062E000C770BDB01AA0FA8 +:10129000BB1FAA0FBB1FAE53BB4F12962C91022E41 +:1012A000000C330BEB012196DE012C173D0721F5D5 +:1012B000EE0FFF1FEE0FFF1FEE53FB4FA283638362 +:1012C00051834083660F771F660F771FFB01EE5334 +:1012D000FB4F8283FD01EE0FFF1FEE0FFF1FEE534A +:1012E000FB4F83832A173B0701F180819181841B87 +:1012F000950B9183808319C0D901AA0FBB1FAA0F38 +:10130000BB1FAE53BB4F0D911C9111974017510756 +:101310004CF0401B510B12969C91B901292F990F4B +:10132000330BC2CFD9019E01C3CF81E001C08FEF43 +:10133000DF91CF911F910F9108958FEF089581E074 +:101340000895EF92FF920F931F93CF93DF93182F7F +:101350000E94E81D082F143080F4E12E012E000CAD +:10136000FF0887E21802F0011124E754FC4F808146 +:101370009181892B11F0111105C0802F0E94E81D69 +:101380008FEF64C08091550490915604019790931B +:10139000560480935504029714F40E94621387E266 +:1013A0008E9DE0018F9DD00D1124C754DC4F612F1D +:1013B0008A8D0E9400118D8D0E945E028F8D0E9489 +:1013C0005E0289A10E945E022F813885295F3F4F0E +:1013D000287F8D819E810296B901821B930B0E940A +:1013E0009F05888199818430910579F030F48130AE +:1013F000910549F00297C9F01BC08630910549F06C +:10140000079719F015C019821882812F0E94961231 +:101410000FC0E98D84E0E802F0011124E95AFB4F86 +:1014200081819281019692838183812F0E94A606F9 +:1014300087E28E9DF0018F9DF00D1124E754FC4F43 +:1014400011821082802F0E94E81D81E0DF91CF91F0 +:101450001F910F91FF90EF900895CF93C82F0E9496 +:10146000E81DCA3061F4209100383091013826FF20 +:10147000FACF2DE030E030930338209302382091EA +:1014800000383091013826FFFACF2C2F30E030930E +:101490000338209302380E94E81D81E0CF9108951F +:1014A0000895CF93DF93CDB7DEB7BE016B5F7F4F5B +:1014B000FB0181919191BF014DE25AE00E940E150E +:1014C00081E0DF91CF9108951092940410929304DB +:1014D00081E090E00E944D10809395040895CF9391 +:1014E000DF93FC0120813181409193045091940459 +:1014F00037FD0DC02417350754F4220F331FF901AF +:10150000E559FB4F2081318182179307F9F044316F +:101510005105F4F4EC01809195040E94DD122091B4 +:10152000930430919404C90101969093940480939C +:10153000930439832883220F331FF901E559FB4FA8 +:10154000D183C083809195040E947D1181E001C008 +:101550008FEFDF91CF910895CF93DF9300D0CDB778 +:10156000DEB79E012F5F3F4F309397042093960480 +:1015700080E29AE49093990480939804E7E6F4E07B +:1015800031832083821B930B938382830F900F9070 +:10159000DF91CF9108956F927F928F929F92AF9239 +:1015A000BF92CF92DF92EF92FF920F931F93CF9350 +:1015B000DF938C016B010E94E81D682EC80108971B +:1015C0000D9708F040C0C60101970A97E0F5809199 +:1015D000B3028530C4F50D5F1F4F0C7F58012FEF0C +:1015E000A21AB20AAC9CE001AD9CD00DBC9CD00DFF +:1015F0001124CE010E94E4067C01019621F1709035 +:10160000B30281E0870D8093B302E72DF5E0EF028E +:10161000C00111249C0126563D4F4901F901F18278 +:10162000E08214830383C6010E944D10F40182837B +:101630008F3F79F4BE01C7010E949F058091B302DC +:1016400081508093B302862D0E94E81D77247A94FE +:1016500017C0F70180E090E00196C816D90639F06E +:1016600095012E0F3F1F31832083F901F5CFCA1951 +:10167000DB09CE0DDF1D19821882862D0E94E81D20 +:10168000872DDF91CF911F910F91FF90EF90DF9009 +:10169000CF90BF90AF909F908F907F906F90089564 +:1016A0008091150180313CF592E0980F90931501DF +:1016B000E82F082E000CFF0BDF01AA0FBB1FAA0F9B +:1016C000BB1FAE53BB4F91E0980F12969C9312979D +:1016D0009FEF13969C9313972FEF3FEF2D933C931F +:1016E000EE0FFF1FEE0FFF1FEA53FB4F9283838322 +:1016F0001182108208958FEF0895EF92FF920F9359 +:101700001F93CF93DF93C82F8B017A010E94E81DAE +:10171000D82FC33020F00E94E81DCFEF12C02BE27B +:10172000C202C001112480539F4FDC015696ED91F7 +:10173000FC915797A701B8010995C82F8D2F0E94DA +:10174000E81D8C2FDF91CF911F910F91FF90EF90AB +:101750000895EC010E94E81DDF93CF9386E192E0AB +:101760009F938F930E94510A0F900F900F900F90AC +:10177000FFCF0E943A050C949512E0E0F0E18485D9 +:101780009585846090649587848784E998E4909334 +:10179000030880930208E0E0F8E3868197819F7D4B +:1017A0009783868385E490E09583848386819781FF +:1017B0008C629783868386819781906297838683E4 +:1017C0000895CF92DF92EF92FF920F931F93CF93E2 +:1017D000DF93EC016B017A0182E090E09B838A83C6 +:1017E0008E819F8101969F838E83088519850115BF +:1017F0001105C9F0F80180819181F7010995F8017F +:101800000281138101151105A9F7EA85FB858091F5 +:10181000C0049091C10493838283888599859093B5 +:10182000C1048093C004F3E0CF16D10479F4198683 +:1018300018861B861A866C817D8188810E94C21061 +:1018400060E070E089810E94C21006C088810E9419 +:10185000831089810E948310DB82CA82DF91CF913D +:101860001F910F91FF90EF90DF90CF900895FF921E +:101870000F931F93CF93DF93EC010E94E81DF82E86 +:10188000C330D10568F48CE08C9F80018D9F100DD2 +:10189000112406561B4FF80182819381039731F082 +:1018A0008F2D0E94E81D8FEF9FEF18C0F8018181F6 +:1018B0000E943410C82F880FDD0BD7FD0BC0F80134 +:1018C00080810E943410082E000C990B97FF02C0F3 +:1018D000C81BD90B8F2D0E94E81DCE01DF91CF913F +:1018E0001F910F91FF900895CF92DF92FF920F9377 +:1018F0001F93CF93DF936C010E94E81DF82ED7FC55 +:1019000046C00091BE041091BF0423E030E04CE0DB +:10191000C80101968330910514F080E090E0409F6B +:10192000E001419FD00D1124C656DB4FFE013296D7 +:101930006A817B816130710509F59093BF048093C2 +:10194000BE0483E090E091838083C6010E944D1025 +:10195000888380E090E00E944D1089831B861A8660 +:10196000198618868E819F8101969F838E83DD82E2 +:10197000CC828F2D0E94E81D802F0DC0215031098F +:1019800011F08C01C5CF9093BF048093BE048F2DBE +:101990000E94E81D8FEFDF91CF911F910F91FF9073 +:1019A000DF90CF900895EF92FF921F93CF93DF9334 +:1019B000EC017B010E94E81D182FC330D10570F4A3 +:1019C0002CE02C9FC0012D9F900D112486569B4F1B +:1019D000FC01228133812330310529F0812F0E94BF +:1019E000E81D8FEF0DC0A70161E070E00E94E10BE0 +:1019F000D093BF04C093BE04812F0E94E81D81E0F4 +:101A0000DF91CF911F91FF90EF900895CF93DF93D7 +:101A1000EC01880F991F880F991F0E94E40690938C +:101A2000C1048093C004019621F485E292E00E94F3 +:101A3000A90B81E090E090939D0480939C04109208 +:101A4000A1041092A0049093A9048093A80410927A +:101A5000AD041092AC049093B5048093B40410923A +:101A6000B9041092B8041092BF041092BE04E09121 +:101A7000C004F091C10421971C161D0634F434965D +:101A8000DF011297ED93FC93F6CF1382128281E06F +:101A9000DF91CF910895CF92DF92EF92FF920F9353 +:101AA0001F93CF93DF937C010E94E81D082F83E0F2 +:101AB000E816F104E0F48CE08E9DE0018F9DD00DDE +:101AC0001124C656DB4F8A819B81039781F4CE8017 +:101AD000DF8089810E94DD128F3F49F08A819B81DE +:101AE000039729F48E819F81C816D90631F0802F83 +:101AF0000E94E81D8FEF9FEF2CC0E885F9851081CB +:101B00008A859B85E817F90729F41B861A861986AA +:101B1000188604C082819381998788878091C00448 +:101B20009091C10493838283F093C104E093C00435 +:101B30008CE08E9DF0018F9DF00D1124E656FB4F39 +:101B400080810E947D11802F0E94E81D812F110F3E +:101B5000990BDF91CF911F910F91FF90EF90DF9044 +:101B6000CF900895EF92FF920F931F93CF938C0124 +:101B70007B010E94E81DC82F0330110570F42CE092 +:101B8000209FC001219F900D112486569B4FFC0180 +:101B9000228133812330310529F08C2F0E94E81DEA +:101BA0008FEF09C0A70163E070E00E94E10B8C2F6A +:101BB0000E94E81D81E0CF911F910F91FF90EF905F +:101BC0000895CF92DF92EF92FF920F931F93CF93DE +:101BD000DF938C01E62E0E94E81DF82E03301105DC +:101BE000E0F48CE0809FE001819FD00D1124C65667 +:101BF000DB4F8A819B81039781F4CE80DF808881CF +:101C00000E94DD128F3F49F08A819B81039729F45E +:101C10008E819F81C816D90629F08F2D0E94E81D5C +:101C20008FEF43C08091C0049091C104892B21F4AF +:101C300087E592E00E94A90BE091C004F091C104F5 +:101C4000828193819093C1048093C0041382128295 +:101C50006E2DEE0C770B718360838CE0809FD0013A +:101C6000819FB00D1124A656BB4F1A96CD91DC91E1 +:101C70001B97209729F41996FC93EE93189702C0AE +:101C8000FB83EA831B96FC93EE931A978CE0809F6C +:101C9000F001819FF00D1124E656FB4F81810E94D7 +:101CA0007D118F2D0E94E81D81E0DF91CF911F9162 +:101CB0000F91FF90EF90DF90CF9008951F93CF93F7 +:101CC000DF93C82F162F0E94E81DD82FC33020F0B5 +:101CD0000E94E81DCFEF11C02BE2C202C001112407 +:101CE00080539F4FDC019296ED91FC919397612F69 +:101CF0000995C82F8D2F0E94E81D8C2FDF91CF9161 +:101D00001F910895CF93DF939CEF960F9B3060F562 +:101D1000843050F5A82F082E000CBB0B97E28902E7 +:101D2000F0011124E754FC4F20813181232BE1F095 +:101D30006F5F94E0699FE0011124CE53DB4FEB818C +:101D4000AA0FBB1FAA0FBB1FAE53BB4F12966C93BB +:101D500012971396EC9394E0E902F0011124EE53EC +:101D6000FB4F82838B8301C08FEFDF91CF9108956A +:101D70009CEF980F9B30A8F494E08902F0011124A5 +:101D8000EE53FB4F9281943064F40E94C10694E0BC +:101D90008902F0011124EE53FB4F9FEF938392834E +:101DA00008958FEF0895EF92FF920F931F93CF93B3 +:101DB000DF93C82F8B017A010E94E81DD82FC33012 +:101DC00020F00E94E81DCFEF12C02BE2C202C0013A +:101DD000112480539F4FDC015A96ED91FC915B9743 +:101DE000A701B8010995C82F8D2F0E94E81D8C2FDF +:101DF000DF91CF911F910F91FF90EF900895843064 +:101E0000C0F497E28902F0011124E754FC4F2081CD +:101E10003181232B71F022E030E031832083428135 +:101E2000042E000C550B609102050E94E60881E02B +:101E300008958FEF0895E091B8038E2F0E2E000CB9 +:101E4000990B27E2E202F0011124E754FC4F248DA4 +:101E5000211104C023E030E03183208327E2289F52 +:101E6000F001299FF00D1124E754FC4F838D148E4F +:101E70000895CF930E94E81DE091B80397E2E9022C +:101E8000F0011124E754FC4F948D913019F4C38D67 +:101E9000148E01C0C1E00E94E81D8C2FCF910895DF +:101EA000DF92EF92FF920F931F93CF93DF9397FDF3 +:101EB00034C0EC010E94E81DD82E8091B803E82EB2 +:101EC000082E000CFF0897E28902800111240754B4 +:101ED0001C4FF801948D91110DC0AE016091B402B8 +:101EE0000E942809C82F8F3FA1F087E090E0F801F9 +:101EF0009183808387E28E9DF0018F9DF00D1124E8 +:101F0000E754FC4F848D882319F0C38D148E01C0D3 +:101F1000CDEF8D2D0E94E81D01C0CFEF8C2FDF91FA +:101F2000CF911F910F91FF90EF90DF9008958091D6 +:101F3000B803C82F082E000CDD0B37E28302F00136 +:101F40001124E754FC4F208131812130310561F4A7 +:101F500042816091020522E030E031832083042E2B +:101F6000000C550B0E94E608809102050E94B80EF5 +:101F70008093B80327E2382F3203F0011124E7548D +:101F8000FC4F81E090E0918380839093B602809330 +:101F9000B5022C9FF0012D9FF00D1124E754FC4F4A +:101FA000148213828130910519F0029789F01EC0C6 +:101FB00080910305909104059C012F5F3F4F309362 +:101FC000040520930305892B79F4109205050CC0B4 +:101FD0008091030590910405181619063CF40197A9 +:101FE000909304058093030581E008958FEF089591 +:101FF000CF93843080F497E28902F0011124E754F2 +:10200000FC4F208131812530310529F4C2810E94A5 +:10201000FF0E8C2F01C08FEFCF9108950F931F9368 +:10202000CF93DF93C82F8B010E94E81DD82FC330B8 +:1020300020F00E94E81DCFEF11C02BE2C202C001C8 +:10204000112480539F4FDC015E96ED91FC915F97C8 +:10205000B8010995C82F8D2F0E94E81D8C2FDF91A4 +:10206000CF911F910F910895CF93C82F0E94E81D23 +:10207000C43048F494E0C902F0011124E95AFB4F3E +:102080009081911104C00E94E81D8FEF04C0C181AE +:102090000E94E81D8C2FCF9108950F931F93CF932B +:1020A0008C010E94E81D17FF04C00E94E81DCFEFBD +:1020B00025C0C091990224E030E091E09C0F94305B +:1020C0000CF090E044E0C402F0011124E95AFB4F07 +:1020D000408141110BC09093990291E09083CF3FD2 +:1020E00021F3128301830E94E81D08C021503109A9 +:1020F00011F0C92FE2CF90939902D7CF8C2FCF91B7 +:102100001F910F910895FF920F931F93CF93DF9329 +:10211000C82F0E94E81DF82EC43048F484E0C8029D +:10212000E0011124C95ADB4F8881811105C08F2D30 +:102130000E94E81D8FEF20C0FE0111928F0181E007 +:1021400090E00E94D20F2396F801808191819C013A +:102150002F5F3F4F3183208397FF06C088810E9405 +:10216000C1060E94FF0EF0CF82E090E00E94D20FE5 +:102170008F2D0E94E81D81E0DF91CF911F910F917B +:10218000FF900895EF92FF920F931F93CF93DF93E9 +:10219000C82F7B010E94E81D182FF7FC0CC0C4302B +:1021A00050F484E0C802E0011124FE01E95AFB4F1B +:1021B0008081811105C0812F0E94E81D8FEF19C019 +:1021C000038181E090E00E94D20F802F0E94C1061F +:1021D0008F3F19F00E94FF0EF8CFC95ADB4FFA82E9 +:1021E000E98282E090E00E94D20F812F0E94E81DD8 +:1021F00081E0DF91CF911F910F91FF90EF900895B3 +:102200001F93CF93DF93C82F162F0E94E81DD82F5E +:10221000C43068F487E2C802F0011124E754FC4F8F +:1022200080819181009719F0248D222329F08D2F30 +:102230000E94E81D8FEF12C0138F21E0248F83309E +:10224000910529F0079731F48C2F0E9496128C2F5C +:102250000E94FF0E8D2F0E94E81D81E0DF91CF913B +:102260001F9108950E94A2011092C50087E68093F5 +:10227000C40086E08093C20088E18093C100809111 +:10228000C00085FFFCCF82E58093C6000895909141 +:10229000C00095FFFCCF8093C60008958091C000D8 +:1022A00087FFFCCF8091C6000895CF93DF93EC01A8 +:1022B0008991882319F00E944711FACFDF91CF91BD +:1022C0000895CF93DF930E944E11C6E0D5E09E01A2 +:1022D000265035408D3041F08A3031F0882321F08E +:1022E00089930E944E11F3CFF901EA5FFA4F1082F1 +:1022F00086E095E0DF91CF910895CF93DF93C82FCB +:102300000E94E81DD82FC43048F484E0C802F001D0 +:102310001124E95AFB4F8081811105C08D2F0E9445 +:10232000E81D8FEF12C0818192819C012F5F3F4F8A +:102330003283218397FF05C083810E94B80E0E94DB +:10234000FF0E8D2F0E94E81D81E0DF91CF9108954F +:10235000CF92DF92FF920F931F93CF93DF93C82FFB +:102360008B010E94E81DF82EC43058F417FD09C0F7 +:1023700084E0C802E0011124C95ADB4F8881811131 +:1023800005C08F2D0E94E81D8FEF26C081E090E0F0 +:102390000E94D20F6E01EFEFCE1ADE0A23960115CE +:1023A000110591F0F601808191819C012F5F3F4FD3 +:1023B0003183208397FF05C088810E94B80E0E9458 +:1023C000FF0E01501109EBCF82E090E00E94D20F86 +:1023D0008F2D0E94E81D81E0DF91CF911F910F9119 +:1023E000FF90DF90CF9008951F93CF93DF9397FDD9 +:1023F00028C0EC01892B19F40E946C1320C00E94A4 +:10240000E81D182FAE016091B4028091B8030E94BC +:102410002809C82F8F3F21F4812F0E94E81D12C088 +:10242000E091B80387E2E802F0011124E754FC4F81 +:1024300084E090E091838083812F0E94E81DC1E0B9 +:1024400001C0CFEF8C2FDF91CF911F91089597FDA1 +:102450000EC028EE33E0AC01429FC001439F900DB7 +:10246000529F900D11240E94F41181E008958FEF86 +:102470000895EF92FF920F931F93CF93DF93182F3E +:102480000E94E81D082F1430B0F4E12E012E000C3C +:10249000FF0887E21802E0011124C754DC4F88814D +:1024A0009981009741F0112331F09C0121503109AD +:1024B0002230310528F0802F0E94E81D8FEF16C0D2 +:1024C000029719F4812F0E94A60685E090E0998377 +:1024D000888387E28E9DF0018F9DF00D1124E754D3 +:1024E000FC4FC281802F0E94E81D8C2FDF91CF917D +:1024F0001F910F91FF90EF900895809100009091AF +:1025000001009927009789F0029739F4E0E0F0E0A4 +:10251000648182810E945E0E08C082E492E09F93F3 +:102520008F930E94510A0F900F900895CF93DF93DD +:10253000C82F0E94E81DD82FC43098F4AC2F0C2E61 +:10254000000CBB0B87E2C802F0011124E754FC4FDA +:1025500080819181009729F08430910539F00797A7 +:1025600029F08D2F0E94E81D8FEF20C0AA0FBB1FFE +:10257000AA0FBB1FAE53BB4F1296EC911297E430DB +:1025800074F484E0E802F0011124EE53FB4F208143 +:1025900031818D919C91820F931F918380838C2F29 +:1025A0000E94A6068D2F0E94E81D81E0DF91CF9149 +:1025B00008950E942F070C94A109CF93DF93D82F81 +:1025C0000E94E81DC82FD43048F484E0D802F001FE +:1025D0001124E95AFB4F8081811105C08C2F0E9484 +:1025E000E81D8FEF1DC081819281019792838183C5 +:1025F00097FF12C08091B80397E28902D00111249D +:10260000A754BC4F26E030E011963C932E93599688 +:10261000DC9363810E94820E8C2F0E94E81D81E072 +:10262000DF91CF91089581E090E00E94D20F8091D8 +:10263000B40294E08902F0011124EE53FB4FE281D1 +:10264000E43084F494E0E902F0011124EE53FB4FEE +:1026500020813181121613062CF00E94B80E0E94C0 +:10266000FF0EE5CF82E090E00C94D20FEF92FF9244 +:102670000F931F93CF93DF93C82F8B017A010E9492 +:10268000E81DD82FC33020F00E94E81DCFEF12C004 +:102690002BE2C202C001112480539F4FDC015C96E3 +:1026A000ED91FC915D97A701B8010995C82F8D2F79 +:1026B0000E94E81D8C2FDF91CF911F910F91FF9009 +:1026C000EF90089580E392E09F938F930E94510AC8 +:1026D0000F900F900C94E81D0E94E81D0E94E81DC9 +:1026E00081E008958F929F92AF92BF92CF92DF9236 +:1026F000EF92FF920F931F93CF93DF93CDB7DEB787 +:102700002B970FB6F894DEBF0FBECDBF6B017C01D7 +:102710008A0119822AE030E040E050E00E943A1E2F +:10272000F7FE04C080E3861B682F01C0605D6A83EA +:10273000F7FC05C02AE030E040E050E004C026EF9E +:102740003FEF4FEF5FEFC701B6010E943A1E6E01E7 +:1027500083E0C80ED11C7E01ECE0EE0EF11C8AE095 +:10276000882E912CA12CB12CB901CA01A50194018C +:102770000E943A1E605DF60161936F01EE15FF0540 +:1027800099F78AE090E0F70122917F01203311F45C +:102790000197F9CF009711F481E090E001969E0136 +:1027A0002F5F3F4FF901E80FF91FD80182918D93F8 +:1027B0002E173F07D9F72B960FB6F894DEBF0FBE42 +:1027C000CDBFDF91CF911F910F91FF90EF90DF90E0 +:1027D000CF90BF90AF909F908F900895CF93DF934D +:1027E000CDB7DEB72C970FB6F894DEBF0FBECDBFC6 +:1027F0001982DE011296FE013D96262F2770205D7C +:102800002D9323E095958795779567952A95D1F730 +:10281000AE17BF0791F78C8583738C878BE090E0B0 +:102820002291203311F40197FBCF009711F481E03E +:1028300090E001969E012F5F3F4FF901E80FF91FCD +:10284000DA0182918D93E217F307D9F72C960FB630 +:10285000F894DEBF0FBECDBFDF91CF910895EF9208 +:10286000FF920F931F93CF93DF93CDB7DEB72997D6 +:102870000FB6F894DEBF0FBECDBF1982DE011296EF +:102880007E012AE0E20EF11C8B019C010F701127E2 +:1028900022273327015A1D4FF80120812D9324E070 +:1028A00095958795779567952A95D1F7AE15BF05CC +:1028B00059F788E090E0F70122917F01203311F46D +:1028C0000197F9CF009711F481E090E001969E0105 +:1028D0002F5F3F4FF901E80FF91FDA0182918D93C5 +:1028E0002E173F07D9F729960FB6F894DEBF0FBE13 +:1028F000CDBFDF91CF911F910F91FF90EF90089581 +:10290000EF92FF920F931F93CF93DF93CDB7DEB774 +:1029100029970FB6F894DEBF0FBECDBF1982DE0136 +:1029200012967E012AE0E20EF11C8B019C010F70D1 +:1029300011272227332700591D4FF80120812D939D +:1029400024E095958795779567952A95D1F7AE15EB +:10295000BF0559F788E090E0F70122917F0120330D +:1029600011F40197F9CF009711F481E090E00196FE +:102970009E012F5F3F4FF901E80FF91FDA018291A5 +:102980008D932E173F07D9F729960FB6F894DEBF1F +:102990000FBECDBFDF91CF911F910F91FF90EF90B0 +:1029A0000895CF93DF93CDB7DEB7A3970FB6F89412 +:1029B000DEBF0FBECDBF1982DE011296FE01B296B8 +:1029C00060FF02C021E301C020E32D939595879518 +:1029D00077956795AE17BF0799F780E290E022914F +:1029E000203311F40197FBCF009711F481E090E0C0 +:1029F00001969E012F5F3F4FF901E80FF91FDA01A1 +:102A000082918D932E173F07D9F7A3960FB6F894AE +:102A1000DEBF0FBECDBFDF91CF9108952F923F92C1 +:102A20004F925F926F927F928F929F92AF92BF92DE +:102A3000CF92DF92EF92FF920F931F93CF93DF938A +:102A4000CDB7DEB769970FB6F894DEBF0FBECDBF26 +:102A50006C018B011A017601FFEFEF1AFF0AD60114 +:102A60008C91082E000C990B8532910539F0009756 +:102A700009F4F9C1F10109956701EDCF1196BC91F7 +:102A8000BD8BB53241F4E2E0CE0ED11C85E290E080 +:102A9000F1010995E0CFFD89FD3221F4760132E0A4 +:102AA000E30EF11CD7014C90B0E34B1204C0EFEFE2 +:102AB000EE1AFE0A02C060E2462ED7018C918A32DD +:102AC00019F0612C712C08C0F80160807180F70149 +:102AD00031960E5F1F4F15C0FD012D9180ED820FC5 +:102AE0008A3078F4FAE0F69DC001F79D900D11242C +:102AF0003C01620E711C27FD7A9430E3631A710861 +:102B0000EBCF80818E3221F581818A3229F0DF017D +:102B10001196A12CB12C07C0D801AD90BC90329673 +:102B20000E5F1F4F17C0FD012D9180ED820F8A307F +:102B300088F4EAE0EA9DC001EB9D900D11245C0150 +:102B4000A20EB11C27FDBA94F0E3AF1AB108EBCF87 +:102B5000A12CB12C6F013FEFC31AD30A9081292F0A +:102B6000092E000C330B2115310529F485E290E084 +:102B7000F101099578C1963609F4EFC0FCF492365C +:102B800009F4CDC0ACF4983409F493C0983509F039 +:102B9000DCC07801F4E0EF0EF11CD8016D917D915D +:102BA0008D919C91AE014F5F5F4F0E948014C5C014 +:102BB000933689F1943609F44CC0C7C09337B9F104 +:102BC000ACF4983609F48EC09F3609F0BEC0780187 +:102BD000F4E0EF0EF11CD8016D917D918D919C91E7 +:102BE000AE014F5F5F4F0E94EE13A7C0953709F407 +:102BF00046C0983709F0A9C07801F4E0EF0EF11C47 +:102C0000D8016D917D918D919C91AE014F5F5F4F89 +:102C10000E942F1492C0D8018C9189831A820E5F72 +:102C20001F4F512CA12CB12C50E2452E8AC0C80157 +:102C30000296D801ED90FC908C01512C40E2442E7C +:102C4000E114F10409F08DC031E8E32E32E0F32EF7 +:102C500088C07801B4E0EB0EF11CF801608171814D +:102C60008281938197FF03C02DE2522E01C0512C27 +:102C7000AE014F5F5F4F0E94721387016AC07801F7 +:102C800094E0E90EF11CD8016D917D918D919C919C +:102C900010E097FF05C07A5C8A499B431F5FF9CF1C +:102CA000AE014F5F5F4F0E9472138981180F198325 +:102CB00044C0D8016D917D918D919C91AE014F5F83 +:102CC0005F4F0E9480147801B8E0EB0EF11CF80110 +:102CD0006481758186819781AE01475F5F4F0E9455 +:102CE000801418C0D8016D917D918D919C91AE0199 +:102CF0004F5F5F4F0E942F147801B8E0EB0EF11C7C +:102D0000F8016481758186819781AE01475F5F4FCD +:102D10000E942F148701512CA12CB12C1AC07801CC +:102D200094E0E90EF11CD8016D917D918D919C91FB +:102D3000AE014F5F5F4F0E94D1148701512CA12C2F +:102D4000B12CFE0131967F010CC0C901F10109953A +:102D5000512CCE0101967C0104C0512CDE0111964C +:102D60007D01FF8AEE8AF7014F018E189F0881913D +:102D70008111FACFB1E56B16710410F0612C712C42 +:102D8000C50101978035910520F06114710441F46B +:102D900013C0A814B9040CF445016114710419F0AE +:102DA0006818790802C0612C712CEDE25E1256C0E1 +:102DB000F1E06F1A710805C03DE2612C712C5312CD +:102DC0004DC080E3481204C08DE290E0F101099506 +:102DD000FD89FD32B1F0A12CB12C842D042C000C06 +:102DE000990B998F888FA614B70444F4888D998D18 +:102DF000F1010995FFEFAF1ABF0AF5CF3DE253127B +:102E000007C080E2481204C08DE290E0F10109950C +:102E1000E80CF91C8E899F89E816F90659F0AE89ED +:102E2000BF898D91BF8BAE8B082E000C990BF101E1 +:102E30000995F0CF9D899D3209F00DCEE12CF12C42 +:102E4000042C000C5508E614F7040CF004CEC20163 +:102E5000F1010995FFEFEF1AFF0AF5CF3D893D32E9 +:102E600009F0B9CFD5CF69960FB6F894DEBF0FBE83 +:102E7000CDBFDF91CF911F910F91FF90EF90DF9029 +:102E8000CF90BF90AF909F908F907F906F905F900A +:102E90004F903F902F9008952F923F924F925F92C4 +:102EA0006F927F928F929F92AF92BF92CF92DF925A +:102EB000EF92FF920F931F93CF93DF93CDB7DEB7BF +:102EC000C155D1090FB6F894DEBF0FBECDBFFC01CE +:102ED00062967FAF6EAF62972B965FAF4EAF2B9728 +:102EE00060963FAF2EAF6097680129961FAE1EAE69 +:102EF0002997AE014F5F5F4F23965FAF4EAF239789 +:102F0000CE01029625969FAF8EAF25971F019FEFAA +:102F1000291A390A00810B303CF409300CF03AC20E +:102F2000002309F462C24BC2003209F433C20532F5 +:102F300009F045C21F01A2E02A0E311C0181002EBA +:102F4000000C110B0532110509F43CC20A321105BF +:102F500081F06296EEADFFAD62972796FFAFEEAFC0 +:102F60002797AF014E5F5F4F62965FAF4EAF62979C +:102F70000CC01F0153E0250E311C0281002E000CF5 +:102F8000110B27961FAE1EAE2797F101412C512C35 +:102F90001F01D801AE5ABE4F8C9182FF13C0AAE028 +:102FA000A49DC001A59D900D1124080F191F280193 +:102FB000B0E34B1A51083196D1010C91002E000C50 +:102FC000110BE6CF4114510421F460E3462E65E76E +:102FD000562E0C36110561F40081002E000C110BE9 +:102FE000AF014F5F5F4F1A0152E0652E712C4DC04B +:102FF0000836110551F40081002E000C110BCF0191 +:1030000001961C01612C712C40C00B351105D1F5C6 +:1030100080818E3539F41F019FEF291A390A41E06A +:1030200050E002C040E050E0E7E1F1E0808141156E +:10303000510511F08D7F01C0826080833196A1E03F +:10304000E739FA0799F7B1016F5F7F4FF1012081EE +:10305000822F022E000C990B2F772D3591F09C01B9 +:103060002F5F3F4FFC01E95EFE4F80814115510506 +:1030700011F0826001C08D7F8083232B19F01B012A +:10308000E2CF1B0166246394712CF801EE5AFE4FC7 +:10309000808180FF05C0005E1F4F32E0632E712CDF +:1030A0000115110509F46DC10336110509F4A4C118 +:1030B0000337110509F405C20B35110509F410C1D8 +:1030C0000F36110541F00837110551F0BAE02E9680 +:1030D000BFAF2E9709C0E8E02E96EFAF2E9704C041 +:1030E000F0E12E96FFAF2E97B701C6012B96EEADFD +:1030F000FFAD2B970995E82F8032B1F387EF8E0F44 +:10310000823090F3820101501109ED3299F4E98384 +:10311000B701C6012B96EEADFFAD2B970995E82FB1 +:10312000280101E010E024969FAD249725968FADED +:10313000259713C0EB3249F42801B701C6012B963D +:10314000EEADFFAD2B970995E82F00E010E0229639 +:103150009FAD229723968FAD23972C969FAF2C97E8 +:103160002D968FAF2D97812C912C5401F1E04F1AA1 +:10317000510857FC68C0AE2F0E2E000CBB0BAE5A88 +:10318000BE4F8C9182FD06C02E96FFAD2E97F0317A +:1031900009F059C08E2F8F7D8154863008F053C0BE +:1031A0002E962FAD2E97283051F4B501A401B3E02F +:1031B000440F551F661F771FBA95D1F71BC02E9677 +:1031C0004FAD2E974A3069F4A5E0B0E0A501940117 +:1031D0000E94591EAB01BC01440F551F661F771F8B +:1031E00009C0B501A401F4E0440F551F661F771F05 +:1031F000FA95D1F780ED8E0F8A3040F08FE98E0F6F +:10320000863010F489EA01C089EC8E0F082E000C7C +:10321000990BAA0BBB0B4C015D01840E951EA61EDB +:10322000B71E2D96AEADBFAD2D97ED932D96BFAFCA +:10323000AEAF2D97B701C6012B96EEADFFAD2B9724 +:103240000995E82F93CF012B41F0B094A09490946E +:103250008094811C911CA11CB11CEE3F51F0B70160 +:10326000C6016096EEADFFAD6097099520E030E0B5 +:1032700002C021E030E027964EAD5FAD27974115A3 +:10328000510509F460C023968EAD9FAD23972D960E +:10329000AEADBFAD2D978A179B0709F454C01C92A1 +:1032A000B1E06B16710431F0E2E06E16710459F072 +:1032B000DA0104C02796AEADBFAD2797ED91FC9122 +:1032C000918280820AC02796AEADBFAD2797ED915F +:1032D000FC9180829182A282B38281E090E035C02D +:1032E00027964EAD5FAD2797452B09F4E7C027968B +:1032F000AEADBFAD27976D907C900336110509F4F4 +:1033000084C00337110509F48FC0B701C6012B969D +:10331000EEADFFAD2B9709950336110509F492C068 +:103320000B35110509F0D7C022E0822E912C5301F4 +:103330008E3FFFEF9F0709F088C021E030E0A11425 +:10334000B10409F0A3C080E090E0892B81F02796BA +:10335000EEADFFAD2797EF2B51F029964EAD5FAD47 +:1033600029974F5F5F4F29965FAF4EAF2997232B69 +:1033700011F4F101CBCD29968EAD9FAD2997892B04 +:10338000A1F58FEF9FEFABC09C012950310922308E +:10339000310558F4B701C6012B96EEADFFAD2B9762 +:1033A00009958032910581F7F5CF029611F3B701A7 +:1033B000C6016096EEADFFAD60970995DACF002E9D +:1033C000000C110BB701C6012B96EEADFFAD2B978C +:1033D00009950817190769F2029699F2B701C60113 +:1033E0006096EEADFFAD6097099528968FAD289752 +:1033F00029969FAD299773C02796AEADBFAD27978D +:10340000AB2B09F074CF612C712CB0E34B16B5E7F0 +:103410005B0609F07ACF44244394512C76CF8E3F3B +:10342000EFEF9E0709F457C0B701C6012B96EEAD2A +:10343000FFAD2B970995FC01E95EFE4F208120FD31 +:10344000EECF49C0812C912C72CFFC01E95EFE4F7A +:103450002081022E000C330B28213921232B09F562 +:10346000A114B10429F0D5018C93F50131965F01C7 +:10347000F1E04F1A510814141504ECF4B701C60119 +:103480002B96EEADFFAD2B97099552CF6A147B04B6 +:1034900009F459CF0336110509F41FCFD5011C9249 +:1034A0001CCF141415043CF4B701C6016096EEADB0 +:1034B000FFAD6097099520E030E041CF612C712C81 +:1034C00024CF27968EAD9FAD2797892B09F00FCF7C +:1034D000612C712CA9CF88248394912C28CFCF5AAA +:1034E000DF4F0FB6F894DEBF0FBECDBFDF91CF9197 +:1034F0001F910F91FF90EF90DF90CF90BF90AF9012 +:103500009F908F907F906F905F904F903F902F9003 +:10351000089520E030E040E050E060E070E081E0BD +:1035200090E00E94891A0895462F660F550B20E0FF +:1035300030E0BC0182E090E00E94891A089520E00A +:1035400030E0261737074CF4FC014191CF012F5F83 +:103550003F4F4111F6CFC90108958FEF9FEF0895B6 +:10356000CF92DF92EF92FF920F931F93CF93DF934F +:103570006C017B01D42F0E94E81DC82F68E070E029 +:10358000C6010E949F1A8C0168E070E0C7010E948A +:103590009F1A0F3F2FEF1207C9F08F3F2FEF9207AF +:1035A000A9F0D33098F420916A0530916B0523304F +:1035B000310564F4F60141E1429FB001439F700D73 +:1035C000112464597A4F40E050E005C08C2F0E94CE +:1035D000E81D8FEF2DC04017510744F4D190DB0157 +:1035E000A40FB51FDC924F5F5F4FF5CFF70140E0AE +:1035F00050E0481759074CF41191DB01A40FB51F97 +:1036000018961C934F5F5F4FF4CF81E1829FF001CA +:10361000839FF00D1124E459FA4FD08B2F5F3F4F59 +:1036200030936B0520936A058C2F0E94E81D81E082 +:10363000DF91CF911F910F91FF90EF90DF90CF908E +:1036400008959F92AF92BF92CF92DF92EF92FF9236 +:103650000F931F93CF93DF93CDB7DEB72E970FB69F +:10366000F894DEBF0FBECDBF86E0E2E9F2E0DE01F6 +:10367000199601900D928A95E1F710926B051092C0 +:103680006A0504ED10E083E0982ECE0101967C01DE +:103690009CE0C92E92E0D92E27EEA22E21E0B22E78 +:1036A000CE010996F7019F012E193F09DC014D91CA +:1036B000CD01DF014D93442311F0FD01F4CFD8017A +:1036C0002F5F3F4F2830310554F48D919FEB980FB9 +:1036D0009A3108F4805E81938111F2CF08C02830BE +:1036E000310529F01F930F93BF92AF920EC0F801DE +:1036F000349740816FED71E0C7010E94B01A8F3F8F +:1037000051F41F930F93DF92CF920E94510A0F90B2 +:103710000F900F900F909A94055D1F4F9110C0CF9E +:1037200041E06FED71E088E892E00E94B01A4FEF3F +:103730006FED71E082E992E00E94B01A81E02E966E +:103740000FB6F894DEBF0FBECDBFDF91CF911F91B2 +:103750000F91FF90EF90DF90CF90BF90AF909F9030 +:1037600008959F92AF92BF92CF92DF92EF92FF9215 +:103770000F931F93CF93DF93A0916A05B0916B05D0 +:103780002CE635E0E12CF12CEA16FB06A4F48C01C2 +:10379000F9015801A81AB90AE8014191442369F0D6 +:1037A0000F5F1F4F58814517A1F34FEFE41AF40A3A +:1037B0002F5E3F4FE9CF8FEF3BC06B0168E070E0B9 +:1037C0000E949F1A982E81E18E9DE0018F9DD00D61 +:1037D0001124CC58DA4F68E070E0CE010E949F1AA5 +:1037E000292D990C330B2A193B09AC014150510981 +:1037F000420F531F49305105F4F6F6010197181690 +:1038000019061CF449914193F9CF121613063CF4A2 +:10381000D8018D918D01819321503109F6CF81E13D +:103820008E9DF0018F9DF00D1124E459FA4F80898F +:10383000DF91CF911F910F91FF90EF90DF90CF908C +:10384000BF90AF909F900895FB01DC019D01281B64 +:10385000390B2417350734F421912D932111F6CF1C +:1038600081E008958FEF0895DF92EF92FF920F931A +:103870001F93CF93DF93CDB7DEB728970FB6F89499 +:10388000DEBF0FBECDBF7B01D42E48E050E0BC01AF +:10389000CE0101960E94241C8F3FD1F000E010E081 +:1038A00010C0B701CE0101960E94B11B8D1111C04D +:1038B00048E050E0B701CE0101960E94241C0F5F42 +:1038C0001F4F80916A0590916B05081719074CF3FB +:1038D0008FEF28960FB6F894DEBF0FBECDBFDF91F5 +:1038E000CF911F910F91FF90EF90DF9008950F936C +:1038F0001F93CF93DF93CDB7DEB728970FB6F89419 +:10390000DEBF0FBECDBFFC01CB018A014081BE01ED +:103910006F5F7F4F0E94341C8F3F39F0A801BE01BA +:103920006F5F7F4F0E947D0B01C08FEF28960FB60F +:10393000F894DEBF0FBECDBFDF91CF911F910F91E5 +:1039400008954F925F926F927F928F929F92AF9263 +:10395000BF92CF92DF92EF92FF920F931F93CF937C +:10396000DF93C82F6B01542E452E590147010E9449 +:10397000E81DF82E1C141D040CF052C0B7FC50C0FA +:103980006C2E0C2E000C770887E2C802F00111247F +:10399000E754FC4F87819085C581D681C81BD90B20 +:1039A0002596CC7FC6010196880F991FE52DF42D31 +:1039B000DE0140E050E021913191280F391F2C0F9A +:1039C0003D1F2D933D934F5F5F4FC416D50699F76A +:1039D00002978C0F9D1FFC0111921192CF01A5013E +:1039E000B8010E94B31E87E2869DF001879DF00D0D +:1039F0001124E754FC4F2581368183819481FC0199 +:103A00008217930768F402964081518184169506C7 +:103A1000B1F7D183C0838F2D0E94E81D81E004C0DF +:103A20008F2D0E94E81D8FEFDF91CF911F910F9195 +:103A3000FF90EF90DF90CF90BF90AF909F908F90CE +:103A40007F906F905F904F9008952F923F924F928A +:103A50005F926F927F928F929F92AF92BF92CF921E +:103A6000DF92EF92FF920F931F93CF93DF93290181 +:103A7000E7017801A0E0B0E060E070E066246394C4 +:103A8000712C32E0832E912CE3E0AE2EB12CFC01A0 +:103A90002081211105C0F20171836083CD0183C0B3 +:103AA0002A30C9F3A032B105C9F413C0B982A88283 +:103AB0002732E1F56F018F01041B150B0196BC0144 +:103AC00061507109FB016081261709F462C06A30F8 +:103AD00081F58FEF9FEF67C0293039F48C01FC012D +:103AE0002191CF012032C1F7F9CF2A30A1F2222350 +:103AF00091F2F701619371937F01FA01E60FF71FCD +:103B00002C3339F02E3341F0263281F61982188297 +:103B100005C07982688202C0998288822083FB0175 +:103B20003196E40FF51F6E5F7F4F39C0223231F4BA +:103B3000C1CF662371F2F6016193BCCF20831C01D3 +:103B40006B01FFEFCF1ADF0AC40ED51E9B01201BAD +:103B5000310B8901020D131DC101F10161911F019A +:103B60006A30B9F06623A9F0762F7D7F7C3309F4A3 +:103B7000B0CF603271F0693061F0663251F0673277 +:103B800009F4A7CF623209F4A4CFF60161936F0163 +:103B9000E0CFB8016F5F7F4FFA01E00FF11F108295 +:103BA0002296119674CFDF91CF911F910F91FF90C4 +:103BB000EF90DF90CF90BF90AF909F908F907F90CD +:103BC0006F905F904F903F902F90089581E00895FF +:103BD0000E94E1070E94390F1F921F921F9281E0FD +:103BE0008F9380E192E09F938F9382E38F9380E1A4 +:103BF0008F931F9286EE9DE19F938F930E94B00258 +:103C00000E94F80F8DB79EB70B960FB6F8949EBF23 +:103C10000FBE8DBF8CE7E82E82E0F82EBB24B39454 +:103C200000E112E094E1C92E20E1D22EC6EEDDE1E2 +:103C30000E941B0F88EC90E00E94F411FF92EF921B +:103C40000E94510A1F921F921F92BF921F930F93BF +:103C5000CF92DF921F92DF93CF930E94B0020E9417 +:103C6000F80F8DB79EB70D960FB6F8949EBF0FBE96 +:103C70008DBFDECF052E97FB1EF400940E94511ECF +:103C800057FD07D00E94641E07FC03D04EF40C942D +:103C9000511E50954095309521953F4F4F4F5F4FA6 +:103CA000089590958095709561957F4F8F4F9F4FA8 +:103CB00008950E94861EA59F900DB49F900DA49F0D +:103CC000800D911D11240895A1E21A2EAA1BBB1B81 +:103CD000FD010DC0AA1FBB1FEE1FFF1FA217B307D8 +:103CE000E407F50720F0A21BB30BE40BF50B661FEE +:103CF000771F881F991F1A9469F7609570958095B2 +:103D000090959B01AC01BD01CF010895A29FB00128 +:103D1000B39FC001A39F700D811D1124911DB29FFF +:103D2000700D811D1124911D0895FC01882799278C +:103D3000E89421912032E9F3293010F02E30C8F3B5 +:103D40002B3241F02D3239F4689404C00E94E01EF9 +:103D5000820F911D219120532A30C0F31EF49095BB +:103D600081959F4F0895FB01DC0102C001900D92E7 +:103D700041505040D8F70895DC0101C06D93415087 +:103D80005040E0F70895FB01DC014150504030F015 +:103D90008D910190801919F40020B9F7881B990BB7 +:103DA0000895FB01DC014150504048F001900D9214 +:103DB0000020C9F701C01D9241505040E0F708951E +:103DC0007AE0979F902D879F802D910D1124089563 +:103DD000A0E0B0E0EEEEFEE10C949B21AE01475F67 +:103DE0005F4F6F8178858D819E810E94FA1EE2E08F +:103DF0000C94B721ABE0B0E0E0E0FFE10C948B2144 +:103E00006C017B018A01FC0117821682838181FF8C +:103E1000CCC1CE0101963C01F6019381F70193FDDF +:103E2000859193FF81917F01882309F4BAC185327E +:103E300039F493FD859193FF81917F01853229F4B7 +:103E4000B60190E00E94F120E7CF912C212C312C7B +:103E5000FFE1F315D8F08B3279F038F4803279F045 +:103E60008332A1F4232D20611DC08D3261F0803397 +:103E700069F4232D216016C0832D8260382EE32D36 +:103E8000E4603E2E2AC0F32DF8601DC037FC2DC023 +:103E900020ED280F2A3040F08E32B9F436FC81C173 +:103EA000232D2064322E19C036FE06C08AE0989E6B +:103EB000200D1124922E11C0EAE02E9E200D112417 +:103EC000222EF32DF0623F2E08C08C3621F4832D74 +:103ED0008068382E02C0883641F4F70193FD859141 +:103EE00093FF81917F018111B3CF982F9F7D9554CE +:103EF000933028F40C5F1F4F9FE399830DC08336E6 +:103F000031F0833771F0833509F059C021C0F801D1 +:103F1000808189830E5F1F4F88248394912C5301E5 +:103F200013C02801F2E04F0E511CF801A080B180AF +:103F300036FE03C0692D70E002C06FEF7FEFC50150 +:103F40000E94E6204C018201F32DFF773F2E16C020 +:103F5000280122E0420E511CF801A080B18036FEFB +:103F600003C0692D70E002C06FEF7FEFC5010E94B2 +:103F7000DB204C01F32DF0683F2E820133FC1BC087 +:103F8000822D90E088169906B0F4B60180E290E0A8 +:103F90000E94F1202A94F4CFF50137FC859137FE79 +:103FA00081915F01B60190E00E94F12021102A94D6 +:103FB00021E0821A91088114910471F7E8C08436D7 +:103FC00011F0893641F5F80137FE07C06081718133 +:103FD000828193810C5F1F4F08C060817181072E21 +:103FE000000C880B990B0E5F1F4FF32DFF763F2EB1 +:103FF00097FF09C090958095709561957F4F8F4F81 +:104000009F4FF0683F2E2AE030E0A3010E942D214F +:10401000882E861845C0853731F4232D2F7EB22E89 +:104020002AE030E025C0932D997FB92E8F36C1F05C +:1040300018F4883579F0B5C0803719F0883721F049 +:10404000B0C0E92FE061BE2EB4FE0DC0FB2DF460C0 +:10405000BF2E09C034FE0AC0292F2660B22E06C02A +:1040600028E030E005C020E130E002C020E132E08D +:10407000F801B7FE07C060817181828193810C5F76 +:104080001F4F06C06081718180E090E00E5F1F4F7E +:10409000A3010E942D21882E8618FB2DFF773F2E2D +:1040A00036FE0DC0232D2E7FA22E891458F434FE27 +:1040B0000BC032FC09C0832D8E7EA82E05C0B82C03 +:1040C000A32C03C0B82C01C0B92CA4FE0FC0FE0164 +:1040D000E80DF11D8081803321F49A2D997EA92E5F +:1040E00009C0A2FE06C0B394B39404C08A2D86789A +:1040F00009F0B394A3FC11C0A0FE06C0B21488F46A +:10410000280C922C9B180EC0B21460F4B60180E209 +:1041100090E00E94F120B394F7CFB21418F42B185A +:1041200002C0982C212CA4FE10C0B60180E390E0C0 +:104130000E94F120A2FE17C0A1FC03C088E790E016 +:1041400002C088E590E0B6010CC08A2D867859F04F +:10415000A1FE02C08BE201C080E2A7FC8DE2B601A5 +:1041600090E00E94F120891438F4B60180E390E0D9 +:104170000E94F1209A94F7CF8A94F301E80DF11D83 +:104180008081B60190E00E94F1208110F5CF2220BD +:1041900009F442CEB60180E290E00E94F1202A9418 +:1041A000F6CFF6018681978102C08FEF9FEF2B96A5 +:1041B000E2E10C94A721FC010590615070400110D0 +:1041C000D8F7809590958E0F9F1F0895FC01615040 +:1041D000704001900110D8F7809590958E0F9F1F29 +:1041E00008950F931F93CF93DF93FB01238121FD4C +:1041F00003C08FEF9FEF2CC022FF16C0468157816E +:10420000248135814217530744F4A081B1819D0177 +:104210002F5F3F4F318320838C93268137812F5F1F +:104220003F4F3783268314C08B01EC01FB010084D0 +:10423000F185E02D0995892BE1F6D80116968D912F +:104240009C911797019617969C938E931697CE0183 +:10425000DF91CF911F910F910895FA01AA2728307D +:1042600051F1203181F1E8946F936E7F6E5F7F4F43 +:104270008F4F9F4FAF4FB1E03ED0B4E03CD0670FBF +:10428000781F891F9A1FA11D680F791F8A1F911D12 +:10429000A11D6A0F711D811D911DA11D20D009F462 +:1042A00068943F912AE0269F11243019305D3193A4 +:1042B000DEF6CF010895462F4770405D4193B3E08D +:1042C0000FD0C9F7F6CF462F4F70405D4A3318F034 +:1042D000495D31FD4052419302D0A9F7EACFB4E0E5 +:1042E000A6959795879577956795BA95C9F700979D +:1042F0006105710508959B01AC010A2E069457953E +:10430000479537952795BA95C9F7620F731F841F94 +:10431000951FA01D08952F923F924F925F926F922A +:104320007F928F929F92AF92BF92CF92DF92EF9245 +:10433000FF920F931F93CF93DF93CDB7DEB7CA1BC6 +:10434000DB0B0FB6F894DEBF0FBECDBF09942A88F1 +:10435000398848885F846E847D848C849B84AA8499 +:10436000B984C884DF80EE80FD800C811B81AA8126 +:10437000B981CE0FD11D0FB6F894DEBF0FBECDBFF1 +:04438000ED010895AE +:1043840058696E7520415652206C6F6164696E677E +:104394002E2E2E0A0004520000000000000000002F +:1043A4000101000000000000000000000000000007 +:1043B40000000000000000010000000000000000F8 +:1043C40000000000000000000000000000000000E9 +:1043D40000000000000000000000000000000000D9 +:1043E40000000000000000000000000000000000C9 +:1043F40000000000000000000000000000000000B9 +:1044040000000000000000000000000000000000A8 +:10441400000000000000004D61696E00253038780E +:10442400200025303278200020202000207C002528 +:104434006300554E4B4E4F574E004D61696E2050F0 +:10444400726F6365737300201B5B306D1B5B324AB4 +:104454001B5B3B480052616661000A25730A0A002F +:1044640020202020202020202020205B3078253090 +:10447400385820746F203078253038585D0A004E43 +:10448400756C6C2070726F636573730025730A001A +:104494007368656C6C000A0A0D70616E69633A207A +:1044A40025730A0A007074696E6974202D20696E80 +:1044B40073756666696369656E74206D656D6F7288 +:1044C400790053797374656D2063616C6C206E6F31 +:1044D4007420696D706C656D656E7465640A003076 +:1044E4003132333435363738396162636465660096 +:1044F4003031323334353637383941424344454616 +:1045040000286E756C6C29002F6465762F6E756CAF +:084514006C002F6465762F0096 +:00000001FF diff --git a/compile/xinu.map b/compile/xinu.map new file mode 100644 index 0000000..866ee47 --- /dev/null +++ b/compile/xinu.map @@ -0,0 +1,1332 @@ +Archive member included to satisfy reference by file (symbol) + +/usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + binaries/doprnt.o (__divmodsi4) +/usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) (__negsi2) +/usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + binaries/create.o (__do_copy_data) +/usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + binaries/bufinit.o (__do_clear_bss) +/usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + binaries/doscan.o (__muluhisi3) +/usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) (__udivmodsi4) +/usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) (__umulhisi3) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(atoi.o) + binaries/initialize.o (atoi) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memcpy.o) + binaries/addargs.o (memcpy) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memset.o) + binaries/evec.o (memset) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncmp.o) + binaries/create.o (strncmp) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncpy.o) + binaries/create.o (strncpy) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(mul10.o) + /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(atoi.o) (__mulhi_const_10) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fprintf.o) + binaries/debug.o (fprintf) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) + /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fprintf.o) (vfprintf) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen_P.o) + /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) (strnlen_P) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen.o) + /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) (strnlen) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fputc.o) + /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) (fputc) +/usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(ultoa_invert.o) + /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) (__ultoa_invert) +/usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fprintf.o) (__prologue_saves__) +/usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fprintf.o) (__epilogue_restores__) + +Se asignan símbolos comunes +Símbolo común tamaño fichero + +readylist 0x1 binaries/ready.o +sleepq 0x1 binaries/clkinit.o +intc_vector 0xb8 binaries/evec.o +nnames 0x2 binaries/naminit.o +minheap 0x2 binaries/meminit.o +marks 0x28 binaries/mark.o +currpid 0x1 binaries/initialize.o +porttab 0x24 binaries/ptinit.o +proctab 0x9c binaries/initialize.o +prcount 0x2 binaries/initialize.o +nmarks 0x2 binaries/mark.o +Defer 0x3 binaries/resched.o +semtab 0x10 binaries/initialize.o +maxheap 0x2 binaries/meminit.o +preempt 0x2 binaries/clkinit.o +buftab 0x19 binaries/bufinit.o +mkmutex 0x1 binaries/mark.o +count1000 0x2 binaries/clkinit.o +clktime 0x2 binaries/clkinit.o +nbpools 0x1 binaries/bufinit.o +nombre 0xa binaries/create.o +queuetab 0x40 binaries/queue.o +ptnextid 0x2 binaries/ptinit.o +cadena 0x64 binaries/serial_avr.o +memlist 0x4 binaries/initialize.o +nametab 0x33 binaries/naminit.o +ptfree 0x2 binaries/ptinit.o + +Configuración de la Memoria + +Nombre Origen Longitud Atributos +text 0x0000000000000000 0x0000000000020000 xr +data 0x0000000000800060 0x000000000000ffa0 rw !x +eeprom 0x0000000000810000 0x0000000000010000 rw !x +fuse 0x0000000000820000 0x0000000000000003 rw !x +lock 0x0000000000830000 0x0000000000000400 rw !x +signature 0x0000000000840000 0x0000000000000400 rw !x +user_signatures 0x0000000000850000 0x0000000000000400 rw !x +*default* 0x0000000000000000 0xffffffffffffffff + +Guión del enlazador y mapa de memoria + +La dirección de la sección .data se estableció a 0x800100 +LOAD /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o +LOAD binaries/start.o +LOAD binaries/ascdate.o +LOAD binaries/blink_avr.o +LOAD binaries/bufinit.o +LOAD binaries/chprio.o +LOAD binaries/clkhandler.o +LOAD binaries/clkinit.o +LOAD binaries/close.o +LOAD binaries/conf.o +LOAD binaries/control.o +LOAD binaries/create.o +LOAD binaries/debug.o +LOAD binaries/evec.o +LOAD binaries/exit.o +LOAD binaries/freebuf.o +LOAD binaries/freemem.o +LOAD binaries/getbuf.o +LOAD binaries/getc.o +LOAD binaries/getdev.o +LOAD binaries/getitem.o +LOAD binaries/getmem.o +LOAD binaries/getpid.o +LOAD binaries/getprio.o +LOAD binaries/getstk.o +LOAD binaries/getticks.o +LOAD binaries/gettime.o +LOAD binaries/init.o +LOAD binaries/initialize.o +LOAD binaries/insert.o +LOAD binaries/insertd.o +LOAD binaries/ioerr.o +LOAD binaries/ionull.o +LOAD binaries/kill.o +LOAD binaries/kprintf.o +LOAD binaries/main.o +LOAD binaries/mark.o +LOAD binaries/meminit.o +LOAD binaries/mkbufpool.o +LOAD binaries/newqueue.o +LOAD binaries/open.o +LOAD binaries/panic.o +LOAD binaries/platinit.o +LOAD binaries/ptclear.o +LOAD binaries/ptcount.o +LOAD binaries/ptcreate.o +LOAD binaries/ptdelete.o +LOAD binaries/ptinit.o +LOAD binaries/ptrecv.o +LOAD binaries/ptreset.o +LOAD binaries/ptsend.o +LOAD binaries/putc.o +LOAD binaries/queue.o +LOAD binaries/read.o +LOAD binaries/ready.o +LOAD binaries/receive.o +LOAD binaries/recvclr.o +LOAD binaries/recvtime.o +LOAD binaries/resched.o +LOAD binaries/resume.o +LOAD binaries/seek.o +LOAD binaries/semcount.o +LOAD binaries/semcreate.o +LOAD binaries/semdelete.o +LOAD binaries/semreset.o +LOAD binaries/send.o +LOAD binaries/serial_avr.o +LOAD binaries/signal.o +LOAD binaries/signaln.o +LOAD binaries/sleep.o +LOAD binaries/suspend.o +LOAD binaries/syscall.o +LOAD binaries/unsleep.o +LOAD binaries/userret.o +LOAD binaries/wait.o +LOAD binaries/wakeup.o +LOAD binaries/write.o +LOAD binaries/xdone.o +LOAD binaries/yield.o +LOAD binaries/ctype_.o +LOAD binaries/doprnt.o +LOAD binaries/doscan.o +LOAD binaries/messages.o +LOAD binaries/userland.o +LOAD binaries/mount.o +LOAD binaries/naminit.o +LOAD binaries/nammap.o +LOAD binaries/namopen.o +LOAD binaries/addargs.o +LOAD binaries/lexan.o +LOAD binaries/shell.o +LOAD binaries/intr.o +START GROUP +LOAD /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a +LOAD /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libm.a +LOAD /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a +LOAD /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libatmega328p.a +END GROUP + 0x0000000000020000 __TEXT_REGION_LENGTH__ = DEFINED (__TEXT_REGION_LENGTH__)?__TEXT_REGION_LENGTH__:0x20000 + 0x000000000000ffa0 __DATA_REGION_LENGTH__ = DEFINED (__DATA_REGION_LENGTH__)?__DATA_REGION_LENGTH__:0xffa0 + 0x0000000000010000 __EEPROM_REGION_LENGTH__ = DEFINED (__EEPROM_REGION_LENGTH__)?__EEPROM_REGION_LENGTH__:0x10000 + [0x0000000000000003] __FUSE_REGION_LENGTH__ = DEFINED (__FUSE_REGION_LENGTH__)?__FUSE_REGION_LENGTH__:0x400 + 0x0000000000000400 __LOCK_REGION_LENGTH__ = DEFINED (__LOCK_REGION_LENGTH__)?__LOCK_REGION_LENGTH__:0x400 + 0x0000000000000400 __SIGNATURE_REGION_LENGTH__ = DEFINED (__SIGNATURE_REGION_LENGTH__)?__SIGNATURE_REGION_LENGTH__:0x400 + 0x0000000000000400 __USER_SIGNATURE_REGION_LENGTH__ = DEFINED (__USER_SIGNATURE_REGION_LENGTH__)?__USER_SIGNATURE_REGION_LENGTH__:0x400 + +.hash + *(.hash) + +.dynsym + *(.dynsym) + +.dynstr + *(.dynstr) + +.gnu.version + *(.gnu.version) + +.gnu.version_d + *(.gnu.version_d) + +.gnu.version_r + *(.gnu.version_r) + +.rel.init + *(.rel.init) + +.rela.init + *(.rela.init) + +.rel.text + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + +.rela.text + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + +.rel.fini + *(.rel.fini) + +.rela.fini + *(.rela.fini) + +.rel.rodata + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + +.rela.rodata + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + +.rel.data + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + +.rela.data + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + +.rel.ctors + *(.rel.ctors) + +.rela.ctors + *(.rela.ctors) + +.rel.dtors + *(.rel.dtors) + +.rela.dtors + *(.rela.dtors) + +.rel.got + *(.rel.got) + +.rela.got + *(.rela.got) + +.rel.bss + *(.rel.bss) + +.rela.bss + *(.rela.bss) + +.rel.plt + *(.rel.plt) + +.rela.plt + *(.rela.plt) + +.text 0x0000000000000000 0x4384 + *(.vectors) + .vectors 0x0000000000000000 0x68 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + 0x0000000000000000 __vectors + 0x0000000000000000 __vector_default + .vectors 0x0000000000000068 0x68 binaries/start.o + *(.vectors) + *(.progmem.gcc*) + 0x00000000000000d0 . = ALIGN (0x2) + 0x00000000000000d0 __trampolines_start = . + *(.trampolines) + .trampolines 0x00000000000000d0 0x0 linker stubs + *(.trampolines*) + 0x00000000000000d0 __trampolines_end = . + *libprintf_flt.a:*(.progmem.data) + *libc.a:*(.progmem.data) + *(.progmem*) + .progmem.data 0x00000000000000d0 0x81 binaries/conf.o + 0x00000000000000d0 devtab + .progmem.data 0x0000000000000151 0x81 binaries/ctype_.o + 0x0000000000000151 _ctype_ + .progmem.data 0x00000000000001d2 0xcc binaries/messages.o + 0x00000000000001d2 m6 + 0x00000000000001e7 m5 + 0x000000000000020c m4 + 0x0000000000000230 m3 + 0x0000000000000257 m2 + 0x000000000000027c m1 + 0x000000000000029e . = ALIGN (0x2) + *(.jumptables) + *(.jumptables*) + *(.lowtext) + *(.lowtext*) + 0x000000000000029e __ctors_start = . + *(.ctors) + 0x000000000000029e __ctors_end = . + 0x000000000000029e __dtors_start = . + *(.dtors) + 0x000000000000029e __dtors_end = . + SORT(*)(.ctors) + SORT(*)(.dtors) + *(.init0) + .init0 0x000000000000029e 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + 0x000000000000029e __init + *(.init0) + *(.init1) + *(.init1) + *(.init2) + .init2 0x000000000000029e 0xc /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + *(.init2) + *(.init3) + *(.init3) + *(.init4) + .init4 0x00000000000002aa 0x16 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + 0x00000000000002aa __do_copy_data + .init4 0x00000000000002c0 0x10 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + 0x00000000000002c0 __do_clear_bss + *(.init4) + *(.init5) + *(.init5) + *(.init6) + *(.init6) + *(.init7) + *(.init7) + *(.init8) + .init8 0x00000000000002d0 0x4 binaries/start.o + *(.init8) + *(.init9) + .init9 0x00000000000002d4 0x8 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + *(.init9) + *(.text) + .text 0x00000000000002dc 0x4 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + 0x00000000000002dc __vector_22 + 0x00000000000002dc __vector_1 + 0x00000000000002dc __vector_24 + 0x00000000000002dc __vector_12 + 0x00000000000002dc __bad_interrupt + 0x00000000000002dc __vector_6 + 0x00000000000002dc __vector_3 + 0x00000000000002dc __vector_23 + 0x00000000000002dc __vector_25 + 0x00000000000002dc __vector_11 + 0x00000000000002dc __vector_13 + 0x00000000000002dc __vector_17 + 0x00000000000002dc __vector_19 + 0x00000000000002dc __vector_7 + 0x00000000000002dc __vector_5 + 0x00000000000002dc __vector_4 + 0x00000000000002dc __vector_9 + 0x00000000000002dc __vector_2 + 0x00000000000002dc __vector_21 + 0x00000000000002dc __vector_15 + 0x00000000000002dc __vector_8 + 0x00000000000002dc __vector_14 + 0x00000000000002dc __vector_10 + 0x00000000000002dc __vector_16 + 0x00000000000002dc __vector_18 + 0x00000000000002dc __vector_20 + .text 0x00000000000002e0 0x0 binaries/start.o + .text 0x00000000000002e0 0x4 binaries/ascdate.o + 0x00000000000002e0 ascdate + .text 0x00000000000002e4 0x80 binaries/blink_avr.o + 0x00000000000002e4 my_delay + 0x0000000000000344 blink_avr + .text 0x0000000000000364 0x8 binaries/bufinit.o + 0x0000000000000364 bufinit + .text 0x000000000000036c 0x3c binaries/chprio.o + 0x000000000000036c chprio + .text 0x00000000000003a8 0x92 binaries/clkhandler.o + 0x00000000000003a8 clkhandler + .text 0x000000000000043a 0x82 binaries/clkinit.o + 0x000000000000043a clkinit + .text 0x00000000000004bc 0x40 binaries/close.o + 0x00000000000004bc close + .text 0x00000000000004fc 0x0 binaries/conf.o + .text 0x00000000000004fc 0x64 binaries/control.o + 0x00000000000004fc control + .text 0x0000000000000560 0x202 binaries/create.o + 0x0000000000000560 create + .text 0x0000000000000762 0x2d2 binaries/debug.o + 0x0000000000000762 hexdump + .text 0x0000000000000a34 0xa6 binaries/evec.o + 0x0000000000000a34 dummy_isr + 0x0000000000000a34 exception_message + 0x0000000000000a74 initintc + 0x0000000000000aba set_evec + .text 0x0000000000000ada 0x8 binaries/exit.o + 0x0000000000000ada exit + .text 0x0000000000000ae2 0x5c binaries/freebuf.o + 0x0000000000000ae2 freebuf + .text 0x0000000000000b3e 0x112 binaries/freemem.o + 0x0000000000000b3e freemem + .text 0x0000000000000c50 0x68 binaries/getbuf.o + 0x0000000000000c50 getbuf + .text 0x0000000000000cb8 0x40 binaries/getc.o + 0x0000000000000cb8 getc + .text 0x0000000000000cf8 0x54 binaries/getdev.o + 0x0000000000000cf8 getdev + .text 0x0000000000000d4c 0x7c binaries/getitem.o + 0x0000000000000d4c getitem + 0x0000000000000d82 getfirst + 0x0000000000000d9e getlast + .text 0x0000000000000dc8 0x96 binaries/getmem.o + 0x0000000000000dc8 getmem + .text 0x0000000000000e5e 0x6 binaries/getpid.o + 0x0000000000000e5e getpid + .text 0x0000000000000e64 0x34 binaries/getprio.o + 0x0000000000000e64 getprio + .text 0x0000000000000e98 0xa4 binaries/getstk.o + 0x0000000000000e98 getstk + .text 0x0000000000000f3c 0x6 binaries/getticks.o + 0x0000000000000f3c getticks + .text 0x0000000000000f42 0x4 binaries/gettime.o + 0x0000000000000f42 gettime + .text 0x0000000000000f46 0x40 binaries/init.o + 0x0000000000000f46 init + .text 0x0000000000000f86 0x246 binaries/initialize.o + 0x0000000000000f86 nullprocess + 0x0000000000000fc2 notmain + 0x0000000000000fc4 nulluser + 0x0000000000001156 startup + 0x000000000000115e stop + 0x0000000000001178 delay + .text 0x00000000000011cc 0x84 binaries/insert.o + 0x00000000000011cc insert + .text 0x0000000000001250 0xea binaries/insertd.o + 0x0000000000001250 insertd + .text 0x000000000000133a 0x4 binaries/ioerr.o + 0x000000000000133a ioerr + .text 0x000000000000133e 0x4 binaries/ionull.o + 0x000000000000133e ionull + .text 0x0000000000001342 0x118 binaries/kill.o + 0x0000000000001342 kill + .text 0x000000000000145a 0x6e binaries/kprintf.o + 0x000000000000145a kputc + 0x00000000000014a0 kgetc + 0x00000000000014a2 kprintf + .text 0x00000000000014c8 0x0 binaries/main.o + .text 0x00000000000014c8 0x90 binaries/mark.o + 0x00000000000014c8 markinit + 0x00000000000014de mark + .text 0x0000000000001558 0x3e binaries/meminit.o + 0x0000000000001558 meminit + .text 0x0000000000001596 0x10a binaries/mkbufpool.o + 0x0000000000001596 mkbufpool + .text 0x00000000000016a0 0x5a binaries/newqueue.o + 0x00000000000016a0 newqueue + .text 0x00000000000016fa 0x58 binaries/open.o + 0x00000000000016fa open + .text 0x0000000000001752 0x20 binaries/panic.o + 0x0000000000001752 panic + .text 0x0000000000001772 0x50 binaries/platinit.o + 0x0000000000001772 platinit + 0x000000000000177a uartinit + .text 0x00000000000017c2 0xac binaries/ptclear.o + 0x00000000000017c2 _ptclear + .text 0x000000000000186e 0x7a binaries/ptcount.o + 0x000000000000186e ptcount + .text 0x00000000000018e8 0xbe binaries/ptcreate.o + 0x00000000000018e8 ptcreate + .text 0x00000000000019a6 0x66 binaries/ptdelete.o + 0x00000000000019a6 ptdelete + .text 0x0000000000001a0c 0x8a binaries/ptinit.o + 0x0000000000001a0c ptinit + .text 0x0000000000001a96 0xce binaries/ptrecv.o + 0x0000000000001a96 ptrecv + .text 0x0000000000001b64 0x5e binaries/ptreset.o + 0x0000000000001b64 ptreset + .text 0x0000000000001bc2 0xfa binaries/ptsend.o + 0x0000000000001bc2 ptsend + .text 0x0000000000001cbc 0x48 binaries/putc.o + 0x0000000000001cbc putc + .text 0x0000000000001d04 0xa2 binaries/queue.o + 0x0000000000001d04 enqueue + 0x0000000000001d70 dequeue + .text 0x0000000000001da6 0x58 binaries/read.o + 0x0000000000001da6 read + .text 0x0000000000001dfe 0x38 binaries/ready.o + 0x0000000000001dfe ready + .text 0x0000000000001e36 0x3c binaries/receive.o + 0x0000000000001e36 receive + .text 0x0000000000001e72 0x2e binaries/recvclr.o + 0x0000000000001e72 recvclr + .text 0x0000000000001ea0 0x8e binaries/recvtime.o + 0x0000000000001ea0 recvtime + .text 0x0000000000001f2e 0xc2 binaries/resched.o + 0x0000000000001f2e resched + 0x0000000000001fa4 resched_cntl + .text 0x0000000000001ff0 0x2c binaries/resume.o + 0x0000000000001ff0 resume + .text 0x000000000000201c 0x4c binaries/seek.o + 0x000000000000201c seek + .text 0x0000000000002068 0x32 binaries/semcount.o + 0x0000000000002068 semcount + .text 0x000000000000209a 0x6c binaries/semcreate.o + 0x000000000000209a semcreate + .text 0x0000000000002106 0x7e binaries/semdelete.o + 0x0000000000002106 semdelete + .text 0x0000000000002184 0x7c binaries/semreset.o + 0x0000000000002184 semreset + .text 0x0000000000002200 0x64 binaries/send.o + 0x0000000000002200 send + .text 0x0000000000002264 0x96 binaries/serial_avr.o + 0x0000000000002264 serial_init + 0x000000000000228e serial_put_char + 0x000000000000229c serial_get_char + 0x00000000000022aa serial_put_str + 0x00000000000022c2 serial_get_str + .text 0x00000000000022fa 0x56 binaries/signal.o + 0x00000000000022fa signal + .text 0x0000000000002350 0x98 binaries/signaln.o + 0x0000000000002350 signaln + .text 0x00000000000023e8 0x8a binaries/sleep.o + 0x00000000000023e8 sleepms + 0x000000000000244e sleep + .text 0x0000000000002472 0x88 binaries/suspend.o + 0x0000000000002472 suspend + .text 0x00000000000024fa 0x32 binaries/syscall.o + 0x00000000000024fa _svc_handler + 0x000000000000252a syscall_init + .text 0x000000000000252c 0x86 binaries/unsleep.o + 0x000000000000252c unsleep + .text 0x00000000000025b2 0x8 binaries/userret.o + 0x00000000000025b2 userret + .text 0x00000000000025ba 0x6c binaries/wait.o + 0x00000000000025ba wait + .text 0x0000000000002626 0x46 binaries/wakeup.o + 0x0000000000002626 wakeup + .text 0x000000000000266c 0x58 binaries/write.o + 0x000000000000266c write + .text 0x00000000000026c4 0x14 binaries/xdone.o + 0x00000000000026c4 xdone + .text 0x00000000000026d8 0xc binaries/yield.o + 0x00000000000026d8 yield + .text 0x00000000000026e4 0x0 binaries/ctype_.o + .text 0x00000000000026e4 0x7b4 binaries/doprnt.o + 0x00000000000026e4 _prtl10 + 0x00000000000027dc _prtl8 + 0x000000000000285e _prtl16 + 0x0000000000002900 _prtX16 + 0x00000000000029a2 _prtl2 + 0x0000000000002a1c _doprnt + .text 0x0000000000002e98 0x67a binaries/doscan.o + 0x0000000000002e98 _doscan + .text 0x0000000000003512 0x0 binaries/messages.o + .text 0x0000000000003512 0x2c binaries/userland.o + 0x0000000000003512 xinu_syscall + 0x0000000000003512 xinu_uptime + 0x0000000000003528 xinu_putc + .text 0x000000000000353e 0x104 binaries/mount.o + 0x000000000000353e namlen + 0x0000000000003560 mount + .text 0x0000000000003642 0x120 binaries/naminit.o + 0x0000000000003642 naminit + .text 0x0000000000003762 0x18c binaries/nammap.o + 0x0000000000003762 namrepl + 0x0000000000003848 namcpy + 0x0000000000003868 nammap + .text 0x00000000000038ee 0x54 binaries/namopen.o + 0x00000000000038ee namopen + .text 0x0000000000003942 0x108 binaries/addargs.o + 0x0000000000003942 addargs + .text 0x0000000000003a4a 0x182 binaries/lexan.o + 0x0000000000003a4a lexan + .text 0x0000000000003bcc 0x4 binaries/shell.o + 0x0000000000003bcc shell + .text 0x0000000000003bd0 0x0 binaries/intr.o + 0x0000000000003bd0 pause + 0x0000000000003bd0 enable + 0x0000000000003bd0 disable + 0x0000000000003bd0 halt + 0x0000000000003bd0 restore + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(atoi.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memcpy.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memset.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncmp.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncpy.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(mul10.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fprintf.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen_P.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fputc.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(ultoa_invert.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + .text 0x0000000000003bd0 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + 0x0000000000003bd0 . = ALIGN (0x2) + *(.text.*) + .text.startup 0x0000000000003bd0 0xa4 binaries/main.o + 0x0000000000003bd0 main + .text.libgcc.mul + 0x0000000000003c74 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + .text.libgcc.div + 0x0000000000003c74 0x2e /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + 0x0000000000003c74 __divmodsi4 + .text.libgcc 0x0000000000003ca2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + .text.libgcc.prologue + 0x0000000000003ca2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + .text.libgcc.builtins + 0x0000000000003ca2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + .text.libgcc.fmul + 0x0000000000003ca2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + .text.libgcc.fixed + 0x0000000000003ca2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + .text.libgcc.mul + 0x0000000000003ca2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + .text.libgcc.div + 0x0000000000003ca2 0x10 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + 0x0000000000003ca2 __negsi2 + .text.libgcc 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + .text.libgcc.prologue + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + .text.libgcc.builtins + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + .text.libgcc.fmul + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + .text.libgcc.fixed + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + .text.libgcc.mul + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .text.libgcc.div + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .text.libgcc 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .text.libgcc.prologue + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .text.libgcc.builtins + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .text.libgcc.fmul + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .text.libgcc.fixed + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .text.libgcc.mul + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .text.libgcc.div + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .text.libgcc 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .text.libgcc.prologue + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .text.libgcc.builtins + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .text.libgcc.fmul + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .text.libgcc.fixed + 0x0000000000003cb2 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .text.libgcc.mul + 0x0000000000003cb2 0x16 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + 0x0000000000003cb2 __muluhisi3 + .text.libgcc.div + 0x0000000000003cc8 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + .text.libgcc 0x0000000000003cc8 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + .text.libgcc.prologue + 0x0000000000003cc8 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + .text.libgcc.builtins + 0x0000000000003cc8 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + .text.libgcc.fmul + 0x0000000000003cc8 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + .text.libgcc.fixed + 0x0000000000003cc8 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + .text.libgcc.mul + 0x0000000000003cc8 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + .text.libgcc.div + 0x0000000000003cc8 0x44 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + 0x0000000000003cc8 __udivmodsi4 + .text.libgcc 0x0000000000003d0c 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + .text.libgcc.prologue + 0x0000000000003d0c 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + .text.libgcc.builtins + 0x0000000000003d0c 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + .text.libgcc.fmul + 0x0000000000003d0c 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + .text.libgcc.fixed + 0x0000000000003d0c 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + .text.libgcc.mul + 0x0000000000003d0c 0x1e /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + 0x0000000000003d0c __umulhisi3 + .text.libgcc.div + 0x0000000000003d2a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + .text.libgcc 0x0000000000003d2a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + .text.libgcc.prologue + 0x0000000000003d2a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + .text.libgcc.builtins + 0x0000000000003d2a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + .text.libgcc.fmul + 0x0000000000003d2a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + .text.libgcc.fixed + 0x0000000000003d2a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + .text.avr-libc + 0x0000000000003d2a 0x3c /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(atoi.o) + 0x0000000000003d2a atoi + .text.avr-libc + 0x0000000000003d66 0x12 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memcpy.o) + 0x0000000000003d66 memcpy + .text.avr-libc + 0x0000000000003d78 0xe /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memset.o) + 0x0000000000003d78 memset + .text.avr-libc + 0x0000000000003d86 0x1c /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncmp.o) + 0x0000000000003d86 strncmp + .text.avr-libc + 0x0000000000003da2 0x1e /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncpy.o) + 0x0000000000003da2 strncpy + .text.avr-libc + 0x0000000000003dc0 0x10 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(mul10.o) + 0x0000000000003dc0 __mulhi_const_10 + .text.avr-libc + 0x0000000000003dd0 0x24 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fprintf.o) + 0x0000000000003dd0 fprintf + .text.avr-libc + 0x0000000000003df4 0x3c2 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) + 0x0000000000003df4 vfprintf + .text.avr-libc + 0x00000000000041b6 0x16 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen_P.o) + 0x00000000000041b6 strnlen_P + .text.avr-libc + 0x00000000000041cc 0x16 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen.o) + 0x00000000000041cc strnlen + .text.avr-libc + 0x00000000000041e2 0x78 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fputc.o) + 0x00000000000041e2 fputc + .text.avr-libc + 0x000000000000425a 0xbc /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(ultoa_invert.o) + 0x000000000000425a __ultoa_invert + .text.libgcc.mul + 0x0000000000004316 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + .text.libgcc.div + 0x0000000000004316 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + .text.libgcc 0x0000000000004316 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + .text.libgcc.prologue + 0x0000000000004316 0x38 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + 0x0000000000004316 __prologue_saves__ + .text.libgcc.builtins + 0x000000000000434e 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + .text.libgcc.fmul + 0x000000000000434e 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + .text.libgcc.fixed + 0x000000000000434e 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + .text.libgcc.mul + 0x000000000000434e 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + .text.libgcc.div + 0x000000000000434e 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + .text.libgcc 0x000000000000434e 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + .text.libgcc.prologue + 0x000000000000434e 0x36 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + 0x000000000000434e __epilogue_restores__ + .text.libgcc.builtins + 0x0000000000004384 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + .text.libgcc.fmul + 0x0000000000004384 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + .text.libgcc.fixed + 0x0000000000004384 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + 0x0000000000004384 . = ALIGN (0x2) + *(.fini9) + *(.fini9) + *(.fini8) + *(.fini8) + *(.fini7) + *(.fini7) + *(.fini6) + *(.fini6) + *(.fini5) + *(.fini5) + *(.fini4) + *(.fini4) + *(.fini3) + *(.fini3) + *(.fini2) + *(.fini2) + *(.fini1) + *(.fini1) + *(.fini0) + *(.fini0) + 0x0000000000004384 _etext = . + +.data 0x0000000000800100 0x198 dirección de carga 0x0000000000004384 + 0x0000000000800100 PROVIDE (__data_start, .) + *(.data) + .data 0x0000000000800100 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + .data 0x0000000000800100 0x0 binaries/start.o + .data 0x0000000000800100 0x0 binaries/ascdate.o + .data 0x0000000000800100 0x0 binaries/blink_avr.o + .data 0x0000000000800100 0x0 binaries/bufinit.o + .data 0x0000000000800100 0x0 binaries/chprio.o + .data 0x0000000000800100 0x0 binaries/clkhandler.o + .data 0x0000000000800100 0x0 binaries/clkinit.o + .data 0x0000000000800100 0x0 binaries/close.o + .data 0x0000000000800100 0x0 binaries/conf.o + .data 0x0000000000800100 0x0 binaries/control.o + .data 0x0000000000800100 0x0 binaries/create.o + .data 0x0000000000800100 0x0 binaries/debug.o + .data 0x0000000000800100 0x0 binaries/evec.o + .data 0x0000000000800100 0x0 binaries/exit.o + .data 0x0000000000800100 0x0 binaries/freebuf.o + .data 0x0000000000800100 0x0 binaries/freemem.o + .data 0x0000000000800100 0x0 binaries/getbuf.o + .data 0x0000000000800100 0x0 binaries/getc.o + .data 0x0000000000800100 0x0 binaries/getdev.o + .data 0x0000000000800100 0x0 binaries/getitem.o + .data 0x0000000000800100 0x0 binaries/getmem.o + .data 0x0000000000800100 0x0 binaries/getpid.o + .data 0x0000000000800100 0x0 binaries/getprio.o + .data 0x0000000000800100 0x0 binaries/getstk.o + .data 0x0000000000800100 0x0 binaries/getticks.o + .data 0x0000000000800100 0x0 binaries/gettime.o + .data 0x0000000000800100 0x0 binaries/init.o + .data 0x0000000000800100 0x15 binaries/initialize.o + 0x0000000000800100 frase + .data 0x0000000000800115 0x0 binaries/insert.o + .data 0x0000000000800115 0x0 binaries/insertd.o + .data 0x0000000000800115 0x0 binaries/ioerr.o + .data 0x0000000000800115 0x0 binaries/ionull.o + .data 0x0000000000800115 0x0 binaries/kill.o + .data 0x0000000000800115 0x0 binaries/kprintf.o + .data 0x0000000000800115 0x0 binaries/main.o + .data 0x0000000000800115 0x0 binaries/mark.o + .data 0x0000000000800115 0x0 binaries/meminit.o + .data 0x0000000000800115 0x0 binaries/mkbufpool.o + .data 0x0000000000800115 0x1 binaries/newqueue.o + .data 0x0000000000800116 0x0 binaries/open.o + .data 0x0000000000800116 0x0 binaries/panic.o + .data 0x0000000000800116 0x0 binaries/platinit.o + .data 0x0000000000800116 0x0 binaries/ptclear.o + .data 0x0000000000800116 0x0 binaries/ptcount.o + .data 0x0000000000800116 0x0 binaries/ptcreate.o + .data 0x0000000000800116 0x0 binaries/ptdelete.o + .data 0x0000000000800116 0x0 binaries/ptinit.o + .data 0x0000000000800116 0x0 binaries/ptrecv.o + .data 0x0000000000800116 0x0 binaries/ptreset.o + .data 0x0000000000800116 0x0 binaries/ptsend.o + .data 0x0000000000800116 0x0 binaries/putc.o + .data 0x0000000000800116 0x0 binaries/queue.o + .data 0x0000000000800116 0x0 binaries/read.o + .data 0x0000000000800116 0x0 binaries/ready.o + .data 0x0000000000800116 0x0 binaries/receive.o + .data 0x0000000000800116 0x0 binaries/recvclr.o + .data 0x0000000000800116 0x0 binaries/recvtime.o + .data 0x0000000000800116 0x0 binaries/resched.o + .data 0x0000000000800116 0x0 binaries/resume.o + .data 0x0000000000800116 0x0 binaries/seek.o + .data 0x0000000000800116 0x0 binaries/semcount.o + .data 0x0000000000800116 0x0 binaries/semcreate.o + .data 0x0000000000800116 0x0 binaries/semdelete.o + .data 0x0000000000800116 0x0 binaries/semreset.o + .data 0x0000000000800116 0x0 binaries/send.o + .data 0x0000000000800116 0x1 binaries/serial_avr.o + 0x0000000000800116 letra_start + .data 0x0000000000800117 0x0 binaries/signal.o + .data 0x0000000000800117 0x0 binaries/signaln.o + .data 0x0000000000800117 0x0 binaries/sleep.o + .data 0x0000000000800117 0x0 binaries/suspend.o + .data 0x0000000000800117 0x0 binaries/syscall.o + .data 0x0000000000800117 0x0 binaries/unsleep.o + .data 0x0000000000800117 0x0 binaries/userret.o + .data 0x0000000000800117 0x0 binaries/wait.o + .data 0x0000000000800117 0x0 binaries/wakeup.o + .data 0x0000000000800117 0x0 binaries/write.o + .data 0x0000000000800117 0x0 binaries/xdone.o + .data 0x0000000000800117 0x0 binaries/yield.o + .data 0x0000000000800117 0x0 binaries/ctype_.o + .data 0x0000000000800117 0x0 binaries/doprnt.o + .data 0x0000000000800117 0x80 binaries/doscan.o + 0x0000000000800117 _sctab + .data 0x0000000000800197 0x0 binaries/messages.o + .data 0x0000000000800197 0x0 binaries/userland.o + .data 0x0000000000800197 0x0 binaries/mount.o + .data 0x0000000000800197 0x0 binaries/naminit.o + .data 0x0000000000800197 0x0 binaries/nammap.o + .data 0x0000000000800197 0x0 binaries/namopen.o + .data 0x0000000000800197 0x0 binaries/addargs.o + .data 0x0000000000800197 0x0 binaries/lexan.o + .data 0x0000000000800197 0x0 binaries/shell.o + .data 0x0000000000800197 0x0 binaries/intr.o + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(atoi.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memcpy.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memset.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncmp.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncpy.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(mul10.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fprintf.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen_P.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fputc.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(ultoa_invert.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + .data 0x0000000000800197 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + *(.data*) + *(.rodata) + *(.rodata*) + .rodata.str1.1 + 0x0000000000800197 0x5 binaries/create.o + .rodata.str1.1 + 0x000000000080019c 0x16 binaries/debug.o + 0x1c (tamaño antes de la relajación) + .rodata.str1.1 + 0x00000000008001b2 0x8 binaries/evec.o + .rodata.str1.1 + 0x00000000008001ba 0x56 binaries/initialize.o + .rodata.str1.1 + 0x0000000000800210 0x6 binaries/main.o + .rodata.str1.1 + 0x0000000000800216 0xf binaries/panic.o + .rodata.str1.1 + 0x0000000000800225 0x1d binaries/ptinit.o + .rodata.str1.1 + 0x0000000000800242 0x1d binaries/syscall.o + .rodata.str1.1 + 0x000000000080025f 0x29 binaries/doprnt.o + .rodata.str1.1 + 0x0000000000800288 0x10 binaries/naminit.o + 0x11 (tamaño antes de la relajación) + *(.gnu.linkonce.d*) + 0x0000000000800298 . = ALIGN (0x2) + 0x0000000000800298 _edata = . + 0x0000000000800298 PROVIDE (__data_end, .) + +.bss 0x0000000000800298 0x307 + 0x0000000000800298 PROVIDE (__bss_start, .) + *(.bss) + .bss 0x0000000000800298 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + .bss 0x0000000000800298 0x0 binaries/start.o + .bss 0x0000000000800298 0x0 binaries/ascdate.o + .bss 0x0000000000800298 0x0 binaries/blink_avr.o + .bss 0x0000000000800298 0x0 binaries/bufinit.o + .bss 0x0000000000800298 0x0 binaries/chprio.o + .bss 0x0000000000800298 0x0 binaries/clkhandler.o + .bss 0x0000000000800298 0x0 binaries/clkinit.o + .bss 0x0000000000800298 0x0 binaries/close.o + .bss 0x0000000000800298 0x0 binaries/conf.o + .bss 0x0000000000800298 0x0 binaries/control.o + .bss 0x0000000000800298 0x1 binaries/create.o + .bss 0x0000000000800299 0x0 binaries/debug.o + .bss 0x0000000000800299 0x0 binaries/evec.o + .bss 0x0000000000800299 0x0 binaries/exit.o + .bss 0x0000000000800299 0x0 binaries/freebuf.o + .bss 0x0000000000800299 0x0 binaries/freemem.o + .bss 0x0000000000800299 0x0 binaries/getbuf.o + .bss 0x0000000000800299 0x0 binaries/getc.o + .bss 0x0000000000800299 0x0 binaries/getdev.o + .bss 0x0000000000800299 0x0 binaries/getitem.o + .bss 0x0000000000800299 0x0 binaries/getmem.o + .bss 0x0000000000800299 0x0 binaries/getpid.o + .bss 0x0000000000800299 0x0 binaries/getprio.o + .bss 0x0000000000800299 0x0 binaries/getstk.o + .bss 0x0000000000800299 0x0 binaries/getticks.o + .bss 0x0000000000800299 0x0 binaries/gettime.o + .bss 0x0000000000800299 0x0 binaries/init.o + .bss 0x0000000000800299 0x0 binaries/initialize.o + .bss 0x0000000000800299 0x0 binaries/insert.o + .bss 0x0000000000800299 0x0 binaries/insertd.o + .bss 0x0000000000800299 0x0 binaries/ioerr.o + .bss 0x0000000000800299 0x0 binaries/ionull.o + .bss 0x0000000000800299 0x0 binaries/kill.o + .bss 0x0000000000800299 0x0 binaries/kprintf.o + .bss 0x0000000000800299 0x0 binaries/main.o + .bss 0x0000000000800299 0x0 binaries/mark.o + .bss 0x0000000000800299 0x0 binaries/meminit.o + .bss 0x0000000000800299 0x0 binaries/mkbufpool.o + .bss 0x0000000000800299 0x0 binaries/newqueue.o + .bss 0x0000000000800299 0x0 binaries/open.o + .bss 0x0000000000800299 0x0 binaries/panic.o + .bss 0x0000000000800299 0x0 binaries/platinit.o + .bss 0x0000000000800299 0x0 binaries/ptclear.o + .bss 0x0000000000800299 0x0 binaries/ptcount.o + .bss 0x0000000000800299 0x0 binaries/ptcreate.o + .bss 0x0000000000800299 0x0 binaries/ptdelete.o + .bss 0x0000000000800299 0x0 binaries/ptinit.o + .bss 0x0000000000800299 0x0 binaries/ptrecv.o + .bss 0x0000000000800299 0x0 binaries/ptreset.o + .bss 0x0000000000800299 0x0 binaries/ptsend.o + .bss 0x0000000000800299 0x0 binaries/putc.o + .bss 0x0000000000800299 0x0 binaries/queue.o + .bss 0x0000000000800299 0x0 binaries/read.o + .bss 0x0000000000800299 0x0 binaries/ready.o + .bss 0x0000000000800299 0x0 binaries/receive.o + .bss 0x0000000000800299 0x0 binaries/recvclr.o + .bss 0x0000000000800299 0x0 binaries/recvtime.o + .bss 0x0000000000800299 0x0 binaries/resched.o + .bss 0x0000000000800299 0x0 binaries/resume.o + .bss 0x0000000000800299 0x0 binaries/seek.o + .bss 0x0000000000800299 0x0 binaries/semcount.o + .bss 0x0000000000800299 0x1 binaries/semcreate.o + .bss 0x000000000080029a 0x0 binaries/semdelete.o + .bss 0x000000000080029a 0x0 binaries/semreset.o + .bss 0x000000000080029a 0x0 binaries/send.o + .bss 0x000000000080029a 0x0 binaries/serial_avr.o + .bss 0x000000000080029a 0x0 binaries/signal.o + .bss 0x000000000080029a 0x0 binaries/signaln.o + .bss 0x000000000080029a 0x0 binaries/sleep.o + .bss 0x000000000080029a 0x0 binaries/suspend.o + .bss 0x000000000080029a 0x0 binaries/syscall.o + .bss 0x000000000080029a 0x0 binaries/unsleep.o + .bss 0x000000000080029a 0x0 binaries/userret.o + .bss 0x000000000080029a 0x0 binaries/wait.o + .bss 0x000000000080029a 0x0 binaries/wakeup.o + .bss 0x000000000080029a 0x0 binaries/write.o + .bss 0x000000000080029a 0x0 binaries/xdone.o + .bss 0x000000000080029a 0x0 binaries/yield.o + .bss 0x000000000080029a 0x0 binaries/ctype_.o + .bss 0x000000000080029a 0x0 binaries/doprnt.o + .bss 0x000000000080029a 0x0 binaries/doscan.o + .bss 0x000000000080029a 0x0 binaries/messages.o + .bss 0x000000000080029a 0x0 binaries/userland.o + .bss 0x000000000080029a 0x0 binaries/mount.o + .bss 0x000000000080029a 0x0 binaries/naminit.o + .bss 0x000000000080029a 0x0 binaries/nammap.o + .bss 0x000000000080029a 0x0 binaries/namopen.o + .bss 0x000000000080029a 0x0 binaries/addargs.o + .bss 0x000000000080029a 0x0 binaries/lexan.o + .bss 0x000000000080029a 0x0 binaries/shell.o + .bss 0x000000000080029a 0x0 binaries/intr.o + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_divmodsi4.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_negsi2.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_copy_data.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_clear_bss.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_muluhisi3.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_udivmodsi4.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_umulhisi3.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(atoi.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memcpy.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(memset.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncmp.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strncpy.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(mul10.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fprintf.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen_P.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(strnlen.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fputc.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(ultoa_invert.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_prologue.o) + .bss 0x000000000080029a 0x0 /usr/lib/gcc/avr/5.4.0/avr5/libgcc.a(_epilogue.o) + *(.bss*) + *(COMMON) + COMMON 0x000000000080029a 0x1a binaries/bufinit.o + 0x000000000080029a buftab + 0x00000000008002b3 nbpools + COMMON 0x00000000008002b4 0x7 binaries/clkinit.o + 0x00000000008002b4 sleepq + 0x00000000008002b5 preempt + 0x00000000008002b7 count1000 + 0x00000000008002b9 clktime + COMMON 0x00000000008002bb 0xa binaries/create.o + 0x00000000008002bb nombre + *fill* 0x00000000008002c5 0x3b + COMMON 0x0000000000800300 0xb8 binaries/evec.o + 0x0000000000800300 intc_vector + COMMON 0x00000000008003b8 0xb3 binaries/initialize.o + 0x00000000008003b8 currpid + 0x00000000008003b9 proctab + 0x0000000000800455 prcount + 0x0000000000800457 semtab + 0x0000000000800467 memlist + COMMON 0x000000000080046b 0x2b binaries/mark.o + 0x000000000080046b marks + 0x0000000000800493 nmarks + 0x0000000000800495 mkmutex + COMMON 0x0000000000800496 0x4 binaries/meminit.o + 0x0000000000800496 minheap + 0x0000000000800498 maxheap + COMMON 0x000000000080049a 0x28 binaries/ptinit.o + 0x000000000080049a porttab + 0x00000000008004be ptnextid + 0x00000000008004c0 ptfree + COMMON 0x00000000008004c2 0x40 binaries/queue.o + 0x00000000008004c2 queuetab + COMMON 0x0000000000800502 0x1 binaries/ready.o + 0x0000000000800502 readylist + COMMON 0x0000000000800503 0x3 binaries/resched.o + 0x0000000000800503 Defer + COMMON 0x0000000000800506 0x64 binaries/serial_avr.o + 0x0000000000800506 cadena + COMMON 0x000000000080056a 0x35 binaries/naminit.o + 0x000000000080056a nnames + 0x000000000080056c nametab + 0x000000000080059f PROVIDE (__bss_end, .) + 0x0000000000004384 __data_load_start = LOADADDR (.data) + 0x000000000000451c __data_load_end = (__data_load_start + SIZEOF (.data)) + +.noinit 0x000000000080059f 0x0 + [!provide] PROVIDE (__noinit_start, .) + *(.noinit*) + [!provide] PROVIDE (__noinit_end, .) + 0x000000000080059f _end = . + [!provide] PROVIDE (__heap_start, .) + +.eeprom 0x0000000000810000 0x0 + *(.eeprom*) + 0x0000000000810000 __eeprom_end = . + +.fuse + *(.fuse) + *(.lfuse) + *(.hfuse) + *(.efuse) + +.lock + *(.lock*) + +.signature + *(.signature*) + +.user_signatures + *(.user_signatures*) + +.stab + *(.stab) + +.stabstr + *(.stabstr) + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.comment 0x0000000000000000 0x11 + *(.comment) + .comment 0x0000000000000000 0x11 binaries/ascdate.o + 0x12 (tamaño antes de la relajación) + .comment 0x0000000000000011 0x12 binaries/blink_avr.o + .comment 0x0000000000000011 0x12 binaries/bufinit.o + .comment 0x0000000000000011 0x12 binaries/chprio.o + .comment 0x0000000000000011 0x12 binaries/clkhandler.o + .comment 0x0000000000000011 0x12 binaries/clkinit.o + .comment 0x0000000000000011 0x12 binaries/close.o + .comment 0x0000000000000011 0x12 binaries/conf.o + .comment 0x0000000000000011 0x12 binaries/control.o + .comment 0x0000000000000011 0x12 binaries/create.o + .comment 0x0000000000000011 0x12 binaries/debug.o + .comment 0x0000000000000011 0x12 binaries/evec.o + .comment 0x0000000000000011 0x12 binaries/exit.o + .comment 0x0000000000000011 0x12 binaries/freebuf.o + .comment 0x0000000000000011 0x12 binaries/freemem.o + .comment 0x0000000000000011 0x12 binaries/getbuf.o + .comment 0x0000000000000011 0x12 binaries/getc.o + .comment 0x0000000000000011 0x12 binaries/getdev.o + .comment 0x0000000000000011 0x12 binaries/getitem.o + .comment 0x0000000000000011 0x12 binaries/getmem.o + .comment 0x0000000000000011 0x12 binaries/getpid.o + .comment 0x0000000000000011 0x12 binaries/getprio.o + .comment 0x0000000000000011 0x12 binaries/getstk.o + .comment 0x0000000000000011 0x12 binaries/getticks.o + .comment 0x0000000000000011 0x12 binaries/gettime.o + .comment 0x0000000000000011 0x12 binaries/init.o + .comment 0x0000000000000011 0x12 binaries/initialize.o + .comment 0x0000000000000011 0x12 binaries/insert.o + .comment 0x0000000000000011 0x12 binaries/insertd.o + .comment 0x0000000000000011 0x12 binaries/ioerr.o + .comment 0x0000000000000011 0x12 binaries/ionull.o + .comment 0x0000000000000011 0x12 binaries/kill.o + .comment 0x0000000000000011 0x12 binaries/kprintf.o + .comment 0x0000000000000011 0x12 binaries/main.o + .comment 0x0000000000000011 0x12 binaries/mark.o + .comment 0x0000000000000011 0x12 binaries/meminit.o + .comment 0x0000000000000011 0x12 binaries/mkbufpool.o + .comment 0x0000000000000011 0x12 binaries/newqueue.o + .comment 0x0000000000000011 0x12 binaries/open.o + .comment 0x0000000000000011 0x12 binaries/panic.o + .comment 0x0000000000000011 0x12 binaries/platinit.o + .comment 0x0000000000000011 0x12 binaries/ptclear.o + .comment 0x0000000000000011 0x12 binaries/ptcount.o + .comment 0x0000000000000011 0x12 binaries/ptcreate.o + .comment 0x0000000000000011 0x12 binaries/ptdelete.o + .comment 0x0000000000000011 0x12 binaries/ptinit.o + .comment 0x0000000000000011 0x12 binaries/ptrecv.o + .comment 0x0000000000000011 0x12 binaries/ptreset.o + .comment 0x0000000000000011 0x12 binaries/ptsend.o + .comment 0x0000000000000011 0x12 binaries/putc.o + .comment 0x0000000000000011 0x12 binaries/queue.o + .comment 0x0000000000000011 0x12 binaries/read.o + .comment 0x0000000000000011 0x12 binaries/ready.o + .comment 0x0000000000000011 0x12 binaries/receive.o + .comment 0x0000000000000011 0x12 binaries/recvclr.o + .comment 0x0000000000000011 0x12 binaries/recvtime.o + .comment 0x0000000000000011 0x12 binaries/resched.o + .comment 0x0000000000000011 0x12 binaries/resume.o + .comment 0x0000000000000011 0x12 binaries/seek.o + .comment 0x0000000000000011 0x12 binaries/semcount.o + .comment 0x0000000000000011 0x12 binaries/semcreate.o + .comment 0x0000000000000011 0x12 binaries/semdelete.o + .comment 0x0000000000000011 0x12 binaries/semreset.o + .comment 0x0000000000000011 0x12 binaries/send.o + .comment 0x0000000000000011 0x12 binaries/serial_avr.o + .comment 0x0000000000000011 0x12 binaries/signal.o + .comment 0x0000000000000011 0x12 binaries/signaln.o + .comment 0x0000000000000011 0x12 binaries/sleep.o + .comment 0x0000000000000011 0x12 binaries/suspend.o + .comment 0x0000000000000011 0x12 binaries/syscall.o + .comment 0x0000000000000011 0x12 binaries/unsleep.o + .comment 0x0000000000000011 0x12 binaries/userret.o + .comment 0x0000000000000011 0x12 binaries/wait.o + .comment 0x0000000000000011 0x12 binaries/wakeup.o + .comment 0x0000000000000011 0x12 binaries/write.o + .comment 0x0000000000000011 0x12 binaries/xdone.o + .comment 0x0000000000000011 0x12 binaries/yield.o + .comment 0x0000000000000011 0x12 binaries/ctype_.o + .comment 0x0000000000000011 0x12 binaries/doprnt.o + .comment 0x0000000000000011 0x12 binaries/doscan.o + .comment 0x0000000000000011 0x12 binaries/messages.o + .comment 0x0000000000000011 0x12 binaries/userland.o + .comment 0x0000000000000011 0x12 binaries/mount.o + .comment 0x0000000000000011 0x12 binaries/naminit.o + .comment 0x0000000000000011 0x12 binaries/nammap.o + .comment 0x0000000000000011 0x12 binaries/namopen.o + .comment 0x0000000000000011 0x12 binaries/addargs.o + .comment 0x0000000000000011 0x12 binaries/lexan.o + .comment 0x0000000000000011 0x12 binaries/shell.o + .comment 0x0000000000000011 0x12 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fprintf.o) + .comment 0x0000000000000011 0x12 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(vfprintf_std.o) + .comment 0x0000000000000011 0x12 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/libc.a(fputc.o) + +.note.gnu.avr.deviceinfo + 0x0000000000000000 0x40 + .note.gnu.avr.deviceinfo + 0x0000000000000000 0x40 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + +.note.gnu.build-id + *(.note.gnu.build-id) + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges + *(.debug_aranges) + +.debug_pubnames + *(.debug_pubnames) + +.debug_info 0x0000000000000000 0x5f4 + *(.debug_info .gnu.linkonce.wi.*) + .debug_info 0x0000000000000000 0x5f4 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + +.debug_abbrev 0x0000000000000000 0x5a2 + *(.debug_abbrev) + .debug_abbrev 0x0000000000000000 0x5a2 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + +.debug_line 0x0000000000000000 0x1a + *(.debug_line .debug_line.* .debug_line_end) + .debug_line 0x0000000000000000 0x1a /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + +.debug_frame + *(.debug_frame) + +.debug_str 0x0000000000000000 0x208 + *(.debug_str) + .debug_str 0x0000000000000000 0x208 /usr/lib/gcc/avr/5.4.0/../../../avr/lib/avr5/crtatmega328p.o + +.debug_loc + *(.debug_loc) + +.debug_macinfo + *(.debug_macinfo) + +.debug_weaknames + *(.debug_weaknames) + +.debug_funcnames + *(.debug_funcnames) + +.debug_typenames + *(.debug_typenames) + +.debug_varnames + *(.debug_varnames) + +.debug_pubtypes + *(.debug_pubtypes) + +.debug_ranges + *(.debug_ranges) + +.debug_macro + *(.debug_macro) +OUTPUT(../compile/xinu.elf elf32-avr) +LOAD linker stubs diff --git a/config/Configuration b/config/Configuration new file mode 100644 index 0000000..36d3759 --- /dev/null +++ b/config/Configuration @@ -0,0 +1,119 @@ +/************************************************************************/ +/* */ +/* Configuration - Xinu device configuration specification file */ +/* */ +/* This file becomes input to the config program, which generates */ +/* conf.h and conf.c */ +/* */ +/* Entries for a device specify the functions that handle each of the */ +/* high-level I/O operations as follows: */ +/* */ +/* -i init -o open -c close */ +/* -r read -w write -s seek */ +/* -g getc -p putc -n control */ +/* -intr int_hndlr -csr csr -irq irq */ +/* */ +/************************************************************************/ + +/* Type Declarations for both real- and pseudo- device types */ + +/* type of a null device */ +null: + on nothing + -i ionull -o ionull -c ionull + -r ionull -g ionull -p ionull + -w ionull -s ioerr + +/* type of a gpio device */ +/* RAFA +gpio: + on standard_gpio + -i gpioinit -o ionull -c ionull + -r gpioread -g ionull -p ionull + -w gpiowrite -s ioerr -n gpiocontrol + -intr gpiohandler +FIN DE RAFA */ + +/* type of a tty device */ +tty: + /* RAFA + on uart + -i ttyinit -o ionull -c ionull + -r ttyread -g ttygetc -p ttyputc + -w ttywrite -s ioerr -n ttycontrol + -intr ttyhandler + FIN DE RAFA */ + on uart + -i ionull -o ionull -c ionull + -r ionull -g ionull -p ionull + -w ionull -s ioerr -n ionull + -intr ionull + +/* type of ram disk */ +/* RAFA +ram: + on mem + -i raminit -o ramopen -c ramclose + -r ramread -g ioerr -p ioerr + -w ramwrite -s ioerr -n ioerr + -intr ionull +FIN DE RAFA */ + +/* type of namespace device */ +nam: + on top + -i naminit -o namopen -c ioerr + -r ioerr -g ioerr -p ioerr + -w ioerr -s ioerr -n ioerr + -intr ioerr + +/* RAFA +spi: + on standard_spi + -i spiinit -o ioerr -c ioerr + -r ioerr -g ioerr -p spiputc + -w ioerr -s ioerr -n ioerr + -intr ioerr +FIN DE RAFA */ + +%% + +/* Actual device declarations that each give the name of a device that */ +/* will be present in the system */ + + /* Define the console device to be a tty and specify CSR*/ + CONSOLE is tty on uart csr 0x40013800 -irq 53 + + /* Define the console device to be a tty and specify CSR*/ +/* RAFA GPIO0 is gpio on standard_gpio csr 0x40010800 -irq 99 */ + /* Define the console device to be a tty and specify CSR*/ +/* RAFA GPIO1 is gpio on standard_gpio csr 0x40010C00 -irq 99 */ + /* Define the console device to be a tty and specify CSR*/ +/* RAFA GPIO2 is gpio on standard_gpio csr 0x40011000 -irq 99 */ + /* Define the console device to be a tty and specify CSR*/ +/* RAFA GPIO3 is gpio on standard_gpio csr 0x40011400 -irq 99 */ + + /* Define a null device */ + NULLDEV is null on nothing + + /* Define a namespace device */ + NAMESPACE is nam on top + + /* Define a SPI device */ +/* RAFA SPI1 is spi on standard_spi */ + + /* Define a ram disk device */ +/* RAFA RAM0 is ram on mem */ + +%% + +/* Configuration and Size Constants */ + +#define NPROC 4 /* number of user processes */ +#define NSEM 4 /* number of semaphores */ +#define IRQBASE 32 /* base ivec for IRQ0 */ +#define IRQ_TIMER IRQ_HW5 /* timer IRQ is wired to hardware 5 */ +#define IRQ_ATH_MISC IRQ_HW4 /* Misc. IRQ is wired to hardware 4 */ +#define CLKFREQ 200000000 /* 200 MHz clock */ + +// #define LF_DISK_DEV RAM0 diff --git a/config/Configuration.orig b/config/Configuration.orig new file mode 100644 index 0000000..4096645 --- /dev/null +++ b/config/Configuration.orig @@ -0,0 +1,106 @@ +/************************************************************************/ +/* */ +/* Configuration - Xinu device configuration specification file */ +/* */ +/* This file becomes input to the config program, which generates */ +/* conf.h and conf.c */ +/* */ +/* Entries for a device specify the functions that handle each of the */ +/* high-level I/O operations as follows: */ +/* */ +/* -i init -o open -c close */ +/* -r read -w write -s seek */ +/* -g getc -p putc -n control */ +/* -intr int_hndlr -csr csr -irq irq */ +/* */ +/************************************************************************/ + +/* Type Declarations for both real- and pseudo- device types */ + +/* type of a null device */ +null: + on nothing + -i ionull -o ionull -c ionull + -r ionull -g ionull -p ionull + -w ionull -s ioerr + +/* type of a gpio device */ +gpio: + on standard_gpio + -i gpioinit -o ionull -c ionull + -r gpioread -g ionull -p ionull + -w gpiowrite -s ioerr -n gpiocontrol + -intr gpiohandler + +/* type of a tty device */ +tty: + on uart + -i ttyinit -o ionull -c ionull + -r ttyread -g ttygetc -p ttyputc + -w ttywrite -s ioerr -n ttycontrol + -intr ttyhandler + +/* type of ram disk */ +ram: + on mem + -i raminit -o ramopen -c ramclose + -r ramread -g ioerr -p ioerr + -w ramwrite -s ioerr -n ioerr + -intr ionull + +/* type of namespace device */ +nam: + on top + -i naminit -o namopen -c ioerr + -r ioerr -g ioerr -p ioerr + -w ioerr -s ioerr -n ioerr + -intr ioerr + +spi: + on standard_spi + -i spiinit -o ioerr -c ioerr + -r ioerr -g ioerr -p spiputc + -w ioerr -s ioerr -n ioerr + -intr ioerr + +%% + +/* Actual device declarations that each give the name of a device that */ +/* will be present in the system */ + + /* Define the console device to be a tty and specify CSR*/ + CONSOLE is tty on uart csr 0x40013800 -irq 53 + + /* Define the console device to be a tty and specify CSR*/ + GPIO0 is gpio on standard_gpio csr 0x40010800 -irq 99 + /* Define the console device to be a tty and specify CSR*/ + GPIO1 is gpio on standard_gpio csr 0x40010C00 -irq 99 + /* Define the console device to be a tty and specify CSR*/ + GPIO2 is gpio on standard_gpio csr 0x40011000 -irq 99 + /* Define the console device to be a tty and specify CSR*/ + GPIO3 is gpio on standard_gpio csr 0x40011400 -irq 99 + + /* Define a null device */ + NULLDEV is null on nothing + + /* Define a namespace device */ + NAMESPACE is nam on top + + /* Define a SPI device */ + SPI1 is spi on standard_spi + + /* Define a ram disk device */ + RAM0 is ram on mem + +%% + +/* Configuration and Size Constants */ + +#define NPROC 10 /* number of user processes */ +#define NSEM 10 /* number of semaphores */ +#define IRQBASE 32 /* base ivec for IRQ0 */ +#define IRQ_TIMER IRQ_HW5 /* timer IRQ is wired to hardware 5 */ +#define IRQ_ATH_MISC IRQ_HW4 /* Misc. IRQ is wired to hardware 4 */ +#define CLKFREQ 200000000 /* 200 MHz clock */ + +#define LF_DISK_DEV RAM0 diff --git a/config/DESCRIPTION b/config/DESCRIPTION new file mode 100644 index 0000000..4186fbb --- /dev/null +++ b/config/DESCRIPTION @@ -0,0 +1,111 @@ +This is the Xinu config program that allows one to specify a set of +device drivers. + +Input: the program reads specifications from an input file, usually + + Configuration + + +Output: the program produces two ouput files, usually + + conf.h - configuration constants and declarations + for device drivers and the device + switch table + + conf.c - initialization code for data strcutures + declared in conf.h + + +The input file consists of three sections, with %% used as a sparator +between sections: + +---------------------------------------------------------------------------- + + /* Comments can appear anywhere in the input file; use */ + /* the C style of slash-star ... star-slash. */ + /* The config program ignores whitespace and comments. */ + + + device type declarations + +%% + + device declarations + +%% + + Other constants added to conf.h (typically, #defines) + +---------------------------------------------------------------------------- + + +**************************** Type Declarations ***************************** + + +The type declaration section consists of a series of entries of the form: + + type_name: on hardware_name [options] + +where + + type_name a name for the type + : a required punctuation, usually appended onto the + type name + on a keyword + hardware_name any string used to allow a type name to have + two implementations + options multiple options can be specified, and each + consists of a flag and the name of a + driver function or hardware parameter + (the minus sign in front of a flag + can be omitted): + + -i initialization_function + -o open_function + -r read_function + -w write_function + -s seek_function + -c close_function + -g getc_function + -p putc_function + -n control_function + -intr interrupt_handler + -csr CSR address + -irq Interrupt request number + +Example: + + + eth: on quark_eth + -i ethinit -o ioerr -c ioerr + -r ethread -g ioerr -p ioerr + -w ethwrite -s ioerr -n ethcontrol + -intr ethdispatch + + +*************************** Device Declarations **************************** + + +The device declaration section consists of one entry per device in the form: + + device_name is type_name on hardware_name [options] + +where + + device_name a name for the device (by convention, Xinu + uses upper-case device names) + is a keyword + type_name the name of a type defined above + on a keyword + hardware_name must match one of the hardware names used with + when the type was defined + options the same as the options above -- any values used + on a device declaration override the + values defined for the type. Typically, + a type does not have specific hardware + parameters, so they must be filled in. + +Example: + + + ETHER is eth on quark_eth csr 0001770 -irq 0053 diff --git a/config/Makefile b/config/Makefile new file mode 100644 index 0000000..68a6a47 --- /dev/null +++ b/config/Makefile @@ -0,0 +1,41 @@ +# +# Make the Xinu configuration program +# + +COMPILER_ROOT = /usr/bin/ + +CC = ${COMPILER_ROOT}gcc +LEX = ${COMPILER_ROOT}flex +YACC = ${COMPILER_ROOT}bison -y # Flag enables yacc-compatible filenames +CFLAGS = +LFLAGS = -lfl + +# +# Name of the configuration program +# + +CONFIG = config + +all: conf.h conf.c + +${CONFIG}: lex.yy.c y.tab.c + $(CC) ${CFLAGS} -o $@ y.tab.c ${LFLAGS} + +lex.yy.c: config.l + $(LEX) config.l + +y.tab.c: config.y + $(YACC) config.y + +clean: + rm -f config lex.yy.c y.tab.c + +conf.h: config Configuration + ./config Configuration conf.c conf.h + +conf.c: config Configuration + ./config Configuration conf.c conf.h + +install: conf.h conf.c + cp -p conf.h ../include + cp -p conf.c ../system diff --git a/config/conf.c b/config/conf.c new file mode 100644 index 0000000..6d88315 --- /dev/null +++ b/config/conf.c @@ -0,0 +1,44 @@ +/* conf.c (GENERATED FILE; DO NOT EDIT) */ + +#include + + +extern devcall ioerr(void); +extern devcall ionull(void); + +/* Device independent I/O switch */ + +typedef unsigned int size_t; +#include +const struct dentry devtab[] PROGMEM = +{ +/** + * Format of entries is: + * dev-number, minor-number, dev-name, + * init, open, close, + * read, write, seek, + * getc, putc, control, + * dev-csr-address, intr-handler, irq + */ + +/* CONSOLE is tty */ + { 0, 0, "CONSOLE", + (void *)ionull, (void *)ionull, (void *)ionull, + (void *)ionull, (void *)ionull, (void *)ioerr, + (void *)ionull, (void *)ionull, (void *)ionull, + (void *)0x40013800, (void *)ionull, 53 }, + +/* NULLDEV is null */ + { 1, 0, "NULLDEV", + (void *)ionull, (void *)ionull, (void *)ionull, + (void *)ionull, (void *)ionull, (void *)ioerr, + (void *)ionull, (void *)ionull, (void *)ioerr, + (void *)0x0, (void *)ioerr, 0 }, + +/* NAMESPACE is nam */ + { 2, 0, "NAMESPACE", + (void *)naminit, (void *)namopen, (void *)ioerr, + (void *)ioerr, (void *)ioerr, (void *)ioerr, + (void *)ioerr, (void *)ioerr, (void *)ioerr, + (void *)0x0, (void *)ioerr, 0 } +}; diff --git a/config/conf.h b/config/conf.h new file mode 100644 index 0000000..0609764 --- /dev/null +++ b/config/conf.h @@ -0,0 +1,50 @@ +/* conf.h (GENERATED FILE; DO NOT EDIT) */ + +/* Device switch table declarations */ + +/* Device table entry */ +struct dentry { + int32 dvnum; + int32 dvminor; + char dvname[16]; + devcall (*dvinit) (struct dentry *); + devcall (*dvopen) (struct dentry *, char *, char *); + devcall (*dvclose)(struct dentry *); + devcall (*dvread) (struct dentry *, void *, uint32); + devcall (*dvwrite)(struct dentry *, void *, uint32); + devcall (*dvseek) (struct dentry *, int32); + devcall (*dvgetc) (struct dentry *); + devcall (*dvputc) (struct dentry *, char); + devcall (*dvcntl) (struct dentry *, int32, int32, int32); + void *dvcsr; + void (*dvintr)(void); + byte dvirq; +}; + +extern const struct dentry devtab[]; /* one entry per device */ + +/* Device name definitions */ + +#define CONSOLE 0 /* type tty */ +#define NULLDEV 1 /* type null */ +#define NAMESPACE 2 /* type nam */ + +/* Control block sizes */ + +#define Nnull 1 +#define Ntty 1 +#define Nnam 1 + +#define NDEVS 3 + + +/* Configuration and Size Constants */ + +#define NPROC 4 /* number of user processes */ +#define NSEM 4 /* number of semaphores */ +#define IRQBASE 32 /* base ivec for IRQ0 */ +#define IRQ_TIMER IRQ_HW5 /* timer IRQ is wired to hardware 5 */ +#define IRQ_ATH_MISC IRQ_HW4 /* Misc. IRQ is wired to hardware 4 */ +#define CLKFREQ 200000000 /* 200 MHz clock */ + +// #define LF_DISK_DEV RAM0 diff --git a/config/config.l b/config/config.l new file mode 100644 index 0000000..ba2f687 --- /dev/null +++ b/config/config.l @@ -0,0 +1,40 @@ +%{ +extern int linectr; +extern int brkcount; +int skipping; +%} +OCT 0[0-7]* +DEC [1-9][0-9]* +HEX 0x[0-9a-fA-F]+ +ID [a-z_A-Z][a-z_A-Z0-9]* +%% +"/*" { skipping = 1; } +"*/" { skipping = 0; } +"%%" { if (! skipping) + if (++brkcount >= 2) + { return 0; /* EOF */ } + else + { return DEFBRK; } } +":" { if (! skipping) return COLON; } +{OCT} { if (! skipping) return INTEGER; } +{DEC} { if (! skipping) return INTEGER; } +{HEX} { if (! skipping) return INTEGER; } +is { if (! skipping) return IS; } +on { if (! skipping) return ON; } +"=" ; +-?intr { if (! skipping) return INTR; } +-?csr { if (! skipping) return CSR; } +-?irq { if (! skipping) return IRQ; } +-?i { if (! skipping) return INIT; } +-?o { if (! skipping) return OPEN; } +-?c { if (! skipping) return CLOSE; } +-?r { if (! skipping) return READ; } +-?g { if (! skipping) return GETC; } +-?p { if (! skipping) return PUTC; } +-?w { if (! skipping) return WRITE; } +-?s { if (! skipping) return SEEK; } +-?n { if (! skipping) return CONTROL; } +[ \t]+ ; +"\n" { linectr++; } +{ID} { if (! skipping) return IDENT; } +. { if (! skipping) return yytext[0]; } diff --git a/config/config.y b/config/config.y new file mode 100644 index 0000000..1fd4c85 --- /dev/null +++ b/config/config.y @@ -0,0 +1,754 @@ +/* config.y - yacc input file for the Xinu config program */ + +/************************************************************************/ +/* */ +/* This file contains the yacc grammar and semantic functions */ +/* that read a Xinu Configuration file and generate output files */ +/* conf.h and conf.c that are then compiled along with the rest of */ +/* Xinu. */ +/* */ +/************************************************************************/ + +%token DEFBRK IFBRK COLON OCTAL INTEGER IDENT CSR IRQ INTR INIT OPEN + CLOSE READ WRITE SEEK CONTROL IS ON GETC PUTC +%{ +#include +#include +#include +#include + +extern char *yytext; +/* + Work-around for the type conflict that results from unmatched versions + of flex and bison (lex and yacc). The idea is to force the new flex + style so the output file (lex.yy.c) treats yyleng as an int (as was + done by oldest lex versions) instead of a size_t. We override the + new flex typedef of yy_size_t. +*/ +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef int yy_size_t; +#endif +/* End work-around */ +extern int yyleng; + + +/********************************************************************************/ +/* */ +/* Start of Definitions */ +/* */ +/********************************************************************************/ + +#define NIL (struct dev_ent *)0x00 + +#define CONFC "conf.c" /* Name of .c output */ +#define CONFH "conf.h" /* Name of .h output */ +#define CONFHREF "" /* How conf.h referenced */ +#define INFILE "Configuration" /* Name of input file */ +// RAFA #define MAXNAME 16 /* Max length of names */ +#define MAXNAME 16 /* Max length of names */ + +// RAFA #define NDEVS 250 /* Max devices */ +// RAFA #define NTYPES 250 /* Max device types */ +#define NDEVS 5 /* Max devices */ +#define NTYPES 5 /* Max device types */ + +int linectr = 1; + +FILE *confc; +FILE *confh; + +int brkcount = 0; /* Count of %% separators till now in */ + /* the input file */ +char *doing = "device type declarations"; + +struct dev_ent { /* Entry for a device or device type */ + char name[MAXNAME]; /* device name (unused in a type) */ + char tname[MAXNAME]; /* Type name */ + char ison[MAXNAME]; /* Name is "on" XXX */ + int tindex; /* Index in dtypes (unused in a type) */ + int csr; /* Control Status Register addr */ + int irq; /* interrupt request */ + char intr[MAXNAME]; /* interrupt function name */ + char init[MAXNAME]; /* init function name */ + char open[MAXNAME]; /* open function name */ + char close[MAXNAME]; /* close function name */ + char read[MAXNAME]; /* read function name */ + char write[MAXNAME]; /* write function name */ + char control[MAXNAME]; /* control function name */ + char seek[MAXNAME]; /* seek function name */ + char getc[MAXNAME]; /* getc function name */ + char putc[MAXNAME]; /* putc function name */ + int minor; /* In a device, the minor device */ + /* assigned to the device 0,1,... */ + /* in a type, the next minor number */ + /* to assign */ +}; +struct dev_ent dtypes[NTYPES];/* Table of all device types */ +int ntypes = 0; /* Number of device types found */ + +struct dev_ent devs[NDEVS]; /* Table of all devices */ +int ndevs = 0; /* Number of devices found */ + +char *devstab[] = { + "/* Device table entry */", + "struct\tdentry\t{", + "\tint32 dvnum;", + "\tint32 dvminor;", +// RAFA "\tchar *dvname;", + "\tchar dvname[16];", + "\tdevcall (*dvinit) (struct dentry *);", + "\tdevcall (*dvopen) (struct dentry *, char *, char *);", + "\tdevcall (*dvclose)(struct dentry *);", + "\tdevcall (*dvread) (struct dentry *, void *, uint32);", + "\tdevcall (*dvwrite)(struct dentry *, void *, uint32);", + "\tdevcall (*dvseek) (struct dentry *, int32);", + "\tdevcall (*dvgetc) (struct dentry *);", + "\tdevcall (*dvputc) (struct dentry *, char);", + "\tdevcall (*dvcntl) (struct dentry *, int32, int32, int32);", + "\tvoid *dvcsr;", + "\tvoid (*dvintr)(void);", + "\tbyte dvirq;", + "};\n", + "extern const struct dentry devtab[]; /* one entry per device */", + NULL +}; + +char saveattrid[MAXNAME]; /* Holds the IDENT from an attribute */ + +/********************************************************************************/ +/* */ +/* Function prototypes */ +/* */ +/********************************************************************************/ + +void addattr(int, int); +int addton(char *); +int config_atoi(char *, int); +void devisid(char *); +void devonid(char *); +void getattrid(char *); +void newdev(char *); +int newtype(char *); +void yyerror(char *); + + +%} + +%% +/************************************************************************/ +/* */ +/* Grammar rules for the entire Configuration */ +/* */ +/************************************************************************/ + +configuration: devtypes DEFBRK devices +; + +/************************************************************************/ +/* */ +/* Grammar rules for device types */ +/* */ +/************************************************************************/ + +devtypes: /* nothing */ { doing = "device definitions"; } + | devtypes devtype +; + +devtype: tname COLON dev_tlist +; + +tname: IDENT { $$ = newtype(yytext); } +; + +dev_tlist: theader attr_list + | dev_tlist theader attr_list +; + +theader: ON tonid { $$ = $2; } +; + +tonid: IDENT { $$ = addton(yytext); } +; + +attr_list: /* nothing */ + | attr_list attr +; + +attr: CSR number { addattr(CSR, $2); } + | IRQ number { addattr(IRQ, $2); } + | INTR id { addattr(INTR, 0); } + | OPEN id { addattr(OPEN, 0); } + | CLOSE id { addattr(CLOSE, 0); } + | INIT id { addattr(INIT, 0); } + | GETC id { addattr(GETC, 0); } + | PUTC id { addattr(PUTC, 0); } + | READ id { addattr(READ, 0); } + | WRITE id { addattr(WRITE, 0); } + | SEEK id { addattr(SEEK, 0); } + | CONTROL id { addattr(CONTROL, 0); } +; + +id: IDENT { $$ = 0; getattrid(yytext); } +; + +number: INTEGER { $$ = config_atoi(yytext, yyleng); } +; + + +/************************************************************************/ +/* */ +/* Grammar rules for device definitions */ +/* */ +/************************************************************************/ + +devices: /* nothing */ { doing = "interface types"; } + | devices device +; + +device: dheader attr_list +; + +dheader: dname devis devon +; + +dname: IDENT { newdev(yytext); } +; + +devis: IS devisid +; + +devisid: IDENT { devisid(yytext); } +; + +devon: ON devonid +; + +devonid: IDENT { devonid(yytext); } +; + +%% + +#include "lex.yy.c" + + +/************************************************************************/ +/* */ +/* main - main program: parse arguments, invoke the parser, and */ +/* write the conf.h and conf.c files */ +/* */ +/************************************************************************/ + + +int main(int argc, char **argv) { + int n, i, j, l, fcount; + struct dev_ent *s; + int verbose = 0; + char *p; + int c; + + if ( argc > 1 && (strncmp("-v", argv[1], 2) == 0) ) { + argc--; + argv++; + verbose++; + } + + if ( argc > 4 ) { + fprintf(stderr, "use: config [-v] [input_file] [conf.c] [conf.h]\n"); + exit(1); + } + + if (verbose) { printf("Opening input file...\n"); } + + if (argc >= 2) { + if (freopen(argv[1], "r", stdin) == NULL) { + fprintf(stderr, "Can't open %s\n", argv[1]); + exit(1); + } + } + else { /* try to open Configuration file */ + if (freopen(INFILE, "r", stdin) == NULL) { + fprintf(stderr, "Can't open %s\n", INFILE); + exit(1); + } + } + + /****************************************************************/ + /* */ + /* Parse the Configuration file */ + /* */ + /****************************************************************/ + + + if (verbose) { printf("Parsing configuration specs...\n"); } + + if ( (n = yyparse()) != 0 ) { exit(n); } + + /* Open conf.h and conf.c for writing */ + + if (verbose) { printf("Opening output files...\n"); } + + if (argc >= 3) { + if ( (confc = fopen(argv[2],"w") ) == NULL) { + fprintf(stderr, "Can't write on %s\n", argv[2]); + exit(1); + } + } + else { /* try to open conf.c file */ + if ( (confc = fopen(CONFC,"w") ) == NULL) { + fprintf(stderr, "Can't write on %s\n", CONFC); + exit(1); + } + } + + if (argc >= 4) { + if ( (confh = fopen(argv[3],"w") ) == NULL) { + fprintf(stderr, "Can't write on %s\n", argv[3]); + exit(1); + } + } + else { /* try to open conf.h file */ + if ( (confh = fopen(CONFH,"w") ) == NULL) { + fprintf(stderr, "Can't write on %s\n", CONFH); + exit(1); + } + } + + /****************************************************************/ + /* */ + /* produce conf.h */ + /* */ + /****************************************************************/ + + + fprintf(confh, "/* conf.h (GENERATED FILE; DO NOT EDIT) */\n\n"); + + if (verbose) { printf("Writing output...\n"); } + + fprintf(confh, "/* Device switch table declarations */\n\n"); + + for (i = 0; (p = devstab[i]) != NULL; i++) { + fprintf(confh, "%s\n", p); + } + + fprintf(confh, "\n"); + + /* write device declarations and definitions */ + + fprintf(confh, "/* Device name definitions */\n\n"); + for (i = 0; iname, i, s->tname); + } + fprintf(confh, "\n"); + + /* write count of device types */ + + fprintf(confh, "/* Control block sizes */\n\n"); + for (i = 0; i < ntypes; i++) { + s = &dtypes[i]; + if (s->minor > 0) { + fprintf(confh, "#define\tN%s\t%d\n", + s->tname, s->minor); + } + } + + fprintf(confh, "\n"); + + if (ndevs > 0) { fprintf(confh, "#define NDEVS %d\n", ndevs); } + + /* Copy definitions to output */ + + if (brkcount >= 4 && verbose) { + printf("Copying definitions to %s...\n", CONFH); + } + + if (brkcount >= 2) { + while ( (c = input()) > 0) { /* lex input function */ + putc(c, confh); + } + } + fclose(confh); + + + /****************************************************************/ + /* */ + /* produce conf.c */ + /* */ + /****************************************************************/ + + + fprintf(confc, "/* conf.c (GENERATED FILE; DO NOT EDIT) */\n\n"); + fprintf(confc, "#include \n\n"); + fprintf(confc, "\n"); + + fprintf(confc, "extern\tdevcall\tioerr(void);\n"); + fprintf(confc, "extern\tdevcall\tionull(void);\n\n"); + + /* produce devtab (giant I/O switch table) */ + fprintf(confc, "/* Device independent I/O switch */\n\n"); + if (ndevs > 0) + { + // RAFA fprintf(confc, "const struct dentry devtab[NDEVS] =\n{\n"); + fprintf(confc, "typedef unsigned int size_t;\n"); + fprintf(confc, "#include \n"); + fprintf(confc, "const struct dentry devtab[] PROGMEM =\n{\n"); + // RAFA fprintf(confc, "const struct dentry devtab[] PROGMEM =\n{\n"); + fprintf(confc, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n", + "/**", + " * Format of entries is:", + " * dev-number, minor-number, dev-name,", + " * init, open, close,", + " * read, write, seek,", + " * getc, putc, control,", + " * dev-csr-address, intr-handler, irq", + " */"); + } + + for (i=0; iname, s->tname); + fprintf(confc, "\t{ %d, %d, \"%s\",\n", i, s->minor, s->name); + fprintf(confc, "\t (void *)%s, (void *)%s, (void *)%s,\n", + s->init, s->open, s->close); + fprintf(confc, "\t (void *)%s, (void *)%s, (void *)%s,\n", + s->read, s->write, s->seek); + fprintf(confc, "\t (void *)%s, (void *)%s, (void *)%s,\n", + s->getc, s->putc, s->control); + fprintf(confc, "\t (void *)0x%x, (void *)%s, %d }", + s->csr, s->intr, s->irq); + if (i< ndevs-1) { + fprintf(confc, ",\n\n"); + } else { + fprintf(confc, "\n};"); + } + } + + /* we must guarantee conf.c written later than conf.h for make */ + fprintf(confc, "\n"); + fclose(confc); + + /* finish up and write report for user if requested */ + if (verbose) { + printf("Configuration complete. Number of devs=%d:\n", ndevs); + for (i=0; iname, s->ison); + printf(" csr=0x%04x, irq=0x%04x, minor=%d\n", + s->csr, s->irq, s->minor); + } + } +} + +/************************************************************************/ +/* */ +/* addattr - add a new attribute spec to current type/device description*/ +/* tok: token type (attribute type) */ +/* val: symbol number of value */ +/* */ +/************************************************************************/ + +void addattr(int tok, int val) { + struct dev_ent *s; + char *c; + + if (brkcount == 0) { + /* Doing types */ + s = &dtypes[ntypes-1]; + } else { + /* Doing devices */ + s = &devs[ndevs-1]; + } + + switch (tok) { + case CSR: s->csr = val; break; + case IRQ: s->irq = val; break; + case INTR: strcpy(s->intr, saveattrid); break; + case READ: strcpy(s->read, saveattrid); break; + case WRITE: strcpy(s->write,saveattrid); break; + case GETC: strcpy(s->getc, saveattrid); break; + case PUTC: strcpy(s->putc, saveattrid); break; + case OPEN: strcpy(s->open, saveattrid); break; + case CLOSE: strcpy(s->close,saveattrid); break; + case INIT: strcpy(s->init, saveattrid); break; + case SEEK: strcpy(s->seek, saveattrid); break; + case CONTROL: strcpy(s->control,saveattrid); break; + default: fprintf(stderr, "Internal error 1\n"); + } +} + + +/************************************************************************/ +/* */ +/* addton -- add an "on XXX" to the current type */ +/* */ +/************************************************************************/ + +int addton(char *tonid) { + int currtype; /* The current type */ + + if (strlen(tonid) >= MAXNAME) { + fprintf(stderr,"string %s is too long on line %d\n", + tonid, linectr); + exit(1); + } + currtype = ntypes - 1; + strcpy(dtypes[currtype].ison, tonid); + + return currtype; +} + + +/************************************************************************/ +/* */ +/* config_atoi - convert an ascii string of text to an integer, */ +/* honoring octal, decimal, and hex */ +/* */ +/************************************************************************/ + +int config_atoi(char *p, int len) { + int base, rv; + + if (*p == '0') + { + ++p; + --len; + if (*p == 'x' || *p == 'X') + { + ++p; --len; /* skip 'x' */ + base = 16; + } + else + { + base = 8; + } + } + else + { + base = 10; + } + + rv = 0; + for (; len > 0; ++p, --len) + { + rv *= base; + if (isdigit(*p)) { rv += *p - '0'; } + else if (isupper(*p)) { rv += *p - 'A' + 10; } + else { rv += *p - 'a' + 10; } + } + + return rv; +} + +/************************************************************************/ +/* */ +/* devisid -- add an "is XXX" to the current device */ +/* */ +/************************************************************************/ + +void devisid(char *tname) { + int currdev; /* The current device */ + int i; + + if (strlen(tname) >= MAXNAME) { + fprintf(stderr,"string %s is too long on line %d\n", + tname, linectr); + exit(1); + } + /* Verify the type exists */ + + for (i=0; i= ntypes) { + fprintf(stderr, "Illegal type name %s on line %d\n", + tname, linectr); + exit(1); + } + currdev = ndevs - 1; + strcpy(devs[currdev].tname, tname); + + return; +} + + +/************************************************************************/ +/* */ +/* devonid -- add an "on XXX" to the current device, lookup the type, */ +/* and copy attributes into the device from the type */ +/* */ +/************************************************************************/ + +void devonid(char *onname) { + int currdev; /* The current device */ + int i; + struct dev_ent *dptr; /* Pointer to current device */ + struct dev_ent *tptr; /* Pointer to a type */ + char tmp[MAXNAME]; /* Holds the device name during */ + /* copy */ + + if (strlen(onname) >= MAXNAME) { + fprintf(stderr,"string %s is too long on line %d\n", + onname, linectr); + exit(1); + } + if (ndevs <=0) { + fprintf(stderr,"Internal error 3\n"); + exit(1); + } + currdev = ndevs - 1; + dptr = &devs[currdev]; + + strcpy(dptr->ison, onname); + + /* Lookup the device type */ + + for (i=0; itname,tptr->tname) == 0 ) && + (strcmp(dptr->ison, tptr->ison) == 0 ) ){ + + /* The specified type matches the ith entry, so */ + /* set all attributes equal to the ones in the */ + /* type definition. */ + + strcpy(tmp, dptr->name); + bcopy (tptr, dptr, sizeof(struct dev_ent)); + /* Increment the minor device number for the */ + /* next time the type is used */ + tptr->minor++; + strcpy(dptr->name, tmp); + return; + } + } + + fprintf(stderr, "Ileagal device specification on line %d\n", linectr); + exit(1); +} + + +/************************************************************************/ +/* */ +/* getattrid -- pick up and save the attribute string from an id */ +/* */ +/************************************************************************/ + +void getattrid(char *str) { + + if (strlen(str) >= MAXNAME) { + fprintf(stderr,"atribute string %s is too long on line %d\n", + str, linectr); + exit(1); + } + strcpy(saveattrid, str); + return; +} + + +/************************************************************************/ +/* */ +/* newdev -- allocate an entry in devs, initialize, and fill in the name*/ +/* */ +/************************************************************************/ + +void newdev(char *name) { + + struct dev_ent *dptr; /* Ptr. to an entry in devs */ + int i; + + if (ndevs >= NDEVS) { + fprintf(stderr,"Too many devices on line %d", linectr); + exit(1); + } + if (strlen(name) >= MAXNAME) { + fprintf(stderr,"Device name %s is too long on line %d\n", + name, linectr); + exit(1); + } + + /* Verify that the device name is unique */ + + for (i=0; iname, name); + ndevs++; + return; +} + + +/************************************************************************/ +/* */ +/* newtype -- allocate an entry in the type array and fill in the name */ +/* */ +/************************************************************************/ + +int newtype(char *name) { + + struct dev_ent *dptr; /* Ptr. to an entry in dtypes */ + int i; /* Index into the type table */ + + if (ntypes >= NTYPES) { + fprintf(stderr,"Too many types on line %d", linectr); + exit(1); + } + if (strlen(name) >= MAXNAME) { + fprintf(stderr,"Type name %s is too long on line %d\n", + name, linectr); + exit(1); + } + + /* Verify that the type name is unique */ + + for (i=0; itname, name); + strncpy(dptr->intr, "ioerr", 5); + strncpy(dptr->init, "ioerr", 5); + strncpy(dptr->open, "ioerr", 5); + strncpy(dptr->close, "ioerr", 5); + strncpy(dptr->read, "ioerr", 5); + strncpy(dptr->write, "ioerr", 5); + strncpy(dptr->control, "ioerr", 5); + strncpy(dptr->seek, "ioerr", 5); + strncpy(dptr->getc, "ioerr", 5); + strncpy(dptr->putc, "ioerr", 5); + + return ntypes++; +} + + +/************************************************************************/ +/* */ +/* yyerror - print an error message with the line number */ +/* */ +/************************************************************************/ + +void yyerror(char *s) { + + fprintf(stderr, "Syntax error in %s on line %d\n", doing, linectr); +} diff --git a/device/eth/ethcontrol.c b/device/eth/ethcontrol.c new file mode 100644 index 0000000..2de1873 --- /dev/null +++ b/device/eth/ethcontrol.c @@ -0,0 +1,35 @@ +/* ethcontrol.c - ethcontrol */ + +#include + +/*------------------------------------------------------------------------ + * ethcontrol - implement control function for a quark ethernet device + *------------------------------------------------------------------------ + */ +devcall ethcontrol ( + struct dentry *devptr, /* entry in device switch table */ + int32 func, /* control function */ + int32 arg1, /* argument 1, if needed */ + int32 arg2 /* argument 2, if needed */ + ) +{ + struct ethcblk *ethptr; /* Ethertab entry pointer */ + int32 retval = OK; /* Return value of cntl function*/ + + ethptr = ðertab[devptr->dvminor]; + + switch (func) { + + /* Get MAC address */ + + case ETH_CTRL_GET_MAC: + memcpy((byte *)arg1, ethptr->devAddress, + ETH_ADDR_LEN); + break; + + default: + return SYSERR; + } + + return retval; +} diff --git a/device/eth/ethhandler.c b/device/eth/ethhandler.c new file mode 100644 index 0000000..c0d521a --- /dev/null +++ b/device/eth/ethhandler.c @@ -0,0 +1,123 @@ +/* ethhandler.c - ethhandler */ + +#include + +/*------------------------------------------------------------------------ + * ethhandler - TI AM335X Ethernet Interrupt Handler + *------------------------------------------------------------------------ + */ +interrupt ethhandler ( + uint32 xnum /* IRQ number */ + ) +{ + struct eth_a_csreg *csrptr; /* Ethernet CSR pointer */ + struct eth_a_tx_desc *tdescptr; /* Tx desc pointer */ + struct eth_a_rx_desc *rdescptr; /* Rx desc pointer */ + struct ethcblk *ethptr = ðertab[0]; /* Ethernet ctl blk ptr */ + + csrptr = (struct eth_a_csreg *)ethptr->csr; + + if(xnum == ETH_AM335X_TXINT) { /* Transmit interrupt */ + + /* Get pointer to first desc in queue */ + + tdescptr = (struct eth_a_tx_desc *)ethptr->txRing + + ethptr->txHead; + + /* Defer scheduling until all descs are processed */ + + resched_cntl(DEFER_START); + + while(semcount(ethptr->osem) < (int32)ethptr->txRingSize) { + + /* If desc owned by DMA, check if we need to */ + /* Restart the transmission */ + + if(tdescptr->stat & ETH_AM335X_TDS_OWN) { + if(csrptr->stateram->tx_hdp[0] == 0) { + csrptr->stateram->tx_hdp[0] = + (uint32)tdescptr; + } + break; + } + + /* Acknowledge the interrupt */ + + csrptr->stateram->tx_cp[0] = (uint32)tdescptr; + + /* Increment the head index of the queue */ + /* And go to the next descriptor in queue */ + + ethptr->txHead++; + tdescptr++; + if(ethptr->txHead >= ethptr->txRingSize) { + ethptr->txHead = 0; + tdescptr = (struct eth_a_tx_desc *) + ethptr->txRing; + } + + /* Signal the output semaphore */ + + signal(ethptr->osem); + } + + /* Acknowledge the transmit interrupt */ + + csrptr->cpdma->eoi_vector = 0x2; + + /* Resume rescheduling */ + + resched_cntl(DEFER_STOP); + } + else if(xnum == ETH_AM335X_RXINT) { /* Receive interrupt */ + + /* Get the pointer to last desc in the queue */ + + rdescptr = (struct eth_a_rx_desc *)ethptr->rxRing + + ethptr->rxTail; + + /* Defer scheduling until all descriptors are processed */ + + resched_cntl(DEFER_START); + + while(semcount(ethptr->isem) < (int32)ethptr->rxRingSize) { + + /* Check if we need to restart the DMA */ + + if(rdescptr->stat & ETH_AM335X_RDS_OWN) { + if(csrptr->stateram->rx_hdp[0] == 0) { + csrptr->stateram->rx_hdp[0] = + (uint32)rdescptr; + } + break; + } + + /* Acknowledge the interrupt */ + + csrptr->stateram->rx_cp[0] = (uint32)rdescptr; + + /* Increment the tail index of the queue */ + /* And go to the next descriptor in the queue */ + + ethptr->rxTail++; + rdescptr++; + if(ethptr->rxTail >= ethptr->rxRingSize) { + ethptr->rxTail = 0; + rdescptr = (struct eth_a_rx_desc *) + ethptr->rxRing; + } + + /* Signal the input semaphore */ + + signal(ethptr->isem); + } + + /* Acknowledge the receive interrupt */ + + csrptr->cpdma->eoi_vector = 0x1; + + /* Resume rescheduling */ + + resched_cntl(DEFER_STOP); + } +} diff --git a/device/eth/ethinit.c b/device/eth/ethinit.c new file mode 100755 index 0000000..4f73750 --- /dev/null +++ b/device/eth/ethinit.c @@ -0,0 +1,403 @@ +/* ethinit.c - ethinit, eth_phy_read, eth_phy_write */ + +#include + +struct eth_a_csreg eth_a_regs; + +struct ethcblk ethertab[1]; + +/*----------------------------------------------------------------------- + * eth_phy_read - read a PHY register + *----------------------------------------------------------------------- + */ +int32 eth_phy_read ( + volatile struct eth_a_mdio *mdio,/* MDIO CSR pointer */ + byte regadr, /* PHY Register number */ + byte phyadr, /* PHY address */ + uint32 *value /* Pointer to value */ + ) +{ + + /* Ethernet PHY has only 32 registers */ + + if(regadr > 31) { + return SYSERR; + } + + /* Only 32 possible PHY addresses */ + + if(phyadr > 31) { + return SYSERR; + } + + /* Wait for the previous access to complete */ + + while( (mdio->useraccess0 & ETH_AM335X_MDIOUA_GO) != 0 ); + + /* Start the access */ + + mdio->useraccess0 = (ETH_AM335X_MDIOUA_GO) | + (regadr << 21) | + (phyadr << 16); + + /* Wait until the access is complete */ + + while( (mdio->useraccess0 & ETH_AM335X_MDIOUA_GO) != 0 ); + + /* Check if the access was successful */ + + if( (mdio->useraccess0 & ETH_AM335X_MDIOUA_ACK) == 0 ) { + return SYSERR; + } + + /* Copy the value read */ + + (*value) = mdio->useraccess0 & ETH_AM335X_MDIOUA_DM; + + return OK; +} + +/*----------------------------------------------------------------------- + * eth_phy_write - write a PHY register + *----------------------------------------------------------------------- + */ +int32 eth_phy_write ( + volatile struct eth_a_mdio *mdio, /* MDIO CSR pointer */ + byte regadr, /* PHY register number */ + byte phyadr, /* PHY address */ + uint32 value /* Value to be written */ + ) +{ + + /* There are only 32 PHY registers */ + + if(regadr > 31) { + return SYSERR; + } + + /* There are only 32 possible PHY addresses */ + + if(phyadr > 31) { + return SYSERR; + } + + /* Wait for the previous access to complete */ + + while( (mdio->useraccess0 & ETH_AM335X_MDIOUA_GO) != 0); + + /* Start the access */ + + mdio->useraccess0 = ETH_AM335X_MDIOUA_GO | + ETH_AM335X_MDIOUA_WR | + (regadr << 21) | + (phyadr << 16) | + (value & 0xffff); + + /* Wait for the access to complete */ + + while( (mdio->useraccess0 & ETH_AM335X_MDIOUA_GO) != 0); + + return OK; +} + +/*----------------------------------------------------------------------- + * eth_phy_reset - Reset an Ethernet PHY + *----------------------------------------------------------------------- + */ +int32 eth_phy_reset ( + volatile struct eth_a_mdio *mdio, /* MDIO CSR pointer */ + byte phyadr /* PHY Address */ + ) +{ + uint32 phyreg; /* Variable to hold ETH PHY register value */ + int32 retries;/* Number of retries */ + int32 retval; /* Return value of functions called here */ + + /* Read the PHY Control Register */ + + retval = eth_phy_read(mdio, ETH_PHY_CTLREG, phyadr, &phyreg); + if(retval == SYSERR) { + return SYSERR; + } + + /* Set the Reset bit and write the register */ + + phyreg |= ETH_PHY_CTLREG_RESET; + eth_phy_write(mdio, ETH_PHY_CTLREG, phyadr, phyreg); + + /* Check if Reset operation is complete */ + + for(retries = 0; retries < 10; retries++) { + if(eth_phy_read(mdio, ETH_PHY_CTLREG, phyadr, &phyreg) == SYSERR) { + return SYSERR; + } + if((phyreg & ETH_PHY_CTLREG_RESET) == 0) { + break; + } + else { + retries++; + DELAY(ETH_AM335X_INIT_DELAY); + continue; + } + } + if(retries >= 3) { + return SYSERR; + } + + /* Check if the Link is established */ + + for(retries = 0; retries < 10; retries++) { + if(eth_phy_read(mdio, ETH_PHY_STATREG, phyadr, &phyreg) == SYSERR) { + return SYSERR; + } + if(phyreg & ETH_PHY_STATREG_LINK) { + break; + } + else { + retries++; + DELAY(ETH_AM335X_INIT_DELAY); + continue; + } + } + if(retries >= 3) { + return SYSERR; + } + + return OK; +} + +/*----------------------------------------------------------------------- + * ethinit - initialize the TI AM335X ethernet hardware + *----------------------------------------------------------------------- + */ +int32 ethinit ( + struct dentry *devptr + ) +{ + struct ethcblk *ethptr; /* Ethernet control blk pointer */ + struct eth_a_tx_desc *tdescptr;/* Tx descriptor pointer */ + struct eth_a_rx_desc *rdescptr;/* Rx descriptor pointer */ + struct netpacket *pktptr; /* Packet pointer */ + struct eth_a_csreg *csrptr; /* Ethernet CSR pointer */ + uint32 phyreg; /* Variable to store PHY reg val*/ + int32 retval; /* Return value */ + int32 i; /* Index variable */ + + /* Get the Ethernet control block address */ + /* from the device table entry */ + + ethptr = ðertab[devptr->dvminor]; + + /* Store the address of CSRs in the Ethernet control block */ + + csrptr = ð_a_regs; + ethptr->csr = csrptr; + + /* Initialize the addresses of all the submodules */ + + csrptr->ale = (struct eth_a_ale *)ETH_AM335X_ALE_ADDR; + csrptr->cpdma = (struct eth_a_cpdma *)ETH_AM335X_CPDMA_ADDR; + csrptr->sl = (struct eth_a_sl *)ETH_AM335X_SL1_ADDR; + csrptr->stateram = (struct eth_a_stateram *) + ETH_AM335X_STATERAM_ADDR; + csrptr->ss = (struct eth_a_ss *)ETH_AM335X_SS_ADDR; + csrptr->wr = (struct eth_a_wr *)ETH_AM335X_WR_ADDR; + csrptr->mdio = (struct eth_a_mdio *)ETH_AM335X_MDIO_ADDR; + + /* Reset all the submodules */ + + csrptr->cpdma->reset = 1; + while(csrptr->cpdma->reset == 1); + + csrptr->sl->reset = 1; + while(csrptr->sl->reset == 1); + + csrptr->wr->reset = 1; + while(csrptr->wr->reset == 1) ; + + csrptr->ss->reset = 1; + while(csrptr->ss->reset == 1) ; + + /* Enable MDIO */ + + csrptr->mdio->ctrl |= ETH_AM335X_MDIOCTL_EN; + + /* Reset the PHY */ + + retval = eth_phy_reset(csrptr->mdio, 0); + if(retval == SYSERR) { + kprintf("Cannot reset Ethernet PHY\n"); + return SYSERR; + } + + retval = eth_phy_read(csrptr->mdio, ETH_PHY_CTLREG, 0, &phyreg); + if(retval == SYSERR) { + return SYSERR; + } + + if( (phyreg & ETH_PHY_CTLREG_SM) == ETH_PHY_10M ) { + kprintf("Ethernet Link is Up. Speed is 10Mbps\n"); + } + else if( (phyreg & ETH_PHY_CTLREG_SM) == ETH_PHY_100M ) { + kprintf("Ethernet Link is Up. Speed is 100Mbps\n"); + } + else if( (phyreg & ETH_PHY_CTLREG_SM) == ETH_PHY_1000M ) { + kprintf("Ethernet Link is Up. Speed is 1000Mbps\n"); + } + else { + return SYSERR; + } + + if(phyreg & ETH_PHY_CTLREG_FD) { + kprintf("Link is Full Duplex\n"); + csrptr->sl->macctrl |= ETH_AM335X_SLCTL_FD; + } + else { + kprintf("Link is Half Duplex\n"); + } + + /* Read the device MAC address */ + for(i = 0; i < 2; i++) { + ethptr->devAddress[4+i] = *((byte *)(0x44e10630+i)); + } + for(i = 0; i < 4; i++) { + ethptr->devAddress[i] = *((byte *)(0x44e10634+i)); + } + + kprintf("MAC Address is: "); + for(i = 0; i < 5; i++) { + kprintf("%02X:", ethptr->devAddress[i]); + } + kprintf("%02X\n", ethptr->devAddress[5]); + + /* Initialize the rx ring size field */ + ethptr->rxRingSize = ETH_AM335X_RX_RING_SIZE; + + /* Allocate memory for the rx ring */ + ethptr->rxRing = (void*)getmem(sizeof(struct eth_a_rx_desc)* + ethptr->rxRingSize); + if((int32)ethptr->rxRing == SYSERR) { + return SYSERR; + } + + /* Zero out the rx ring */ + memset((char*)ethptr->rxRing, NULLCH, + sizeof(struct eth_a_rx_desc)*ethptr->rxRingSize); + + /* Allocate memory for rx buffers */ + ethptr->rxBufs = (void*)getmem(ETH_BUF_SIZE * + ethptr->rxRingSize); + if((int32)ethptr->rxBufs == SYSERR) { + return SYSERR; + } + + /* Zero out the rx buffers */ + memset((char *)ethptr->rxBufs, NULLCH, ETH_BUF_SIZE * + ethptr->rxRingSize); + + /* Initialize the rx ring */ + + rdescptr = (struct eth_a_rx_desc *)ethptr->rxRing; + pktptr = (struct netpacket *)ethptr->rxBufs; + + for(i = 0; i < ethptr->rxRingSize; i++) { + rdescptr->next = rdescptr + 1; + rdescptr->buffer = (uint32)pktptr->net_ethdst; + rdescptr->buflen = ETH_BUF_SIZE; + rdescptr->bufoff = 0; + rdescptr->stat = ETH_AM335X_RDS_OWN; + rdescptr++; + pktptr++; + } + (--rdescptr)->next = NULL; + + ethptr->rxHead = 0; + ethptr->rxTail = 0; + ethptr->isem = semcreate(0); + if((int32)ethptr->isem == SYSERR) { + return SYSERR; + } + + /* initialize the tx ring size */ + ethptr->txRingSize = ETH_AM335X_TX_RING_SIZE; + + /* Allocate memory for tx ring */ + ethptr->txRing = (void*)getmem(sizeof(struct eth_a_tx_desc)* + ethptr->txRingSize); + if((int32)ethptr->txRing == SYSERR) { + return SYSERR; + } + + /* Zero out the tx ring */ + memset((char*)ethptr->txRing, NULLCH, + sizeof(struct eth_a_tx_desc)*ethptr->txRingSize); + + /* Allocate memory for tx buffers */ + ethptr->txBufs = (void*)getmem(ETH_BUF_SIZE * + ethptr->txRingSize); + if((int32)ethptr->txBufs == SYSERR) { + return SYSERR; + } + + /* Zero out the tx buffers */ + memset((char*)ethptr->txBufs, NULLCH, ETH_BUF_SIZE * + ethptr->txRingSize); + + /* Initialize the tx ring */ + + tdescptr = (struct eth_a_tx_desc *)ethptr->txRing; + pktptr = (struct netpacket *)ethptr->txBufs; + + for(i = 0; i < ethptr->txRingSize; i++) { + tdescptr->next = NULL; + tdescptr->buffer = (uint32)pktptr->net_ethdst; + tdescptr->buflen = ETH_BUF_SIZE; + tdescptr->bufoff = 0; + tdescptr->stat = (ETH_AM335X_TDS_SOP | + ETH_AM335X_TDS_EOP | + ETH_AM335X_TDS_DIR | + ETH_AM335X_TDS_P1); + tdescptr++; + pktptr++; + } + + ethptr->txHead = 0; + ethptr->txTail = 0; + ethptr->osem = semcreate(ethptr->txRingSize); + if((int32)ethptr->osem == SYSERR) { + return SYSERR; + } + + /* Enable the ALE and put it into bypass mode */ + csrptr->ale->ctrl = (ETH_AM335X_ALECTL_EN | + ETH_AM335X_ALECTL_BY); + + /* Put the ports 0, 1 in forwarding state */ + csrptr->ale->portctl[0] = ETH_AM335X_ALEPCTL_FWD; + csrptr->ale->portctl[1] = ETH_AM335X_ALEPCTL_FWD; + + /* Start the rx and tx processes in DMA */ + csrptr->cpdma->tx_ctrl = 1; + csrptr->cpdma->rx_ctrl = 1; + + /* Initialize the head desc pointers for tx and rx */ + csrptr->stateram->tx_hdp[0] = 0; + csrptr->stateram->rx_hdp[0] = (uint32)ethptr->rxRing; + + /* Enable Rx and Tx in MAC */ + csrptr->sl->macctrl |= ETH_AM335X_SLCTL_EN; + + /* Set interrupt vectors */ + set_evec(ETH_AM335X_TXINT, (uint32)devptr->dvintr); + set_evec(ETH_AM335X_RXINT, (uint32)devptr->dvintr); + + /* Enable the CPDMA interrupts */ + csrptr->cpdma->tx_intmask_set = 0x1; + csrptr->cpdma->rx_intmask_set = 0x1; + + /* Route the interrupts to core 0 */ + csrptr->wr->c0_tx_en = 0x1; + csrptr->wr->c0_rx_en = 0x1; + + return OK; +} diff --git a/device/eth/ethread.c b/device/eth/ethread.c new file mode 100755 index 0000000..147ca17 --- /dev/null +++ b/device/eth/ethread.c @@ -0,0 +1,69 @@ +/* ethread.c - ethread */ + +#include + +/*------------------------------------------------------------------------ + * ethread - read an incoming packet on TI AM335X Ethernet + *------------------------------------------------------------------------ + */ +int32 ethread ( + struct dentry *devptr, + void *buf, + uint32 count + ) +{ + struct ethcblk *ethptr; /* Ethernet ctl blk ptr */ + struct eth_a_csreg *csrptr; /* Ethernet CSR pointer */ + struct eth_a_rx_desc *rdescptr;/* Rx Desc. pointer */ + struct eth_a_rx_desc *prev; /* Prev Rx desc pointer */ + uint32 retval; /* Num of bytes returned*/ + + ethptr = ðertab[devptr->dvminor]; + + /* Get the pointer to Ethernet CSR */ + csrptr = (struct eth_a_csreg *)ethptr->csr; + + /* Wait for a packet */ + wait(ethptr->isem); + + /* Get pointer to the descriptor */ + rdescptr = (struct eth_a_rx_desc *)ethptr->rxRing + + ethptr->rxHead; + + /* Read the packet length */ + retval = rdescptr->packlen; + if(retval > count) { + retval = count; + } + + /* Copy the packet into user provided buffer */ + memcpy((char *)buf, (char *)rdescptr->buffer, retval); + + /* Initialize the descriptor for next packet */ + rdescptr->stat = ETH_AM335X_RDS_OWN; + rdescptr->bufoff = 0; + rdescptr->buflen = ETH_BUF_SIZE; + rdescptr->packlen = 0; + rdescptr->next = NULL; + + /* Insert the descriptor into Rx queue */ + prev = (struct eth_a_rx_desc *)csrptr->stateram->rx_hdp[0]; + if(prev == NULL) { + kprintf("hdp 0, adding %x\n", rdescptr); + csrptr->stateram->rx_hdp[0] = (uint32)rdescptr; + } + else { + while(prev->next != NULL) { + prev = prev->next; + } + prev->next = rdescptr; + } + + /* Increment the head index of rx ring */ + ethptr->rxHead++; + if(ethptr->rxHead >= ethptr->rxRingSize) { + ethptr->rxHead = 0; + } + + return retval; +} diff --git a/device/eth/ethwrite.c b/device/eth/ethwrite.c new file mode 100644 index 0000000..dbd5c3b --- /dev/null +++ b/device/eth/ethwrite.c @@ -0,0 +1,84 @@ +/* ethwrite.c - ethwrite */ + +#include + +/*------------------------------------------------------------------------ + * ethwrite - enqueue a packet for transmission on TI AM335X Ethernet + *------------------------------------------------------------------------ + */ +int32 ethwrite ( + struct dentry *devptr, + void *buf, + uint32 count + ) +{ + struct ethcblk *ethptr; /* Ether entry pointer */ + struct eth_a_csreg *csrptr; /* Ethernet CSR pointer */ + struct eth_a_tx_desc *tdescptr;/* Tx Desc. pointer */ + struct eth_a_tx_desc *prev; /* Prev. Desc. pointer */ + + ethptr = ðertab[devptr->dvminor]; + + /* Get the pointer to the Ethernet CSR */ + csrptr = (struct eth_a_csreg *)ethptr->csr; + + /* Wait for an empty slot in the queue */ + wait(ethptr->osem); + + /* Get the pointer to the next descriptor */ + tdescptr = (struct eth_a_tx_desc *)ethptr->txRing + + ethptr->txTail; + + /* Adjust count if greater than max. possible packet size */ + if(count > PACKLEN) { + count = PACKLEN; + } + + /* Initialize the descriptor */ + tdescptr->next = NULL; + tdescptr->buflen = count; + tdescptr->bufoff = 0; + tdescptr->packlen = count; + tdescptr->stat = (ETH_AM335X_TDS_SOP | /* Start of packet */ + ETH_AM335X_TDS_EOP | /* End of packet */ + ETH_AM335X_TDS_OWN | /* Own flag set for DMA */ + ETH_AM335X_TDS_DIR | /* Directed packet */ + ETH_AM335X_TDS_P1); /* Output port is port1 */ + + /* Copy the packet into the Tx buffer */ + memcpy((char *)tdescptr->buffer, buf, count); + + /* TODO Figure out why we need this hack */ + /* This ethernet device does not send packets smaller than 60 */ + /* bytes; So pad a small packet to make it 60 bytes long */ + + if(count < 60) { + memset((char *)tdescptr->buffer+count, 0, 60-count); + tdescptr->buflen = 60; + tdescptr->packlen = 60; + } + + /* Insert the descriptor into Tx queue */ + + if(csrptr->stateram->tx_hdp[0] == 0) { + /* Tx queue is empty, this desc. will be the first */ + csrptr->stateram->tx_hdp[0] = (uint32)tdescptr; + } + else { + /* Tx queue not empty, insert at end */ + prev = (struct eth_a_tx_desc *) + csrptr->stateram->tx_hdp[0]; + while(prev->next != NULL) { + prev = prev->next; + } + prev->next = tdescptr; + } + + /* Increment the tail index of the Tx ring */ + ethptr->txTail++; + if(ethptr->txTail >= ethptr->txRingSize) { + ethptr->txTail = 0; + } + + return count; +} diff --git a/device/lfs/lfdballoc.c b/device/lfs/lfdballoc.c new file mode 100644 index 0000000..bafb418 --- /dev/null +++ b/device/lfs/lfdballoc.c @@ -0,0 +1,40 @@ +/* lfdballoc.c - lfdballoc */ + +#include + +#define DFILL '+' /* character used to fill a disk block */ + +/*------------------------------------------------------------------------ + * lfdballoc - Allocate a new data block from free list on disk + * (assumes directory mutex held) + *------------------------------------------------------------------------ + */ +dbid32 lfdballoc ( + struct lfdbfree *dbuff /* Addr. of buffer to hold data block */ + ) +{ + dbid32 dnum; /* ID of next d-block on the free list */ + int32 retval; /* Return value */ + + /* Get the ID of first data block on the free list */ + + dnum = Lf_data.lf_dir.lfd_dfree; + if (dnum == LF_DNULL) { /* Ran out of free data blocks */ + panic("out of data blocks"); + } + retval = read(Lf_data.lf_dskdev, (char *)dbuff, dnum); + if (retval == SYSERR) { + panic("lfdballoc cannot read disk block\n\r"); + } + + /* Unlink d-block from in-memory directory */ + + Lf_data.lf_dir.lfd_dfree = dbuff->lf_nextdb; + write(Lf_data.lf_dskdev, (char *)&Lf_data.lf_dir, LF_AREA_DIR); + Lf_data.lf_dirdirty = FALSE; + + /* Fill data block to erase old data */ + + memset((char *)dbuff, DFILL, LF_BLKSIZ); + return dnum; +} diff --git a/device/lfs/lfdbfree.c b/device/lfs/lfdbfree.c new file mode 100644 index 0000000..d23eadc --- /dev/null +++ b/device/lfs/lfdbfree.c @@ -0,0 +1,25 @@ +/* lfdbfree.c - lfdbfree */ + +#include + +/*------------------------------------------------------------------------ + * lfdbfree - Free a data block given its block number (assumes + * directory mutex is held) + *------------------------------------------------------------------------ + */ +status lfdbfree( + did32 diskdev, /* ID of disk device to use */ + dbid32 dnum /* ID of data block to free */ + ) +{ + struct lfdir *dirptr; /* Pointer to directory */ + struct lfdbfree buf; /* Buffer to hold data block */ + + dirptr = &Lf_data.lf_dir; + buf.lf_nextdb = dirptr->lfd_dfree; + dirptr->lfd_dfree = dnum; + write(diskdev, (char *)&buf, dnum); + write(diskdev, (char *)dirptr, LF_AREA_DIR); + + return OK; +} diff --git a/device/lfs/lfflush.c b/device/lfs/lfflush.c new file mode 100644 index 0000000..89d1ff6 --- /dev/null +++ b/device/lfs/lfflush.c @@ -0,0 +1,42 @@ +/* lfflush.c - lfflush */ + +#include + +/*------------------------------------------------------------------------ + * lfflush - Flush directory, data block, and index block for an open + * file (assumes file mutex is held) + *------------------------------------------------------------------------ + */ +status lfflush ( + struct lflcblk *lfptr /* Ptr to file pseudo device */ + ) +{ + + if (lfptr->lfstate == LF_FREE) { + return SYSERR; + } + + /* Write the directory if it has changed */ + + if (Lf_data.lf_dirdirty) { + write(Lf_data.lf_dskdev, (char *)&Lf_data.lf_dir, + LF_AREA_DIR); + Lf_data.lf_dirdirty = FALSE; + } + + /* Write data block if it has changed */ + + if (lfptr->lfdbdirty) { + write(Lf_data.lf_dskdev, lfptr->lfdblock, lfptr->lfdnum); + lfptr->lfdbdirty = FALSE; + } + + /* Write i-block if it has changed */ + + if (lfptr->lfibdirty) { + lfibput(Lf_data.lf_dskdev, lfptr->lfinum, &lfptr->lfiblock); + lfptr->lfibdirty = FALSE; + } + + return OK; +} diff --git a/device/lfs/lfgetmode.c b/device/lfs/lfgetmode.c new file mode 100644 index 0000000..cf81090 --- /dev/null +++ b/device/lfs/lfgetmode.c @@ -0,0 +1,61 @@ +/* lfgetmode.c - lfgetmode */ + +#include + +/*------------------------------------------------------------------------ + * lfgetmode - Parse mode argument and generate integer of mode bits + *------------------------------------------------------------------------ + */ +int32 lfgetmode ( + char *mode /* String of mode characters */ + ) +{ + int32 mbits; /* Mode bits to return */ + char ch; /* Next char in mode string */ + + mbits = 0; + + /* Mode string specifies: */ + /* r - read */ + /* w - write */ + /* o - old (file must exist) */ + /* n - new (create a new file) */ + + while ( (ch = *mode++) != NULLCH) { + switch (ch) { + + case 'r': if (mbits&LF_MODE_R) { + return SYSERR; + } + mbits |= LF_MODE_R; + continue; + + case 'w': if (mbits&LF_MODE_W) { + return SYSERR; + } + mbits |= LF_MODE_W; + continue; + + case 'o': if (mbits&LF_MODE_O || mbits&LF_MODE_N) { + return SYSERR; + } + mbits |= LF_MODE_O; + break; + + case 'n': if (mbits&LF_MODE_O || mbits&LF_MODE_N) { + return SYSERR; + } + mbits |= LF_MODE_N; + break; + + default: return SYSERR; + } + } + + /* If neither read nor write specified, allow both */ + + if ( (mbits&LF_MODE_RW) == 0 ) { + mbits |= LF_MODE_RW; + } + return mbits; +} diff --git a/device/lfs/lfiballoc.c b/device/lfs/lfiballoc.c new file mode 100644 index 0000000..16eb4c3 --- /dev/null +++ b/device/lfs/lfiballoc.c @@ -0,0 +1,33 @@ +/* lfiballoc.c - lfiballoc */ + +#include + +/*------------------------------------------------------------------------ + * lfiballoc - Allocate a new index block from free list on disk + * (assumes directory mutex held) + *------------------------------------------------------------------------ + */ +ibid32 lfiballoc (void) +{ + ibid32 ibnum; /* ID of next block on the free list */ + struct lfiblk iblock; /* Buffer to hold an index block */ + + /* Get ID of first index block on free list */ + + ibnum = Lf_data.lf_dir.lfd_ifree; + if (ibnum == LF_INULL) { /* Ran out of free index blocks */ + panic("out of index blocks"); + } + lfibget(Lf_data.lf_dskdev, ibnum, &iblock); + + /* Unlink index block from the directory free list */ + + Lf_data.lf_dir.lfd_ifree = iblock.ib_next; + + /* Write a copy of the directory to disk after the change */ + + write(Lf_data.lf_dskdev, (char *) &Lf_data.lf_dir, LF_AREA_DIR); + Lf_data.lf_dirdirty = FALSE; + + return ibnum; +} diff --git a/device/lfs/lfibclear.c b/device/lfs/lfibclear.c new file mode 100644 index 0000000..9d0cf3d --- /dev/null +++ b/device/lfs/lfibclear.c @@ -0,0 +1,22 @@ +/* lfibclear.c - lfibclear */ + +#include + +/*------------------------------------------------------------------------ + * lfibclear -- Clear an in-core copy of an index block + *------------------------------------------------------------------------ + */ +void lfibclear( + struct lfiblk *ibptr, /* Address of i-block in memory */ + int32 offset /* File offset for this i-block */ + ) +{ + int32 i; /* Index for data block array */ + + ibptr->ib_offset = offset; /* Assign specified file offset */ + for (i=0 ; iib_dba[i] = LF_DNULL; + } + ibptr->ib_next = LF_INULL; /* Set next ptr to null */ + return; +} diff --git a/device/lfs/lfibget.c b/device/lfs/lfibget.c new file mode 100644 index 0000000..4e69f1d --- /dev/null +++ b/device/lfs/lfibget.c @@ -0,0 +1,31 @@ +/* lfibget.c - lfibget */ + +#include + +/*------------------------------------------------------------------------ + * lfibget - Get an index block from disk given its number (assumes + * mutex is held) + *------------------------------------------------------------------------ + */ +void lfibget( + did32 diskdev, /* Device ID of disk to use */ + ibid32 inum, /* ID of index block to fetch */ + struct lfiblk *ibuff /* Buffer to hold index block */ + ) +{ + char *from, *to; /* Pointers used in copying */ + int32 i; /* Loop index used during copy */ + char dbuff[LF_BLKSIZ]; /* Buffer to hold disk block */ + + /* Read disk block that contains the specified index block */ + + read(diskdev, dbuff, ib2sect(inum)); + + /* Copy specified index block to caller's ibuff */ + + from = dbuff + ib2disp(inum); + to = (char *)ibuff; + for (i=0 ; i + +/*------------------------------------------------------------------------ + * lfibput - Write an index block to disk given its ID (assumes + * mutex is held) + *------------------------------------------------------------------------ + */ +status lfibput( + did32 diskdev, /* ID of disk device */ + ibid32 inum, /* ID of index block to write */ + struct lfiblk *ibuff /* Buffer holding the index blk */ + ) +{ + dbid32 diskblock; /* ID of disk sector (block) */ + char *from, *to; /* Pointers used in copying */ + int32 i; /* Loop index used during copy */ + char dbuff[LF_BLKSIZ]; /* Temp. buffer to hold d-block */ + + /* Compute disk block number and offset of index block */ + + diskblock = ib2sect(inum); + to = dbuff + ib2disp(inum); + from = (char *)ibuff; + + /* Read disk block */ + + if (read(diskdev, dbuff, diskblock) == SYSERR) { + return SYSERR; + } + + /* Copy index block into place */ + + for (i=0 ; i + +/*------------------------------------------------------------------------ + * lflclose - Close a file by flushing output and freeing device entry + *------------------------------------------------------------------------ + */ +devcall lflclose ( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + struct lflcblk *lfptr; /* Ptr to open file table entry */ + + /* Obtain exclusive use of the file */ + + lfptr = &lfltab[devptr->dvminor]; + wait(lfptr->lfmutex); + + /* If file is not open, return an error */ + + if (lfptr->lfstate != LF_USED) { + signal(lfptr->lfmutex); + return SYSERR; + } + + /* Write index or data blocks to disk if they have changed */ + + if (Lf_data.lf_dirdirty || lfptr->lfdbdirty || lfptr->lfibdirty) { + lfflush(lfptr); + } + + /* Set device state to FREE and return to caller */ + + lfptr->lfstate = LF_FREE; + signal(lfptr->lfmutex); + return OK; +} diff --git a/device/lfs/lflcontrol.c b/device/lfs/lflcontrol.c new file mode 100644 index 0000000..a023098 --- /dev/null +++ b/device/lfs/lflcontrol.c @@ -0,0 +1,47 @@ +/* lflcontrol.c - lflcontrol */ + +#include + +/*------------------------------------------------------------------------ + * lflcontrol - Provide control functions for a local file pseudo-device + *------------------------------------------------------------------------ + */ +devcall lflcontrol ( + struct dentry *devptr, /* Entry in device switch table */ + int32 func, /* A control function */ + int32 arg1, /* Argument #1 */ + int32 arg2 /* Argument #2 */ + ) +{ + struct lflcblk *lfptr; /* Ptr to open file table entry */ + int32 retval; /* Return value from func. call */ + + /* Obtain exclusive use of the file */ + + lfptr = &lfltab[devptr->dvminor]; + wait(lfptr->lfmutex); + + /* If file is not open, return an error */ + + if (lfptr->lfstate != LF_USED) { + signal(lfptr->lfmutex); + return SYSERR; + } + + switch (func) { + + /* Truncate a file */ + + case LF_CTL_TRUNC: + wait(Lf_data.lf_mutex); + retval = lftruncate(lfptr); + signal(Lf_data.lf_mutex); + signal(lfptr->lfmutex); + return retval; + + default: + kprintf("lfcontrol: function %d not valid\n\r", func); + signal(lfptr->lfmutex); + return SYSERR; + } +} diff --git a/device/lfs/lflgetc.c b/device/lfs/lflgetc.c new file mode 100644 index 0000000..822d0c8 --- /dev/null +++ b/device/lfs/lflgetc.c @@ -0,0 +1,52 @@ +/* lflgetc.c - lfgetc */ + +#include + +/*------------------------------------------------------------------------ + * lflgetc - Read the next byte from an open local file + *------------------------------------------------------------------------ + */ +devcall lflgetc ( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + struct lflcblk *lfptr; /* Ptr to open file table entry */ + struct ldentry *ldptr; /* Ptr to file's entry in the */ + /* in-memory directory */ + int32 onebyte; /* Next data byte in the file */ + + /* Obtain exclusive use of the file */ + + lfptr = &lfltab[devptr->dvminor]; + wait(lfptr->lfmutex); + + /* If file is not open, return an error */ + + if (lfptr->lfstate != LF_USED) { + signal(lfptr->lfmutex); + return SYSERR; + } + + /* Return EOF for any attempt to read beyond the end-of-file */ + + ldptr = lfptr->lfdirptr; + if (lfptr->lfpos >= ldptr->ld_size) { + signal(lfptr->lfmutex); + return EOF; + } + + /* If byte pointer is beyond the current data block, set up */ + /* a new data block */ + + if (lfptr->lfbyte >= &lfptr->lfdblock[LF_BLKSIZ]) { + lfsetup(lfptr); + } + + /* Extract the next byte from block, update file position, and */ + /* return the byte to the caller */ + + onebyte = 0xff & *lfptr->lfbyte++; + lfptr->lfpos++; + signal(lfptr->lfmutex); + return onebyte; +} diff --git a/device/lfs/lflinit.c b/device/lfs/lflinit.c new file mode 100644 index 0000000..c3f4e13 --- /dev/null +++ b/device/lfs/lflinit.c @@ -0,0 +1,46 @@ +/* lflinit.c - lflinit */ + +#include + +struct lflcblk lfltab[Nlfl]; /* Pseudo-device control blocks */ + +/*------------------------------------------------------------------------ + * lflinit - Initialize control blocks for local file pseudo-devices + *------------------------------------------------------------------------ + */ +devcall lflinit ( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + struct lflcblk *lfptr; /* Ptr. to control block entry */ + int32 i; /* Walks through name array */ + + lfptr = &lfltab[ devptr->dvminor ]; + + /* Initialize control block entry */ + + lfptr->lfstate = LF_FREE; /* Device is currently unused */ + lfptr->lfdev = devptr->dvnum; /* Set device ID */ + lfptr->lfmutex = semcreate(1); /* Create the mutex semaphore */ + + /* Initialize the directory and file position */ + + lfptr->lfdirptr = (struct ldentry *) NULL; + lfptr->lfpos = 0; + for (i=0; ilfname[i] = NULLCH; + } + + /* Zero the in-memory index block and data block */ + + lfptr->lfinum = LF_INULL; + memset((char *) &lfptr->lfiblock, NULLCH, sizeof(struct lfiblk)); + lfptr->lfdnum = 0; + memset((char *) &lfptr->lfdblock, NULLCH, LF_BLKSIZ); + + /* Start with the byte beyond the current data block */ + + lfptr->lfbyte = &lfptr->lfdblock[LF_BLKSIZ]; + lfptr->lfibdirty = lfptr->lfdbdirty = FALSE; + return OK; +} diff --git a/device/lfs/lflputc.c b/device/lfs/lflputc.c new file mode 100644 index 0000000..8184c5d --- /dev/null +++ b/device/lfs/lflputc.c @@ -0,0 +1,64 @@ +/* lflputc.c - lfputc */ + +#include + +/*------------------------------------------------------------------------ + * lflputc - Write a single byte to an open local file + *------------------------------------------------------------------------ + */ +devcall lflputc ( + struct dentry *devptr, /* Entry in device switch table */ + char ch /* Character (byte) to write */ + ) +{ + struct lflcblk *lfptr; /* Ptr to open file table entry */ + struct ldentry *ldptr; /* Ptr to file's entry in the */ + /* in-memory directory */ + + /* Obtain exclusive use of the file */ + + lfptr = &lfltab[devptr->dvminor]; + wait(lfptr->lfmutex); + + /* If file is not open, return an error */ + + if (lfptr->lfstate != LF_USED) { + signal(lfptr->lfmutex); + return SYSERR; + } + + /* Return SYSERR for an attempt to skip bytes beyond the byte */ + /* that is currently the end of the file */ + + ldptr = lfptr->lfdirptr; + if (lfptr->lfpos > ldptr->ld_size) { + signal(lfptr->lfmutex); + return SYSERR; + } + + /* If pointer is outside current block, set up new block */ + + if (lfptr->lfbyte >= &lfptr->lfdblock[LF_BLKSIZ]) { + + /* Set up block for current file position */ + + lfsetup(lfptr); + } + + /* If appending a byte to the file, increment the file size. */ + /* Note: comparison might be equal, but should not be greater.*/ + + if (lfptr->lfpos >= ldptr->ld_size) { + ldptr->ld_size++; + Lf_data.lf_dirdirty = TRUE; + } + + /* Place byte in buffer and mark buffer "dirty" */ + + *lfptr->lfbyte++ = ch; + lfptr->lfpos++; + lfptr->lfdbdirty = TRUE; + + signal(lfptr->lfmutex); + return OK; +} diff --git a/device/lfs/lflread.c b/device/lfs/lflread.c new file mode 100644 index 0000000..0b7cb12 --- /dev/null +++ b/device/lfs/lflread.c @@ -0,0 +1,39 @@ +/* lflread.c - lflread */ + +#include + +/*------------------------------------------------------------------------ + * lflread - Read from a previously opened local file + *------------------------------------------------------------------------ + */ +devcall lflread ( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer to hold bytes */ + int32 count /* Max bytes to read */ + ) +{ + uint32 numread; /* Number of bytes read */ + int32 nxtbyte; /* Character or SYSERR/EOF */ + + if (count < 0) { + return SYSERR; + } + + /* Iterate and use lflgetc to read individual bytes */ + + for (numread=0 ; numread < count ; numread++) { + nxtbyte = lflgetc(devptr); + if (nxtbyte == SYSERR) { + return SYSERR; + } else if (nxtbyte == EOF) { /* EOF before finished */ + if (numread == 0) { + return EOF; + } else { + return numread; + } + } else { + *buff++ = (char) (0xff & nxtbyte); + } + } + return numread; +} diff --git a/device/lfs/lflseek.c b/device/lfs/lflseek.c new file mode 100644 index 0000000..e0076c2 --- /dev/null +++ b/device/lfs/lflseek.c @@ -0,0 +1,41 @@ +/* lflseek.c - lflseek */ + +#include + +/*------------------------------------------------------------------------ + * lflseek - Seek to a specified position in a file + *------------------------------------------------------------------------ + */ +devcall lflseek ( + struct dentry *devptr, /* Entry in device switch table */ + uint32 offset /* Byte position in the file */ + ) +{ + struct lflcblk *lfptr; /* Ptr to open file table entry */ + + /* If file is not open, return an error */ + + lfptr = &lfltab[devptr->dvminor]; + wait(lfptr->lfmutex); + if (lfptr->lfstate != LF_USED) { + signal(lfptr->lfmutex); + return SYSERR; + } + + /* Verify offset is within current file size */ + + if (offset > lfptr->lfdirptr->ld_size) { + signal(lfptr->lfmutex); + return SYSERR; + } + + /* Record new offset and invalidate byte pointer (i.e., force */ + /* the index and data blocks to be replaced if a successive */ + /* call is made to read or write) */ + + lfptr->lfpos = offset; + lfptr->lfbyte = &lfptr->lfdblock[LF_BLKSIZ]; + + signal(lfptr->lfmutex); + return OK; +} diff --git a/device/lfs/lflwrite.c b/device/lfs/lflwrite.c new file mode 100644 index 0000000..ce924c4 --- /dev/null +++ b/device/lfs/lflwrite.c @@ -0,0 +1,29 @@ +/* lflwrite.c - lflwrite */ + +#include + +/*------------------------------------------------------------------------ + * lflwrite -- Write data to a previously opened local disk file + *------------------------------------------------------------------------ + */ +devcall lflwrite ( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer holding data to write */ + int32 count /* Number of bytes to write */ + ) +{ + int32 i; /* Number of bytes written */ + + if (count < 0) { + return SYSERR; + } + + /* Iteratate and write one byte at a time */ + + for (i=0; i +#include + +/*------------------------------------------------------------------------ + * lfscheck - Check a directory to verify it contains a Xinu file system + *------------------------------------------------------------------------ + */ +status lfscheck ( + struct lfdir *dirptr /* Ptr to an in-core directory */ + ) +{ + uint32 reverse; /* LFS_ID in reverse byte order */ + + /* Verify the File System ID, all 0's and all 1's fields */ + + if ( (dirptr->lfd_fsysid != LFS_ID) || + (dirptr->lfd_allzeros != 0x00000000) || + (dirptr->lfd_allones != 0xffffffff) ) { + return SYSERR; + } + + /* Check the reverse-order File System ID field */ + + reverse = ((LFS_ID>>24) & 0x000000ff) | + ((LFS_ID>> 8) & 0x0000ff00) | + ((LFS_ID<< 8) & 0x00ff0000) | + ((LFS_ID<<24) & 0xff000000) ; + + if (dirptr->lfd_revid != reverse) { + return SYSERR; + } + + /* Extra sanity check - verify file count is positive */ + if (dirptr->lfd_nfiles < 0){ + return SYSERR; + } + return OK; +} diff --git a/device/lfs/lfsckfmt.c b/device/lfs/lfsckfmt.c new file mode 100644 index 0000000..f6e8da7 --- /dev/null +++ b/device/lfs/lfsckfmt.c @@ -0,0 +1,65 @@ +/* lfckfmt.c - lfckfmt */ + +#include +#include + +/*------------------------------------------------------------------------ + * lfckfmt - Check the format of an initially-created disk + *------------------------------------------------------------------------ + */ +status lfsckfmt ( + did32 disk /* ID of an open disk device */ + ) +{ + uint32 ibsectors; /* Number of sectors of i-blocks*/ + struct lfdir dir; /* Buffer to hold the directory */ + uint32 dblks; /* Total free data blocks */ + struct lfiblk iblock; /* Space for one i-block */ + struct lfdbfree dblock; /* Data block on the free list */ + int32 lfiblks; /* Total free index blocks */ + int32 retval; + ibid32 nextib; + dbid32 nextdb; + + /* Read directory */ + + retval = read(disk,(char *)&dir, LF_AREA_DIR); + if (retval == SYSERR) { + panic("cannot read directory"); + } + kprintf("Have read directory from disk device %d\n\r", + disk); + + /* Check to see if directory contains a Xinu file system */ + + if (lfscheck(&dir) == SYSERR) { + panic("directory does not contain a Xinu file system"); + } + kprintf("Directory corresponds to a local Xinu file system\n"); + + /* Follow index block list */ + + lfiblks = 0; + nextib = dir.lfd_ifree; + kprintf("initial index block is %d\n\r", nextib); + while (nextib != LF_INULL) { + lfiblks++; + lfibget(disk, nextib, &iblock); + nextib = iblock.ib_next; + } + ibsectors = (lfiblks + 6) /7; + kprintf("Found %d index blocks (%d sectors)\n\r", lfiblks, ibsectors); + + /* Follow data block list */ + + dblks = 0; + nextdb = dir.lfd_dfree; + kprintf("initial data block is %d\n\r", nextdb); + while (nextdb != LF_DNULL) { + dblks++; + read(disk, (char *)&dblock, nextdb); + nextdb = dblock.lf_nextdb; + } + kprintf("Found %d data blocks\n\r", dblks); + return OK; +} diff --git a/device/lfs/lfscreate.c b/device/lfs/lfscreate.c new file mode 100644 index 0000000..68ba943 --- /dev/null +++ b/device/lfs/lfscreate.c @@ -0,0 +1,74 @@ +/* lfscreate.c - lfscreate */ + +#include +#include + +/*------------------------------------------------------------------------ + * lfscreate - Create an initially-empty file system on a disk + *------------------------------------------------------------------------ + */ +status lfscreate ( + did32 disk, /* ID of an open disk device */ + ibid32 lfiblks, /* Num. of index blocks on disk */ + uint32 dsiz /* Total size of disk in bytes */ + ) +{ + uint32 sectors; /* Number of sectors to use */ + uint32 ibsectors; /* Number of sectors of i-blocks*/ + uint32 ibpersector; /* Number of i-blocks per sector*/ + struct lfdir dir; /* Buffer to hold the directory */ + uint32 dblks; /* Total free data blocks */ + struct lfiblk iblock; /* Space for one i-block */ + struct lfdbfree dblock; /* Data block on the free list */ + dbid32 dbindex; /* Index for data blocks */ + int32 retval; /* Return value from func call */ + int32 i; /* Loop index */ + + /* Compute total sectors on disk */ + + sectors = dsiz / LF_BLKSIZ; /* Truncate to full sector */ + + /* Compute number of sectors comprising i-blocks */ + + ibpersector = LF_BLKSIZ / sizeof(struct lfiblk); + ibsectors = (lfiblks+(ibpersector-1)) / ibpersector;/* Round up */ + lfiblks = ibsectors * ibpersector; + if (ibsectors > sectors/2) { /* Invalid arguments */ + return SYSERR; + } + + /* Create an initial directory */ + + memset((char *)&dir, NULLCH, sizeof(struct lfdir)); + dir.lfd_nfiles = 0; + dbindex= (dbid32)(ibsectors + 1); + dir.lfd_dfree = dbindex; + dblks = sectors - ibsectors - 1; + retval = write(disk,(char *)&dir, LF_AREA_DIR); + if (retval == SYSERR) { + return SYSERR; + } + + /* Create list of free i-blocks on disk */ + + lfibclear(&iblock, 0); + for (i=0; i + +/*------------------------------------------------------------------------ + * lfsetup - Set a file's index block and data block for the current + * file position (assumes file mutex held) + *------------------------------------------------------------------------ + */ +status lfsetup ( + struct lflcblk *lfptr /* Pointer to slave file device */ + ) +{ + dbid32 dnum; /* Data block to fetch */ + ibid32 ibnum; /* I-block number during search */ + struct ldentry *ldptr; /* Ptr to file entry in dir. */ + struct lfiblk *ibptr; /* Ptr to in-memory index block */ + uint32 newoffset; /* Computed data offset for */ + /* next index block */ + int32 dindex; /* Index into array in an index */ + /* block */ + + + /* Obtain exclusive access to the directory */ + + wait(Lf_data.lf_mutex); + + /* Get pointers to in-memory directory, file's entry in the */ + /* directory, and the in-memory index block */ + + ldptr = lfptr->lfdirptr; + ibptr = &lfptr->lfiblock; + + /* If existing index block or data block changed, write to disk */ + + if (lfptr->lfibdirty || lfptr->lfdbdirty) { + lfflush(lfptr); + } + ibnum = lfptr->lfinum; /* Get ID of curr. index block */ + + /* If there is no index block in memory (e.g., because the file */ + /* was just opened), either load the first index block of */ + /* the file or allocate a new first index block */ + + if (ibnum == LF_INULL) { + + /* Check directory entry to see if index block exists */ + + ibnum = ldptr->ld_ilist; + if (ibnum == LF_INULL) { /* Empty file - get new i-block*/ + ibnum = lfiballoc(); + lfibclear(ibptr, 0); + ldptr->ld_ilist = ibnum; + lfptr->lfibdirty = TRUE; + } else { /* Nonempty - read first i-block*/ + lfibget(Lf_data.lf_dskdev, ibnum, ibptr); + } + lfptr->lfinum = ibnum; + + /* Otherwise, if current file position has been moved to an */ + /* offset before the current index block, start at the */ + /* beginning of the index list for the file */ + + } else if (lfptr->lfpos < ibptr->ib_offset) { + + /* Load initial index block for the file (we know that */ + /* at least one index block exists) */ + + ibnum = ldptr->ld_ilist; + lfibget(Lf_data.lf_dskdev, ibnum, ibptr); + lfptr->lfinum = ibnum; + } + + /* At this point, an index block is in memory, but may cover */ + /* an offset less than the current file position. Loop until */ + /* the index block covers the current file position. */ + + while ((lfptr->lfpos & ~LF_IMASK) > ibptr->ib_offset ) { + ibnum = ibptr->ib_next; + if (ibnum == LF_INULL) { + /* Allocate new index block to extend file */ + ibnum = lfiballoc(); + ibptr->ib_next = ibnum; + lfibput(Lf_data.lf_dskdev, lfptr->lfinum, ibptr); + lfptr->lfinum = ibnum; + newoffset = ibptr->ib_offset + LF_IDATA; + lfibclear(ibptr, newoffset); + lfptr->lfibdirty = TRUE; + } else { + lfibget(Lf_data.lf_dskdev, ibnum, ibptr); + lfptr->lfinum = ibnum; + } + lfptr->lfdnum = LF_DNULL; /* Invalidate old data block */ + } + + /* At this point, the index block in lfiblock covers the */ + /* current file position (i.e., position lfptr->lfpos). The */ + /* next step consists of loading the correct data block. */ + + dindex = (lfptr->lfpos & LF_IMASK) >> 9; + + /* If data block index does not match current data block, read */ + /* the correct data block from disk */ + + dnum = lfptr->lfiblock.ib_dba[dindex]; + if (dnum == LF_DNULL) { /* Allocate new data block */ + dnum = lfdballoc((struct lfdbfree *)&lfptr->lfdblock); + lfptr->lfiblock.ib_dba[dindex] = dnum; + lfptr->lfibdirty = TRUE; + } else if ( dnum != lfptr->lfdnum) { + read(Lf_data.lf_dskdev, (char *)lfptr->lfdblock, dnum); + lfptr->lfdbdirty = FALSE; + } + lfptr->lfdnum = dnum; + + /* Use current file offset to set the pointer to the next byte */ + /* within the data block */ + + lfptr->lfbyte = &lfptr->lfdblock[lfptr->lfpos & LF_DMASK]; + signal(Lf_data.lf_mutex); + return OK; +} diff --git a/device/lfs/lfsinit.c b/device/lfs/lfsinit.c new file mode 100644 index 0000000..d9ab814 --- /dev/null +++ b/device/lfs/lfsinit.c @@ -0,0 +1,32 @@ +/* lfsinit.c - lfsinit */ + +#include + +struct lfdata Lf_data; + +/*------------------------------------------------------------------------ + * lfsinit - Initialize the local file system master device + *------------------------------------------------------------------------ + */ +devcall lfsinit ( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + /* Assign ID of disk device that will be used */ + + Lf_data.lf_dskdev = LF_DISK_DEV; + + /* Create a mutual exclusion semaphore */ + + Lf_data.lf_mutex = semcreate(1); + + /* Zero directory area (for debugging) */ + + memset((char *)&Lf_data.lf_dir, NULLCH, sizeof(struct lfdir)); + + /* Initialize directory to "not present" in memory */ + + Lf_data.lf_dirpresent = Lf_data.lf_dirdirty = FALSE; + + return OK; +} diff --git a/device/lfs/lfsopen.c b/device/lfs/lfsopen.c new file mode 100644 index 0000000..6ed5590 --- /dev/null +++ b/device/lfs/lfsopen.c @@ -0,0 +1,185 @@ +/* lfsopen.c - lfsopen */ + +#include + +/*------------------------------------------------------------------------ + * lfsopen - Open a file and allocate a local file pseudo-device + *------------------------------------------------------------------------ + */ +devcall lfsopen ( + struct dentry *devptr, /* Entry in device switch table */ + char *name, /* Name of file to open */ + char *mode /* Mode chars: 'r' 'w' 'o' 'n' */ + ) +{ + struct lfdir *dirptr; /* Ptr to in-memory directory */ + char *from, *to; /* Ptrs used during copy */ + char *nam, *cmp; /* Ptrs used during comparison */ + int32 i; /* General loop index */ + did32 lfnext; /* Minor number of an unused */ + /* file pseudo-device */ + struct ldentry *ldptr; /* Ptr to an entry in directory */ + struct lflcblk *lfptr; /* Ptr to open file table entry */ + bool8 found; /* Was the name found? */ + int32 retval; /* Value returned from function */ + int32 mbits; /* Mode bits */ + + /* Check length of name file (leaving space for NULLCH */ + + from = name; + for (i=0; i< LF_NAME_LEN; i++) { + if (*from++ == NULLCH) { + break; + } + } + if (i >= LF_NAME_LEN) { /* Name is too long */ + return SYSERR; + } + + /* Parse mode argument and convert to binary */ + + mbits = lfgetmode(mode); + if (mbits == SYSERR) { + return SYSERR; + } + + /* If named file is already open, return SYSERR */ + + lfnext = SYSERR; + for (i=0; ilfstate == LF_FREE) { + if (lfnext == SYSERR) { + lfnext = i; /* Record index */ + } + continue; + } + + /* Compare requested name to name of open file */ + + nam = name; + cmp = lfptr->lfname; + while(*nam != NULLCH) { + if (*nam != *cmp) { + break; + } + nam++; + cmp++; + } + + /* See if comparison succeeded */ + + if ( (*nam==NULLCH) && (*cmp == NULLCH) ) { + return SYSERR; + } + } + if (lfnext == SYSERR) { /* No slave file devices are available */ + return SYSERR; + } + + /* Obtain copy of directory if not already present in memory */ + + dirptr = &Lf_data.lf_dir; + wait(Lf_data.lf_mutex); + if (! Lf_data.lf_dirpresent) { + retval = read(Lf_data.lf_dskdev,(char *)dirptr,LF_AREA_DIR); + if (retval == SYSERR ) { + signal(Lf_data.lf_mutex); + return SYSERR; + } + if (lfscheck(dirptr) == SYSERR ) { + kprintf("Disk does not contain a Xinu file system\n"); + signal(Lf_data.lf_mutex); + return SYSERR; + } + Lf_data.lf_dirpresent = TRUE; + } + + /* Search directory to see if file exists */ + + found = FALSE; + for (i=0; ilfd_nfiles; i++) { + ldptr = &dirptr->lfd_files[i]; + nam = name; + cmp = ldptr->ld_name; + while(*nam != NULLCH) { + if (*nam != *cmp) { + break; + } + nam++; + cmp++; + } + if ( (*nam==NULLCH) && (*cmp==NULLCH) ) { /* Name found */ + found = TRUE; + break; + } + } + + /* Case #1 - file is not in directory (i.e., does not exist) */ + + if (! found) { + if (mbits & LF_MODE_O) { /* File *must* exist */ + signal(Lf_data.lf_mutex); + return SYSERR; + } + + /* Take steps to create new file and add to directory */ + + /* Verify that space remains in the directory */ + + if (dirptr->lfd_nfiles >= LF_NUM_DIR_ENT) { + signal(Lf_data.lf_mutex); + return SYSERR; + } + + /* Allocate next dir. entry & initialize to empty file */ + + ldptr = &dirptr->lfd_files[dirptr->lfd_nfiles++]; + ldptr->ld_size = 0; + from = name; + to = ldptr->ld_name; + while ( (*to++ = *from++) != NULLCH ) { + ; + } + ldptr->ld_ilist = LF_INULL; + + /* Case #2 - file is in directory (i.e., already exists) */ + + } else if (mbits & LF_MODE_N) { /* File must not exist */ + signal(Lf_data.lf_mutex); + return SYSERR; + } + + /* Initialize the local file pseudo-device */ + + lfptr = &lfltab[lfnext]; + lfptr->lfstate = LF_USED; + lfptr->lfdirptr = ldptr; /* Point to directory entry */ + lfptr->lfmode = mbits & LF_MODE_RW; + + /* File starts at position 0 */ + + lfptr->lfpos = 0; + + to = lfptr->lfname; + from = name; + while ( (*to++ = *from++) != NULLCH ) { + ; + } + + /* Neither index block nor data block are initially valid */ + + lfptr->lfinum = LF_INULL; + lfptr->lfdnum = LF_DNULL; + + /* Initialize byte pointer to address beyond the end of the */ + /* buffer (i.e., invalid pointer triggers setup) */ + + lfptr->lfbyte = &lfptr->lfdblock[LF_BLKSIZ]; + lfptr->lfibdirty = FALSE; + lfptr->lfdbdirty = FALSE; + + signal(Lf_data.lf_mutex); + + return lfptr->lfdev; +} diff --git a/device/lfs/lftruncate.c b/device/lfs/lftruncate.c new file mode 100644 index 0000000..519ad71 --- /dev/null +++ b/device/lfs/lftruncate.c @@ -0,0 +1,104 @@ +/* lftruncate.c - lftruncate */ + +#include + +/*------------------------------------------------------------------------ + * lftruncate - Truncate a file by freeing its index and data blocks + * (assumes directory mutex held) + *------------------------------------------------------------------------ + */ +status lftruncate ( + struct lflcblk *lfptr /* Ptr to file's cntl blk entry */ + ) +{ + struct ldentry *ldptr; /* Pointer to file's dir. entry */ + struct lfiblk iblock; /* Buffer for one index block */ + ibid32 ifree; /* Start of index blk free list */ + ibid32 firstib; /* First index blk of the file */ + ibid32 nextib; /* Walks down list of the */ + /* file's index blocks */ + dbid32 nextdb; /* Next data block to free */ + int32 i; /* Moves through data blocks in */ + /* a given index block */ + + ldptr = lfptr->lfdirptr; /* Get pointer to dir. entry */ + if (ldptr->ld_size == 0) { /* File is already empty */ + return OK; + } + + /* Clean up the open local file first */ + + if ( (lfptr->lfibdirty) || (lfptr->lfdbdirty) ) { + lfflush(lfptr); + } + lfptr->lfpos = 0; + lfptr->lfinum = LF_INULL; + lfptr->lfdnum = LF_DNULL; + lfptr->lfbyte = &lfptr->lfdblock[LF_BLKSIZ]; + + /* Obtain ID of first index block on free list */ + + ifree = Lf_data.lf_dir.lfd_ifree; + + /* Record file's first i-block and clear directory entry */ + + firstib = ldptr->ld_ilist; + ldptr->ld_ilist = LF_INULL; + ldptr->ld_size = 0; + Lf_data.lf_dirdirty = TRUE; + + /* Walk along index block list, disposing of each data block */ + /* and clearing the corresponding pointer. A note on loop */ + /* termination: last pointer is set to ifree below. */ + + for (nextib=firstib; nextib!=ifree; nextib=iblock.ib_next) { + + /* Obtain a copy of current index block from disk */ + + lfibget(Lf_data.lf_dskdev, nextib, &iblock); + + /* Free each data block in the index block */ + + for (i=0; i + +#define OFFSETMODE(x) (x * 4) +#define OFFSETCFG(x) ((x * 4) + 2) +#define OFFSETMODE2(x) ((x - 8) * 4) +#define OFFSETCFG2(x) (((x - 8) * 4) + 2) + +static int setmode(struct dentry * devptr, uint32 mode, uint32 pin) +{ + struct gpio_csreg * csrptr; + csrptr = (struct gpio_csreg *)(devptr->dvcsr); + + if (pin < 8) { + csrptr->crl &= ~(0x3 << OFFSETMODE(pin)); // clear + csrptr->crl |= (mode << OFFSETMODE(pin)); + } + + else { + csrptr->crh &= ~(0x3 << OFFSETMODE2(pin)); // clear + csrptr->crh |= (mode << OFFSETMODE2(pin)); + } + return 0; +} + +static int setcnf(struct dentry * devptr, uint32 mode, uint32 pin) +{ + struct gpio_csreg * csrptr; + csrptr = (struct gpio_csreg *)(devptr->dvcsr); + + if (pin < 8) { + csrptr->crl &= ~(0x3 << OFFSETCFG(pin)); // clear + csrptr->crl |= (mode << OFFSETCFG(pin)); + } + else { + csrptr->crh &= ~(0x3 << OFFSETCFG2(pin)); // clear + csrptr->crh |= (mode << OFFSETCFG2(pin)); + } + return 0; +} + +/*------------------------------------------------------------------------ + * gpiocontrol - Control a gpio device pin settings + *------------------------------------------------------------------------ + */ +devcall gpiocontrol(struct dentry * devptr, int32 func, int32 mode, int32 pin) { + + switch(func) { + + case SETMODE: + setmode(devptr, mode, pin); + break; + case SETCFG: + setcnf(devptr, mode, pin); + break; + + default: + break; + + } + return OK; + +} diff --git a/device/movidos/gpio/gpiohandler.c b/device/movidos/gpio/gpiohandler.c new file mode 100644 index 0000000..f0adf9a --- /dev/null +++ b/device/movidos/gpio/gpiohandler.c @@ -0,0 +1,85 @@ +/* gpiohandler.c - gpiohandler */ + +#include + +/*------------------------------------------------------------------------ + * gpiohandler - Handle an interrupt for a gpio device + *------------------------------------------------------------------------ + */ +void gpiohandler( + uint32 xnum /* IRQ number */ + ) +{ + struct gpio_csreg *csrptr; /* GPIO CSR pointer */ + gpiointhook gphookfn; /* The inerrupt function */ + + /* Clear all interrupts */ + +// if(xnum == GPIO0_INT_A) { +// csrptr = (struct gpio_csreg *)(GPIO0_BASE); +// gphookfn = gpiotab[0].gphookfn; +// if(gphookfn != NULL) +// gphookfn(xnum, csrptr->irqstatus0); +// csrptr->irqstatus0 = 0xFFFFFFFF; +// return; +// } +// if(xnum == GPIO0_INT_B) { +// csrptr = (struct gpio_csreg *)(GPIO0_BASE); +// gphookfn = gpiotab[0].gphookfn; +// if(gphookfn != NULL) +// gphookfn(xnum, csrptr->irqstatus1); +// csrptr->irqstatus1 = 0xFFFFFFFF; +// return; +// } +// +// if(xnum == GPIO1_INT_A) { +// csrptr = (struct gpio_csreg *)(GPIO1_BASE); +// gphookfn = gpiotab[1].gphookfn; +// if(gphookfn != NULL) +// gphookfn(xnum, csrptr->irqstatus0); +// csrptr->irqstatus0 = 0xFFFFFFFF; +// return; +// } +// if(xnum == GPIO1_INT_B) { +// csrptr = (struct gpio_csreg *)(GPIO1_BASE); +// gphookfn = gpiotab[1].gphookfn; +// if(gphookfn != NULL) +// gphookfn(xnum, csrptr->irqstatus1); +// csrptr->irqstatus1 = 0xFFFFFFFF; +// return; +// } +// +// if(xnum == GPIO2_INT_A) { +// csrptr = (struct gpio_csreg *)(GPIO2_BASE); +// gphookfn = gpiotab[2].gphookfn; +// if(gphookfn != NULL) +// gphookfn(xnum, csrptr->irqstatus0); +// csrptr->irqstatus0 = 0xFFFFFFFF; +// return; +// } +// if(xnum == GPIO2_INT_B) { +// csrptr = (struct gpio_csreg *)(GPIO2_BASE); +// gphookfn = gpiotab[2].gphookfn; +// if(gphookfn != NULL) +// gphookfn(xnum, csrptr->irqstatus1); +// csrptr->irqstatus1 = 0xFFFFFFFF; +// return; +// } +// +// if(xnum == GPIO3_INT_A) { +// csrptr = (struct gpio_csreg *)(GPIO3_BASE); +// gphookfn = gpiotab[3].gphookfn; +// if(gphookfn != NULL) +// gphookfn(xnum, csrptr->irqstatus0); +// csrptr->irqstatus0 = 0xFFFFFFFF; +// return; +// } +// if(xnum == GPIO3_INT_B) { +// csrptr = (struct gpio_csreg *)(GPIO3_BASE); +// gphookfn = gpiotab[3].gphookfn; +// if(gphookfn != NULL) +// gphookfn(xnum, csrptr->irqstatus1); +// csrptr->irqstatus1 = 0xFFFFFFFF; +// return; +// } +} diff --git a/device/movidos/gpio/gpioinit.c b/device/movidos/gpio/gpioinit.c new file mode 100644 index 0000000..8b3bfae --- /dev/null +++ b/device/movidos/gpio/gpioinit.c @@ -0,0 +1,42 @@ +/* gpioinit.c - gpioinit */ + +#include + +struct gpiocblk gpiotab[NGPIO]; + +/*------------------------------------------------------------------------ + * gpioinit - Initialize settings for a gpio device + *------------------------------------------------------------------------ + */ +devcall gpioinit( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + //struct gpio_csreg * csrptr; + struct clock_csreg * clockptr; + //struct gpiocblk * gpioptr; + //csrptr = (struct gpio_csreg *)(devptr->dvcsr); + clockptr = (struct clock_csreg *)CLOCK_BASE; + //gpioptr = &gpiotab[devptr->dvminor]; + + /* Enable clock on GPIO */ + switch (devptr->dvminor) { + case 0: + clockptr->apb2enr |= (1 << IOPAEN); + break; + case 1: + clockptr->apb2enr |= (1 << IOPBEN); + break; + case 2: + clockptr->apb2enr |= (1 << IOPCEN); + break; + case 3: + clockptr->apb2enr |= (1 << IOPDEN); + break; + default: + kprintf("Failed to recognize GPIO device"); + return SYSERR; + } + + return OK; +} diff --git a/device/movidos/gpio/gpioread.c b/device/movidos/gpio/gpioread.c new file mode 100644 index 0000000..3d39389 --- /dev/null +++ b/device/movidos/gpio/gpioread.c @@ -0,0 +1,27 @@ +/* gpioread.c - gpioread */ + +#include + +/*------------------------------------------------------------------------ + * gpioread - Read aspecified set of GPIO pins + *------------------------------------------------------------------------ + */ +devcall gpioread( + struct dentry *devptr, /* Entry in device switch table */ + char *value, /* Pointer to a 32bit buffer */ + int32 pinmask /* Pins from which to read */ + ) +{ +// struct gpio_csreg *csrptr; /* Pointer to GPIO CSRs */ +// +// /* Obtain the address of the CSR from the device switch table */ +// +// csrptr = (struct gpio_csreg *)(devptr->dvcsr); +// +// /* Access the GPIO pins, use the mask to select a subset, and */ +// /* store the result in the specified buffer */ +// +// *((uint32 *)value) = csrptr->datain & pinmask; + + return OK; +} diff --git a/device/movidos/gpio/gpioselect.c b/device/movidos/gpio/gpioselect.c new file mode 100644 index 0000000..5d32eb8 --- /dev/null +++ b/device/movidos/gpio/gpioselect.c @@ -0,0 +1,25 @@ +/* gpioselect.h - pin multiplexing and control for the BBB ZCZ package */ +#include + +/*------------------------------------------------------------------------ + * gpioselect - Configure modes for GPIO pins + *------------------------------------------------------------------------ + */ +devcall gpioselect( + uint32 pinreg, /* Pin to be affected */ + uint32 pinmode, /* Multiplexed pin function */ + uint32 pinsettings /* Settings for the pin */ +) +{ +// volatile uint32* confreg; /* Pin configuration register */ +// +// /* Pick up the pin configuration register address */ +// +// confreg = &(((uint32*)PINMUXBASE)[pinreg]); +// +// /* Apply the specified settings to the pin */ +// +// *confreg = pinmode|pinsettings; +// + return OK; +} diff --git a/device/movidos/gpio/gpiowrite.c b/device/movidos/gpio/gpiowrite.c new file mode 100644 index 0000000..047f2cc --- /dev/null +++ b/device/movidos/gpio/gpiowrite.c @@ -0,0 +1,31 @@ +/* gpiowrite.c - gpiowrite */ + +#include + +/*------------------------------------------------------------------------ + * gpiowrite - Write value of gpio pins + *------------------------------------------------------------------------ + */ +devcall gpiowrite( + struct dentry *devptr, /* Entry in device switch table */ + char *value, /* Pointer to 32-bit buffer */ + int32 pin /* Pins to be written written */ + ) +{ + struct gpio_csreg * csrptr; + uint8 val; + + csrptr = (struct gpio_csreg *)(devptr->dvcsr); + val = (uint8)value; + + if (val == 0) { + csrptr->odr &= ~(1 << pin); + return 0; + } + else if (val == 1) { + csrptr->odr |= (1 << pin); + return 0; + } + + return OK; +} diff --git a/device/movidos/ram/ramclose.c b/device/movidos/ram/ramclose.c new file mode 100644 index 0000000..0580c07 --- /dev/null +++ b/device/movidos/ram/ramclose.c @@ -0,0 +1,14 @@ +/* ramclose.c - ramclose */ + +#include + +/*------------------------------------------------------------------------ + * Ramclose - Close a ram disk + *------------------------------------------------------------------------ + */ +devcall ramclose ( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + return OK; +} diff --git a/device/movidos/ram/raminit.c b/device/movidos/ram/raminit.c new file mode 100644 index 0000000..866140e --- /dev/null +++ b/device/movidos/ram/raminit.c @@ -0,0 +1,19 @@ +/* raminit.c - raminit */ + +#include +#include + +struct ramdisk Ram; + +/*------------------------------------------------------------------------ + * raminit - Initialize the remote disk system device + *------------------------------------------------------------------------ + */ +devcall raminit ( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + memcpy(Ram.disk, "hopeless", 8); + memcpy( &Ram.disk[8], Ram.disk, RM_BLKSIZ * RM_BLKS - 8); + return OK; +} diff --git a/device/movidos/ram/ramopen.c b/device/movidos/ram/ramopen.c new file mode 100644 index 0000000..07ba1ba --- /dev/null +++ b/device/movidos/ram/ramopen.c @@ -0,0 +1,19 @@ +/* ramopen.c - ramopen */ + +#include + +/*------------------------------------------------------------------------ + * ramopen - Open a ram disk + *------------------------------------------------------------------------ + */ + +devcall ramopen ( + struct dentry *devptr, /* Entry in device switch table */ + char *name, /* Unused for a ram disk */ + char *mode /* Unused for a ram disk */ + ) +{ + /* No action -- just return the device descriptor */ + + return devptr->dvnum; +} diff --git a/device/movidos/ram/ramread.c b/device/movidos/ram/ramread.c new file mode 100644 index 0000000..07b8fbf --- /dev/null +++ b/device/movidos/ram/ramread.c @@ -0,0 +1,21 @@ +/* ramread.c - ramread */ + +#include +#include + +/*------------------------------------------------------------------------ + * ramread - Read a block from a ram disk + *------------------------------------------------------------------------ + */ +devcall ramread ( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer to hold disk block */ + int32 blk /* Block number of block to read*/ + ) +{ + int32 bpos; /* Byte position of blk */ + + bpos = RM_BLKSIZ * blk; + memcpy(buff, &Ram.disk[bpos], RM_BLKSIZ); + return OK; +} diff --git a/device/movidos/ram/ramwrite.c b/device/movidos/ram/ramwrite.c new file mode 100644 index 0000000..3b5f19a --- /dev/null +++ b/device/movidos/ram/ramwrite.c @@ -0,0 +1,21 @@ +/* ramwrite.c - ramwrite */ + +#include +#include + +/*------------------------------------------------------------------------ + * ramwrite - Write a block to a ram disk + *------------------------------------------------------------------------ + */ +devcall ramwrite ( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer containing a block */ + int32 blk /* Block number to write */ + ) +{ + int32 bpos; /* Byte position of blk */ + + bpos = RM_BLKSIZ * blk; + memcpy(&Ram.disk[bpos], buff, RM_BLKSIZ); + return OK; +} diff --git a/device/movidos/tty/ttycontrol.c b/device/movidos/tty/ttycontrol.c new file mode 100644 index 0000000..eeeb5e2 --- /dev/null +++ b/device/movidos/tty/ttycontrol.c @@ -0,0 +1,58 @@ +/* ttycontrol.c - ttycontrol */ + +#include + +/*------------------------------------------------------------------------ + * ttycontrol - Control a tty device by setting modes + *------------------------------------------------------------------------ + */ +devcall ttycontrol( + struct dentry *devptr, /* Entry in device switch table */ + int32 func, /* Function to perform */ + int32 arg1, /* Argument 1 for request */ + int32 arg2 /* Argument 2 for request */ + ) +{ + struct ttycblk *typtr; /* Pointer to tty control block */ + char ch; /* Character for lookahead */ + + typtr = &ttytab[devptr->dvminor]; + + /* Process the request */ + + switch ( func ) { + + case TC_NEXTC: + wait(typtr->tyisem); + ch = *typtr->tyitail; + signal(typtr->tyisem); + return (devcall)ch; + + case TC_MODER: + typtr->tyimode = TY_IMRAW; + return (devcall)OK; + + case TC_MODEC: + typtr->tyimode = TY_IMCOOKED; + return (devcall)OK; + + case TC_MODEK: + typtr->tyimode = TY_IMCBREAK; + return (devcall)OK; + + case TC_ICHARS: + return(semcount(typtr->tyisem)); + + case TC_ECHO: + typtr->tyiecho = TRUE; + return (devcall)OK; + + case TC_NOECHO: + typtr->tyiecho = FALSE; + return (devcall)OK; + + default: + return (devcall)SYSERR; + } + +} diff --git a/device/movidos/tty/ttygetc.c b/device/movidos/tty/ttygetc.c new file mode 100644 index 0000000..8388a50 --- /dev/null +++ b/device/movidos/tty/ttygetc.c @@ -0,0 +1,41 @@ +/* ttygetc.c - ttygetc */ + +#include + +/*------------------------------------------------------------------------ + * ttygetc - Read one character from a tty device (interrupts disabled) + *------------------------------------------------------------------------ + */ +devcall ttygetc( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + char ch; /* Character to return */ + struct ttycblk *typtr; /* Pointer to ttytab entry */ + + typtr = &ttytab[devptr->dvminor]; + + /* Wait for a character in the buffer and extract one character */ + + +// struct sentry * semptr; +// semptr = &semtab[typtr->tyisem]; +// while(--(semptr->scount) < 0); + wait(typtr->tyisem); + ch = *typtr->tyihead++; + + /* Wrap around to beginning of buffer, if needed */ + + if (typtr->tyihead >= &typtr->tyibuff[TY_IBUFLEN]) { + typtr->tyihead = typtr->tyibuff; + } + + /* In cooked mode, check for the EOF character */ + + if ( (typtr->tyimode == TY_IMCOOKED) && (typtr->tyeof) && + (ch == typtr->tyeofch) ) { + return (devcall)EOF; + } + + return (devcall)ch; +} diff --git a/device/movidos/tty/ttyhandle_in.c b/device/movidos/tty/ttyhandle_in.c new file mode 100644 index 0000000..1a972c7 --- /dev/null +++ b/device/movidos/tty/ttyhandle_in.c @@ -0,0 +1,267 @@ +/* ttyhandle_in.c - ttyhandle_in, erase1, eputc, echoch */ + +#include + +local void erase1(struct ttycblk *, struct uart_csreg *); +local void echoch(char, struct ttycblk *, struct uart_csreg *); +local void eputc(char, struct ttycblk *, struct uart_csreg *); + +/*------------------------------------------------------------------------ + * ttyhandle_in - Handle one arriving char (interrupts disabled) + *------------------------------------------------------------------------ + */ +void ttyhandle_in ( + struct ttycblk *typtr, /* Pointer to ttytab entry */ + struct uart_csreg *csrptr /* Address of UART's CSR */ + ) +{ + char ch; /* Next char from device */ + int32 avail; /* Chars available in buffer */ + + ch = csrptr->dr; + + /* Compute chars available */ + + avail = semcount(typtr->tyisem); + if (avail < 0) { /* One or more processes waiting*/ + avail = 0; + } + + /* Handle raw mode */ + + if (typtr->tyimode == TY_IMRAW) { + if (avail >= TY_IBUFLEN) { /* No space => ignore input */ + return; + } + + /* Place char in buffer with no editing */ + + *typtr->tyitail++ = ch; + + /* Wrap buffer pointer */ + + if (typtr->tyitail >= &typtr->tyibuff[TY_IBUFLEN]) { + typtr->tyitail = typtr->tyibuff; + } + + /* Signal input semaphore and return */ + signal(typtr->tyisem); + return; + } + + /* Handle cooked and cbreak modes (common part) */ + + if ( (ch == TY_RETURN) && typtr->tyicrlf ) { + ch = TY_NEWLINE; + } + + /* If flow control is in effect, handle ^S and ^Q */ + + if (typtr->tyoflow) { + if (ch == typtr->tyostart) { /* ^Q starts output */ + typtr->tyoheld = FALSE; + ttykickout(csrptr); + return; + } else if (ch == typtr->tyostop) { /* ^S stops output */ + typtr->tyoheld = TRUE; + return; + } + } + + typtr->tyoheld = FALSE; /* Any other char starts output */ + + if (typtr->tyimode == TY_IMCBREAK) { /* Just cbreak mode */ + + /* If input buffer is full, send bell to user */ + + if (avail >= TY_IBUFLEN) { + eputc(typtr->tyifullc, typtr, csrptr); + } else { /* Input buffer has space for this char */ + *typtr->tyitail++ = ch; + + /* Wrap around buffer */ + + if (typtr->tyitail>=&typtr->tyibuff[TY_IBUFLEN]) { + typtr->tyitail = typtr->tyibuff; + } + if (typtr->tyiecho) { /* Are we echoing chars?*/ + echoch(ch, typtr, csrptr); + } + signal(typtr->tyisem); + } + return; + + } else { /* Just cooked mode (see common code above) */ + + /* Line kill character arrives - kill entire line */ + + if (ch == typtr->tyikillc && typtr->tyikill) { + typtr->tyitail -= typtr->tyicursor; + if (typtr->tyitail < typtr->tyibuff) { + typtr->tyitail += TY_IBUFLEN; + } + typtr->tyicursor = 0; + eputc(TY_RETURN, typtr, csrptr); + eputc(TY_NEWLINE, typtr, csrptr); + return; + } + + /* Erase (backspace) character */ + + if ( ((ch==typtr->tyierasec) || (ch==typtr->tyierasec2)) + && typtr->tyierase) { + if (typtr->tyicursor > 0) { + typtr->tyicursor--; + erase1(typtr, csrptr); + } + return; + } + + /* End of line */ + + if ( (ch == TY_NEWLINE) || (ch == TY_RETURN) ) { + if (typtr->tyiecho) { + echoch(ch, typtr, csrptr); + } + *typtr->tyitail++ = ch; + if (typtr->tyitail>=&typtr->tyibuff[TY_IBUFLEN]) { + typtr->tyitail = typtr->tyibuff; + } + /* Make entire line (plus \n or \r) available */ + signaln(typtr->tyisem, typtr->tyicursor + 1); + typtr->tyicursor = 0; /* Reset for next line */ + return; + } + + /* Character to be placed in buffer - send bell if */ + /* buffer has overflowed */ + + avail = semcount(typtr->tyisem); + if (avail < 0) { + avail = 0; + } + if ((avail + typtr->tyicursor) >= TY_IBUFLEN-1) { + eputc(typtr->tyifullc, typtr, csrptr); + return; + } + + /* EOF character: recognize at beginning of line, but */ + /* print and ignore otherwise. */ + + if (ch == typtr->tyeofch && typtr->tyeof) { + if (typtr->tyiecho) { + echoch(ch, typtr, csrptr); + } + if (typtr->tyicursor != 0) { + return; + } + *typtr->tyitail++ = ch; + signal(typtr->tyisem); + return; + } + + + /* Echo the character */ + + if (typtr->tyiecho) { + echoch(ch, typtr, csrptr); + } + + /* Insert in the input buffer */ + + typtr->tyicursor++; + *typtr->tyitail++ = ch; + + /* Wrap around if needed */ + + if (typtr->tyitail >= &typtr->tyibuff[TY_IBUFLEN]) { + typtr->tyitail = typtr->tyibuff; + } + return; + } +} + +/*------------------------------------------------------------------------ + * erase1 - Erase one character honoring erasing backspace + *------------------------------------------------------------------------ + */ +local void erase1( + struct ttycblk *typtr, /* Ptr to ttytab entry */ + struct uart_csreg *csrptr /* Address of UART's CSRs */ + ) +{ + char ch; /* Character to erase */ + + if ( (--typtr->tyitail) < typtr->tyibuff) { + typtr->tyitail += TY_IBUFLEN; + } + + /* Pick up char to erase */ + + ch = *typtr->tyitail; + if (typtr->tyiecho) { /* Are we echoing? */ + if (ch < TY_BLANK || ch == 0177) { /* Nonprintable */ + if (typtr->tyevis) { /* Visual cntl chars */ + eputc(TY_BACKSP, typtr, csrptr); + if (typtr->tyieback) { /* Erase char */ + eputc(TY_BLANK, typtr, csrptr); + eputc(TY_BACKSP, typtr, csrptr); + } + } + eputc(TY_BACKSP, typtr, csrptr);/* Bypass up arr*/ + if (typtr->tyieback) { + eputc(TY_BLANK, typtr, csrptr); + eputc(TY_BACKSP, typtr, csrptr); + } + } else { /* A normal character that is printable */ + eputc(TY_BACKSP, typtr, csrptr); + if (typtr->tyieback) { /* erase the character */ + eputc(TY_BLANK, typtr, csrptr); + eputc(TY_BACKSP, typtr, csrptr); + } + } + } + return; +} + +/*------------------------------------------------------------------------ + * echoch - Echo a character with visual and output crlf options + *------------------------------------------------------------------------ + */ +local void echoch( + char ch, /* Character to echo */ + struct ttycblk *typtr, /* Ptr to ttytab entry */ + struct uart_csreg *csrptr /* Address of UART's CSRs */ + ) +{ + if ((ch==TY_NEWLINE || ch==TY_RETURN) && typtr->tyecrlf) { + eputc(TY_RETURN, typtr, csrptr); + eputc(TY_NEWLINE, typtr, csrptr); + } else if ( (chtyevis) { + eputc(TY_UPARROW, typtr, csrptr);/* print ^x */ + eputc(ch+0100, typtr, csrptr); /* Make it printable */ + } else { + eputc(ch, typtr, csrptr); + } +} + +/*------------------------------------------------------------------------ + * eputc - Put one character in the echo queue + *------------------------------------------------------------------------ + */ +local void eputc( + char ch, /* Character to echo */ + struct ttycblk *typtr, /* Ptr to ttytab entry */ + struct uart_csreg *csrptr /* Address of UART's CSRs */ + ) +{ + *typtr->tyetail++ = ch; + + /* Wrap around buffer, if needed */ + + if (typtr->tyetail >= &typtr->tyebuff[TY_EBUFLEN]) { + typtr->tyetail = typtr->tyebuff; + } + ttykickout(csrptr); + return; +} diff --git a/device/movidos/tty/ttyhandle_out.c b/device/movidos/tty/ttyhandle_out.c new file mode 100644 index 0000000..a8afe35 --- /dev/null +++ b/device/movidos/tty/ttyhandle_out.c @@ -0,0 +1,83 @@ +/* ttyhandle_out.c - ttyhandle_out */ + +#include + +/*------------------------------------------------------------------------ + * ttyhandle_out - Handle an output on a tty device by sending more + * characters to the device FIFO (interrupts disabled) + *------------------------------------------------------------------------ + */ +void ttyhandle_out( + struct ttycblk *typtr, /* Ptr to ttytab entry */ + struct uart_csreg *csrptr /* Address of UART's CSRs */ + ) +{ + + int32 ochars; /* Number of output chars sent */ + /* to the UART */ + int32 avail; /* Available chars in output buf*/ + int32 uspace; /* Space left in onboard UART */ + /* output FIFO */ + //uint32 ier = 0; + + /* If output is currently held, simply ignore the call */ + + if (typtr->tyoheld) { + return; + } + + /* If echo and output queues empty, turn off interrupts */ + + if ( (typtr->tyehead == typtr->tyetail) && + (semcount(typtr->tyosem) >= TY_OBUFLEN) ) { + csrptr->cr1 &= ~(1 << UART_INTR_TX); + //ier = csrptr->ier; + //csrptr->ier = ier & ~UART_IER_ETBEI; + return; + } + + /* Initialize uspace to the available space in the Tx FIFO */ + + //uspace = UART_FIFO_SIZE - csrptr->txfifo_lvl; + uspace = UART_FIFO_SIZE; + + + /* While onboard FIFO is not full and the echo queue is */ + /* nonempty, xmit chars from the echo queue */ + + while ( (uspace>0) && typtr->tyehead != typtr->tyetail) { + csrptr->dr = *typtr->tyehead++; + if (typtr->tyehead >= &typtr->tyebuff[TY_EBUFLEN]) { + typtr->tyehead = typtr->tyebuff; + } + uspace--; + } + + /* While onboard FIFO is not full and the output queue is */ + /* nonempty, transmit chars from the output queue */ + + ochars = 0; + avail = TY_OBUFLEN - semcount(typtr->tyosem); + while ( (uspace>0) && (avail > 0) ) { + //while(!(csrptr->sr & UART_TC)); + //while(csrptr->sr &= ~(1 << UART_TEST)); + csrptr->dr = *typtr->tyohead++; + if (typtr->tyohead >= &typtr->tyobuff[TY_OBUFLEN]) { + typtr->tyohead = typtr->tyobuff; + } + avail--; + uspace--; + ochars++; + } + if (ochars > 0) { + signaln(typtr->tyosem, ochars); + } + + if ( (typtr->tyehead == typtr->tyetail) && + (semcount(typtr->tyosem) >= TY_OBUFLEN) ) { + csrptr->cr1 &= ~(1 << UART_INTR_TX); + //ier = csrptr->ier; + //csrptr->ier = (ier & ~UART_IER_ETBEI); + } + return; +} diff --git a/device/movidos/tty/ttyhandler.c b/device/movidos/tty/ttyhandler.c new file mode 100644 index 0000000..6aa2a54 --- /dev/null +++ b/device/movidos/tty/ttyhandler.c @@ -0,0 +1,114 @@ +/* ttyhandler.c - ttyhandler */ + +#include + +/*------------------------------------------------------------------------ + * ttyhandler - Handle an interrupt for a tty (serial) device + *------------------------------------------------------------------------ + */ +void ttyhandler(uint32 xnum) { + struct dentry *devptr; /* Address of device control blk*/ + struct ttycblk *typtr; /* Pointer to ttytab entry */ + struct uart_csreg *csrptr; /* Address of UART's CSR */ +// uint32 iir = 0; /* Interrupt identification */ +// uint32 lsr = 0; /* Line status */ +// +// + /* Get CSR address of the device (assume console for now) */ + + devptr = (struct dentry *) &devtab[CONSOLE]; + csrptr = (struct uart_csreg *) devptr->dvcsr; + + /* Obtain a pointer to the tty control block */ + + typtr = &ttytab[devptr->dvminor]; + + /* Test type of UART interrupt */ + + uint8 flags = csrptr->sr & 0xFF; + //kprintf("%x", flags); + if (flags & UART_RXNE) { + ttyhandle_in(typtr, csrptr); + return; + } + + else if (flags & UART_TC) { + ttyhandle_out(typtr, csrptr); + return; + + } + +// switch(flags) { +// +// case UART_TC_TXE: +// case UART_TC: +// ttyhandle_out(typtr, csrptr); +// return; +// case UART_RXNE: +// ttyhandle_in(typtr, csrptr); +// return; +// +// default: +// kprintf("Unknown status\n"); +// return; +// } + +// /* Decode hardware interrupt request from UART device */ +// +// /* Check interrupt identification register */ +// iir = csrptr->iir; +// if (iir & UART_IIR_IRQ) { +// return; +// } +// +// /* Decode the interrupt cause based upon the value extracted */ +// /* from the UART interrupt identification register. Clear */ +// /* the interrupt source and perform the appropriate handling */ +// /* to coordinate with the upper half of the driver */ +// +// /* Decode the interrupt cause */ +// +// iir &= UART_IIR_IDMASK; /* Mask off the interrupt ID */ +// switch (iir) { +// +// /* Receiver line status interrupt (error) */ +// +// case UART_IIR_RLSI: +// lsr = csrptr->lsr; +// if(lsr & UART_LSR_BI) { /* Break Interrupt */ +// +// /* Read the RHR register to acknowledge */ +// +// lsr = csrptr->buffer; +// } +// return; +// +// /* Receiver data available or timed out */ +// +// case UART_IIR_RDA: +// case UART_IIR_RTO: +// +// resched_cntl(DEFER_START); +// +// /* While chars avail. in UART buffer, call ttyhandle_in */ +// +// while ( (csrptr->lsr & UART_LSR_DR) != 0) { +// ttyhandle_in(typtr, csrptr); +// } +// +// resched_cntl(DEFER_STOP); +// +// return; +// +// /* Transmitter output FIFO is empty (i.e., ready for more) */ +// +// case UART_IIR_THRE: +// ttyhandle_out(typtr, csrptr); +// return; +// +// /* Modem status change (simply ignore) */ +// +// case UART_IIR_MSC: +// return; +// } +} diff --git a/device/movidos/tty/ttyinit.c b/device/movidos/tty/ttyinit.c new file mode 100644 index 0000000..1706780 --- /dev/null +++ b/device/movidos/tty/ttyinit.c @@ -0,0 +1,83 @@ +/* ttyinit.c - ttyinit */ + +#include + +struct ttycblk ttytab[Ntty]; + +/*------------------------------------------------------------------------ + * ttyinit - Initialize buffers and modes for a tty line + *------------------------------------------------------------------------ + */ +devcall ttyinit( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + struct ttycblk *typtr; /* Pointer to ttytab entry */ + struct uart_csreg *uptr; /* Address of UART's CSRs */ + + typtr = &ttytab[ devptr->dvminor ]; + + /* Initialize values in the tty control block */ + + typtr->tyihead = typtr->tyitail = /* Set up input queue */ + &typtr->tyibuff[0]; /* as empty */ + typtr->tyisem = semcreate(0); /* Input semaphore */ + typtr->tyohead = typtr->tyotail = /* Set up output queue */ + &typtr->tyobuff[0]; /* as empty */ + typtr->tyosem = semcreate(TY_OBUFLEN); /* Output semaphore */ + typtr->tyehead = typtr->tyetail = /* Set up echo queue */ + &typtr->tyebuff[0]; /* as empty */ + typtr->tyimode = TY_IMCOOKED; /* Start in cooked mode */ + typtr->tyiecho = TRUE; /* Echo console input */ + typtr->tyieback = TRUE; /* Honor erasing bksp */ + typtr->tyevis = TRUE; /* Visual control chars */ + typtr->tyecrlf = TRUE; /* Echo CRLF for NEWLINE*/ + typtr->tyicrlf = TRUE; /* Map CR to NEWLINE */ + typtr->tyierase = TRUE; /* Do erasing backspace */ + typtr->tyierasec = TY_BACKSP; /* Primary erase char */ + typtr->tyierasec2= TY_BACKSP2; /* Alternate erase char */ + typtr->tyeof = TRUE; /* Honor eof on input */ + typtr->tyeofch = TY_EOFCH; /* End-of-file character*/ + typtr->tyikill = TRUE; /* Allow line kill */ + typtr->tyikillc = TY_KILLCH; /* Set line kill to ^U */ + typtr->tyicursor = 0; /* Start of input line */ + typtr->tyoflow = TRUE; /* Handle flow control */ + typtr->tyoheld = FALSE; /* Output not held */ + typtr->tyostop = TY_STOPCH; /* Stop char is ^S */ + typtr->tyostart = TY_STRTCH; /* Start char is ^Q */ + typtr->tyocrlf = TRUE; /* Send CRLF for NEWLINE*/ + typtr->tyifullc = TY_FULLCH; /* Send ^G when buffer */ + /* is full */ + + /* Initialize UART */ + struct gpio_csreg *gptr; + struct clock_csreg *cptr; + + /* Enable 'clock' on peripherals */ + cptr = (struct clock_csreg *)CLOCK_BASE; + cptr->apb2enr |= (1 << IOPAEN) | (1 << USART1EN); + + /* Set in and output mode */ + gptr = (struct gpio_csreg *)(0x40010800); + gptr->crh = 0x44444894; + + /* Enable peripheral */ + uptr = (struct uart_csreg *)(0x40013800); + uptr->cr1 &= ~(1 << UART_EN); + + /* Set baudrate 115200 */ + uptr->brr = 0x00000045; + + uptr->cr1 |= (1 << UART_TX_EN) | (1 << UART_RX_EN); /* Enable lines */ + uptr->cr1 |= (1 << UART_INTR_RX) | (1 << UART_INTR_TX); /* Enable interrupts */ + + /* Set and enable interrupt vector */ + set_evec(devptr->dvirq, (uint32)devptr->dvintr); + *NVIC_ISER1 |= (1 << 5); + + /* Start the device */ + uptr->cr1 |= (1 << UART_EN); + +// ttykickout(uptr); + return OK; +} diff --git a/device/movidos/tty/ttykickout.c b/device/movidos/tty/ttykickout.c new file mode 100644 index 0000000..c36e655 --- /dev/null +++ b/device/movidos/tty/ttykickout.c @@ -0,0 +1,19 @@ +/* ttykickout.c - ttykickout */ + +#include + +/*------------------------------------------------------------------------ + * ttykickout - "Kick" the hardware for a tty device, causing it to + * generate an output interrupt (interrupts disabled) + *------------------------------------------------------------------------ + */ +void ttykickout( + struct uart_csreg *csrptr /* Address of UART's CSRs */ + ) +{ + /* Force the UART hardware generate an output interrupt */ + csrptr->cr1 |= (1 << UART_INTR_TX); + *NVIC_STIR = 0x25; /* Generate general UART interrupt */ + + return; +} diff --git a/device/movidos/tty/ttyputc.c b/device/movidos/tty/ttyputc.c new file mode 100644 index 0000000..fbdac51 --- /dev/null +++ b/device/movidos/tty/ttyputc.c @@ -0,0 +1,44 @@ +/* ttyputc.c - ttyputc */ + +#include + +/*------------------------------------------------------------------------ + * ttyputc - Write one character to a tty device (interrupts disabled) + *------------------------------------------------------------------------ + */ +devcall ttyputc( + struct dentry *devptr, /* Entry in device switch table */ + char ch /* Character to write */ + ) +{ + //struct uart_csreg * uptr; + struct ttycblk *typtr; /* Pointer to tty control block */ + + //uptr = (struct uart_csreg *)devptr->csreg; + typtr = &ttytab[devptr->dvminor]; + + /* Handle output CRLF by sending CR first */ + + if ( ch==TY_NEWLINE && typtr->tyocrlf ) { + ttyputc(devptr, TY_RETURN); + } + + + wait(typtr->tyosem); /* Wait for space in queue */ + *typtr->tyotail++ = ch; + + /* Wrap around to beginning of buffer, if needed */ + + if (typtr->tyotail >= &typtr->tyobuff[TY_OBUFLEN]) { + typtr->tyotail = typtr->tyobuff; + } + + /* Start output in case device is idle */ + //while () { + // + // uptr->dr = + //} + ttykickout((struct uart_csreg *)devptr->dvcsr); + + return OK; +} diff --git a/device/movidos/tty/ttyread.c b/device/movidos/tty/ttyread.c new file mode 100644 index 0000000..b9b4f57 --- /dev/null +++ b/device/movidos/tty/ttyread.c @@ -0,0 +1,68 @@ +/* ttyread.c - ttyread */ + +#include + +/*------------------------------------------------------------------------ + * ttyread - Read character(s) from a tty device (interrupts disabled) + *------------------------------------------------------------------------ + */ +devcall ttyread( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer of characters */ + int32 count /* Count of character to read */ + ) +{ + struct ttycblk *typtr; /* Pointer to tty control block */ + int32 avail; /* Characters available in buff.*/ + int32 nread; /* Number of characters read */ + int32 firstch; /* First input character on line*/ + char ch; /* Next input character */ + + if (count < 0) { + return SYSERR; + } + typtr= &ttytab[devptr->dvminor]; + + if (typtr->tyimode != TY_IMCOOKED) { + + /* For count of zero, return all available characters */ + + if (count == 0) { + avail = semcount(typtr->tyisem); + if (avail == 0) { + return 0; + } else { + count = avail; + } + } + for (nread = 0; nread < count; nread++) { + *buff++ = (char) ttygetc(devptr); + } + return nread; + } + + /* Block until input arrives */ + + firstch = ttygetc(devptr); + + /* Check for End-Of-File */ + + if (firstch == EOF) { + return EOF; + } + + /* Read up to a line */ + + ch = (char) firstch; + *buff++ = ch; + nread = 1; + while ( (nread < count) && (ch != TY_NEWLINE) && + (ch != TY_RETURN) ) { + ch = ttygetc(devptr); + *buff++ = ch; + nread++; + } + return nread; + + return OK; +} diff --git a/device/movidos/tty/ttywrite.c b/device/movidos/tty/ttywrite.c new file mode 100644 index 0000000..f9f4ada --- /dev/null +++ b/device/movidos/tty/ttywrite.c @@ -0,0 +1,29 @@ +/* ttywrite.c - ttywrite */ + +#include + +/*------------------------------------------------------------------------ + * ttywrite - Write character(s) to a tty device (interrupts disabled) + *------------------------------------------------------------------------ + */ +devcall ttywrite( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer of characters */ + int32 count /* Count of character to write */ + ) +{ + /* Handle negative and zero counts */ + + if (count < 0) { + return SYSERR; + } else if (count == 0){ + return OK; + } + + /* Write count characters one at a time */ + + for (; count>0 ; count--) { + ttyputc(devptr, *buff++); + } + return OK; +} diff --git a/device/nam/mount.c b/device/nam/mount.c new file mode 100644 index 0000000..90ac46f --- /dev/null +++ b/device/nam/mount.c @@ -0,0 +1,76 @@ +/* mount.c - mount, namlen */ + +#include + +/*------------------------------------------------------------------------ + * mount - Add a prefix mapping to the name space + *------------------------------------------------------------------------ + */ +syscall mount( + char *prefix, /* Prefix to add */ + char *replace, /* Replacement string */ + did32 device /* Device ID to use */ +) +{ + intmask mask; /* Saved interrupt mask */ + struct nmentry *namptr; /* Pointer to unused table entry*/ + int32 psiz, rsiz; /* Sizes of prefix & replacement*/ + int32 i; /* Counter for copy loop */ + + mask = disable(); + + psiz = namlen(prefix, NM_PRELEN); + rsiz = namlen(replace, NM_REPLLEN); + + /* If arguments are invalid or table is full, return error */ + + if ( (psiz == SYSERR) || (rsiz == SYSERR) || + (isbaddev(device)) || (nnames >= NNAMES) ) { + restore(mask); + return SYSERR; + } + + /* Allocate a slot in the table */ + + namptr = &nametab[nnames]; /* Next unused entry in table */ + + /* copy prefix and replacement strings and record device ID */ + + for (i=0; inprefix[i] = *prefix++; + } + + for (i=0; inreplace[i] = *replace++; + } + + namptr->ndevice = device; /* Record the device ID */ + + nnames++; /* Increment number of names */ + + restore(mask); + return OK; +} + + +/*------------------------------------------------------------------------ + * namlen - Compute the length of a string stopping at maxlen + *------------------------------------------------------------------------ + */ +int32 namlen( + char *name, /* Name to use */ + int32 maxlen /* Maximum length (including a */ + /* NULLCH) */ +) +{ + int32 i; /* Count of characters found */ + + /* Search until a null terminator or length reaches max */ + + for (i=0; i < maxlen; i++) { + if (*name++ == NULLCH) { + return i+1; /* Include NULLCH in length */ + } + } + return SYSERR; +} diff --git a/device/nam/naminit.c b/device/nam/naminit.c new file mode 100644 index 0000000..35b479b --- /dev/null +++ b/device/nam/naminit.c @@ -0,0 +1,93 @@ +/* naminit.c - naminit */ + +#include + +#ifndef RFILESYS +#define RFILESYS SYSERR +#endif + +#ifndef FILESYS +#define FILESYS SYSERR +#endif + +#ifndef LFILESYS +#define LFILESYS SYSERR +#endif + +struct nmentry nametab[NNAMES]; /* Table of name mappings */ +int32 nnames; /* Number of entries allocated */ + +/*------------------------------------------------------------------------ + * naminit - Initialize the syntactic namespace + *------------------------------------------------------------------------ + */ +status naminit(void) +{ + did32 i; /* Index into devtab */ + struct dentry *devptr; /* Pointer to device table entry*/ + char tmpstr[NM_MAXLEN]; /* String to hold a name */ + status retval; /* Return value */ + char *tptr; /* Pointer into tempstring */ + char *nptr; /* Pointer to device name */ + char devprefix[] = "/dev/"; /* Prefix to use for devices */ + int32 len; /* Length of created name */ + char ch; /* Storage for a character */ + + /* Set prefix table to empty */ + + nnames = 0; + + for (i=0; idvname; /* Move to device name */ + + /* Map device name to lower case and append */ + + while(++len < NM_MAXLEN) { + ch = *nptr++; + if ( (ch >= 'A') && (ch <= 'Z')) { + ch += 'a' - 'A'; + } + if ( (*tptr++ = ch) == NULLCH) { + break; + } + } + + if (len > NM_MAXLEN) { + // RAFA kprintf("namespace: device name %s too long\r\n", + kprintf(&m5[0], + devptr->dvname); + continue; + } + + retval = mount(tmpstr, NULLSTR, devptr->dvnum); + if (retval == SYSERR) { + // RAFA kprintf("namespace: cannot mount device %d\r\n", + kprintf(&m4[0], + devptr->dvname); + continue; + } + } + + /* Add other prefixes (longest prefix first) */ + + mount("/dev/null", "", NULLDEV); +// mount("/remote/", "remote:", RFILESYS); +// mount("/local/", NULLSTR, LFILESYS); + mount("/dev/", NULLSTR, SYSERR); + // mount("~/", NULLSTR, LFILESYS); +// mount("/", "root:", RFILESYS); +// mount("", "", LFILESYS); + + return OK; +} diff --git a/device/nam/nammap.c b/device/nam/nammap.c new file mode 100644 index 0000000..1aa23e7 --- /dev/null +++ b/device/nam/nammap.c @@ -0,0 +1,135 @@ +/* nammap.c - nammap, namrepl, namcpy */ + +#include + +status namcpy(char *, char *, int32); +did32 namrepl(char *, char[]); + +/*------------------------------------------------------------------------ + * nammap - Using namespace, map name to new name and new device + *------------------------------------------------------------------------ + */ +devcall nammap( + char *name, /* The name to map */ + char newname[NM_MAXLEN], /* Buffer for mapped name */ + did32 namdev /* ID of the namespace device */ + ) +{ + did32 newdev; /* Device descriptor to return */ + char tmpname[NM_MAXLEN]; /* Temporary buffer for name */ + int32 iter; /* Number of iterations */ + + /* Place original name in temporary buffer and null terminate */ + + if (namcpy(tmpname, name, NM_MAXLEN) == SYSERR) { + return SYSERR; + } + + /* Repeatedly substitute the name prefix until a non-namespace */ + /* device is reached or an iteration limit is exceeded */ + + for (iter=0; iternprefix; /* Start at beginning of prefix */ + + /* Compare prefix to string and count prefix size */ + + for (plen=0; *pptr != NULLCH ; plen++) { + if (*pptr != *optr) { + break; + } + pptr++; + optr++; + } + if (*pptr != NULLCH) { /* Prefix does not match */ + continue; + } + + /* Found a match - check that replacement string plus */ + /* bytes remaining at the end of the original name will */ + /* fit into new name buffer. Ignore null on replacement*/ + /* string, but keep null on remainder of name. */ + + olen = namlen(name ,NM_MAXLEN); + rlen = namlen(namptr->nreplace,NM_MAXLEN) - 1; + remain = olen - plen; + if ( (rlen + remain) > NM_MAXLEN) { + return (did32)SYSERR; + } + + /* Place replacement string followed by remainder of */ + /* original name (and null) into the new name buffer */ + + + nptr = newname; + rptr = namptr->nreplace; + for (; rlen>0 ; rlen--) { + *nptr++ = *rptr++; + } + for (; remain>0 ; remain--) { + *nptr++ = *optr++; + } + return namptr->ndevice; + } + return (did32)SYSERR; +} + +/*------------------------------------------------------------------------ + * namcpy - Copy a name from one buffer to another, checking length + *------------------------------------------------------------------------ + */ +status namcpy( + char *newname, /* Buffer to hold copy */ + char *oldname, /* Buffer containing name */ + int32 buflen /* Size of buffer for copy */ + ) +{ + char *nptr; /* Point to new name */ + char *optr; /* Point to old name */ + int32 cnt; /* Count of characters copied */ + + nptr = newname; + optr = oldname; + + for (cnt=0; cnt + +/*------------------------------------------------------------------------ + * namopen - Open a file or device based on the name + *------------------------------------------------------------------------ + */ +devcall namopen( + struct dentry *devptr, /* Entry in device switch table */ + char *name, /* Name to open */ + char *mode /* Mode argument */ + ) +{ + char newname[NM_MAXLEN]; /* Name with prefix replaced */ + did32 newdev; /* Device ID after mapping */ + + /* Use namespace to map name to a new name and new descriptor */ + + newdev = nammap(name, newname, devptr->dvnum); + + if (newdev == SYSERR) { + return SYSERR; + } + + /* Open underlying device and return status */ + + return open(newdev, newname, mode); +} diff --git a/device/rds/rdsbufalloc.c b/device/rds/rdsbufalloc.c new file mode 100644 index 0000000..b872e07 --- /dev/null +++ b/device/rds/rdsbufalloc.c @@ -0,0 +1,50 @@ +/* rdsbufalloc.c - rdsbufalloc */ + +#include + +/*------------------------------------------------------------------------ + * rdsbufalloc - Allocate a buffer from the free list or the cache + *------------------------------------------------------------------------ + */ +struct rdbuff *rdsbufalloc ( + struct rdscblk *rdptr /* Ptr to device control block */ + ) +{ + struct rdbuff *bptr; /* Pointer to a buffer */ + struct rdbuff *pptr; /* Pointer to previous buffer */ + struct rdbuff *nptr; /* Pointer to next buffer */ + + /* Wait for an available buffer */ + + wait(rdptr->rd_availsem); + + /* If free list contains a buffer, extract it */ + + bptr = rdptr->rd_free; + + if ( bptr != (struct rdbuff *)NULL ) { + rdptr->rd_free = bptr->rd_next; + return bptr; + } + + /* Extract oldest item in cache that has ref count zero (at */ + /* least one such entry must exist because the semaphore */ + /* had a nonzero count) */ + + bptr = rdptr->rd_ctprev; + while (bptr != (struct rdbuff *) &rdptr->rd_chnext) { + if (bptr->rd_refcnt <= 0) { + + /* Remove from cache and return to caller */ + + pptr = bptr->rd_prev; + nptr = bptr->rd_next; + pptr->rd_next = nptr; + nptr->rd_prev = pptr; + return bptr; + } + bptr = bptr->rd_prev; + } + panic("Remote disk cannot find an available buffer"); + return (struct rdbuff *)SYSERR; +} diff --git a/device/rds/rdsclose.c b/device/rds/rdsclose.c new file mode 100644 index 0000000..eeac7e5 --- /dev/null +++ b/device/rds/rdsclose.c @@ -0,0 +1,60 @@ +/* rdsclose.c - rdsclose */ + +#include + +/*------------------------------------------------------------------------ + * rdsclose - Close a remote disk device + *------------------------------------------------------------------------ + */ +devcall rdsclose ( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + struct rdscblk *rdptr; /* Ptr to control block entry */ + struct rdbuff *bptr; /* Ptr to buffer on a list */ + struct rdbuff *nptr; /* Ptr to next buff on the list */ + int32 nmoved; /* Number of buffers moved */ + + /* Device must be open */ + + rdptr = &rdstab[devptr->dvminor]; + if (rdptr->rd_state != RD_OPEN) { + return SYSERR; + } + + /* Request queue must be empty */ + + if (rdptr->rd_rhnext != (struct rdbuff *)&rdptr->rd_rtnext) { + return SYSERR; + } + + /* Move all buffers from the cache to the free list */ + + bptr = rdptr->rd_chnext; + nmoved = 0; + while (bptr != (struct rdbuff *)&rdptr->rd_ctnext) { + nmoved++; + + /* Unlink buffer from cache */ + + nptr = bptr->rd_next; + (bptr->rd_prev)->rd_next = nptr; + nptr->rd_prev = bptr->rd_prev; + + /* Insert buffer into free list */ + + bptr->rd_next = rdptr->rd_free; + + rdptr->rd_free = bptr; + bptr->rd_status = RD_INVALID; + + /* Move to next buffer in the cache */ + + bptr = nptr; + } + + /* Set the state to indicate the device is closed */ + + rdptr->rd_state = RD_FREE; + return OK; +} diff --git a/device/rds/rdscomm.c b/device/rds/rdscomm.c new file mode 100644 index 0000000..d6d6484 --- /dev/null +++ b/device/rds/rdscomm.c @@ -0,0 +1,124 @@ +/* rdscomm.c - rdscomm */ + +#include + +/*------------------------------------------------------------------------ + * rdscomm - handle communication with a remote disk server (send a + * request and receive a reply, including sequencing and + * retries) + *------------------------------------------------------------------------ + */ +status rdscomm ( + struct rd_msg_hdr *msg, /* Message to send */ + int32 mlen, /* Message length */ + struct rd_msg_hdr *reply, /* Buffer for reply */ + int32 rlen, /* Size of reply buffer */ + struct rdscblk *rdptr /* Ptr to device control block */ + ) +{ + intmask mask; /* Saved interrupt mask */ + int32 i; /* Counts retries */ + int32 retval; /* Return value */ + int32 seq; /* Sequence for this exchange */ + uint32 localip; /* Local IP address */ + int16 rtype; /* Reply type in host byte order*/ + bool8 xmit; /* Should we transmit again? */ + int32 slot; /* UDP slot */ + + /* Disable interrupts while testing status */ + + mask = disable(); + + /* Register the server port, if not registered */ + + if ( ! rdptr->rd_registered ) { + slot = udp_register(0, rdptr->rd_ser_port, + rdptr->rd_loc_port); + if(slot == SYSERR) { + restore(mask); + return SYSERR; + } + rdptr->rd_udpslot = slot; + rdptr->rd_registered = TRUE; + } + + /* Get the local IP address */ + + if ( NetData.ipvalid == FALSE ) { + localip = getlocalip(); + if((int32)localip == SYSERR) { + restore(mask); + return SYSERR; + } + } + restore(mask); + + /* Retrieve the saved UDP slot number */ + + slot = rdptr->rd_udpslot; + + /* Assign message next sequence number */ + + seq = rdptr->rd_seq++; + msg->rd_seq = htonl(seq); + + /* Repeat RD_RETRIES times: send message and receive reply */ + + xmit = TRUE; + for (i=0; ird_ser_ip, rdptr->rd_ser_port, + (char *)msg, mlen); + if (retval == SYSERR) { + kprintf("Cannot send to remote disk server\n\r"); + return SYSERR; + } + } else { + xmit = TRUE; + } + + /* Receive a reply */ + + retval = udp_recv(slot, (char *)reply, rlen, + RD_TIMEOUT); + + if (retval == TIMEOUT) { + continue; + } else if (retval == SYSERR) { + kprintf("Error reading remote disk reply\n\r"); + return SYSERR; + } + + /* Verify that sequence in reply matches request */ + + + if (ntohl(reply->rd_seq) < seq) { + xmit = FALSE; + } else if (ntohl(reply->rd_seq) != seq) { + continue; + } + + /* Verify the type in the reply matches the request */ + + rtype = ntohs(reply->rd_type); + if (rtype != ( ntohs(msg->rd_type) | RD_MSG_RESPONSE) ) { + continue; + } + + /* Check the status */ + + if (ntohs(reply->rd_status) != 0) { + return SYSERR; + } + + return OK; + } + + /* Retries exhausted without success */ + + kprintf("Timeout on exchange with remote disk server\n\r"); + return TIMEOUT; +} diff --git a/device/rds/rdscontrol.c b/device/rds/rdscontrol.c new file mode 100644 index 0000000..7482394 --- /dev/null +++ b/device/rds/rdscontrol.c @@ -0,0 +1,131 @@ +/* rdscontrol.c - rdscontrol */ + +#include + +/*------------------------------------------------------------------------ + * rdscontrol - Provide control functions for the remote disk + *------------------------------------------------------------------------ + */ +devcall rdscontrol ( + struct dentry *devptr, /* Entry in device switch table */ + int32 func, /* The control function to use */ + int32 arg1, /* Argument #1 */ + int32 arg2 /* Argument #2 */ + ) +{ + struct rdscblk *rdptr; /* Pointer to control block */ + struct rdbuff *bptr; /* Ptr to buffer that will be */ + /* placed on the req. queue */ + struct rdbuff *pptr; /* Ptr to "previous" node on */ + /* a list */ + struct rd_msg_dreq msg; /* Buffer for delete request */ + struct rd_msg_dres resp; /* Buffer for delete response */ + char *to, *from; /* Used during name copy */ + int32 retval; /* Return value */ + + /* Verify that device is currently open */ + + rdptr = &rdstab[devptr->dvminor]; + if (rdptr->rd_state != RD_OPEN) { + return SYSERR; + } + + /* Ensure rdsprocess is runnning */ + + if ( ! rdptr->rd_comruns ) { + rdptr->rd_comruns = TRUE; + resume(rdptr->rd_comproc); + } + + switch (func) { + + /* Synchronize writes */ + + case RDS_CTL_SYNC: + + /* Allocate a buffer to use for the request list */ + + bptr = rdsbufalloc(rdptr); + if (bptr == (struct rdbuff *)SYSERR) { + return SYSERR; + } + + /* Form a sync request */ + + bptr->rd_op = RD_OP_SYNC; + bptr->rd_refcnt = 1; + bptr->rd_blknum = 0; /* Unused */ + bptr->rd_status = RD_INVALID; + bptr->rd_pid = getpid(); + + /* Insert new request into list just before tail */ + + pptr = rdptr->rd_rtprev; + rdptr->rd_rtprev = bptr; + bptr->rd_next = pptr->rd_next; + bptr->rd_prev = pptr; + pptr->rd_next = bptr; + + /* Prepare to wait until item is processed */ + + recvclr(); + + /* Signal then semaphore to start communication */ + + signal(rdptr->rd_reqsem); + + /* Block to wait for a message */ + + bptr = (struct rdbuff *)receive(); + if (bptr == (struct rdbuff *)SYSERR) { + return SYSERR; + } + break; + + /* Delete the remote disk (entirely remove it) */ + + case RDS_CTL_DEL: + + /* Handcraft a message for the server that requests */ + /* deleting the disk with the specified ID */ + + msg.rd_type = htons(RD_MSG_DREQ);/* Request deletion */ + msg.rd_status = htons(0); + msg.rd_seq = 0; /* rdscomm will insert sequence # later */ + to = msg.rd_id; + memset(to, NULLCH, RD_IDLEN); /* Initialize to zeroes */ + from = rdptr->rd_id; + while ( (*to++ = *from++) != NULLCH ) { /* copy ID */ + ; + } + + /* Send message and receive response */ + + retval = rdscomm((struct rd_msg_hdr *)&msg, + sizeof(struct rd_msg_dreq), + (struct rd_msg_hdr *)&resp, + sizeof(struct rd_msg_dres), + rdptr); + + /* Check response */ + + if (retval == SYSERR) { + return SYSERR; + } else if (retval == TIMEOUT) { + kprintf("Timeout during remote file delete\n\r"); + return SYSERR; + } else if (ntohs(resp.rd_status) != 0) { + return SYSERR; + } + + /* Close local device */ + + return rdsclose(devptr); + + default: + kprintf("rfsControl: function %d not valid\n\r", func); + return SYSERR; + } + + return OK; +} diff --git a/device/rds/rdsinit.c b/device/rds/rdsinit.c new file mode 100644 index 0000000..8c39f7f --- /dev/null +++ b/device/rds/rdsinit.c @@ -0,0 +1,108 @@ +/* rdsinit.c - rdsinit */ + +#include + +struct rdscblk rdstab[Nrds]; + +/*------------------------------------------------------------------------ + * rdsinit - Initialize the remote disk system device + *------------------------------------------------------------------------ + */ +devcall rdsinit ( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + 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 *buffend; /* Last address in buffer memory*/ + uint32 size; /* Total size of memory needed */ + /* buffers */ + + /* Obtain address of control block */ + + rdptr = &rdstab[devptr->dvminor]; + + /* Set control block to unused */ + + rdptr->rd_state = RD_FREE; + + /* Create the resprocess and leave it suspended. */ + /* Note: the process cannot be resumed because */ + /* device initialization occurs before interrupts */ + /* are enabled. */ + + rdptr->rd_comproc = create(rdsprocess, RD_STACK, RD_PRIO, + "rdsproc", 1, rdptr); + if (rdptr->rd_comproc == SYSERR) { + panic("Cannot create remote disk process"); + } + rdptr->rd_comruns = FALSE; + + rdptr->rd_id[0] = NULLCH; + + /* Set initial message sequence number */ + + rdptr->rd_seq = 1; + + /* Initialize request queue and cache to empty */ + + rdptr->rd_rhnext = (struct rdbuff *) &rdptr->rd_rtnext; + rdptr->rd_rhprev = (struct rdbuff *)NULL; + + rdptr->rd_rtnext = (struct rdbuff *)NULL; + rdptr->rd_rtprev = (struct rdbuff *) &rdptr->rd_rhnext; + + + rdptr->rd_chnext = (struct rdbuff *) &rdptr->rd_ctnext; + rdptr->rd_chprev = (struct rdbuff *)NULL; + + rdptr->rd_ctnext = (struct rdbuff *)NULL; + rdptr->rd_ctprev = (struct rdbuff *) &rdptr->rd_chnext; + + /* Allocate memory for a set of buffers (actually request */ + /* blocks and link them to form the initial free list */ + + size = sizeof(struct rdbuff) * RD_BUFFS; + + bptr = (struct rdbuff *)getmem(size); + rdptr->rd_free = bptr; + + if ((int32)bptr == SYSERR) { + panic("Cannot allocate memory for remote disk buffers"); + } + + pptr = (struct rdbuff *) NULL; /* To avoid a compiler warning */ + buffend = (struct rdbuff *) ((char *)bptr + size); + while (bptr < buffend) { /* walk through memory */ + pptr = bptr; + bptr = (struct rdbuff *) + (sizeof(struct rdbuff)+ (char *)bptr); + 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 */ + + /* Create the request list and available buffer semaphores */ + + rdptr->rd_availsem = semcreate(RD_BUFFS); + rdptr->rd_reqsem = semcreate(0); + + /* Set the server IP address, server port, and local port */ + + if ( dot2ip(RD_SERVER_IP, &rdptr->rd_ser_ip) == SYSERR ) { + panic("invalid IP address for remote disk server"); + } + + /* Set the port numbers */ + + rdptr->rd_ser_port = RD_SERVER_PORT; + rdptr->rd_loc_port = RD_LOC_PORT + devptr->dvminor; + + /* Specify that the server port is not yet registered */ + + rdptr->rd_registered = FALSE; + + return OK; +} diff --git a/device/rds/rdsopen.c b/device/rds/rdsopen.c new file mode 100644 index 0000000..67ee955 --- /dev/null +++ b/device/rds/rdsopen.c @@ -0,0 +1,93 @@ +/* rdsopen.c - rdsopen */ + +#include + +/*------------------------------------------------------------------------ + * rdsopen - Open a remote disk device and specify an ID to use + *------------------------------------------------------------------------ + */ + +devcall rdsopen ( + struct dentry *devptr, /* Entry in device switch table */ + char *diskid, /* Disk ID to use */ + char *mode /* Unused for a remote disk */ + ) +{ + struct rdscblk *rdptr; /* Ptr to control block entry */ + struct rd_msg_oreq msg; /* Message to be sent */ + struct rd_msg_ores resp; /* Buffer to hold response */ + int32 retval; /* Return value from rdscomm */ + int32 len; /* Counts chars in diskid */ + char *idto; /* Ptr to ID string copy */ + char *idfrom; /* Pointer into ID string */ + + rdptr = &rdstab[devptr->dvminor]; + + /* Reject if device is already open */ + + if (rdptr->rd_state != RD_FREE) { + return SYSERR; + } + rdptr->rd_state = RD_PEND; + + /* Copy disk ID into free table slot */ + + idto = rdptr->rd_id; + idfrom = diskid; + len = 0; + while ( (*idto++ = *idfrom++) != NULLCH) { + len++; + if (len >= RD_IDLEN) { /* ID string is too long */ + return SYSERR; + } + } + + /* Verify that name is non-null */ + + if (len == 0) { + return SYSERR; + } + + /* Hand-craft an open request message to be sent to the server */ + + msg.rd_type = htons(RD_MSG_OREQ);/* Request an open */ + msg.rd_status = htons(0); + msg.rd_seq = 0; /* Rdscomm fills in an entry */ + idto = msg.rd_id; + memset(idto, NULLCH, RD_IDLEN);/* initialize ID to zero bytes */ + + idfrom = diskid; + while ( (*idto++ = *idfrom++) != NULLCH ) { /* Copy ID to req. */ + ; + } + + /* Send message and receive response */ + + retval = rdscomm((struct rd_msg_hdr *)&msg, + sizeof(struct rd_msg_oreq), + (struct rd_msg_hdr *)&resp, + sizeof(struct rd_msg_ores), + rdptr ); + + /* Check response */ + + if (retval == SYSERR) { + rdptr->rd_state = RD_FREE; + return SYSERR; + } else if (retval == TIMEOUT) { + kprintf("Timeout during remote file open\n\r"); + rdptr->rd_state = RD_FREE; + return SYSERR; + } else if (ntohs(resp.rd_status) != 0) { + rdptr->rd_state = RD_FREE; + return SYSERR; + } + + /* Change state of device to indicate currently open */ + + rdptr->rd_state = RD_OPEN; + + /* Return device descriptor */ + + return devptr->dvnum; +} diff --git a/device/rds/rdsprocess.c b/device/rds/rdsprocess.c new file mode 100644 index 0000000..a01ebab --- /dev/null +++ b/device/rds/rdsprocess.c @@ -0,0 +1,212 @@ +/* rdsprocess.c - rdsprocess */ + +#include + +/*------------------------------------------------------------------------ + * rdsprocess - High-priority background process that repeatedly + * extracts an item from the request queue, sends the + * request to the remote disk server, and handles the + * response, including caching responses blocks + *------------------------------------------------------------------------ + */ +void rdsprocess ( + struct rdscblk *rdptr /* Ptr to device control block */ + ) +{ + struct rd_msg_wreq msg; /* Message to be sent */ + /* (includes data area) */ + struct rd_msg_rres resp; /* Buffer to hold response */ + /* (includes data area) */ + int32 retval; /* Return value from rdscomm */ + char *idto; /* Ptr to ID string copy */ + char *idfrom; /* Ptr into ID string */ + struct rdbuff *bptr; /* Ptr to buffer at the head of */ + /* the request queue */ + struct rdbuff *nptr; /* Ptr to next buffer on the */ + /* request queue */ + struct rdbuff *pptr; /* Ptr to previous buffer */ + struct rdbuff *qptr; /* Ptr that runs along the */ + /* request queue */ + int32 i; /* Loop index */ + + while (TRUE) { /* Do forever */ + + /* Wait until the request queue contains a node */ + wait(rdptr->rd_reqsem); + bptr = rdptr->rd_rhnext; + + /* Use operation in request to determine action */ + + switch (bptr->rd_op) { + + case RD_OP_READ: + + /* Build a read request message for the server */ + + msg.rd_type = htons(RD_MSG_RREQ); /* Read request */ + msg.rd_status = htons(0); + msg.rd_seq = 0; /* Rdscomm fills in an entry */ + idto = msg.rd_id; + memset(idto, NULLCH, RD_IDLEN);/* Initialize ID to zero */ + idfrom = rdptr->rd_id; + while ( (*idto++ = *idfrom++) != NULLCH ) { /* Copy ID */ + ; + } + + /* Send the message and receive a response */ + + retval = rdscomm((struct rd_msg_hdr *)&msg, + sizeof(struct rd_msg_rreq), + (struct rd_msg_hdr *)&resp, + sizeof(struct rd_msg_rres), + rdptr ); + + /* Check response */ + + if ( (retval == SYSERR) || (retval == TIMEOUT) || + (ntohs(resp.rd_status) != 0) ) { + panic("Failed to contact remote disk server"); + } + + /* Copy data from the reply into the buffer */ + + for (i=0; ird_block[i] = resp.rd_data[i]; + } + + /* Unlink buffer from the request queue */ + + nptr = bptr->rd_next; + pptr = bptr->rd_prev; + nptr->rd_prev = bptr->rd_prev; + pptr->rd_next = bptr->rd_next; + + /* Insert buffer in the cache */ + + pptr = (struct rdbuff *) &rdptr->rd_chnext; + nptr = pptr->rd_next; + bptr->rd_next = nptr; + bptr->rd_prev = pptr; + pptr->rd_next = bptr; + nptr->rd_prev = bptr; + + /* Initialize reference count */ + + bptr->rd_refcnt = 1; + + /* Signal the available semaphore */ + + signal(rdptr->rd_availsem); + + /* Send a message to waiting process */ + + send(bptr->rd_pid, (uint32)bptr); + + /* If other processes are waiting to read the */ + /* block, notify them and remove the request */ + + qptr = rdptr->rd_rhnext; + while (qptr != (struct rdbuff *)&rdptr->rd_rtnext) { + if (qptr->rd_blknum == bptr->rd_blknum) { + bptr->rd_refcnt++; + send(qptr->rd_pid,(uint32)bptr); + + /* Unlink request from queue */ + + pptr = qptr->rd_prev; + nptr = qptr->rd_next; + pptr->rd_next = bptr->rd_next; + nptr->rd_prev = bptr->rd_prev; + + /* Move buffer to the free list */ + + qptr->rd_next = rdptr->rd_free; + rdptr->rd_free = qptr; + signal(rdptr->rd_availsem); + break; + } + qptr = qptr->rd_next; + } + break; + + case RD_OP_WRITE: + + /* Build a write request message for the server */ + + msg.rd_type = htons(RD_MSG_WREQ); /* Write request*/ + msg.rd_blk = bptr->rd_blknum; + msg.rd_status = htons(0); + msg.rd_seq = 0; /* Rdscomb fills in an entry */ + idto = msg.rd_id; + memset(idto, NULLCH, RD_IDLEN);/* Initialize ID to zero */ + idfrom = rdptr->rd_id; + while ( (*idto++ = *idfrom++) != NULLCH ) { /* Copy ID */ + ; + } + for (i=0; ird_block[i]; + } + + /* Unlink buffer from request queue */ + + nptr = bptr->rd_next; + pptr = bptr->rd_prev; + pptr->rd_next = nptr; + nptr->rd_prev = pptr; + + /* Insert buffer in the cache */ + + pptr = (struct rdbuff *) &rdptr->rd_chnext; + nptr = pptr->rd_next; + bptr->rd_next = nptr; + bptr->rd_prev = pptr; + pptr->rd_next = bptr; + nptr->rd_prev = bptr; + + /* Declare that buffer is eligible for reuse */ + + bptr->rd_refcnt = 0; + signal(rdptr->rd_availsem); + + /* Send the message and receive a response */ + + retval = rdscomm((struct rd_msg_hdr *)&msg, + sizeof(struct rd_msg_wreq), + (struct rd_msg_hdr *)&resp, + sizeof(struct rd_msg_wres), + rdptr ); + + /* Check response */ + + if ( (retval == SYSERR) || (retval == TIMEOUT) || + (ntohs(resp.rd_status) != 0) ) { + panic("failed to contact remote disk server"); + } + break; + + case RD_OP_SYNC: + + /* Send a message to the waiting process */ + + send(bptr->rd_pid, OK); + + /* Unlink buffer from the request queue */ + + nptr = bptr->rd_next; + pptr = bptr->rd_prev; + nptr->rd_prev = bptr->rd_prev; + pptr->rd_next = bptr->rd_next; + + /* Insert buffer into the free list */ + + bptr->rd_next = rdptr->rd_free; + rdptr->rd_free = bptr; + signal(rdptr->rd_availsem); + break; + } + } +} + + + + diff --git a/device/rds/rdsread.c b/device/rds/rdsread.c new file mode 100644 index 0000000..be99f01 --- /dev/null +++ b/device/rds/rdsread.c @@ -0,0 +1,130 @@ +/* rdsread.c - rdsread */ + +#include + +/*------------------------------------------------------------------------ + * rdsread - Read a block from a remote disk + *------------------------------------------------------------------------ + */ +devcall rdsread ( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer to hold disk block */ + int32 blk /* Block number of block to read*/ + ) +{ + struct rdscblk *rdptr; /* Pointer to control block */ + struct rdbuff *bptr; /* Pointer to buffer possibly */ + /* in the request list */ + struct rdbuff *nptr; /* Pointer to "next" node on a */ + /* list */ + struct rdbuff *pptr; /* Pointer to "previous" node */ + /* on a list */ + struct rdbuff *cptr; /* Pointer that walks the cache */ + + /* If device not currently in use, report an error */ + + rdptr = &rdstab[devptr->dvminor]; + if (rdptr->rd_state != RD_OPEN) { + return SYSERR; + } + + /* Ensure rdsprocess is runnning */ + + if ( ! rdptr->rd_comruns ) { + rdptr->rd_comruns = TRUE; + resume(rdptr->rd_comproc); + } + + /* Search the cache for specified block */ + + bptr = rdptr->rd_chnext; + while (bptr != (struct rdbuff *)&rdptr->rd_ctnext) { + if (bptr->rd_blknum == blk) { + if (bptr->rd_status == RD_INVALID) { + break; + } + memcpy(buff, bptr->rd_block, RD_BLKSIZ); + return OK; + } + bptr = bptr->rd_next; + } + + /* Search the request list for most recent occurrence of block */ + + bptr = rdptr->rd_rtprev; /* Start at tail of list */ + + while (bptr != (struct rdbuff *)&rdptr->rd_rhnext) { + if (bptr->rd_blknum == blk) { + + /* If most recent request for block is write, copy data */ + + if (bptr->rd_op == RD_OP_WRITE) { + memcpy(buff, bptr->rd_block, RD_BLKSIZ); + return OK; + } + break; + } + bptr = bptr->rd_prev; + } + + /* Allocate a buffer and add read request to tail of req. queue */ + + bptr = rdsbufalloc(rdptr); + bptr->rd_op = RD_OP_READ; + bptr->rd_refcnt = 1; + bptr->rd_blknum = blk; + bptr->rd_status = RD_INVALID; + bptr->rd_pid = getpid(); + + /* Insert new request into list just before tail */ + + pptr = rdptr->rd_rtprev; + rdptr->rd_rtprev = bptr; + bptr->rd_next = pptr->rd_next; + bptr->rd_prev = pptr; + pptr->rd_next = bptr; + + /* Prepare to receive message when read completes */ + + recvclr(); + + /* Signal the semaphore to start communication */ + + signal(rdptr->rd_reqsem); + + /* Block to wait for a message */ + + bptr = (struct rdbuff *)receive(); + if (bptr == (struct rdbuff *)SYSERR) { + return SYSERR; + } + memcpy(buff, bptr->rd_block, RD_BLKSIZ); + bptr->rd_refcnt--; + if (bptr->rd_refcnt <= 0) { + + /* Look for previous item in cache with the same block */ + /* number to see if this item was only being kept */ + /* until pending read completed */ + + cptr = rdptr->rd_chnext; + while (cptr != bptr) { + if (cptr->rd_blknum == blk) { + + /* Unlink from cache */ + + pptr = bptr->rd_prev; + nptr = bptr->rd_next; + pptr->rd_next = nptr; + nptr->rd_prev = pptr; + + /* Add to the free list */ + + bptr->rd_next = rdptr->rd_free; + rdptr->rd_free = bptr; + break; + } + cptr = cptr->rd_next; + } + } + return OK; +} diff --git a/device/rds/rdswrite.c b/device/rds/rdswrite.c new file mode 100644 index 0000000..e9eed2a --- /dev/null +++ b/device/rds/rdswrite.c @@ -0,0 +1,97 @@ +/* rdswrite.c - rdswrite */ + +#include + +/*------------------------------------------------------------------------ + * rdswrite - Write a block to a remote disk + *------------------------------------------------------------------------ + */ +devcall rdswrite ( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer that holds a disk blk */ + int32 blk /* Block number to write */ + ) +{ + struct rdscblk *rdptr; /* Pointer to control block */ + struct rdbuff *bptr; /* Pointer to buffer on a list */ + struct rdbuff *pptr; /* Ptr to previous buff on list */ + struct rdbuff *nptr; /* Ptr to next buffer on list */ + bool8 found; /* Was buff found during search?*/ + + /* If device not currently in use, report an error */ + + rdptr = &rdstab[devptr->dvminor]; + if (rdptr->rd_state != RD_OPEN) { + return SYSERR; + } + + /* Ensure rdsprocess is runnning */ + + if ( ! rdptr->rd_comruns ) { + rdptr->rd_comruns = TRUE; + resume(rdptr->rd_comproc); + } + + /* If request queue already contains a write request */ + /* for the block, replace the contents */ + + bptr = rdptr->rd_rhnext; + while (bptr != (struct rdbuff *)&rdptr->rd_rtnext) { + if ( (bptr->rd_blknum == blk) && + (bptr->rd_op == RD_OP_WRITE) ) { + memcpy(bptr->rd_block, buff, RD_BLKSIZ); + return OK; + } + bptr = bptr->rd_next; + } + + /* Search cache for cached copy of block */ + + bptr = rdptr->rd_chnext; + found = FALSE; + while (bptr != (struct rdbuff *)&rdptr->rd_ctnext) { + if (bptr->rd_blknum == blk) { + if (bptr->rd_refcnt <= 0) { + pptr = bptr->rd_prev; + nptr = bptr->rd_next; + + /* Unlink node from cache list and reset*/ + /* the available semaphore accordingly*/ + + pptr->rd_next = bptr->rd_next; + nptr->rd_prev = bptr->rd_prev; + semreset(rdptr->rd_availsem, + semcount(rdptr->rd_availsem) - 1); + found = TRUE; + } + break; + } + bptr = bptr->rd_next; + } + + if ( !found ) { + bptr = rdsbufalloc(rdptr); + } + + /* Create a write request */ + + memcpy(bptr->rd_block, buff, RD_BLKSIZ); + bptr->rd_op = RD_OP_WRITE; + bptr->rd_refcnt = 0; + bptr->rd_blknum = blk; + bptr->rd_status = RD_VALID; + bptr->rd_pid = getpid(); + + /* Insert new request into list just before tail */ + + pptr = rdptr->rd_rtprev; + rdptr->rd_rtprev = bptr; + bptr->rd_next = pptr->rd_next; + bptr->rd_prev = pptr; + pptr->rd_next = bptr; + + /* Signal semaphore to start communication process */ + + signal(rdptr->rd_reqsem); + return OK; +} diff --git a/device/rfs/rflclose.c b/device/rfs/rflclose.c new file mode 100644 index 0000000..f1f0d87 --- /dev/null +++ b/device/rfs/rflclose.c @@ -0,0 +1,32 @@ +/* rflclose.c - rflclose */ + +#include + +/*------------------------------------------------------------------------ + * rflclose - Close a remote file device + *------------------------------------------------------------------------ + */ +devcall rflclose ( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + struct rflcblk *rfptr; /* Pointer to control block */ + + /* Wait for exclusive access */ + + wait(Rf_data.rf_mutex); + + /* Verify remote file device is open */ + + rfptr = &rfltab[devptr->dvminor]; + if (rfptr->rfstate == RF_FREE) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Mark device closed */ + + rfptr->rfstate = RF_FREE; + signal(Rf_data.rf_mutex); + return OK; +} diff --git a/device/rfs/rflgetc.c b/device/rfs/rflgetc.c new file mode 100644 index 0000000..3db46c1 --- /dev/null +++ b/device/rfs/rflgetc.c @@ -0,0 +1,23 @@ +/* rflgetc.c - rflgetc */ + +#include + +/*------------------------------------------------------------------------ + * rflgetc - Read one character from a remote file + *------------------------------------------------------------------------ + */ +devcall rflgetc( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + char ch; /* Character to read */ + int32 retval; /* Return value */ + + retval = rflread(devptr, &ch, 1); + + if (retval != 1) { + return SYSERR; + } + + return (devcall)ch; +} diff --git a/device/rfs/rflinit.c b/device/rfs/rflinit.c new file mode 100644 index 0000000..79e43c8 --- /dev/null +++ b/device/rfs/rflinit.c @@ -0,0 +1,29 @@ +/* rflinit.c - rflinit */ + +#include + +struct rflcblk rfltab[Nrfl]; /* Remote file control blocks */ + +/*------------------------------------------------------------------------ + * rflinit - Initialize a remote file device + *------------------------------------------------------------------------ + */ +devcall rflinit( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + struct rflcblk *rflptr; /* Ptr. to control block entry */ + int32 i; /* Walks through name arrary */ + + rflptr = &rfltab[ devptr->dvminor ]; + + /* Initialize entry to unused */ + + rflptr->rfstate = RF_FREE; + rflptr->rfdev = devptr->dvnum; + for (i=0; irfname[i] = NULLCH; + } + rflptr->rfpos = rflptr->rfmode = 0; + return OK; +} diff --git a/device/rfs/rflputc.c b/device/rfs/rflputc.c new file mode 100644 index 0000000..d7e06e3 --- /dev/null +++ b/device/rfs/rflputc.c @@ -0,0 +1,19 @@ +/* rflputc.c - rflputc */ + +#include + +/*------------------------------------------------------------------------ + * rflputc - Write one character to a remote file + *------------------------------------------------------------------------ + */ +devcall rflputc( + struct dentry *devptr, /* Entry in device switch table */ + char ch /* Character to write */ + ) +{ + if (rflwrite(devptr, &ch, 1) != 1) { + return SYSERR; + } + + return OK; +} diff --git a/device/rfs/rflread.c b/device/rfs/rflread.c new file mode 100644 index 0000000..5d8979b --- /dev/null +++ b/device/rfs/rflread.c @@ -0,0 +1,100 @@ +/* rflread.c - rflread */ + +#include + +/*------------------------------------------------------------------------ + * rflread - Read data from a remote file + *------------------------------------------------------------------------ + */ +devcall rflread ( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer of bytes */ + int32 count /* Count of bytes to read */ + ) +{ + struct rflcblk *rfptr; /* Pointer to control block */ + int32 retval; /* Return value */ + struct rf_msg_rreq msg; /* Request message to send */ + struct rf_msg_rres resp; /* Buffer for response */ + int32 i; /* Counts bytes copied */ + char *from, *to; /* Used during name copy */ + int32 len; /* Length of name */ + + /* Wait for exclusive access */ + + wait(Rf_data.rf_mutex); + + /* Verify count is legitimate */ + + if ( (count <= 0) || (count > RF_DATALEN) ) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Verify pseudo-device is in use */ + + rfptr = &rfltab[devptr->dvminor]; + + /* If device not currently in use, report an error */ + + if (rfptr->rfstate == RF_FREE) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Verify pseudo-device allows reading */ + + if ((rfptr->rfmode & RF_MODE_R) == 0) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Form read request */ + + msg.rf_type = htons(RF_MSG_RREQ); + msg.rf_status = htons(0); + msg.rf_seq = 0; /* Rfscomm will set sequence */ + from = rfptr->rfname; + to = msg.rf_name; + memset(to, NULLCH, RF_NAMLEN); /* Start name as all zero bytes */ + len = 0; + while ( (*to++ = *from++) ) { /* Copy name to request */ + if (++len >= RF_NAMLEN) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + } + msg.rf_pos = htonl(rfptr->rfpos);/* Set file position */ + msg.rf_len = htonl(count); /* Set count of bytes to read */ + + /* Send message and receive response */ + + retval = rfscomm((struct rf_msg_hdr *)&msg, + sizeof(struct rf_msg_rreq), + (struct rf_msg_hdr *)&resp, + sizeof(struct rf_msg_rres) ); + + /* Check response */ + + if (retval == SYSERR) { + signal(Rf_data.rf_mutex); + return SYSERR; + } else if (retval == TIMEOUT) { + kprintf("Timeout during remote file read\n"); + signal(Rf_data.rf_mutex); + return SYSERR; + } else if (ntohs(resp.rf_status) != 0) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Copy data to application buffer and update file position */ + + for (i=0; irfpos += ntohl(resp.rf_len); + + signal(Rf_data.rf_mutex); + return ntohl(resp.rf_len); +} diff --git a/device/rfs/rflseek.c b/device/rfs/rflseek.c new file mode 100644 index 0000000..4a84788 --- /dev/null +++ b/device/rfs/rflseek.c @@ -0,0 +1,33 @@ +/* rflseek.c - rflseek */ + +#include + +/*------------------------------------------------------------------------ + * rflseek - Change the current position in an open file + *------------------------------------------------------------------------ + */ +devcall rflseek ( + struct dentry *devptr, /* Entry in device switch table */ + uint32 pos /* New file position */ + ) +{ + struct rflcblk *rfptr; /* Pointer to control block */ + + /* Wait for exclusive access */ + + wait(Rf_data.rf_mutex); + + /* Verify remote file device is open */ + + rfptr = &rfltab[devptr->dvminor]; + if (rfptr->rfstate == RF_FREE) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Set the new position */ + + rfptr->rfpos = pos; + signal(Rf_data.rf_mutex); + return OK; +} diff --git a/device/rfs/rflwrite.c b/device/rfs/rflwrite.c new file mode 100644 index 0000000..ec3c2b9 --- /dev/null +++ b/device/rfs/rflwrite.c @@ -0,0 +1,97 @@ +/* rflwrite.c - rflwrite */ + +#include + +/*------------------------------------------------------------------------ + * rflwrite - Write data to a remote file + *------------------------------------------------------------------------ + */ +devcall rflwrite ( + struct dentry *devptr, /* Entry in device switch table */ + char *buff, /* Buffer of bytes */ + int32 count /* Count of bytes to write */ + ) +{ + struct rflcblk *rfptr; /* Pointer to control block */ + int32 retval; /* Return value */ + struct rf_msg_wreq msg; /* Request message to send */ + struct rf_msg_wres resp; /* Buffer for response */ + char *from, *to; /* Used to copy name */ + int i; /* Counts bytes copied into req */ + int32 len; /* Length of name */ + + /* Wait for exclusive access */ + + wait(Rf_data.rf_mutex); + + /* Verify count is legitimate */ + + if ( (count <= 0) || (count > RF_DATALEN) ) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Verify pseudo-device is in use and mode allows writing */ + + rfptr = &rfltab[devptr->dvminor]; + if ( (rfptr->rfstate == RF_FREE) || + ! (rfptr->rfmode & RF_MODE_W) ) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Form write request */ + + msg.rf_type = htons(RF_MSG_WREQ); + msg.rf_status = htons(0); + msg.rf_seq = 0; /* Rfscomm will set sequence */ + from = rfptr->rfname; + to = msg.rf_name; + memset(to, NULLCH, RF_NAMLEN); /* Start name as all zero bytes */ + len = 0; + while ( (*to++ = *from++) ) { /* Copy name to request */ + if (++len >= RF_NAMLEN) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + } + while ( (*to++ = *from++) ) { /* Copy name into request */ + ; + } + msg.rf_pos = htonl(rfptr->rfpos);/* Set file position */ + msg.rf_len = htonl(count); /* Set count of bytes to write */ + for (i=0; irfpos += ntohl(resp.rf_len); + + signal(Rf_data.rf_mutex); + return ntohl(resp.rf_len); +} diff --git a/device/rfs/rfscomm.c b/device/rfs/rfscomm.c new file mode 100644 index 0000000..cea00b8 --- /dev/null +++ b/device/rfs/rfscomm.c @@ -0,0 +1,85 @@ +/* rfscomm.c - rfscomm */ + +#include + +/*------------------------------------------------------------------------ + * rfscomm - Handle communication with RFS server (send request and + * receive a reply, including sequencing and retries) + *------------------------------------------------------------------------ + */ +int32 rfscomm ( + struct rf_msg_hdr *msg, /* Message to send */ + int32 mlen, /* Message length */ + struct rf_msg_hdr *reply, /* Buffer for reply */ + int32 rlen /* Size of reply buffer */ + ) +{ + int32 i; /* Counts retries */ + 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 */ + + if ( ! Rf_data.rf_registered ) { + if ( (slot = udp_register(Rf_data.rf_ser_ip, + Rf_data.rf_ser_port, + Rf_data.rf_loc_port)) == SYSERR) { + return SYSERR; + } + Rf_data.rf_udp_slot = slot; + Rf_data.rf_registered = TRUE; + } + + /* Assign message next sequence number */ + + seq = Rf_data.rf_seq++; + msg->rf_seq = htonl(seq); + + /* Repeat RF_RETRIES times: send message and receive reply */ + + for (i=0; irf_seq) != seq) { + continue; + } + + /* Verify the type in the reply matches the request */ + + rtype = ntohs(reply->rf_type); + if (rtype != ( ntohs(msg->rf_type) | RF_MSG_RESPONSE) ) { + continue; + } + + return retval; /* Return length to caller */ + } + + /* Retries exhausted without success */ + + kprintf("Timeout on exchange with remote file server\n"); + return TIMEOUT; +} diff --git a/device/rfs/rfscontrol.c b/device/rfs/rfscontrol.c new file mode 100644 index 0000000..f10cbb9 --- /dev/null +++ b/device/rfs/rfscontrol.c @@ -0,0 +1,114 @@ +/* rfscontrol.c - rfscontrol */ + +#include + +/*------------------------------------------------------------------------ + * rfscontrol - Provide control functions for the remote file system + *------------------------------------------------------------------------ + */ +devcall rfscontrol ( + struct dentry *devptr, /* Entry in device switch table */ + int32 func, /* A control function */ + int32 arg1, /* Argument #1 */ + int32 arg2 /* Argument #2 */ + ) +{ + int32 len; /* Length of name */ + struct rf_msg_sreq msg; /* Buffer for size request */ + struct rf_msg_sres resp; /* Buffer for size response */ + char *to, *from; /* Used during name copy */ + int32 retval; /* Return value */ + + /* Wait for exclusive access */ + + wait(Rf_data.rf_mutex); + + /* Check length of name (copy during the check even though the */ + /* copy is only used for a size request) */ + + from = (char *)arg1; + to = msg.rf_name; + len = 0; + memset(to, NULLCH, RF_NAMLEN); /* Start name as all zeroes */ + while ( (*to++ = *from++) ) { /* Copy name to message */ + len++; + if (len >= (RF_NAMLEN - 1) ) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + } + + switch (func) { + + /* Delete a file */ + + case RFS_CTL_DEL: + if (rfsndmsg(RF_MSG_DREQ, (char *)arg1) == SYSERR) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + break; + + /* Truncate a file */ + + case RFS_CTL_TRUNC: + if (rfsndmsg(RF_MSG_TREQ, (char *)arg1) == SYSERR) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + break; + + + + /* Make a directory */ + + case RFS_CTL_MKDIR: + if (rfsndmsg(RF_MSG_MREQ, (char *)arg1) == SYSERR) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + break; + + /* Remove a directory */ + + case RFS_CTL_RMDIR: + if (rfsndmsg(RF_MSG_XREQ, (char *)arg1) == SYSERR) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + break; + + /* Obtain current file size (cannot use rfsndmsg because a */ + /* response contains a value in addition to the header) */ + + case RFS_CTL_SIZE: + + /* Hand-craft a size request message */ + + msg.rf_type = htons(RF_MSG_SREQ); + msg.rf_status = htons(0); + msg.rf_seq = 0; /* Rfscomm will set the seq num */ + + /* Send the request to server and obtain a response */ + + retval = rfscomm( (struct rf_msg_hdr *)&msg, + sizeof(struct rf_msg_sreq), + (struct rf_msg_hdr *)&resp, + sizeof(struct rf_msg_sres) ); + if ( (retval == SYSERR) || (retval == TIMEOUT) ) { + signal(Rf_data.rf_mutex); + return SYSERR; + } else { + signal(Rf_data.rf_mutex); + return ntohl(resp.rf_size); + } + + default: + kprintf("rfscontrol: function %d not valid\n", func); + signal(Rf_data.rf_mutex); + return SYSERR; + } + + signal(Rf_data.rf_mutex); + return OK; +} diff --git a/device/rfs/rfsgetmode.c b/device/rfs/rfsgetmode.c new file mode 100644 index 0000000..e3e82ed --- /dev/null +++ b/device/rfs/rfsgetmode.c @@ -0,0 +1,63 @@ +/* rfsgetmode.c - rfsgetmode */ + +#include + +/*------------------------------------------------------------------------ + * rfsgetmode - Parse mode argument and generate integer of mode bits + *------------------------------------------------------------------------ + */ + +int32 rfsgetmode ( + char *mode /* String of mode characters */ + ) +{ + int32 mbits; /* Mode bits to return (in host */ + /* byte order) */ + char ch; /* Next character in mode string*/ + + mbits = 0; + + /* Mode string specifies: */ + /* r - read */ + /* w - write */ + /* o - old (file must exist) */ + /* n - new (create a new file) */ + + while ( (ch = *mode++) != NULLCH) { + switch (ch) { + + case 'r': if (mbits&RF_MODE_R) { + return SYSERR; + } + mbits |= RF_MODE_R; + continue; + + case 'w': if (mbits&RF_MODE_W) { + return SYSERR; + } + mbits |= RF_MODE_W; + continue; + + case 'o': if (mbits&RF_MODE_O || mbits&RF_MODE_N) { + return SYSERR; + } + mbits |= RF_MODE_O; + break; + + case 'n': if (mbits&RF_MODE_O || mbits&RF_MODE_N) { + return SYSERR; + } + mbits |= RF_MODE_N; + break; + + default: return SYSERR; + } + } + + /* If neither read nor write specified, allow both */ + + if ( (mbits&RF_MODE_RW) == 0 ) { + mbits |= RF_MODE_RW; + } + return mbits; +} diff --git a/device/rfs/rfsinit.c b/device/rfs/rfsinit.c new file mode 100644 index 0000000..9eff0ad --- /dev/null +++ b/device/rfs/rfsinit.c @@ -0,0 +1,39 @@ +/* rfsinit.c - rfsinit */ + +#include + +struct rfdata Rf_data; + +/*------------------------------------------------------------------------ + * rfsinit - Initialize the remote file system master device + *------------------------------------------------------------------------ + */ +devcall rfsinit( + struct dentry *devptr /* Entry in device switch table */ + ) +{ + + /* Choose an initial message sequence number */ + + Rf_data.rf_seq = 1; + + /* Set the server IP address, server port, and local port */ + + if ( dot2ip(RF_SERVER_IP, &Rf_data.rf_ser_ip) == SYSERR ) { + panic("invalid IP address for remote file server"); + } + Rf_data.rf_ser_port = RF_SERVER_PORT; + Rf_data.rf_loc_port = RF_LOC_PORT; + + /* Create a mutual exclusion semaphore */ + + if ( (Rf_data.rf_mutex = semcreate(1)) == SYSERR ) { + panic("Cannot create remote file system semaphore"); + } + + /* Specify that the server port is not yet registered */ + + Rf_data.rf_registered = FALSE; + + return OK; +} diff --git a/device/rfs/rfsndmsg.c b/device/rfs/rfsndmsg.c new file mode 100644 index 0000000..75917ae --- /dev/null +++ b/device/rfs/rfsndmsg.c @@ -0,0 +1,46 @@ +/* rfsndmsg.c - rfsndmsg */ + +#include + +/*------------------------------------------------------------------------ + * rfsndmsg - Create and send a message that only has header fields + *------------------------------------------------------------------------ + */ +status rfsndmsg ( + uint16 type, /* Message type */ + char *name /* Null-terminated file name */ + ) +{ + struct rf_msg_hdr req; /* Request message to send */ + struct rf_msg_hdr resp; /* Buffer for response */ + int32 retval; /* Return value */ + char *to; /* Used during name copy */ + + /* Form a request */ + + req.rf_type = htons(type); + req.rf_status = htons(0); + req.rf_seq = 0; /* Rfscomm will set sequence */ + to = req.rf_name; + while ( (*to++ = *name++) ) { /* Copy name to request */ + ; + } + + /* Send message and receive response */ + + retval = rfscomm(&req, sizeof(struct rf_msg_hdr), + &resp, sizeof(struct rf_msg_hdr) ); + + /* Check response */ + + if (retval == SYSERR) { + return SYSERR; + } else if (retval == TIMEOUT) { + kprintf("Timeout during remote file server access\n"); + return SYSERR; + } else if (ntohl(resp.rf_status) != 0) { + return SYSERR; + } + + return OK; +} diff --git a/device/rfs/rfsopen.c b/device/rfs/rfsopen.c new file mode 100644 index 0000000..bee91a0 --- /dev/null +++ b/device/rfs/rfsopen.c @@ -0,0 +1,114 @@ +/* rfsopen.c - rfsopen */ + +#include + +/*------------------------------------------------------------------------ + * rfsopen - Allocate a remote file pseudo-device for a specific file + *------------------------------------------------------------------------ + */ + +devcall rfsopen ( + struct dentry *devptr, /* Entry in device switch table */ + char *name, /* File name to use */ + char *mode /* Mode chars: 'r' 'w' 'o' 'n' */ + ) +{ + struct rflcblk *rfptr; /* Ptr to control block entry */ + struct rf_msg_oreq msg; /* Message to be sent */ + struct rf_msg_ores resp; /* Buffer to hold response */ + int32 retval; /* Return value from rfscomm */ + int32 len; /* Counts chars in name */ + char *nptr; /* Pointer into name string */ + char *fptr; /* Pointer into file name */ + int32 i; /* General loop index */ + + /* Wait for exclusive access */ + + wait(Rf_data.rf_mutex); + + /* Search control block array to find a free entry */ + + for(i=0; irfstate == RF_FREE) { + break; + } + } + if (i >= Nrfl) { /* No free table slots remain */ + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Copy name into free table slot */ + + nptr = name; + fptr = rfptr->rfname; + len = 0; + while ( (*fptr++ = *nptr++) != NULLCH) { + len++; + if (len >= RF_NAMLEN) { /* File name is too long */ + signal(Rf_data.rf_mutex); + return SYSERR; + } + } + + /* Verify that name is non-null */ + + if (len==0) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Parse mode string */ + + if ( (rfptr->rfmode = rfsgetmode(mode)) == SYSERR ) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Form an open request to create a new file or open an old one */ + + msg.rf_type = htons(RF_MSG_OREQ);/* Request a file open */ + msg.rf_status = htons(0); + msg.rf_seq = 0; /* Rfscomm fills in seq. number */ + nptr = msg.rf_name; + memset(nptr, NULLCH, RF_NAMLEN);/* Initialize name to zero bytes*/ + while ( (*nptr++ = *name++) != NULLCH ) { /* Copy name to req. */ + ; + } + msg.rf_mode = htonl(rfptr->rfmode); /* Set mode in request */ + + /* Send message and receive response */ + + retval = rfscomm((struct rf_msg_hdr *)&msg, + sizeof(struct rf_msg_oreq), + (struct rf_msg_hdr *)&resp, + sizeof(struct rf_msg_ores) ); + + /* Check response */ + + if (retval == SYSERR) { + signal(Rf_data.rf_mutex); + return SYSERR; + } else if (retval == TIMEOUT) { + kprintf("Timeout during remote file open\n\r"); + signal(Rf_data.rf_mutex); + return SYSERR; + } else if (ntohs(resp.rf_status) != 0) { + signal(Rf_data.rf_mutex); + return SYSERR; + } + + /* Set initial file position */ + + rfptr->rfpos = 0; + + /* Mark state as currently used */ + + rfptr->rfstate = RF_USED; + + /* Return device descriptor of newly created pseudo-device */ + + signal(Rf_data.rf_mutex); + return rfptr->rfdev; +} diff --git a/device/spi/spicontrol.c b/device/spi/spicontrol.c new file mode 100644 index 0000000..c77d683 --- /dev/null +++ b/device/spi/spicontrol.c @@ -0,0 +1,19 @@ +/* spicontrol.c - spicontrol */ + +#include + +/*------------------------------------------------------------------------ + * spicontrol - Control function for SPI device + *------------------------------------------------------------------------ + */ +devcall spicontrol ( + struct dentry *devptr, /* Entry in device switch table */ + int32 func, /* Control function */ + int32 arg1, /* Argument 1, if needed */ + int32 arg2 /* Argument 2, if needed */ + ) +{ + struct spi_csreg *csrptr; /* SPI control and status regs */ + + return OK; +} diff --git a/device/spi/spiinit.c b/device/spi/spiinit.c new file mode 100644 index 0000000..d2e5ce2 --- /dev/null +++ b/device/spi/spiinit.c @@ -0,0 +1,36 @@ +#include + +int32 spiinit ( + struct dentry *devptr + ) +{ + struct spi_csreg *spiptr; /* SPI control and status regs */ + struct clock_csreg *cptr; + + //kprintf("INIT SPI!\n"); + + /* Enable SPI clock */ + cptr = (struct clock_csreg *)CLOCK_BASE; + cptr->apb2enr |= (1 << SPI1EN); + + /* Configure SPI peripheral */ + if(devptr->dvminor == 0) { + spiptr = (struct spi_csreg *)SPI1_BASE; + } + else { + kprintf("SPI device not recognized\n"); + return SYSERR; + } + + spiptr->cr1 &= ~(1 << SPI_ENABLE); // temporarily disable device + spiptr->cr1 |= (1 << SPI_MSTR) | (1 << SPI_SSM) | (1 << SPI_SSI) | + (1 << SPI_BIDIMODE) | (1 << SPI_BIDIOE); + + /* Set Baud rate */ + spiptr->cr1 |= BR_FPCLKDIV8; + + /* Enable SPI peripheral */ + spiptr->cr1 |= (1 << SPI_ENABLE); + + return OK; +} diff --git a/device/spi/spiputc.c b/device/spi/spiputc.c new file mode 100644 index 0000000..35b9267 --- /dev/null +++ b/device/spi/spiputc.c @@ -0,0 +1,21 @@ +#include + +int32 spiputc (struct dentry *devptr, char c) +{ + struct spi_csreg *spiptr; /* SPI control and status regs */ + + /* Configure SPI peripheral */ + if(devptr->dvminor == 0) { + spiptr = (struct spi_csreg *)SPI1_BASE; + } + else { + kprintf("SPI device not recognized\n"); + return SYSERR; + } + + /* Check if buffer is empty -- busy wait TODO: interrupts */ + while (spiptr->sr & ~(1 << SPI_TXE)); + spiptr->dr = c; + + return OK; +} diff --git a/include/arp.h b/include/arp.h new file mode 100644 index 0000000..e2a30b3 --- /dev/null +++ b/include/arp.h @@ -0,0 +1,50 @@ +/* arp.h */ + +/* Items related to ARP - definition of cache and the packet format */ + +#define ARP_HALEN 6 /* Size of Ethernet MAC address */ +#define ARP_PALEN 4 /* Size of IP address */ + +#define ARP_HTYPE 1 /* Ethernet hardware type */ +#define ARP_PTYPE 0x0800 /* IP protocol type */ + +#define ARP_OP_REQ 1 /* Request op code */ +#define ARP_OP_RPLY 2 /* Reply op code */ + +#define ARP_SIZ 16 /* Number of entries in a cache */ + +#define ARP_RETRY 3 /* Num. retries for ARP request */ + +#define ARP_TIMEOUT 300 /* Retry timer in milliseconds */ + +/* State of an ARP cache entry */ + +#define AR_FREE 0 /* Slot is unused */ +#define AR_PENDING 1 /* Resolution in progress */ +#define AR_RESOLVED 2 /* Entry is valid */ + +#pragma pack(2) +struct arppacket { /* ARP packet for IP & Ethernet */ + byte arp_ethdst[ETH_ADDR_LEN];/* Ethernet dest. MAC addr */ + byte arp_ethsrc[ETH_ADDR_LEN];/* Ethernet source MAC address */ + uint16 arp_ethtype; /* Ethernet type field */ + uint16 arp_htype; /* ARP hardware type */ + uint16 arp_ptype; /* ARP protocol type */ + byte arp_hlen; /* ARP hardware address length */ + byte arp_plen; /* ARP protocol address length */ + uint16 arp_op; /* ARP operation */ + byte arp_sndha[ARP_HALEN]; /* ARP sender's Ethernet addr */ + uint32 arp_sndpa; /* ARP sender's IP address */ + byte arp_tarha[ARP_HALEN]; /* ARP target's Ethernet addr */ + uint32 arp_tarpa; /* ARP target's IP address */ +}; +#pragma pack() + +struct arpentry { /* Entry in the ARP cache */ + int32 arstate; /* State of the entry */ + uint32 arpaddr; /* IP address of the entry */ + pid32 arpid; /* Waiting process or -1 */ + byte arhaddr[ARP_HALEN]; /* Ethernet address of the entry*/ +}; + +extern struct arpentry arpcache[]; diff --git a/include/bufpool.h b/include/bufpool.h new file mode 100644 index 0000000..b28877f --- /dev/null +++ b/include/bufpool.h @@ -0,0 +1,27 @@ +/* bufpool.h */ + +#ifndef NBPOOLS +// RAFA #define NBPOOLS 20 /* Maximum number of buffer pools */ +#define NBPOOLS 5 /* Maximum number of buffer pools */ +#endif + +#ifndef BP_MAXB +// #define BP_MAXB 8192 /* Maximum buffer size in bytes */ +#define BP_MAXB 20 /* Maximum buffer size in bytes */ +#endif + +#define BP_MINB 8 /* Minimum buffer size in bytes */ +#ifndef BP_MAXN +// RAFA #define BP_MAXN 2048 /* Maximum number of buffers in a pool */ +#define BP_MAXN 10 /* Maximum number of buffers in a pool */ +#endif + +struct bpentry { /* Description of a single buffer pool */ + struct bpentry *bpnext;/* pointer to next free buffer */ + sid32 bpsem; /* semaphore that counts buffers */ + /* currently available in the pool */ + uint32 bpsize; /* size of buffers in this pool */ + }; + +extern struct bpentry buftab[];/* Buffer pool table */ +extern bpid32 nbpools; /* current number of allocated pools */ diff --git a/include/clk.h b/include/clk.h new file mode 100644 index 0000000..e798cc1 --- /dev/null +++ b/include/clk.h @@ -0,0 +1,82 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +#define CLOCK_BASE 0x40021000; + +/* Enable and check clock */ +#define PLL_ENABLE 24 +#define PLL2_ENABLE 26 +#define PLL3_ENABLE 28 +#define HSE_ENABLE 16 +#define HSI_ENABLE 1 +#define HSE_READY 17 + +/* System clock switch */ +#define HSI_SYSTEMCLOCK 0 +#define HSE_SYSTEMCLOCK 1 +#define PLL_SYSTEMCLOCK 2 + +#define SWITCH_READY 3 + +/* PLL setting */ +#define PPLx4 0x00080000 +#define PPLx5 0x000C0000 +#define PPLx6 0x00100000 +#define PPLx7 0x00140000 +#define PPLx8 0x00180000 +#define PPLx9 0x001C0000 + +#define HSE_PLL_SOURCE 16 +#define HSE_DIVIDERPLL 17 + +/* Enable Clock Signals APB2 */ +#define IOPAEN 2 +#define IOPBEN 3 +#define IOPCEN 4 +#define IOPDEN 5 +#define IOPEEN 6 +#define IOPFEN 7 +#define IOPGEN 8 +#define ADC1EN 9 +#define ADC2EN 10 +#define TIM1EN 11 +#define SPI1EN 12 +#define TIM8EN 13 +#define USART1EN 14 + +/* Enable Clock Signals APB1 */ +#define TIM2EN 0 +#define TIM3EN 1 +#define TIM4EN 2 +#define TIM5EN 3 +#define TIM6EN 4 + +//int clockinit(struct dentry * devptr); +//int clockcontrol(struct dentry * devptr, int32_t func, int32_t, int32_t); + +struct clock_csreg { + volatile uint32 cr; + volatile uint32 cfgr; + volatile uint32 cir; + volatile uint32 apb2rstr; + volatile uint32 apb1rstr; + volatile uint32 ahbenr; + volatile uint32 apb2enr; + volatile uint32 apb1enr; + volatile uint32 bdcr; + volatile uint32 csr; + volatile uint32 ahbstr; + volatile uint32 cfgr2; +}; + diff --git a/include/cortexm3.h b/include/cortexm3.h new file mode 100644 index 0000000..9cd7098 --- /dev/null +++ b/include/cortexm3.h @@ -0,0 +1,27 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* Nested interrupt vector */ +#define NVIC_ISER0 (uint32 *) 0xE000E100 +#define NVIC_ISER1 (uint32 *) 0xE000E104 +#define NVIC_STIR (uint32 *) 0xE000EF00 + +/* System control block */ +#define SCB_ICSR (uint32 *) 0xE000ED04 +#define PENDSV_INTR 28 + +// #define MAXADDR 0x20010000 /* 64kB SRAM */ +#define MAXADDR 0x20004E20 /* 64kB SRAM */ // RAFA +// #define MAXADDR 0x20004000 /* 64kB SRAM */ // RAFA +#define HANDLERSTACK 1024 /* Size reserved for stack in Handler mode */ diff --git a/include/ctype.h b/include/ctype.h new file mode 100644 index 0000000..53b2618 --- /dev/null +++ b/include/ctype.h @@ -0,0 +1,33 @@ +/* ctype.h + * + * Includes isalpha, isupper, islower, isdigit, isspace, ispunct, isalnum, + * isprint, iscntrl, toupper, tolower, toascii, iseof +*/ + +#define _U 0x01 +#define _L 0x02 +#define _N 0x04 +#define _S 0x08 +#define _P 0x10 +#define _C 0x20 +#define _X 0x40 + +extern const char _ctype_[]; + +#define isalpha(c) ((_ctype_+1)[(int)c]&(_U|_L)) +#define isupper(c) ((_ctype_+1)[(int)c]&_U) +#define islower(c) ((_ctype_+1)[(int)c]&_L) +#define isdigit(c) ((_ctype_+1)[(int)c]&_N) +#define isxdigit(c) ((_ctype_+1)[(int)c]&(_N|_X)) +#define isspace(c) ((_ctype_+1)[(int)c]&_S) +#define ispunct(c) ((_ctype_+1)[(int)c]&_P) +#define isalnum(c) ((_ctype_+1)[(int)c]&(_U|_L|_N)) +#define isprint(c) ((_ctype_+1)[(int)c]&(_P|_U|_L|_N|_S)) +#define iscntrl(c) ((_ctype_+1)[(int)c]&_C) +#define isascii(c) ((unsigned)((int)(c))<=0x7F) + +#define toupper(c) (((int)(c))-'a'+'A') +#define tolower(c) (((int)(c))-'A'+'a') +#define toascii(c) (((int)(c))&0x7F) + +#define iseof(c) (0x04 == (int)c) diff --git a/include/date.h b/include/date.h new file mode 100644 index 0000000..4d64547 --- /dev/null +++ b/include/date.h @@ -0,0 +1,67 @@ +/* date.h - ntim2xtim, xtim2ntim, isleap, utim2ltim */ + +/************************************************************************/ +/* */ +/* Constants and declarations for date storage and conversion */ +/* */ +/* Xinu stores time as seconds past Jan 1, 1970 (UNIX format), with */ +/* 1 being 1 second into Jan. 1, 1970, GMT (universal time). The */ +/* Internet uses seconds past Jan 1, 1900 (also GMT or Universal Time) */ +/* */ +/************************************************************************/ + +/* Conversion between network and local representations */ + +#define ntim2xtim(x) ((x)-2208988800U) /* net-to-xinu time */ +#define xtim2ntim(x) ((x)+2208988800U) /* xinu-to-net time */ + +/* Constants for Daylight Savings Time */ + +#define DATE_DST_OFF 0 /* force DST to be off */ +#define DATE_DST_ON 1 /* force DST to be on */ +#define DATE_DST_AUTO 2 /* compute DST automatically */ + +/* Days in months and month names used to format a date */ + +struct dateinfo { + uint32 dt_boot; /* time when system booted */ + /* add clktime to get the */ + /* current time-of-day */ + bool8 dt_bootvalid; /* is dt_boot field valid? */ + int32 dt_daylight; /* whether to compute daylight */ + /* savings time */ + int32 dt_msize[12]; /* days per month */ + char *dt_mnam[12]; /* month names */ + char *dt_dnam[7]; /* day names */ +}; + +extern struct dateinfo Date; /* Global date information */ + +/* Constants for converting time to month/day/year/hour/minute/second */ + +#define isleap(x) ((x)%4==0) /* leap year? (1970-2099) */ +#define SECPERDY (60*60*24) /* one day in seconds */ +#define SECPERHR (60*60) /* one hour in seconds */ +#define SECPERMN (60) /* one minute in seconds */ + +/* The local time zone can be set to EST, CST, MST,or PST. */ + +#define ZONE_EST 5 /* Eastern Standard time is 5 */ +#define ZONE_CST 6 /* hours west of England */ +#define ZONE_MST 7 +#define ZONE_PST 8 +#define TIMEZONE ZONE_EST /* timezone for this system */ + +/* In-line procedures to convert universal-to-local time and vice versa */ + +#define utim2ltim(x) ((x)-TIMEZONE*SECPERHR) +#define ltim2utim(x) ((x)+TIMEZONE*SECPERHR) + +#define TIMERPORT 123 /* UDP port for time server */ +#define TIMELPORT 53678 /* local UDP port for time */ + +#ifndef TIMESERVER +#define TIMESERVER "128.10.19.24" /* IP address of NTP time server*/ +#endif + +#define TIMETIMEOUT 2000 /* timeout for time server (ms) */ diff --git a/include/debug.h b/include/debug.h new file mode 100644 index 0000000..fa99ece --- /dev/null +++ b/include/debug.h @@ -0,0 +1,8 @@ +/* debug.h */ + +#define DEBUG_ASCII 0x01 +#define DEBUG_HEX 0x02 + +void hexdump(void *buffer, uint32 length, bool8 text); +void debugbreak(void); +void debugret(void); diff --git a/include/delay.h b/include/delay.h new file mode 100644 index 0000000..5ffe34f --- /dev/null +++ b/include/delay.h @@ -0,0 +1,25 @@ +/* delay.h - DELAY */ + +/* + * Delay units are in microseconds. + */ +#define DELAY(n) \ +{ \ + volatile long N = 2*n; \ + \ + while(N > 0) { \ + N--; \ + } \ +} + +/* + * Delay units are in milli-seconds. + */ +#define MDELAY(n) \ +{ \ + register long i; \ + \ + for (i=n;i>0;i--) { \ + DELAY(1000); \ + } \ +} diff --git a/include/device.h b/include/device.h new file mode 100644 index 0000000..14f5c64 --- /dev/null +++ b/include/device.h @@ -0,0 +1,7 @@ +/* device.h - isbaddev */ + +#define DEVNAMLEN 16 /* maximum size of a device name */ + +/* Macro used to verify device ID is valid */ + +#define isbaddev(f) ( ((f) < 0) | ((f) >= NDEVS) ) diff --git a/include/dhcp.h b/include/dhcp.h new file mode 100644 index 0000000..56710f9 --- /dev/null +++ b/include/dhcp.h @@ -0,0 +1,58 @@ +/* dhcp.h - Definitions related to DHCP */ + +#define DHCP + +#define DHCP_RETRY 5 + +#define DHCP_PADDING 0 +#define DHCP_SUBNET_MASK 1 +#define DHCP_ROUTER 3 +#define DHCP_DNS_SERVER 6 +#define DHCP_DOMAIN_NAME 15 +#define DHCP_VENDER_OPTIONS 43 +#define DHCP_REQUESTED_IP 50 +#define DHCP_IP_ADDR_LEASE_TIME 51 +#define DHCP_OPTION_OVERLOAD 52 +#define DHCP_MESSAGE_TYPE 53 +#define DHCP_SERVER_ID 54 +#define DHCP_PARAMETER_REQUEST_LIST 55 +#define DHCP_MESSAGE 56 +#define DHCP_MAXIMUM_DHCP_MESSAGE_SIZE 57 +#define DHCP_RENEWAL_TIME_VALUE 58 +#define DHCP_REBINDING_TIME_VALUE 59 +#define DHCP_VENDOR_CLASS_ID 60 +#define DHCP_CLIENT_ID 61 +#define DHCP_TFTP_SERVER_NAME 66 +#define DHCP_BOOTFILE_NAME 67 +#define DHCP_CLIENT_SYS_ARCH 93 +#define DHCP_CLIENT_NET_ID 94 +#define DHCP_CLIENT_MACHINE_ID 97 +#define DHCP_MESSAGE_END 255 + +#pragma pack(2) +struct dhcpmsg { + byte dc_bop; /* DHCP bootp op 1=req 2=reply */ + byte dc_htype; /* DHCP hardware type */ + byte dc_hlen; /* DHCP hardware address length */ + byte dc_hops; /* DHCP hop count */ + uint32 dc_xid; /* DHCP xid */ + uint16 dc_secs; /* DHCP seconds */ + uint16 dc_flags; /* DHCP flags */ + uint32 dc_cip; /* DHCP client IP address */ + uint32 dc_yip; /* DHCP your IP address */ + uint32 dc_sip; /* DHCP server IP address */ + uint32 dc_gip; /* DHCP gateway IP address */ + byte dc_chaddr[16]; /* DHCP client hardware address */ + union { + byte dc_bootp[192]; /* DHCP bootp area (zero) */ + struct { + byte sname[64]; /* TFTP Server Name */ + byte bootfile[128]; /* TFTP File name */ + }; + }; + uint32 dc_cookie; /* DHCP cookie */ + byte dc_opt[1024]; /* DHCP options area (large */ + /* enough to hold more than */ + /* reasonable options */ +}; +#pragma pack() diff --git a/include/dns.h b/include/dns.h new file mode 100644 index 0000000..9013f2e --- /dev/null +++ b/include/dns.h @@ -0,0 +1,61 @@ +/* dns.h */ + +/* Constants and data structures used for DNS */ + +#define DNSTIMEOUT 3000 /* Timeout for a response (ms) */ +#define DNSRETRY 3 /* Number of times to retry */ +#define DNSPORT 53 /* Well-known DNS UDP port */ +#define DNSLPORT 51525 /* Local UDP port to use */ +#define DNSDATASIZ 500 /* Size of the data area */ + + +/* Format of a DNS Query/Response packet */ + +struct dnspkt { + uint16 id; /* DNS Query ID */ + struct { + byte rd:1; /* Recursion Desired */ + byte tc:1; /* Truncation */ + byte aa:1; /* Authoritative Answer */ + byte opcode:4; /* Operation Code */ + byte qr:1; /* Query=0, Response=1 */ + }; + struct { + byte rcode:4; /* Response Code */ + byte z:3; /* Reserved, must be 0 */ + byte ra:1; /* Recursion Available */ + }; + uint16 qucount; /* No. of Questions */ + uint16 ancount; /* No. of RRs in Answer */ + uint16 nscount; /* No of Name Server RRs */ + uint16 arcount; /* No. of RRs in Additional info*/ + char data[DNSDATASIZ]; /* DNS data area */ +}; + +/* QType Values */ + +#define DNS_QT_A 1 /* DNS Address Type (A) */ +#define DNS_QT_NS 2 /* DNS Name Server Type */ + +/* QClass values */ + +#define DNS_QC_IN 1 /* DNS QClass Internet */ + +/* Format of a DNS Question */ + +struct dns_q { + char *qname; /* Domain Name in the query */ + uint16 *qtype; /* Question Type */ + uint16 *qclass; /* Question Class */ +}; + +/* Format of a DNS Resource Record */ + +struct dns_rr { + char *rname; /* Domain Name */ + uint16 *rtype; /* Resource Record Type */ + uint16 *rclass; /* Resource Record Class */ + uint32 *ttl; /* Resource Record Time-to-Live */ + uint16 *rdlen; /* Resource Record RD Length */ + char *rdata; /* Resource Record Data area */ +}; diff --git a/include/ether.h b/include/ether.h new file mode 100644 index 0000000..9cacc93 --- /dev/null +++ b/include/ether.h @@ -0,0 +1,116 @@ +/* ether.h */ + +/* Ethernet packet format: + + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Dest. MAC (6) | Src. MAC (6) |Type (2)| Data (46-1500)... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +*/ + +#define ETH_ADDR_LEN 6 /* Length of Ethernet (MAC) address */ +typedef unsigned char Eaddr[ETH_ADDR_LEN];/* a physical Ethernet address*/ + +/* Ethernet packet header */ + +struct etherPkt { + byte dst[ETH_ADDR_LEN]; /* Destination Mac address */ + byte src[ETH_ADDR_LEN]; /* Source Mac address */ + uint16 type; /* Ether type field */ + byte data[1]; /* Packet payload */ +}; + +#define ETH_HDR_LEN 14 /* Length of Ethernet packet */ + /* header */ + +/* Ethernet DMA buffer sizes */ + +#define ETH_MTU 1500 /* Maximum transmission unit */ +#define ETH_VLAN_LEN 4 /* Length of Ethernet vlan tag */ +#define ETH_CRC_LEN 4 /* Length of CRC on Ethernet */ + /* frame */ + +#define ETH_MAX_PKT_LEN ( ETH_HDR_LEN + ETH_VLAN_LEN + ETH_MTU ) + +#define ETH_BUF_SIZE 1518 /* 1500 MTU + 14 ETH Header + 4 bytes optional VLAN Tagging */ + +/* State of the Ethernet interface */ + +#define ETH_STATE_FREE 0 /* control block is unused */ +#define ETH_STATE_DOWN 1 /* interface is currently */ + /* inactive */ +#define ETH_STATE_UP 2 /* interface is currently active*/ + +/* Ethernet device control functions */ + +#define ETH_CTRL_GET_MAC 1 /* Get the MAC for this device */ + +/* Ethernet multicast */ + +#define ETH_NUM_MCAST 32 /* Max number of multicast addresses*/ + +/* Ehternet NIC type */ + +#define ETH_TYPE_3C905C 1 +#define ETH_TYPE_E1000E 2 + +#define ETH_PHY_CTLREG 0 +#define ETH_PHY_STATREG 1 + +#define ETH_PHY_CTLREG_RESET 0x8000 +#define ETH_PHY_CTLREG_SM 0x2040 /* Speed Mask */ +#define ETH_PHY_10M 0x0000 +#define ETH_PHY_100M 0x2000 +#define ETH_PHY_1000M 0x0040 +#define ETH_PHY_CTLREG_FD 0x0100 + +#define ETH_PHY_STATREG_LINK 0x0004 + +struct ethcblk { + byte state; /* ETH_STATE_... as defined above */ + struct dentry *phy; /* physical eth device for Tx DMA */ + byte type; /* NIC type_... as defined above */ + + /* Pointers to associated structures */ + + struct dentry *dev; /* address in device switch table */ + void *csr; /* addr.of control and status regs. */ + uint32 pcidev; /* PCI device number */ + uint32 iobase; /* I/O base from config */ + uint32 flashbase; /* flash base from config */ + uint32 membase; /* memory base for device from config */ + + void *rxRing; /* ptr to array of recv ring descriptors*/ + void *rxBufs; /* ptr to Rx packet buffers in memory */ + uint32 rxHead; /* Index of current head of Rx ring */ + uint32 rxTail; /* Index of current tail of Rx ring */ + uint32 rxRingSize; /* size of Rx ring descriptor array */ + uint32 rxIrq; /* Count of Rx interrupt requests */ + + void *txRing; /* ptr to array of xmit ring descriptors*/ + void *txBufs; /* ptr to Tx packet buffers in memory */ + uint32 txHead; /* Index of current head of Tx ring */ + uint32 txTail; /* Index of current tail of Tx ring */ + uint32 txRingSize; /* size of Tx ring descriptor array */ + uint32 txIrq; /* Count of Tx interrupt requests */ + + byte devAddress[ETH_ADDR_LEN];/* MAC address */ + + uint8 addrLen; /* Hardware address length */ + uint16 mtu; /* Maximum transmission unit (payload) */ + + uint32 errors; /* Number of Ethernet errors */ + sid32 isem; /* Semaphore for Ethernet input */ + sid32 osem; /* Semaphore for Ethernet output */ + uint16 istart; /* Index of next packet in the ring */ + + int16 inPool; /* Buffer pool ID for input buffers */ + int16 outPool; /* Buffer pool ID for output buffers */ + + int16 proms; /* nonzero => promiscuous mode */ + + int16 ed_mcset; /* nonzero => multicast reception set */ + int16 ed_mcc; /* count of multicast addresses */ + Eaddr ed_mca[ETH_NUM_MCAST];/* array of multicast addrs */ +}; + +extern struct ethcblk ethertab[]; /* array of control blocks */ diff --git a/include/ethloop.h b/include/ethloop.h new file mode 100644 index 0000000..b7043b0 --- /dev/null +++ b/include/ethloop.h @@ -0,0 +1,65 @@ +/** + * @file ethloop.h + * + * $Id: ethloop.h 2076 2009-09-24 23:05:39Z brylow $ + */ +/* Embedded Xinu, Copyright (C) 2009. All rights reserved. */ + +#ifndef _ETHLOOP_H_ +#define _ETHLOOP_H_ + + +#define ELOOP_MTU 1500 +#define ELOOP_LINKHDRSIZE ETH_HDR_LEN + +#define ELOOP_BUFSIZE ELOOP_MTU + ELOOP_LINKHDRSIZE +#define ELOOP_NBUF 100 + +#define ELOOP_CTRL_GETHOLD 1 +#define ELOOP_CTRL_SETFLAG 2 +#define ELOOP_CTRL_CLRFLAG 3 + +#define ELOOP_FLAG_HOLDNXT 0x01 /**< place next written pkt in hold */ +#define ELOOP_FLAG_DROPNXT 0x04 /**< drop next written pkt */ +#define ELOOP_FLAG_DROPALL 0x08 /**< drop all written pkts */ + +#define ELOOP_STATE_FREE 0 +#define ELOOP_STATE_ALLOC 1 + +/** + * Loopback device control block + */ +struct ethloop +{ + int state; /**< device state */ + struct dentry *dev; /**< device table entry */ + int poolid; /**< poolid for the buffer pool */ + byte flags; /**< flags */ + + /* Packet queue */ + int index; /**< index of first packet in buffer */ + sid32 sem; /**< number of packets in buffer */ + int count; /**< number of packets in buffer */ + char *buffer[ELOOP_NBUF]; /**< input buffer */ + int pktlen[ELOOP_NBUF]; /**< length of packet in buffer */ + + /* Hold packet */ + sid32 hsem; /**< number of held packets */ + char *hold; /**< hold buffer */ + int holdlen; /**< length of packet in hold buffer */ + + /* Statistics */ + uint32 nout; /**< number of packets written */ +}; + +extern struct ethloop elooptab[]; + +/* Driver functions */ +devcall ethloopInit(struct dentry *); +devcall ethloopOpen(struct dentry *); +devcall ethloopClose(struct dentry *); +devcall ethloopRead(struct dentry *, void *, uint32); +devcall ethloopWrite(struct dentry *, void *, uint32); +devcall ethloopControl(struct dentry *, int, int32, int32); + +#endif /* _ETHLOOP_H_ */ diff --git a/include/file.h b/include/file.h new file mode 100644 index 0000000..533517c --- /dev/null +++ b/include/file.h @@ -0,0 +1,20 @@ +/* file.h - definitions commmon to remote and local file systems */ + +/* Definition of file mode bits */ + +#define F_MODE_R 0x01 /* Bit to grant read access */ +#define F_MODE_W 0x02 /* Bit to grant write access */ +#define F_MODE_RW 0x03 /* Mask for read and write bits */ +#define F_MODE_N 0x04 /* Bit for "new" mode */ +#define F_MODE_O 0x08 /* Bit for "old" mode */ + /* Note: new and old mode bits */ + /* are mutually exclusive */ +#define F_MODE_NO 0x0C /* Mask for "n" and "o" bits */ + +/* Control functions for files */ + +#define F_CTL_DEL 1 /* Delete a file */ +#define F_CTL_TRUNC 2 /* Truncate a file */ +#define F_CTL_MKDIR 3 /* make a directory */ +#define F_CTL_RMDIR 4 /* remove a directory */ +#define F_CTL_SIZE 5 /* Obtain the size of a file */ diff --git a/include/flash.h b/include/flash.h new file mode 100644 index 0000000..3b3371e --- /dev/null +++ b/include/flash.h @@ -0,0 +1,263 @@ +/** + * @file flash.h + * This file provides various definitions and prototypes for the flash + * driver and all its affiliates + * + * $Id: flash.h 2065 2009-09-04 21:44:36Z brylow $ + */ +/* Embedded XINU, Copyright (C) 2007. All rights reserved. */ + + +#ifndef _FLASH_H_ +#define _FLASH_H_ + +/* Disk variables */ +#define MAX_LIVE_BLOCKS 8 /**< number of blocks to keep in memory */ +#define FLASH_BLK_SIZE 512 /**< disk blocks are 512 bytes */ + +#define FLASH_BLOCK_FREE 0 /**< block can be allocated */ +#define FLASH_BLOCK_CLEAN 1 /**< block has been read but not writted */ +#define FLASH_BLOCK_DIRTY 2 /**< block has been changed */ + +/* Important disk block sections */ +#define CFE_MIN_BLOCK 0x0000 /**< Physical addr: 0x000000 */ +#define CFE_MAX_BLOCK 0x01FF /**< Physical addr: 0x03ffff */ +#define KERNEL_MIN_BLOCK 0x0200 /**< Physical addr: 0x040000 */ +#define KERNEL_MAX_BLOCK 0x03FF /**< Physical addr: 0x07ffff */ +#define NVRAM_MIN_BLOCK 0x1FC0 /**< Physical addr: 0x3F8000 */ +#define NVRAM_MAX_BLOCK 0x1FFF /**< Physical addr: 0x3fffff */ + +/* Flash control switch values */ +#define FLASH_BLOCK_SIZE 0x0000 /**< get the size of disk blocks */ +#define FLASH_N_BLOCKS 0x0001 /**< get number of disk blocks */ +#define FLASH_SYNC 0x0002 /**< force sync of disk device */ + +/* Flash variables */ +#define FLASH_WIDEMODE 1 +#define MAX_REGIONS 8 + +/* TRX variables */ +#define TRX_MAGIC 0x30524448 + +/* Structures */ +struct trx_header +{ + uint32 magic; /**< "HDR0" */ + uint32 len; /**< Length of file including header */ + uint32 crc; /**< 32-bit CRC from flag_vers to EOF */ + uint32 flags_vers; /**< 0-15 flags, 16-31 version */ + uint32 offsets[3]; /**< Partition offsets from header start */ +}; + +/* File structure */ +struct file +{ + uint32 len; + char *name; + void *data; +}; + +struct flash_region +{ + uint32 nblocks; /**< number of blocks within region */ + uint32 block_size; /**< size of block in region */ + uint32 region_start; /**< beginning of region in memory */ + uint32 region_size; /**< size of region in bytes */ +}; + +struct flash_block +{ + uint32 start_pos; /**< physical position data starts at */ + uint32 size; /**< size of this block */ + byte state; /**< state of this block */ + void *buffer; /**< buffer for this block */ +}; + +struct flash +{ + struct dentry *device; /**< flash entry in dev structure */ + byte commands; /**< command set the interface uses */ + uint32 base; /**< base address for flash memory */ + sid32 lock; /**< lock for execution flash operations */ + uint32 size; /**< size (in bytes) of flash memory */ + byte mode; /**< current mode of flash */ + uint16 nregions; /**< number of regions on device */ + struct flash_region regions[MAX_REGIONS]; /**< region info. */ + + uint32 log_size; /**< size of logical disk blocks */ + uint32 nlog_blocks; /**< number of logical blocks on disk */ + + /** list of open blocks on flash device */ + struct flash_block erase_blocks[MAX_LIVE_BLOCKS]; + byte curr_block; /**< offset of the oldest block stored */ +}; + +extern struct flash_block bad_block; + +/* + * Common Flash Interface Query commands and macros + */ + +/* put/get 8-bits commands for CFI */ +#define CFI_PUT_8(addr,offset,cmd) \ + *((volatile unsigned char *)((addr)+((offset)<=nmarks || marks[L[0]]!=L) diff --git a/include/memory.h b/include/memory.h new file mode 100644 index 0000000..fce2cfc --- /dev/null +++ b/include/memory.h @@ -0,0 +1,38 @@ +/* memory.h - roundmb, truncmb, freestk */ + +#define PAGE_SIZE 1024 // TODO: unused? + +/*---------------------------------------------------------------------- + * roundmb, truncmb - Round or truncate address to memory block size + *---------------------------------------------------------------------- + */ +#define roundmb(x) (char *)( (7 + (uint32)(x)) & (~7) ) +#define truncmb(x) (char *)( ((uint32)(x)) & (~7) ) + +/*---------------------------------------------------------------------- + * freestk -- Free stack memory allocated by getstk + *---------------------------------------------------------------------- + */ +#define freestk(p,len) freemem((char *)((uint32)(p) \ + - ((uint32)roundmb(len)) \ + + (uint32)sizeof(uint32)), \ + (uint32)roundmb(len) ) + +struct memblk { /* See roundmb & truncmb */ + struct memblk *mnext; /* Ptr to next free memory blk */ + uint32 mlength; /* Size of blk (includes memblk)*/ + }; +extern struct memblk memlist; /* Head of free memory list */ +extern void *minheap; /* Start of heap */ +extern void *maxheap; /* Highest valid heap address */ + + +/* Added by linker */ + +// extern uint32 text; /* Start of text segment */ +// extern uint32 etext; /* End of text segment */ +// extern uint32 data; /* Start of data segment */ +// extern uint32 edata; /* End of data segment */ +// extern uint32 bss; /* Start of bss segment */ +// extern uint32 ebss; /* End of bss segment */ +// extern uint32 end; /* End of program */ diff --git a/include/messages.h b/include/messages.h new file mode 100644 index 0000000..778fce6 --- /dev/null +++ b/include/messages.h @@ -0,0 +1,14 @@ + +typedef unsigned int size_t; +#include + + +extern const char m1[]; +extern const char m2[]; +extern const char m3[]; +extern const char m4[]; +extern const char m5[]; +extern const char m6[]; + + + diff --git a/include/name.h b/include/name.h new file mode 100644 index 0000000..75af45f --- /dev/null +++ b/include/name.h @@ -0,0 +1,22 @@ +/* name.h */ + +/* Constants that define the namespace mapping table sizes */ + +// RAFA #define NM_PRELEN 64 /* Max size of a prefix string */ +#define NM_PRELEN 8 /* Max size of a prefix string */ +// RAFA #define NM_REPLLEN 96 /* Maximum size of a replacement*/ +#define NM_REPLLEN 8 /* Maximum size of a replacement*/ +#define NM_MAXLEN 8 /* Maximum size of a file name */ +// RAFA #define NNAMES 40 /* Number of prefix definitions */ +#define NNAMES 3 /* Number of prefix definitions */ + +/* Definition of the name prefix table that defines all name mappings */ + +struct nmentry { /* Definition of prefix table */ + char nprefix[NM_PRELEN]; /* Null-terminated prefix */ + char nreplace[NM_REPLLEN]; /* Null-terminated replacement */ + did32 ndevice; /* Device descriptor for prefix */ +}; + +extern struct nmentry nametab[]; /* Table of name mappings */ +extern int32 nnames; /* Number of entries allocated */ diff --git a/include/net.h b/include/net.h new file mode 100644 index 0000000..dd978bf --- /dev/null +++ b/include/net.h @@ -0,0 +1,69 @@ +/* net.h */ + +#define NETSTK 8192 /* Stack size for network setup */ +#define NETPRIO 500 /* Network startup priority */ +#define NETBOOTFILE 128 /* Size of the netboot filename */ + +/* Constants used in the networking code */ + +#define ETH_ARP 0x0806 /* Ethernet type for ARP */ +#define ETH_IP 0x0800 /* Ethernet type for IP */ +#define ETH_IPv6 0x86DD /* Ethernet type for IPv6 */ + +/* Format of an Ethernet packet carrying IPv4 and UDP */ + +#pragma pack(2) +struct netpacket { + byte net_ethdst[ETH_ADDR_LEN];/* Ethernet dest. MAC address */ + byte net_ethsrc[ETH_ADDR_LEN];/* Ethernet source MAC address */ + uint16 net_ethtype; /* Ethernet type field */ + byte net_ipvh; /* IP version and hdr length */ + byte net_iptos; /* IP type of service */ + uint16 net_iplen; /* IP total packet length */ + uint16 net_ipid; /* IP datagram ID */ + uint16 net_ipfrag; /* IP flags & fragment offset */ + byte net_ipttl; /* IP time-to-live */ + byte net_ipproto; /* IP protocol (actually type) */ + uint16 net_ipcksum; /* IP checksum */ + uint32 net_ipsrc; /* IP source address */ + uint32 net_ipdst; /* IP destination address */ + union { + struct { + uint16 net_udpsport; /* UDP source protocol port */ + uint16 net_udpdport; /* UDP destination protocol port*/ + uint16 net_udplen; /* UDP total length */ + uint16 net_udpcksum; /* UDP checksum */ + byte net_udpdata[1500-28];/* UDP payload (1500-above)*/ + }; + struct { + byte net_ictype; /* ICMP message type */ + byte net_iccode; /* ICMP code field (0 for ping) */ + uint16 net_iccksum; /* ICMP message checksum */ + uint16 net_icident; /* ICMP identifier */ + uint16 net_icseq; /* ICMP sequence number */ + byte net_icdata[1500-28];/* ICMP payload (1500-above)*/ + }; + }; +}; +#pragma pack() + +#define PACKLEN sizeof(struct netpacket) + +extern bpid32 netbufpool; /* ID of net packet buffer pool */ + +struct network { /* Network information */ + uint32 ipucast; /* Computer's IP unicast address*/ + uint32 ipbcast; /* IP broadcast address */ + uint32 ipmask; /* IP address mask */ + uint32 ipprefix; /* IP (network) prefix */ + uint32 iprouter; /* Default router address */ + uint32 bootserver; /* Boot server address */ + uint32 dnsserver; /* DNS server address */ + uint32 ntpserver; /* NTP (time) server address */ + bool8 ipvalid; /* nonzero => above are valid */ + byte ethucast[ETH_ADDR_LEN]; /* Ethernet multicast address */ + byte ethbcast[ETH_ADDR_LEN]; /* Ethernet broadcast address */ + char bootfile[NETBOOTFILE]; /* Name of boot file */ +}; + +extern struct network NetData; /* Local Network Interface info */ diff --git a/include/ports.h b/include/ports.h new file mode 100644 index 0000000..ce42043 --- /dev/null +++ b/include/ports.h @@ -0,0 +1,31 @@ +/* ports.h - isbadport */ + +// RAFA #define NPORTS 30 /* Maximum number of ports */ +#define NPORTS 3 /* Maximum number of ports */ +// RAFA #define PT_MSGS 100 /* Total messages in system */ +#define PT_MSGS 10 /* Total messages in system */ +#define PT_FREE 1 /* Port is free */ +#define PT_LIMBO 2 /* Port is being deleted/reset */ +#define PT_ALLOC 3 /* Port is allocated */ + +struct ptnode { /* Node on list of messages */ + uint32 ptmsg; /* A one-word message */ + struct ptnode *ptnext; /* Pointer to next node on list */ +}; + +struct ptentry { /* Entry in the port table */ + sid32 ptssem; /* Sender semaphore */ + sid32 ptrsem; /* Receiver semaphore */ + uint16 ptstate; /* Port state (FREE/LIMBO/ALLOC)*/ + uint16 ptmaxcnt; /* Max messages to be queued */ + int32 ptseq; /* Sequence changed at creation */ + struct ptnode *pthead; /* List of message pointers */ + struct ptnode *pttail; /* Tail of message list */ +}; + +extern struct ptnode *ptfree; /* List of free nodes */ +extern struct ptentry porttab[]; /* Port table */ +extern int32 ptnextid; /* Next port ID to try when */ + /* looking for a free slot */ + +#define isbadport(portid) ( (portid)<0 || (portid)>=NPORTS ) diff --git a/include/process.h b/include/process.h new file mode 100644 index 0000000..245deb9 --- /dev/null +++ b/include/process.h @@ -0,0 +1,63 @@ +/* process.h - isbadpid */ + +/* Maximum number of processes in the system */ + +#ifndef NPROC +#define NPROC 8 +#endif + +/* Process state constants */ + +#define PR_FREE 0 /* Process table entry is unused */ +#define PR_CURR 1 /* Process is currently running */ +#define PR_READY 2 /* Process is on ready queue */ +#define PR_RECV 3 /* Process waiting for message */ +#define PR_SLEEP 4 /* Process is sleeping */ +#define PR_SUSP 5 /* Process is suspended */ +#define PR_WAIT 6 /* Process is on semaphore queue */ +#define PR_RECTIM 7 /* Process is receiving with timeout */ + +/* Miscellaneous process definitions */ + +#define PNMLEN 16 /* Length of process "name" */ +#define NULLPROC 0 /* ID of the null process */ + +/* Process initialization constants */ + +// #define INITSTK 4096 /* Initial process stack size */ +#define INITSTK 1024 /* Initial process stack size */ +#define INITPRIO 20 /* Initial process priority */ +#define INITRET userret /* Address to which process returns */ + +/* Inline code to check process ID (assumes interrupts are disabled) */ + +#define isbadpid(x) ( ((pid32)(x) < 0) || \ + ((pid32)(x) >= NPROC) || \ + (proctab[(x)].prstate == PR_FREE)) + +/* Number of device descriptors a process can have open */ + +#define NDESC 5 /* must be odd to make procent 4N bytes */ + +/* Definition of the process table (multiple of 32 bits) */ + +struct procent { /* Entry in the process table */ + uint16 prstate; /* Process state: PR_CURR, etc. */ + pri16 prprio; /* Process priority */ + char *prstkptr; /* Saved stack pointer */ + char *prstkbase; /* Base of run time stack */ + uint32 prstklen; /* Stack length in bytes */ + char prname[PNMLEN]; /* Process name */ + sid32 prsem; /* Semaphore on which process waits */ + pid32 prparent; /* ID of the creating process */ + umsg32 prmsg; /* Message sent to this process */ + bool8 prhasmsg; /* Nonzero iff msg is valid */ + int16 prdesc[NDESC]; /* Device descriptors for process */ +}; + +/* Marker for the top of a process stack (used to help detect overflow) */ +#define STACKMAGIC 0x0A0AAAA9 + +extern struct procent proctab[]; +extern int32 prcount; /* Currently active processes */ +extern pid32 currpid; /* Currently executing process */ diff --git a/include/prototypes.h b/include/prototypes.h new file mode 100644 index 0000000..a04ff02 --- /dev/null +++ b/include/prototypes.h @@ -0,0 +1,633 @@ +/* in file addargs.c */ +extern status addargs(pid32, int32, int32[], int32,char *, void *); + +/* in file am335x_eth_init.c */ +extern int32 am335x_eth_init(struct ethcblk *); + +/* in file arp.c */ +extern void arp_init(void); +extern status arp_resolve(uint32, byte[]); +extern void arp_in(struct arppacket *); +extern int32 arp_alloc(void); +extern void arp_ntoh(struct arppacket *); +extern void arp_hton(struct arppacket *); + +/* in file ascdate.c */ +extern status ascdate(uint32, char *); + +/* in file bufinit.c */ +extern status bufinit(void); + +/* in file chprio.c */ +extern pri16 chprio(pid32, pri16); + +/* in file clkupdate.S */ +extern uint32 clkcount(void); + +/* in file clkhandler.c */ +extern interrupt clkhandler(void); + +/* in file clkinit.c */ +extern void clkinit(void); + +/* in file clkint.S */ +extern void clkint(void); + +/* in file close.c */ +extern syscall close(did32); + +/* in file control.c */ +extern syscall control(did32, int32, int32, int32); + +/* in file create.c */ +extern pid32 create(void *, uint32, pri16, char *, uint32, ...); + +/* in file ctxsw.S */ +extern void ctxsw(void *, void *); + +/* in file dhcp.c */ +extern uint32 getlocalip(void); + +/* in file dns.c */ +extern uint32 dnslookup(char *); + +/* in file dot2ip.c */ +extern uint32 dot2ip(char *, uint32 *); + +/* in file ethcontrol.c */ +extern int32 ethcontrol(struct dentry *, int32, int32, int32); + +/* in file ethinit.c */ +extern int32 ethinit(struct dentry *); + +/* in file ethhandler.c */ +extern interrupt ethhandler(uint32); + +/* in file ethread.c */ +extern int32 ethread(struct dentry *, void *, uint32); + +/* in file ethwrite.c */ +extern int32 ethwrite(struct dentry *, void *, uint32); + +/* in file evec.c */ + +extern int32 initintc(void); +extern int32 initevec(void); +extern int32 set_evec(uint32, uint32); +extern void trap(int32); + +/* in file exception.c */ +extern void exception(int32, int32*); + +/* in file freebuf.c */ +extern syscall freebuf(char *); + +/* in file freemem.c */ +extern syscall freemem(char *, uint32); + +/* in file getbuf.c */ +extern char *getbuf(bpid32); + +/* in file getc.c */ +extern syscall getc(did32); + +/* in file getitem.c */ +extern pid32 getfirst(qid16); +extern pid32 getlast(qid16); +extern pid32 getitem(pid32); + +/* in file getmem.c */ +extern char *getmem(uint32); + +/* in file getpid.c */ +extern pid32 getpid(void); + +/* in file getprio.c */ +extern syscall getprio(pid32); + +/* in file getstk.c */ +extern char *getstk(uint32); + +/* in file getticks.c */ +extern uint32 getticks(void); + +/* in file gettime.c */ +extern status gettime(uint32 *); + +/* in file getutime.c */ +extern status getutime(uint32 *); + +/* in file gpiocontrol.c */ +extern devcall gpiocontrol(struct dentry *, int32, int32, int32); + +/* in file gpiohandler.c */ +extern void gpiohandler(uint32); + +/* in file gpioinit.c */ +extern devcall gpioinit(struct dentry *); + +/* in file gpioselect.c */ +extern devcall gpioselect(uint32, uint32, uint32); + +/* in file gpioread.c */ +extern devcall gpioread(struct dentry *,char *, int32); + +/* in file gpiowrite.c */ +extern devcall gpiowrite(struct dentry *, char *, int32); + +/* in file halt.S */ +extern void halt(void); + +/* in file icmp.c */ + +extern void icmp_init(void); +extern void icmp_in(struct netpacket *); +extern int32 icmp_register(uint32); +extern int32 icmp_recv(int32, char *, int32, uint32); +extern status icmp_send(uint32, uint16, uint16, uint16, char *, int32); +extern struct netpacket *icmp_mkpkt(uint32, uint16, uint16, uint16, char *, int32); +extern status icmp_release(int32); +extern uint16 icmp_cksum(char *, int32); +extern void icmp_hton(struct netpacket *); +extern void icmp_ntoh(struct netpacket *); + +/* in file init.c */ +extern syscall init(did32); + +/* in file insert.c */ +extern status insert(pid32, qid16, int32); + +/* in file insertd.c */ +extern status insertd(pid32, qid16, int32); + +/* in file intr.S */ +extern intmask disable(void); +extern void enable(void); + +/* in file ioerr.c */ +extern devcall ioerr(void); + +/* in file ionull.c */ +extern devcall ionull(void); + +/* in file ip.c */ +extern void ip_in(struct netpacket *); +extern status ip_send(struct netpacket *); +extern void ip_local(struct netpacket *); +extern status ip_out(struct netpacket *); +extern int32 ip_route(uint32); +extern uint16 ipcksum(struct netpacket *); +extern void ip_ntoh(struct netpacket *); +extern void ip_hton(struct netpacket *); +extern process ipout(void); +extern status ip_enqueue(struct netpacket *); + +/* in file net.c */ +extern void net_init(void); +extern process netin(void); +extern process netout(void); +extern process rawin(void); +extern void eth_hton(struct netpacket *); +extern void eth_ntoh(struct netpacket *); +extern uint16 getport(void); + +/* in file kill.c */ +extern syscall kill(pid32); + +/* in file lexan.c */ +extern int32 lexan(char *, int32, char *, int32 *, int32 [], int32 []); + +/* in file lfibclear.c */ +extern void lfibclear(struct lfiblk *, int32); + +/* in file lfibget.c */ +extern void lfibget(did32, ibid32, struct lfiblk *); + +/* in file lfibput.c */ +extern status lfibput(did32, ibid32, struct lfiblk *); + +/* in file lfdbfree.c */ +extern status lfdbfree(did32, dbid32); + +/* in file lfdballoc.c */ +extern dbid32 lfdballoc(struct lfdbfree *); + +/* in file lfflush.c */ +extern status lfflush(struct lflcblk *); + +/* in file lfgetmode.c */ +extern int32 lfgetmode(char *); + +/* in file lfiballoc.c */ +extern ibid32 lfiballoc(void); + +/* in file lflclose.c */ +extern devcall lflclose(struct dentry *); + +/* in file lflcontrol.c */ +extern devcall lflcontrol(struct dentry *, int32, int32, int32); + +/* in file lflgetc.c */ +extern devcall lflgetc(struct dentry *); + +/* in file lflinit.c */ +extern devcall lflinit(struct dentry *); + +/* in file lflputc.c */ +extern devcall lflputc(struct dentry *, char); + +/* in file lflread.c */ +extern devcall lflread(struct dentry *, char *, int32); + +/* in file lflseek.c */ +extern devcall lflseek(struct dentry *, uint32); + +/* in file lflwrite.c */ +extern devcall lflwrite(struct dentry *, char *, int32); + +/* in file lfscheck.c */ +extern status lfscheck(struct lfdir *); + +/* in file lfscreate.c */ +extern status lfscreate(did32, ibid32, uint32); + +/* in file lfsinit.c */ +extern devcall lfsinit(struct dentry *); + +/* in file lfsopen.c */ +extern devcall lfsopen(struct dentry *, char *, char *); + +/* in file lfsetup.c */ +extern status lfsetup(struct lflcblk *); + +/* in file lftruncate.c */ +extern status lftruncate(struct lflcblk *); + +/* in file lpgetc.c */ +extern devcall lpgetc(struct dentry *); + +/* in file lpinit.c */ +extern devcall lpinit(struct dentry *); + +/* in file lpopen.c */ +extern devcall lpopen(struct dentry *, char *, char *); + +/* in file lpputc.c */ +extern devcall lpputc(struct dentry *, char); + +/* in file lpread.c */ +extern devcall lpread(struct dentry *, char *, int32); + +/* in file lpwrite.c */ +extern devcall lpwrite(struct dentry *, char *, int32); + +/* in file mark.c */ +extern void _mkinit(void); + +/* in file memcpy.c */ +extern void *memcpy(void *, const void *, int32); + +/* in file memcpy.c */ +extern int32 *memcmp(void *, const void *, int32); + +/* in file memset.c */ +extern void *memset(void *, const int, int32); + +/* in file mkbufpool.c */ +extern bpid32 mkbufpool(int32, int32); + +/* in file mount.c */ +extern syscall mount(char *, char *, did32); +extern int32 namlen(char *, int32); + +/* in file naminit.c */ +extern status naminit(void); + +/* in file nammap.c */ +extern devcall nammap(char *, char[], did32); +extern did32 namrepl(char *, char[]); +extern status namcpy(char *, char *, int32); + +/* in file namopen.c */ +extern devcall namopen(struct dentry *, char *, char *); + +/* in file newqueue.c */ +extern qid16 newqueue(void); + +/* in file open.c */ +extern syscall open(did32, char *, char *); + +/* in file panic.c */ +extern void panic(char *); + +/* in file pci.c */ +extern int32 pci_init(void); + +/* in file pdump.c */ +extern void pdump(struct netpacket *); +extern void pdumph(struct netpacket *); + +/* in file platinit.c */ +extern void platinit(void); + +/* in file ptclear.c */ +extern void _ptclear(struct ptentry *, uint16, int32 (*)(int32)); + +/* in file ptcount.c */ +extern int32 ptcount(int32); + +/* in file ptcreate.c */ +extern syscall ptcreate(int32); + +/* in file ptdelete.c */ +extern syscall ptdelete(int32, int32 (*)(int32)); + +/* in file ptinit.c */ +extern syscall ptinit(int32); + +/* in file ptrecv.c */ +extern uint32 ptrecv(int32); + +/* in file ptreset.c */ +extern syscall ptreset(int32, int32 (*)(int32)); + +/* in file ptsend.c */ +extern syscall ptsend(int32, umsg32); + +/* in file putc.c */ +extern syscall putc(did32, char); + +/* in file queue.c */ +extern pid32 enqueue(pid32, qid16); +extern pid32 dequeue(qid16); + +/* in file ramclose.c */ +extern devcall ramclose(struct dentry *); + +/* in file raminit.c */ +extern devcall raminit(struct dentry *); + +/* in file ramopen.c */ +extern devcall ramopen(struct dentry *, char *, char *); + +/* in file ramread.c */ +extern devcall ramread(struct dentry *, char *, int32); + +/* in file ramwrite.c */ +extern devcall ramwrite(struct dentry *, char *, int32); + +/* in file rdsclose.c */ +extern devcall rdsclose(struct dentry *); + +/* in file rdscontrol.c */ +extern devcall rdscontrol(struct dentry *, int32, int32, int32); + +/* in file rdsinit.c */ +extern devcall rdsinit(struct dentry *); + +/* in file rdsopen.c */ +extern devcall rdsopen(struct dentry *, char *, char *); + +/* in file rdsread.c */ +extern devcall rdsread(struct dentry *, char *, int32); + +/* in file rdswrite.c */ +extern devcall rdswrite(struct dentry *, char *, int32); + +/* in file rdsbufalloc.c */ +extern struct rdbuff * rdsbufalloc(struct rdscblk *); + +/* in file rdscomm.c */ +extern status rdscomm(struct rd_msg_hdr *, int32, struct rd_msg_hdr *, + int32, struct rdscblk *); + +/* in file rdsprocess.c */ +extern void rdsprocess(struct rdscblk *); + +/* in file read.c */ +extern syscall read(did32, char *, uint32); + +/* in file ready.c */ +extern status ready(pid32); + +/* in file receive.c */ +extern umsg32 receive(void); + +/* in file recvclr.c */ +extern umsg32 recvclr(void); + +/* in file recvtime.c */ +extern umsg32 recvtime(int32); + +/* in file resched.c */ +extern void resched(void); +extern status resched_cntl(int32); + +/* in file intr.S */ +extern void restore(intmask); + +/* in file resume.c */ +extern pri16 resume(pid32); + +/* in file rfsgetmode.c */ +extern int32 rfsgetmode(char * ); + +/* in file rflclose.c */ +extern devcall rflclose(struct dentry *); + +/* in file rfscontrol.c */ +extern devcall rfscontrol(struct dentry *, int32, int32, int32); + +/* in file rflgetc.c */ +extern devcall rflgetc(struct dentry *); + +/* in file rflinit.c */ +extern devcall rflinit(struct dentry *); + +/* in file rflputc.c */ +extern devcall rflputc(struct dentry *, char ); + +/* in file rflread.c */ +extern devcall rflread(struct dentry *, char *, int32 ); + +/* in file rflseek.c */ +extern devcall rflseek(struct dentry *, uint32 ); + +/* in file rflwrite.c */ +extern devcall rflwrite(struct dentry *, char *, int32 ); + +/* in file rfsndmsg.c */ +extern status rfsndmsg(uint16, char *); + +/* in file rfsinit.c */ +extern devcall rfsinit(struct dentry *); + +/* in file rfsopen.c */ +extern devcall rfsopen(struct dentry *devptr, char *, char *); + +/* in file rfscomm.c */ +extern int32 rfscomm(struct rf_msg_hdr *, int32, struct rf_msg_hdr *, int32); + +/* in file rdsclose.c */ +extern devcall rdsclose(struct dentry *); + +/* in file rdscontrol.c */ +extern devcall rdscontrol(struct dentry *, int32, int32, int32); + +/* in file rdsinit.c */ +extern devcall rdsinit(struct dentry *); + +/* in file rdsopen.c */ +extern devcall rdsopen(struct dentry *, char *, char *); + +/* in file rdsread.c */ +extern devcall rdsread(struct dentry *, char *, int32); + +/* in file rdswrite.c */ +extern devcall rdswrite(struct dentry *, char *, int32); + +/* in file rdsbufalloc.c */ +extern struct rdbuff * rdsbufalloc(struct rdscblk *); + +/* in file rdscomm.c */ +extern status rdscomm(struct rd_msg_hdr *, int32, struct rd_msg_hdr *, int32, struct rdscblk *); + +/* in file rdsprocess.c */ +extern void rdsprocess(struct rdscblk *); + +/* in file seek.c */ +extern syscall seek(did32, uint32); + +/* in file semcount.c */ +extern syscall semcount(sid32); + +/* in file semcreate.c */ +extern sid32 semcreate(int32); + +/* in file semdelete.c */ +extern syscall semdelete(sid32); + +/* in file semreset.c */ +extern syscall semreset(sid32, int32); + +/* in file send.c */ +extern syscall send(pid32, umsg32); + +/* in file shell.c */ +extern process shell(did32); + +/* in file signal.c */ +extern syscall signal(sid32); + +/* in file signaln.c */ +extern syscall signaln(sid32, int32); + +/* in file sleep.c */ +extern syscall sleepms(int32); +extern syscall sleep(int32); + +/* in file spicontrol.c */ +extern devcall spicontrol(struct dentry *, int32, int32, int32); + +/* in spiinit.c */ +extern int32 spiinit(struct dentry *); + +/* in file start.S */ +extern int32 inb(int32); +extern int32 inw(int32); +extern int32 inl(int32); +extern int32 outb(int32, int32); +extern int32 outw(int32, int32); +extern int32 outl(int32, int32); +extern int32 outsw(int32, int32, int32); +extern int32 insw(int32, int32 ,int32); + +/* in file suspend.c */ +extern syscall suspend(pid32); + +/* in file ttycontrol.c */ +extern devcall ttycontrol(struct dentry *, int32, int32, int32); + +/* in file ttygetc.c */ +extern devcall ttygetc(struct dentry *); + +/* in file ttyhandle_in.c */ +extern void ttyhandle_in(struct ttycblk *, struct uart_csreg *); + +/* in file ttyhandle_out.c */ +extern void ttyhandle_out(struct ttycblk *, struct uart_csreg *); + +/* in file ttyhandler.c */ +extern void ttyhandler(uint32); + +/* in file ttyinit.c */ +extern devcall ttyinit(struct dentry *); + +/* in file ttykickout.c */ +extern void ttykickout(struct uart_csreg *); + +/* in file ttyputc.c */ +extern devcall ttyputc(struct dentry *, char); + +/* in file ttyread.c */ +extern devcall ttyread(struct dentry *, char *, int32); + +/* in file ttywrite.c */ +extern devcall ttywrite(struct dentry *, char *, int32); + +/* in file udp.c */ + +extern void udp_init(void); +extern void udp_in(struct netpacket *); +extern uid32 udp_register(uint32, uint16, uint16); +extern int32 udp_recv(uid32, char *, int32, uint32); +extern int32 udp_recvaddr(uid32, uint32 *, uint16 *, char *, int32, uint32); +extern status udp_send(uid32, char *, int32); +extern status udp_sendto(uid32, uint32, uint16, char *, int32); +extern status udp_release(uid32); +extern void udp_ntoh(struct netpacket *); +extern void udp_hton(struct netpacket *); + + +/* in file unsleep.c */ +extern syscall unsleep(pid32); + +/* in file userret.c */ +extern void userret(void); + +/* in file wait.c */ +extern syscall wait(sid32); + +/* in file wakeup.c */ +extern void wakeup(void); + +/* in file write.c */ +extern syscall write(did32, char *, uint32); + +/* in file xdone.c */ +extern void xdone(void); + +/* in file yield.c */ +extern syscall yield(void); + +/* in file syscall.c */ +extern void syscall_init(); + +/* in file suicide.c */ + +/* in file lib/syscall. c*/ + +/* in file spiinit.c */ +// extern devcall spiinit(struct dentry *); + +/* in file spiputc.c */ +extern devcall spiputc(struct dentry *, char); + + +/* NETWORK BYTE ORDER CONVERSION NOT NEEDED ON A BIG-ENDIAN COMPUTER */ +#define htons(x) ( ( 0xff & ((x)>>8) ) | ( (0xff & (x)) << 8 ) ) +#define htonl(x) ( (((x)>>24) & 0x000000ff) | (((x)>> 8) & 0x0000ff00) | \ + (((x)<< 8) & 0x00ff0000) | (((x)<<24) & 0xff000000) ) +#define ntohs(x) ( ( 0xff & ((x)>>8) ) | ( (0xff & (x)) << 8 ) ) +#define ntohl(x) ( (((x)>>24) & 0x000000ff) | (((x)>> 8) & 0x0000ff00) | \ + (((x)<< 8) & 0x00ff0000) | (((x)<<24) & 0xff000000) ) diff --git a/include/queue.h b/include/queue.h new file mode 100644 index 0000000..275563e --- /dev/null +++ b/include/queue.h @@ -0,0 +1,36 @@ +/* queue.h - firstid, firstkey, isempty, lastkey, nonempty */ + +/* Queue structure declarations, constants, and inline functions */ + +/* Default # of queue entries: 1 per process plus 2 for ready list plus */ +/* 2 for sleep list plus 2 per semaphore */ +#ifndef NQENT +#define NQENT (NPROC + 4 + NSEM + NSEM) +#endif + +#define EMPTY (-1) /* Null value for qnext or qprev index */ +#define MAXKEY 0x7FFFFFFF /* Max key that can be stored in queue */ +#define MINKEY 0x80000000 /* Min key that can be stored in queue */ + +struct qentry { /* One per process plus two per list */ + int32 qkey; /* Key on which the queue is ordered */ + qid16 qnext; /* Index of next process or tail */ + qid16 qprev; /* Index of previous process or head */ +}; + +extern struct qentry queuetab[]; + +/* Inline queue manipulation functions */ + +#define queuehead(q) (q) +#define queuetail(q) ((q) + 1) +#define firstid(q) (queuetab[queuehead(q)].qnext) +#define lastid(q) (queuetab[queuetail(q)].qprev) +#define isempty(q) (firstid(q) >= NPROC) +#define nonempty(q) (firstid(q) < NPROC) +#define firstkey(q) (queuetab[firstid(q)].qkey) +#define lastkey(q) (queuetab[ lastid(q)].qkey) + +/* Inline to check queue id assumes interrupts are disabled */ + +#define isbadqid(x) (((int32)(x) < NPROC) || (int32)(x) >= NQENT-1) diff --git a/include/ramdisk.h b/include/ramdisk.h new file mode 100644 index 0000000..dab730c --- /dev/null +++ b/include/ramdisk.h @@ -0,0 +1,12 @@ +/* ramdisk.h - definitions for a ram disk (for testing) */ + +/* Ram disk block size */ + +#define RM_BLKSIZ 5 /* block size */ +#define RM_BLKS 2 /* number of blocks */ + +struct ramdisk { + char disk[RM_BLKSIZ * RM_BLKS]; + }; + +extern struct ramdisk Ram; diff --git a/include/rdisksys.h b/include/rdisksys.h new file mode 100644 index 0000000..21c1f54 --- /dev/null +++ b/include/rdisksys.h @@ -0,0 +1,235 @@ +/* rdisksys.h - definitions for remote disk system pseudo-devices */ + +#ifndef Nrds +#define Nrds 1 +#endif + +/* Remote disk block size */ + +#define RD_BLKSIZ 512 + +/* Global data for the remote disk server */ + +#ifndef RD_SERVER_IP +#define RD_SERVER_IP "255.255.255.255" +#endif + +#ifndef RD_SERVER_PORT +#define RD_SERVER_PORT 33124 +#endif + +#ifndef RD_LOC_PORT +#define RD_LOC_PORT 33124 /* Base port number - minor dev */ + /* number is added to insure */ + /* that each device is unique */ +#endif + +/* Control block for remote disk device */ + +#define RD_IDLEN 64 /* Size of a remote disk ID */ +#define RD_BUFFS 64 /* Number of disk buffers */ +#define RD_STACK 16384 /* Stack size for comm. process */ +#define RD_PRIO 200 /* Priorty of comm. process */ + +/* Constants for state of the device */ + +#define RD_FREE 0 /* Device is available */ +#define RD_OPEN 1 /* Device is open (in use) */ +#define RD_PEND 2 /* Open is pending */ + +/* Operations for request queue */ + +#define RD_OP_READ 1 /* Read operation on req. list */ +#define RD_OP_WRITE 2 /* Write operation on req. list */ +#define RD_OP_SYNC 3 /* Sync operation on req. list */ + +/* Status values for a buffer */ + +#define RD_VALID 0 /* Buffer contains valid data */ +#define RD_INVALID 1 /* Buffer does not contain data */ + +/* Definition of a buffer with a header that allows the same node to be */ +/* used as a request on the request queue, an item in the cache, or a */ +/* node on the free list of buffers */ + +struct rdbuff { /* Request list node */ + struct rdbuff *rd_next; /* Ptr to next node on a list */ + struct rdbuff *rd_prev; /* Ptr to prev node on a list */ + int32 rd_op; /* Operation - read/write/sync */ + int32 rd_refcnt; /* Reference count of processes */ + /* reading the block */ + uint32 rd_blknum; /* Block number of this block */ + int32 rd_status; /* Is buffer currently valid? */ + pid32 rd_pid; /* Process that initiated a */ + /* read request for the block */ + char rd_block[RD_BLKSIZ]; /* Space to hold one disk block */ +}; + +struct rdscblk { + int32 rd_state; /* State of device */ + char rd_id[RD_IDLEN]; /* Disk ID currently being used */ + int32 rd_seq; /* Next sequence number to use */ + /* Request queue head and tail */ + struct rdbuff *rd_rhnext; /* Head of request queue: next */ + struct rdbuff *rd_rhprev; /* and previous */ + struct rdbuff *rd_rtnext; /* Tail of request queue: next */ + struct rdbuff *rd_rtprev; /* (null) and previous */ + + /* Cache head and tail */ + + struct rdbuff *rd_chnext; /* Head of cache: next and */ + struct rdbuff *rd_chprev; /* previous */ + struct rdbuff *rd_ctnext; /* Tail of cache: next (null) */ + struct rdbuff *rd_ctprev; /* and previous */ + + /* Free list head (singly-linked) */ + + struct rdbuff *rd_free; /* Pointer to free list */ + + pid32 rd_comproc; /* Process ID of comm. process */ + bool8 rd_comruns; /* Has comm. process started? */ + sid32 rd_availsem; /* Semaphore ID for avail buffs */ + sid32 rd_reqsem; /* Semaphore ID for requests */ + uint32 rd_ser_ip; /* Server IP address */ + uint16 rd_ser_port; /* Server UDP port */ + uint16 rd_loc_port; /* Local (client) UPD port */ + bool8 rd_registered; /* Has UDP port been registered?*/ + int32 rd_udpslot; /* Registered UDP slot */ +}; + + +extern struct rdscblk rdstab[]; /* Remote disk control block */ + +/* Definitions of parameters used during server access */ + +#define RD_RETRIES 3 /* Times to retry sending a msg */ +#define RD_TIMEOUT 2000 /* Timeout for reply (2 seconds)*/ + +/* Control functions for a remote file pseudo device */ + +#define RDS_CTL_DEL 1 /* Delete (erase) an entire disk*/ +#define RDS_CTL_SYNC 2 /* Write all pending blocks */ + +/************************************************************************/ +/* Definition of messages exchanged with the remote disk server */ +/************************************************************************/ +/* Values for the type field in messages */ + +#define RD_MSG_RESPONSE 0x0100 /* Bit that indicates response */ + +#define RD_MSG_RREQ 0x0010 /* Read request and response */ +#define RD_MSG_RRES (RD_MSG_RREQ | RD_MSG_RESPONSE) + +#define RD_MSG_WREQ 0x0020 /* Write request and response */ +#define RD_MSG_WRES (RD_MSG_WREQ | RD_MSG_RESPONSE) + +#define RD_MSG_OREQ 0x0030 /* Open request and response */ +#define RD_MSG_ORES (RD_MSG_OREQ | RD_MSG_RESPONSE) + +#define RD_MSG_CREQ 0x0040 /* Close request and response */ +#define RD_MSG_CRES (RD_MSG_CREQ | RD_MSG_RESPONSE) + +#define RD_MSG_DREQ 0x0050 /* Delete request and response */ +#define RD_MSG_DRES (RD_MSG_DREQ | RD_MSG_RESPONSE) + +#define RD_MIN_REQ RD_MSG_RREQ /* Minimum request type */ +#define RD_MAX_REQ RD_MSG_DREQ /* Maximum request type */ + +/* Message header fields present in each message */ + +#define RD_MSG_HDR /* Common message fields */\ + uint16 rd_type; /* Message type */\ + uint16 rd_status; /* 0 in req, status in response */\ + uint32 rd_seq; /* Message sequence number */\ + char rd_id[RD_IDLEN]; /* Null-terminated disk ID */ + +/************************************************************************/ +/* Header */ +/************************************************************************/ +/* The standard header present in all messages with no extra fields */ +#pragma pack(2) +struct rd_msg_hdr { /* Header fields present in each*/ + RD_MSG_HDR /* remote file system message */ +}; +#pragma pack() + +/************************************************************************/ +/* Read */ +/************************************************************************/ +#pragma pack(2) +struct rd_msg_rreq { /* Remote file read request */ + RD_MSG_HDR /* Header fields */ + uint32 rd_blk; /* Block number to read */ +}; +#pragma pack() + +#pragma pack(2) +struct rd_msg_rres { /* Remote file read reply */ + RD_MSG_HDR /* Header fields */ + uint32 rd_blk; /* Block number that was read */ + char rd_data[RD_BLKSIZ]; /* Array containing one block */ +}; +#pragma pack() + +/************************************************************************/ +/* Write */ +/************************************************************************/ +#pragma pack(2) +struct rd_msg_wreq { /* Remote file write request */ + RD_MSG_HDR /* Header fields */ + uint32 rd_blk; /* Block number to write */ + char rd_data[RD_BLKSIZ]; /* Array containing one block */ +}; +#pragma pack() + +#pragma pack(2) +struct rd_msg_wres { /* Remote file write response */ + RD_MSG_HDR /* Header fields */ + uint32 rd_blk; /* Block number that was written*/ +}; +#pragma pack() + +/************************************************************************/ +/* Open */ +/************************************************************************/ +#pragma pack(2) +struct rd_msg_oreq { /* Remote file open request */ + RD_MSG_HDR /* Header fields */ +}; +#pragma pack() + +#pragma pack(2) +struct rd_msg_ores { /* Remote file open response */ + RD_MSG_HDR /* Header fields */ +}; +#pragma pack() + +/************************************************************************/ +/* Close */ +/************************************************************************/ +#pragma pack(2) +struct rd_msg_creq { /* Remote file close request */ + RD_MSG_HDR /* Header fields */ +}; +#pragma pack() + +#pragma pack(2) +struct rd_msg_cres { /* Remote file close response */ + RD_MSG_HDR /* Header fields */ +}; +#pragma pack() + +/************************************************************************/ +/* Delete */ +/************************************************************************/ +#pragma pack(2) +struct rd_msg_dreq { /* Remote file delete request */ + RD_MSG_HDR /* Header fields */ +}; +#pragma pack() + +#pragma pack(2) +struct rd_msg_dres { /* Remote file delete response */ + RD_MSG_HDR /* Header fields */ +}; +#pragma pack() diff --git a/include/resched.h b/include/resched.h new file mode 100644 index 0000000..04a9ead --- /dev/null +++ b/include/resched.h @@ -0,0 +1,16 @@ +/* resched.h */ + +/* Constants and variables related to deferred rescheduling */ + +#define DEFER_START 1 /* Start deferred rescehduling */ +#define DEFER_STOP 2 /* Stop deferred rescehduling */ + +/* Structure that collects items related to deferred rescheduling */ + +struct defer { + int32 ndefers; /* Number of outstanding defers */ + bool8 attempt; /* Was resched called during the */ + /* deferral period? */ +}; + +extern struct defer Defer; diff --git a/include/rfilesys.h b/include/rfilesys.h new file mode 100644 index 0000000..4ed7f32 --- /dev/null +++ b/include/rfilesys.h @@ -0,0 +1,292 @@ +/* rfilesys.h - Definitions for remote file system pseudo-devices */ + +#ifndef Nrfl +#define Nrfl 10 +#endif + +/* Control block for a remote file pseudo-device */ + +#define RF_NAMLEN 128 /* Maximum length of file name */ +#define RF_DATALEN 1024 /* Maximum data in read or write*/ +#define RF_MODE_R F_MODE_R /* Bit to grant read access */ +#define RF_MODE_W F_MODE_W /* Bit to grant write access */ +#define RF_MODE_RW F_MODE_RW /* Mask for read and write bits */ +#define RF_MODE_N F_MODE_N /* Bit for "new" mode */ +#define RF_MODE_O F_MODE_O /* Bit for "old" mode */ +#define RF_MODE_NO F_MODE_NO /* Mask for "n" and "o" bits */ + +/* Global data for the remote server */ + +#ifndef RF_SERVER_IP +#define RF_SERVER_IP "128.10.3.51" +#endif + +#ifndef RF_SERVER_PORT +#define RF_SERVER_PORT 33123 +#endif + +#ifndef RF_LOC_PORT +#define RF_LOC_PORT 33123 +#endif + +struct rfdata { + int32 rf_seq; /* Next sequence number to use */ + uint32 rf_ser_ip; /* Server IP address */ + uint16 rf_ser_port; /* Server UDP port */ + uint16 rf_loc_port; /* Local (client) UPD port */ + int32 rf_udp_slot; /* UDP slot to use */ + sid32 rf_mutex; /* Mutual exclusion for access */ + bool8 rf_registered; /* Has UDP port been registered?*/ +}; + +extern struct rfdata Rf_data; + +/* Definition of the control block for a remote file pseudo-device */ + +#define RF_FREE 0 /* Entry is currently unused */ +#define RF_USED 1 /* Entry is currently in use */ + +struct rflcblk { + int32 rfstate; /* Entry is free or used */ + int32 rfdev; /* Device number of this dev. */ + char rfname[RF_NAMLEN]; /* Name of the file */ + uint32 rfpos; /* Current file position */ + uint32 rfmode; /* Mode: read access, write */ + /* access or both */ +}; + +extern struct rflcblk rfltab[]; /* Remote file control blocks */ + +/* Definitions of parameters used when accessing a remote server */ + +#define RF_RETRIES 3 /* Time to retry sending a msg */ +#define RF_TIMEOUT 3000 /* Wait one second for a reply */ + +/* Control functions for a remote file pseudo device */ + +#define RFS_CTL_DEL F_CTL_DEL /* Delete a file */ +#define RFS_CTL_TRUNC F_CTL_TRUNC /* Truncate a file */ +#define RFS_CTL_MKDIR F_CTL_MKDIR /* Make a directory */ +#define RFS_CTL_RMDIR F_CTL_RMDIR /* Remove a directory */ +#define RFS_CTL_SIZE F_CTL_SIZE /* Obtain the size of a file */ + +/************************************************************************/ +/* */ +/* Definition of messages exchanged with the remote server */ +/* */ +/************************************************************************/ + +/* Values for the type field in messages */ + +#define RF_MSG_RESPONSE 0x0100 /* Bit that indicates response */ + +#define RF_MSG_RREQ 0x0001 /* Read Request and response */ +#define RF_MSG_RRES (RF_MSG_RREQ | RF_MSG_RESPONSE) + +#define RF_MSG_WREQ 0x0002 /* Write Request and response */ +#define RF_MSG_WRES (RF_MSG_WREQ | RF_MSG_RESPONSE) + +#define RF_MSG_OREQ 0x0003 /* Open request and response */ +#define RF_MSG_ORES (RF_MSG_OREQ | RF_MSG_RESPONSE) + +#define RF_MSG_DREQ 0x0004 /* Delete request and response */ +#define RF_MSG_DRES (RF_MSG_DREQ | RF_MSG_RESPONSE) + +#define RF_MSG_TREQ 0x0005 /* Truncate request & response */ +#define RF_MSG_TRES (RF_MSG_TREQ | RF_MSG_RESPONSE) + +#define RF_MSG_SREQ 0x0006 /* Size request and response */ +#define RF_MSG_SRES (RF_MSG_SREQ | RF_MSG_RESPONSE) + +#define RF_MSG_MREQ 0x0007 /* Mkdir request and response */ +#define RF_MSG_MRES (RF_MSG_MREQ | RF_MSG_RESPONSE) + +#define RF_MSG_XREQ 0x0008 /* Rmdir request and response */ +#define RF_MSG_XRES (RF_MSG_XREQ | RF_MSG_RESPONSE) + +#define RF_MIN_REQ RF_MSG_RREQ /* Minimum request type */ +#define RF_MAX_REQ RF_MSG_XREQ /* Maximum request type */ + +/* Message header fields present in each message */ + +#define RF_MSG_HDR /* Common message fields */\ + uint16 rf_type; /* Message type */\ + uint16 rf_status; /* 0 in req, status in response */\ + uint32 rf_seq; /* Message sequence number */\ + char rf_name[RF_NAMLEN]; /* Null-terminated file name */ + +/* The standard header present in all messages with no extra fields */ + +/************************************************************************/ +/* */ +/* Header */ +/* */ +/************************************************************************/ + +#pragma pack(2) +struct rf_msg_hdr { /* Header fields present in each*/ + RF_MSG_HDR /* remote file system message */ +}; +#pragma pack() + +/************************************************************************/ +/* */ +/* Read */ +/* */ +/************************************************************************/ + +#pragma pack(2) +struct rf_msg_rreq { /* Remote file read request */ + RF_MSG_HDR /* Header fields */ + uint32 rf_pos; /* Position in file to read */ + uint32 rf_len; /* Number of bytes to read */ + /* (between 1 and 1024) */ +}; +#pragma pack() + +#pragma pack(2) +struct rf_msg_rres { /* Remote file read reply */ + RF_MSG_HDR /* Header fields */ + uint32 rf_pos; /* Position in file */ + uint32 rf_len; /* Number of bytes that follow */ + /* (0 for EOF) */ + char rf_data[RF_DATALEN]; /* Array containing data from */ + /* the file */ +}; +#pragma pack() + +/************************************************************************/ +/* */ +/* Write */ +/* */ +/************************************************************************/ + +#pragma pack(2) +struct rf_msg_wreq { /* Remote file write request */ + RF_MSG_HDR /* Header fields */ + uint32 rf_pos; /* Position in file */ + uint32 rf_len; /* Number of valid bytes in */ + /* array that follows */ + char rf_data[RF_DATALEN]; /* Array containing data to be */ + /* written to the file */ +}; +#pragma pack() + +#pragma pack(2) +struct rf_msg_wres { /* Remote file write response */ + RF_MSG_HDR /* Header fields */ + uint32 rf_pos; /* Original position in file */ + uint32 rf_len; /* Number of bytes written */ +}; +#pragma pack() + +/************************************************************************/ +/* */ +/* Open */ +/* */ +/************************************************************************/ + +#pragma pack(2) +struct rf_msg_oreq { /* Remote file open request */ + RF_MSG_HDR /* Header fields */ + int32 rf_mode; /* Xinu mode bits */ +}; +#pragma pack() + +#pragma pack(2) +struct rf_msg_ores { /* Remote file open response */ + RF_MSG_HDR /* Header fields */ + int32 rf_mode; /* Xinu mode bits */ +}; +#pragma pack() + +/************************************************************************/ +/* */ +/* Size */ +/* */ +/************************************************************************/ + +#pragma pack(2) +struct rf_msg_sreq { /* Remote file size request */ + RF_MSG_HDR /* Header fields */ +}; +#pragma pack() + +#pragma pack(2) +struct rf_msg_sres { /* Remote file status response */ + RF_MSG_HDR /* Header fields */ + uint32 rf_size; /* Size of file in bytes */ +}; +#pragma pack() + +/************************************************************************/ +/* */ +/* Delete */ +/* */ +/************************************************************************/ + +#pragma pack(2) +struct rf_msg_dreq { /* Remote file delete request */ + RF_MSG_HDR /* Header fields */ +}; +#pragma pack() + +#pragma pack(2) +struct rf_msg_dres { /* Remote file delete response */ + RF_MSG_HDR /* Header fields */ +}; +#pragma pack() + +/************************************************************************/ +/* */ +/* Truncate */ +/* */ +/************************************************************************/ + +#pragma pack(2) +struct rf_msg_treq { /* Remote file truncate request */ + RF_MSG_HDR /* Header fields */ +}; +#pragma pack() + +#pragma pack(2) +struct rf_msg_tres { /* Remote file truncate response*/ + RF_MSG_HDR /* Header fields */ +}; +#pragma pack() + +/************************************************************************/ +/* */ +/* Mkdir */ +/* */ +/************************************************************************/ + +#pragma pack(2) +struct rf_msg_mreq { /* Remote file mkdir request */ + RF_MSG_HDR /* Header fields */ +}; +#pragma pack() + +#pragma pack(2) +struct rf_msg_mres { /* Remote file mkdir response */ + RF_MSG_HDR /* Header fields */ +}; +#pragma pack() + +/************************************************************************/ +/* */ +/* Rmdir */ +/* */ +/************************************************************************/ + +#pragma pack(2) +struct rf_msg_xreq { /* Remote file rmdir request */ + RF_MSG_HDR /* Header fields */ +}; +#pragma pack() + +#pragma pack(2) +struct rf_msg_xres { /* Remote file rmdir response */ + RF_MSG_HDR /* Header fields */ +}; +#pragma pack() diff --git a/include/semaphore.h b/include/semaphore.h new file mode 100644 index 0000000..4be66a0 --- /dev/null +++ b/include/semaphore.h @@ -0,0 +1,22 @@ +/* semaphore.h - isbadsem */ + +#ifndef NSEM +#define NSEM 120 /* Number of semaphores, if not defined */ +#endif + +/* Semaphore state definitions */ + +#define S_FREE 0 /* Semaphore table entry is available */ +#define S_USED 1 /* Semaphore table entry is in use */ + +/* Semaphore table entry */ +struct sentry { + byte sstate; /* Whether entry is S_FREE or S_USED */ + int32 scount; /* Count for the semaphore */ + qid16 squeue; /* Queue of processes that are waiting */ + /* on the semaphore */ +}; + +extern struct sentry semtab[]; + +#define isbadsem(s) ((int32)(s) < 0 || (s) >= NSEM) diff --git a/include/serial_avr.h b/include/serial_avr.h new file mode 100644 index 0000000..250bd90 --- /dev/null +++ b/include/serial_avr.h @@ -0,0 +1,21 @@ +/********************************************************************** + * + * Filename: serial.h + * + * API para la aplicacion embebida + * + * META : ocultar el hardware a la aplicacion + * + **********************************************************************/ + +#ifndef _SERIAL_H +#define _SERIAL_H + +void serial_init(void); +void serial_put_char(char outputChar); +char serial_get_char(void); +void serial_put_str(char * outputStr); +char* serial_get_str(void); + + +#endif /* _SERIAL_H */ diff --git a/include/shell.h b/include/shell.h new file mode 100644 index 0000000..8403e10 --- /dev/null +++ b/include/shell.h @@ -0,0 +1,77 @@ +/* shell.h - Declarations and constants used by the Xinu shell */ + +/* Size constants */ + +#define SHELL_BUFLEN TY_IBUFLEN+1 /* Length of input buffer */ +#define SHELL_MAXTOK 32 /* Maximum tokens per line */ +#define SHELL_CMDSTK 4096 /* Size of stack for process */ + /* that executes command */ +#define SHELL_ARGLEN (SHELL_BUFLEN+SHELL_MAXTOK) /* Argument area */ +#define SHELL_CMDPRIO 20 /* Process priority for command */ + +/* Message constants */ + +/* Shell banner (assumes VT100) */ + +#define SHELL_BAN0 "\033[31;1m" +#define SHELL_BAN1 "------------------------------------------" +#define SHELL_BAN2 " __ __ _____ _ _ _ _ " +#define SHELL_BAN3 " \\ \\ / / |__ __| | \\ | | | | | | " +#define SHELL_BAN4 " \\ \\/ / | | | \\| | | | | | " +#define SHELL_BAN5 " / /\\ \\ _| |_ | \\ | | | | | " +#define SHELL_BAN6 " / / \\ \\ | | | | \\ | \\ -- / " +#define SHELL_BAN7 " -- -- ----- - - ---- " +#define SHELL_BAN8 " STM32 Version by Robin Krens " +#define SHELL_BAN9 "------------------------------------------" +#define SHELL_BAN10 "\033[0m\n" + +/* Messages shell displays for user */ + +#define SHELL_PROMPT "xsh $ " /* Command prompt */ +#define SHELL_STRTMSG "Welcome to Xinu!\n"/* Welcome message */ +#define SHELL_EXITMSG "Shell closed\n"/* Shell exit message */ +#define SHELL_SYNERRMSG "Syntax error\n"/* Syntax error message */ +#define SHELL_CREATMSG "Cannot create process\n"/* command error */ +#define SHELL_INERRMSG "Cannot open file %s for input\n" /* Input err */ +#define SHELL_OUTERRMSG "Cannot open file %s for output\n"/* Output err */ + /* Builtin cmd error message */ +#define SHELL_BGERRMSG "Cannot redirect I/O or background a builtin\n" + +/* Constants used for lexical analysis */ + +#define SH_NEWLINE '\n' /* New line character */ +#define SH_EOF '\04' /* Control-D is EOF */ +#define SH_AMPER '&' /* Ampersand character */ +#define SH_BLANK ' ' /* Blank character */ +#define SH_TAB '\t' /* Tab character */ +#define SH_SQUOTE '\'' /* Single quote character */ +#define SH_DQUOTE '"' /* Double quote character */ +#define SH_LESS '<' /* Less-than character */ +#define SH_GREATER '>' /* Greater-than character */ + +/* Token types */ + +#define SH_TOK_AMPER 0 /* Ampersand token */ +#define SH_TOK_LESS 1 /* Less-than token */ +#define SH_TOK_GREATER 2 /* Greater-than token */ +#define SH_TOK_OTHER 3 /* Token other than those */ + /* listed above (e.g., an */ + /* alphanumeric string) */ + +/* Shell return constants */ + +#define SHELL_OK 0 +#define SHELL_ERROR 1 +#define SHELL_EXIT -3 + +/* Structure of an entry in the table of shell commands */ + +struct cmdent { /* Entry in command table */ + char *cname; /* Name of command */ + bool8 cbuiltin; /* Is this a builtin command? */ + int32 (*cfunc)(int32,char*[]);/* Function for command */ +}; + +extern uint32 ncmd; +// RAFA extern const struct cmdent cmdtab[]; +extern const struct cmdent cmdtab[] ; diff --git a/include/shprototypes.h b/include/shprototypes.h new file mode 100644 index 0000000..d2059a4 --- /dev/null +++ b/include/shprototypes.h @@ -0,0 +1,74 @@ +/* in file xsh_argecho.c */ +extern shellcmd xsh_argecho (int32, char *[]); + +/* in file xsh_arp.c */ +extern shellcmd xsh_arp (int32, char *[]); + +/* in file xsh_bingid.c */ +extern shellcmd xsh_bingid (int32, char *[]); + +/* in file xsh_cat.c */ +extern shellcmd xsh_cat (int32, char *[]); + +/* in file xsh_clear.c */ +extern shellcmd xsh_clear (int32, char *[]); + +/* in file xsh_date.c */ +extern shellcmd xsh_date (int32, char *[]); + +/* in file xsh_devdump.c */ +extern shellcmd xsh_devdump (int32, char *[]); + +/* in file xsh_echo.c */ +extern shellcmd xsh_echo (int32, char *[]); + +/* in file xsh_ethstat.c */ +extern shellcmd xsh_ethstat (int32, char *[]); + +/* in file xsh_exit.c */ +extern shellcmd xsh_exit (int32, char *[]); + +/* in file xsh_help.c */ +extern shellcmd xsh_help (int32, char *[]); + +/* in file xsh_kill.c */ +extern shellcmd xsh_kill (int32, char *[]); + +/* in file xsh_led.c */ +extern shellcmd xsh_led (int32, char *[]); + +/* in file xsh_memdump.c */ +extern shellcmd xsh_memdump (int32, char *[]); + +/* in file xsh_memstat.c */ +extern shellcmd xsh_memstat (int32, char *[]); + +/* in file xsh_netinfo.c */ +extern shellcmd xsh_netinfo (int32, char *[]); + +/* in file xsh_nvram.c */ +extern shellcmd xsh_nvram (int32, char *[]); + +/* in file xsh_ping.c */ +extern shellcmd xsh_ping (int32, char *[]); + +/* in file xsh_ps.c */ +extern shellcmd xsh_ps (int32, char *[]); + +/* in file xsh_sleep.c */ +extern shellcmd xsh_sleep (int32, char *[]); + +/* in file xsh_udpdump.c */ +extern shellcmd xsh_udpdump (int32, char *[]); + +/* in file xsh_udpecho.c */ +extern shellcmd xsh_udpecho (int32, char *[]); + +/* in file xsh_udpeserver.c */ +extern shellcmd xsh_udpeserver (int32, char *[]); + +/* in file xsh_uptime.c */ +extern shellcmd xsh_uptime (int32, char *[]); + +/* in file xsh_help.c */ +extern shellcmd xsh_help (int32, char *[]); diff --git a/include/spi.h b/include/spi.h new file mode 100644 index 0000000..f90f37f --- /dev/null +++ b/include/spi.h @@ -0,0 +1,37 @@ +/* spi.h - SPI definitions */ + +struct spi_csreg { + volatile uint32 cr1; + volatile uint32 cr2; + volatile uint32 sr; + volatile uint32 dr; + volatile uint32 crcpr; + volatile uint32 rxcrcr; + volatile uint32 txcrcr; + volatile uint32 i2scfgr; + volatile uint32 i2spr; +}; + +/* No SPI0 peripheral, starts from 1*/ +#define SPI1_BASE 0x40013000 + +/* Control register settings */ +#define SPI_MSTR 2 +#define SPI_ENABLE 6 +#define SPI_SSM 9 +#define SPI_SSI 8 +#define SPI_BIDIMODE 15 +#define SPI_BIDIOE 14 + +/* Status register flags */ +#define SPI_BSY 7 // Busy +#define SPI_TXE 1 // Transfer buffer empty +#define SPI_RXNE 2 // Receive buffer NOT empty + +/* Baud rate control */ +#define BR_FPCLKDIV2 0x00000000 +#define BR_FPCLKDIV4 0x00000008 +#define BR_FPCLKDIV8 0x00000010 +#define BR_FPCLKDIV16 0x00000018 +#define BR_FPCLKDIV32 0x00000020 +#define BR_FPCLKDIV64 0x00000028 diff --git a/include/stdarg.h b/include/stdarg.h new file mode 100644 index 0000000..929d874 --- /dev/null +++ b/include/stdarg.h @@ -0,0 +1,15 @@ +/** + * @file stdarg.h + * @provides va_copy, va_start, va_arg, va_end. + * + * $Id: stdarg.h 2020 2009-08-13 17:50:08Z mschul $ + */ +/* Embedded Xinu, Copyright (C) 2009. All rights reserved. */ + +/* GCC-specific varargs */ +typedef __builtin_va_list va_list; + +#define va_copy(dst, src) __builtin_va_copy(dst, src) +#define va_start(last, va) __builtin_va_start(last, va) +#define va_arg(va, type) __builtin_va_arg(va, type) +#define va_end(va) __builtin_va_end(va) diff --git a/include/stddef.h b/include/stddef.h new file mode 100644 index 0000000..38bd9d8 --- /dev/null +++ b/include/stddef.h @@ -0,0 +1,7 @@ +/* stddef.h */ + +/* TEMPORARY */ + +/* Function declaration return types */ +typedef void exchandler; /**< exception procedure */ +typedef int message; /**< message passing content */ diff --git a/include/stdio.h b/include/stdio.h new file mode 100644 index 0000000..5f81903 --- /dev/null +++ b/include/stdio.h @@ -0,0 +1,34 @@ +/* stdio.h - definintions and constants for standard I/O functions */ + + +/* Prototypes for formatted input functions */ + +extern int32 _doscan(char *,int32 *, int32 (*)(void), + int32 (*)(char), int32, int32); +extern int32 sscanf(char *, char *, int32); +extern int32 fscanf(int32, char *, int32); +#define scanf(fmt, args) fscanf(CONSOLE, fmt, args) + + +/* Definintion of standard input/ouput/error used with shell commands */ + +#define stdin ((proctab[currpid]).prdesc[0]) +#define stdout ((proctab[currpid]).prdesc[1]) +#define stderr ((proctab[currpid]).prdesc[2]) + + +/* Prototypes for formatted output functions */ + +extern int32 fprintf(int, char *, ...); +extern int32 printf(const char *, ...); +extern int32 sprintf(char *, char *, ...); + + +/* Prototypes for character input and output functions */ + +extern int32 fgetc(int); +extern char *fgets(char *, int32, int32); +extern int32 fputc(int32, int32); +extern int32 fputs(char *, int32); +extern int32 putchar(int32 c); +extern int32 getchar(void); diff --git a/include/stdlib.h b/include/stdlib.h new file mode 100644 index 0000000..7365ca7 --- /dev/null +++ b/include/stdlib.h @@ -0,0 +1,19 @@ +/** + * @file stdlib.h + * + * $Id: stdlib.h 2051 2009-08-27 20:55:09Z akoehler $ + */ +/* Embedded Xinu, Copyright (C) 2009. All rights reserved. */ + +#define RAND_MAX 2147483646 + +int abs(int); +long labs(long); +int atoi(char *); +long atol(char *); +void bzero(void *, int); +void qsort(char *, unsigned int, int, int (*)(void)); +int rand(void); +void srand(unsigned int); +void *malloc(unsigned int nbytes); +void free(void *pmem); diff --git a/include/string.h b/include/string.h new file mode 100644 index 0000000..43ba7ec --- /dev/null +++ b/include/string.h @@ -0,0 +1,10 @@ +/* string.h */ + +extern char *strncpy(char *, const char *, int32); +extern char *strncat(char *, const char *, int32); +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 int strlen(char *str); diff --git a/include/syscall.h b/include/syscall.h new file mode 100644 index 0000000..8b818d3 --- /dev/null +++ b/include/syscall.h @@ -0,0 +1,60 @@ +/* Xinu system calls */ + +enum { + XINU_NULLPROCESS = 0, + XINU_UPTIME, + XINU_PUTC, + XINU_CLOSE, /* Devices */ + XINU_CONTROL, + XINU_GETC, + XINU_INIT, + XINU_OPEN, + XINU_READ, + XINU_SEEK, + XINU_WRITE, + + XINU_CREATE, /* Processes */ + XINU_CHPRIO, + XINU_KILL, /* Exit */ + XINU_GETPRIO, + XINU_READY, + XINU_RECEIVE, + XINU_RECVCLR, + XINU_RECVTIME, + XINU_RESCHED_CNTL, + XINU_RESUME, + XINU_SEND, + XINU_SIGNAL, + XINU_SIGNALN, + XINU_SLEEP, + XINU_SLEEPMS, + XINU_SUSPEND, + XINU_UNSLEEP, + XINU_WAKE, + XINU_WAKEUP, + XINU_YIELD, + + XINU_MKBUFPOOL, /* Buffers */ + XINU_FREEBUF, + XINU_FREEMEM, + XINU_GETBUF, + + XINU_KPRINTF, /* Kernel */ + XINU_KPUTC, + XINU_GETDEV, + XINU_GETMEM, + XINU_GETSTK, + + XINU_PTCOUNT, /* Ports */ + XINU_PTCREATE, + XINU_PTDELETE, + XINU_PTINIT, + XINU_PTRCV, + XINU_PTRESET, + + XINU_SEMCOUNT, /* Semaphores */ + XINU_SEMCREATE, + XINU_SEMRESET, + XINU_SEMDELET, + +}; diff --git a/include/testsuite.h b/include/testsuite.h new file mode 100644 index 0000000..3ce0539 --- /dev/null +++ b/include/testsuite.h @@ -0,0 +1,38 @@ +/* testsuite.h - failif */ + +process test_addargs(bool8); +process test_bigargs(bool8); +process test_schedule(bool8 verbose); +process test_preempt(bool8 verbose); +process test_recursion(bool8 verbose); +process test_semaphore(bool8 verbose); +process test_semaphore2(bool8 verbose); +process test_semaphore3(bool8 verbose); +process test_semaphore4(bool8 verbose); +process test_semaphore5(bool8 verbose); +process test_libStdio(bool8 verbose); + +void testPass(bool8, const char *); +void testFail(bool8, const char *); +void testSkip(bool8, const char *); +void testPrint(bool8, const char *); + +/*------------------------------------------------------------------------ + * failif - report failure by displaying a message is condition is met + *------------------------------------------------------------------------ + */ +#define failif(cond, failmsg) \ + if ( cond ) { testFail(verbose, failmsg); passed = FALSE; } \ + else { testPass(verbose, ""); } + +/* Define the strcuture of an entry in the table of test cases */ + +struct testcase { + char *name; /* Name of test case */ + process (*test) (bool8);/* Test case function */ +}; + +extern int ntests; /* total number of tests */ +extern struct testcase testtab[]; /* table of test cases */ + +#define TESTSTK 8192 /* size of process stack used for test */ diff --git a/include/tftp.h b/include/tftp.h new file mode 100644 index 0000000..184d50a --- /dev/null +++ b/include/tftp.h @@ -0,0 +1,67 @@ +/* tftp.h - definitions for trivial file transfer protocol */ + +/* TFTP Packet Op codes */ +#define TFTP_RRQ 1 /* Read Request */ +#define TFTP_WRQ 2 /* Write Request */ +#define TFTP_DATA 3 /* Data Packet */ +#define TFTP_ACK 4 /* Acknowledgement */ +#define TFTP_ERROR 5 /* Error */ + +/* TFTP Error Codes */ +#define TFTP_ERROR_NOT_DEFINED 0 /* Not defined, see error message (if any). */ +#define TFTP_ERROR_FILE_NOT_FOUND 1 /* File not found. */ +#define TFTP_ERROR_ACCESS_VIOLATION 2 /* Access violation. */ +#define TFTP_ERROR_DISK_FULL 3 /* Disk full or allocation exceeded. */ +#define TFTP_ERROR_ILLEGAL_OP 4 /* Illegal TFTP operation. */ +#define TFTP_ERROR_UNKNOWN_TRANSFER_ID 5 /* Unknown transfer ID. */ +#define TFTP_ERROR_FILE_EXISTS 6 /* File already exists. */ +#define TFTP_ERROR_NO_SUCH_USER 7 /* No such user. */ + +#define TFTP_PORT 69 /* UDP Port for TFTP */ +#define TFTP_MAXNAM 64 /* Max length of a file name */ +#define TFTP_MAXDATA 512 /* Max size of a data packet */ +#define TFTP_MAXRETRIES 3 /* Number of retranmissions */ +#define TFTP_WAIT 5000 /* Time to wait for reply (ms) */ + +/* Xinu Specific Flags */ +#define TFTP_NON_VERBOSE 0 /* Do not use verbose output */ +#define TFTP_VERBOSE 1 /* Use verbose output */ + +/* Format of a TFTP message (items following opcode depend on msg type) */ + +#pragma pack(1) +struct tftp_msg { + uint16 tf_opcode; /* One of the opcodes above */ + union { + + /* Items in a RRQ or WRQ message */ + + struct { + char tf_filemode[TFTP_MAXNAM+10]; /* file name and mode */ + }; + + /* Items in a Data packet */ + + struct { + uint16 tf_dblk; /* Block number of this data */ + char tf_data[TFTP_MAXDATA]; /* Actual data */ + }; + + /* Items in an ACK packet */ + + struct { + uint16 tf_ablk; /* Block number being acked */ + }; + + /* Items in an Error packet */ + + struct { + uint16 tf_ercode; /* Integer error code */ + char tf_ermsg[TFTP_MAXDATA]; /* Error message */ + }; + }; +}; +#pragma pack() + +status tftpget(uint32 serverip, const char* filename, char* rcv_buf, uint32 rcv_buf_size, byte verbose); +status tftpget_mb(uint32 serverip, const char* filename, char** rcv_bufs, uint32* rcv_buf_sizes, uint32 rcv_buf_count, byte verbose); \ No newline at end of file diff --git a/include/timer.h b/include/timer.h new file mode 100644 index 0000000..f8f1d51 --- /dev/null +++ b/include/timer.h @@ -0,0 +1,37 @@ +/* STM32 Timer +General purpose timer */ + +extern uint32 clktime; /* current time in secs since boot */ +extern uint32 count1000; /* ms since last clock tick */ + +extern qid16 sleepq; /* queue for sleeping processes */ +extern int32 slnonempty; /* nonzero if sleepq is nonempty */ +extern int32 *sltop; /* ptr to key in first item on sleepq */ +extern uint32 preempt; /* preemption counter */ + +#define TIM2_BASE 0x40000000 +#define TIM2_IRQ 44 + +#define TIM_CEN 0 +#define TIM_UDIS 1 +#define TIM_URS 2 + +#define TIM_UDE 8 +#define TIM_UIE 7 /* */ + +#define TIM_UIF 0 /* Update interrupt flag*/ + +struct timer_csreg { + volatile uint32 cr1; + volatile uint32 cr2; + volatile uint32 smcr; + volatile uint32 dier; + volatile uint32 sr; + volatile uint32 egr; + volatile uint32 ccmr1; + volatile uint32 ccmr2; + volatile uint32 ccer; + volatile uint32 cnt; + volatile uint32 psc; + volatile uint32 arr; +}; diff --git a/include/tty.h b/include/tty.h new file mode 100644 index 0000000..f64e739 --- /dev/null +++ b/include/tty.h @@ -0,0 +1,84 @@ +/* tty.h */ + +#define TY_OBMINSP 1 /* Min space in buffer before */ + /* processes awakened to write*/ +#define TY_EBUFLEN 1 /* Size of echo queue */ + +/* Size constants */ + +#ifndef Ntty +#define Ntty 1 /* Number of serial tty lines */ +#endif +#ifndef TY_IBUFLEN +#define TY_IBUFLEN 5 /* Num. chars in input queue */ +#endif +#ifndef TY_OBUFLEN +#define TY_OBUFLEN 5 /* Num. chars in output queue */ +#endif + +/* Mode constants for input and output modes */ + +#define TY_IMRAW 'R' /* Raw input mode => no edits */ +#define TY_IMCOOKED 'C' /* Cooked mode => line editing */ +#define TY_IMCBREAK 'K' /* Honor echo, etc, no line edit*/ +#define TY_OMRAW 'R' /* Raw output mode => no edits */ + +struct ttycblk { /* Tty line control block */ + char *tyihead; /* Next input char to read */ + char *tyitail; /* Next slot for arriving char */ + char tyibuff[TY_IBUFLEN]; /* Input buffer (holds one line)*/ + sid32 tyisem; /* Input semaphore */ + char *tyohead; /* Next output char to xmit */ + char *tyotail; /* Next slot for outgoing char */ + char tyobuff[TY_OBUFLEN]; /* Output buffer */ + sid32 tyosem; /* Output semaphore */ + char *tyehead; /* Next echo char to xmit */ + char *tyetail; /* Next slot to deposit echo ch */ + char tyebuff[TY_EBUFLEN]; /* Echo buffer */ + char tyimode; /* Input mode raw/cbreak/cooked */ + bool8 tyiecho; /* Is input echoed? */ + bool8 tyieback; /* Do erasing backspace on echo?*/ + bool8 tyevis; /* Echo control chars as ^X ? */ + bool8 tyecrlf; /* Echo CR-LF for newline? */ + bool8 tyicrlf; /* Map '\r' to '\n' on input? */ + bool8 tyierase; /* Honor erase character? */ + char tyierasec; /* Primary erase character */ + char tyierasec2; /* Alternate erase character */ + bool8 tyeof; /* Honor EOF character? */ + char tyeofch; /* EOF character (usually ^D) */ + bool8 tyikill; /* Honor line kill character? */ + char tyikillc; /* Line kill character */ + int32 tyicursor; /* Current cursor position */ + bool8 tyoflow; /* Honor ostop/ostart? */ + bool8 tyoheld; /* Output currently being held? */ + char tyostop; /* Character that stops output */ + char tyostart; /* Character that starts output */ + bool8 tyocrlf; /* Output CR/LF for LF ? */ + char tyifullc; /* Char to send when input full */ +}; +// extern struct ttycblk ttytab[]; + +/* Characters with meaning to the tty driver */ + +#define TY_BACKSP '\b' /* Backspace character */ +#define TY_BACKSP2 '\177' /* Alternate backspace char. */ +#define TY_BELL '\07' /* Character for audible beep */ +#define TY_EOFCH '\04' /* Control-D is EOF on input */ +#define TY_BLANK ' ' /* Blank */ +#define TY_NEWLINE '\n' /* Newline == line feed */ +#define TY_RETURN '\r' /* Carriage return character */ +#define TY_STOPCH '\023' /* Control-S stops output */ +#define TY_STRTCH '\021' /* Control-Q restarts output */ +#define TY_KILLCH '\025' /* Control-U is line kill */ +#define TY_UPARROW '^' /* Used for control chars (^X) */ +#define TY_FULLCH TY_BELL /* Char to echo when buffer full*/ + +/* Tty control function codes */ + +#define TC_NEXTC 3 /* Look ahead 1 character */ +#define TC_MODER 4 /* Set input mode to raw */ +#define TC_MODEC 5 /* Set input mode to cooked */ +#define TC_MODEK 6 /* Set input mode to cbreak */ +#define TC_ICHARS 8 /* Return number of input chars */ +#define TC_ECHO 9 /* Turn on echo */ +#define TC_NOECHO 10 /* Turn off echo */ diff --git a/include/uart.h b/include/uart.h new file mode 100644 index 0000000..eb845e6 --- /dev/null +++ b/include/uart.h @@ -0,0 +1,45 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* Control register */ +#define UART_EN 13 +#define UART_INTR_RX 5 +#define UART_INTR_TCIE 6 +#define UART_INTR_TX 7 +#define UART_TX_EN 3 +#define UART_RX_EN 2 + +#define PARITY 12 + +/* Status register */ +#define UART_RXNE 0x20 +#define UART_TC 0x40 +#define UART_TC_TXE 0xC0 + +#define UART_TEST 6 + +#define UART_FIFO_SIZE 1 +#define UARTBUF 256 +#define ECHO 1 + +struct uart_csreg { + volatile uint32 sr; + volatile uint32 dr; + volatile uint32 brr; + volatile uint32 cr1; + volatile uint32 cr2; + volatile uint32 cr3; + volatile uint32 gtr; +}; + diff --git a/include/udp.h b/include/udp.h new file mode 100644 index 0000000..62302a1 --- /dev/null +++ b/include/udp.h @@ -0,0 +1,33 @@ +/* udp.h - Declarations pertaining to User Datagram Protocol (UDP) */ + +#define UDP_SLOTS 6 /* Number of open UDP endpoints */ +#define UDP_QSIZ 8 /* Packets enqueued per endpoint*/ + +#define UDP_DHCP_CPORT 68 /* Port number for DHCP client */ +#define UDP_DHCP_SPORT 67 /* Port number for DHCP server */ + +/* Constants for the state of an entry */ + +#define UDP_FREE 0 /* Entry is unused */ +#define UDP_USED 1 /* Entry is being used */ +#define UDP_RECV 2 /* Entry has a process waiting */ + +#define UDP_ANYIF -2 /* Register an endpoint for any */ + /* interface on the machine */ + +#define UDP_HDR_LEN 8 /* Bytes in a UDP header */ + +struct udpentry { /* Entry in the UDP endpoint tbl*/ + int32 udstate; /* State of entry: free/used */ + uint32 udremip; /* Remote IP address (zero */ + /* means "don't care") */ + uint16 udremport; /* Remote protocol port number */ + uint16 udlocport; /* Local protocol port number */ + int32 udhead; /* Index of next packet to read */ + int32 udtail; /* Index of next slot to insert */ + int32 udcount; /* Count of packets enqueued */ + pid32 udpid; /* ID of waiting process */ + struct netpacket *udqueue[UDP_QSIZ];/* Circular packet queue */ +}; + +extern struct udpentry udptab[]; diff --git a/include/userland.h b/include/userland.h new file mode 100644 index 0000000..eb300e9 --- /dev/null +++ b/include/userland.h @@ -0,0 +1,6 @@ +#include +#include +#include +#include +#include +#include diff --git a/include/xinu.h b/include/xinu.h new file mode 100644 index 0000000..d3cde23 --- /dev/null +++ b/include/xinu.h @@ -0,0 +1,51 @@ +/* xinu.h - include all system header files */ + +// RAFA +extern void notmain(void); +typedef unsigned int size_t; +void blink_avr(); +#include + +// FIN DE RAFA + + +#include +#include /* Cortex M3 Processor */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* STM32 Clock system */ +#include /* STM32 Timer peripheral */ +#include /* STM32 UART peripheral */ +#include +#include /* STM32 GPIO peripherals */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/lib/ctype_.c b/lib/ctype_.c new file mode 100644 index 0000000..943dd94 --- /dev/null +++ b/lib/ctype_.c @@ -0,0 +1,32 @@ +/* ctype_.c - _ctype_ */ + +#include + +/*------------------------------------------------------------------------ + * _ctype_ - Provides _ctype_. + *------------------------------------------------------------------------ + */ +#include +typedef unsigned int size_t; +#include +const char _ctype_[] PROGMEM = { + 0, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _S, _S, _S, _S, _S, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _S, _P, _P, _P, _P, _P, _P, _P, + _P, _P, _P, _P, _P, _P, _P, _P, + _N, _N, _N, _N, _N, _N, _N, _N, + _N, _N, _P, _P, _P, _P, _P, _P, + _P, _U | _X, _U | _X, _U | _X, _U | _X, _U | _X, _U | _X, + _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _P, _P, _P, _P, _P, + _P, _L | _X, _L | _X, _L | _X, _L | _X, _L | _X, _L | _X, + _L, + _L, _L, _L, _L, _L, _L, _L, _L, + _L, _L, _L, _L, _L, _L, _L, _L, + _L, _L, _L, _P, _P, _P, _P, _C +}; diff --git a/lib/doprnt.c b/lib/doprnt.c new file mode 100644 index 0000000..5ef71cc --- /dev/null +++ b/lib/doprnt.c @@ -0,0 +1,432 @@ +/* dprnt.c - _doprnt, _prtl2, _prtl8, _prtl10, _prtX16, _prtl16 */ + +#include + +#define MAXSTR 80 +#define NULL 0 +#define PRECISION 6 + + void _prtl10(long num, char *str); + void _prtl8(long num, char *str); + void _prtX16(long num, char *str); + void _prtl16(long num, char *str); + void _prtl2(long num, char *str); +// void _prtdbl(double num, int precision, char *str); + +/*------------------------------------------------------------------------ + * _doprnt - Format and write output using 'func' to write characters. + * (Patched for Sun3 by Shawn Ostermann.) + * All arguments passed as 4 bytes, long==int. + *------------------------------------------------------------------------ + */ +void _doprnt( + char *fmt, + va_list ap, + int (*func)(int) + ) +{ + int c; + int i; + int f; /* The format character (comes after %) */ + char *str; /* Running pointer in string */ + char string[20]; /* The string str points to this output */ + + /* from number conversion */ + int length; /* Length of string "str" */ + char fill; /* Fill character (' ' or '0') */ + int leftjust; /* 0 = right-justified, else left-just */ + int fmax, fmin; /* Field specifications % MIN . MAX s */ + int leading; /* No. of leading/trailing fill chars */ + char sign; /* Set to '-' for negative decimals */ + char digit1; /* Offset to add to first numeric digit */ + long larg; + double darg; + + for (;;) + { + /* Echo characters until '%' or end of fmt string */ + while ((c = *fmt++) != '%') + { + if (c == '\0') + { + return; + } + (*func) (c); + } + /* Echo "...%%..." as '%' */ + if (*fmt == '%') + { + (*func) (*fmt++); + continue; + } + /* Check for "%-..." == Left-justified output */ + if ((leftjust = ((*fmt == '-')) ? 1 : 0)) + { + fmt++; + } + /* Allow for zero-filled numeric outputs ("%0...") */ + fill = (*fmt == '0') ? *fmt++ : ' '; + /* Allow for minimum field width specifier for %d,u,x,o,c,s */ + /* Also allow %* for variable width (%0* as well) */ + fmin = 0; + if (*fmt == '*') + { + fmin = va_arg(ap, int); + + ++fmt; + } + else + { + while ('0' <= *fmt && *fmt <= '9') + { + fmin = fmin * 10 + *fmt++ - '0'; + } + } + /* Allow for maximum string width for %s */ + fmax = 0; + if (*fmt == '.') + { + if (*(++fmt) == '*') + { + fmax = va_arg(ap, int); + ++fmt; + } + else + { + while ('0' <= *fmt && *fmt <= '9') + { + fmax = fmax * 10 + *fmt++ - '0'; + } + } + } + + str = string; + if ((f = *fmt++) == '\0') + { + (*func) ('%'); + return; + } + sign = '\0'; /* sign == '-' for negative decimal */ + + switch (f) + { + case 'c': + string[0] = va_arg(ap, int); + string[1] = '\0'; + fmax = 0; + fill = ' '; + break; + + case 's': + str = va_arg(ap, char *); + + if (NULL == str) + { + str = "(null)"; + } + fill = ' '; + break; + + case 'd': + larg = va_arg(ap, long); + + if (larg < 0) + { + sign = '-'; + } + _prtl10(larg, str); + break; + + case 'f': + // darg = va_arg(ap, double); + + // if (darg < 0) + // { + // sign = '-'; + // } + // _prtdbl(darg, PRECISION, str); + break; + + case 'u': + digit1 = '\0'; + /* "negative" longs in unsigned format */ + /* can't be computed with long division */ + /* convert *args to "positive", digit1 */ + /* = how much to add back afterwards */ + larg = va_arg(ap, long); + + while (larg < 0) + { + larg -= 1000000000L; + ++digit1; + } + _prtl10(larg, str); + str[0] += digit1; + fmax = 0; + break; + + case 'o': + larg = va_arg(ap, long); + + _prtl8(larg, str); + fmax = 0; + break; + + case 'X': + larg = va_arg(ap, long); + + _prtX16(larg, str); + fmax = 0; + break; + + case 'x': + larg = va_arg(ap, long); + + _prtl16(larg, str); + fmax = 0; + break; + + case 'H': + larg = va_arg(ap, long); + + _prtX16(larg, str); + + larg = va_arg(ap, long); + + _prtX16(larg, str + 8); + + fmax = 0; + break; + + case 'h': + larg = va_arg(ap, long); + + _prtl16(larg, str); + + larg = va_arg(ap, long); + + _prtl16(larg, str + 8); + + fmax = 0; + break; + + case 'b': + larg = va_arg(ap, long); + + _prtl2(larg, str); + fmax = 0; + break; + + default: + (*func) (f); + break; + } + for (length = 0; str[length] != '\0'; length++) + {; + } + if (fmin > MAXSTR || fmin < 0) + { + fmin = 0; + } + if (fmax > MAXSTR || fmax < 0) + { + fmax = 0; + } + leading = 0; + if (fmax != 0 || fmin != 0) + { + if (fmax != 0) + { + if (length > fmax) + { + length = fmax; + } + } + if (fmin != 0) + { + leading = fmin - length; + } + if (sign == '-') + { + --leading; + } + } + if (sign == '-' && fill == '0') + { + (*func) (sign); + } + if (leftjust == 0) + { + for (i = 0; i < leading; i++) + { + (*func) (fill); + } + } + if (sign == '-' && fill == ' ') + { + (*func) (sign); + } + for (i = 0; i < length; i++) + { + (*func) (str[i]); + } + if (leftjust != 0) + { + for (i = 0; i < leading; i++) + (*func) (fill); + } + } + +} + +/*------------------------------------------------------------------------ + * _prtl10 - Converts long to base 10 string. + *------------------------------------------------------------------------ + */ + void _prtl10( + long num, + char *str + ) +{ + int i; + char temp[11]; + + temp[0] = '\0'; + temp[1] = ((num<0) ? -(num%10) : (num%10)) + '0'; + num /= (num<0) ? -10 : 10; + for (i = 2; i <= 10; i++) { + temp[i] = num % 10 + '0'; + num /= 10; + } + for (i = 10; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} + +/*------------------------------------------------------------------------ + * _prtl8 - Converts long to base 8 string. + *------------------------------------------------------------------------ + */ + void _prtl8( + long num, + char *str + ) +{ + int i; + char temp[12]; + + temp[0] = '\0'; + for (i = 1; i <= 11; i++) + { + temp[i] = (num & 07) + '0'; + num = num >> 3; + } + temp[11] &= '3'; + for (i = 11; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} + +/*------------------------------------------------------------------------ + * _prtl16 - Converts long to lowercase hex string. + *------------------------------------------------------------------------ + */ + void _prtl16( + long num, + char *str + ) +{ + int i; + char temp[9]; + + temp[0] = '\0'; + for (i = 1; i <= 8; i++) + { + temp[i] = "0123456789abcdef"[num & 0x0F]; + num = num >> 4; + } + for (i = 8; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} + +/*------------------------------------------------------------------------ + * _prtX16 - Converts long to uppercase hex string. + *------------------------------------------------------------------------ + */ + void _prtX16( + long num, + char *str + ) +{ + int i; + char temp[9]; + + temp[0] = '\0'; + for (i = 1; i <= 8; i++) + { + temp[i] = "0123456789ABCDEF"[num & 0x0F]; + num = num >> 4; + } + for (i = 8; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} + +/*------------------------------------------------------------------------ + * _prtl2 - Converts long to binary string. + *------------------------------------------------------------------------ + */ + void _prtl2( + long num, + char *str + ) +{ + int i; + char temp[35]; + + temp[0] = '\0'; + for (i = 1; i <= 32; i++) + { + temp[i] = ((num % 2) == 0) ? '0' : '1'; + num = num >> 1; + } + for (i = 32; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} + +/*------------------------------------------------------------------------ + * _prtdbl - Converts double to binary string. + *------------------------------------------------------------------------ + */ +// void _prtdbl( +// double num, +// int precision, +// char *str +// ) +//{ +// int i,mp; +// long w,p; +// +// for(i = 0, mp = 1; i < precision; i++, mp *= 10); +// +// num = ((num<0) ? -(num) : (num)); +// w = (long)(num); +// p = (long)(num * mp) - (long)(w * mp); +// +// _prtl10(w, str); +// while(*str != '\0') { str++; } +// *str++ = '.'; +// _prtl10(p, str); +//} diff --git a/lib/doscan.c b/lib/doscan.c new file mode 100644 index 0000000..920e6e4 --- /dev/null +++ b/lib/doscan.c @@ -0,0 +1,406 @@ +/* doscan.c - _doscan, _innum, _instr, _getccl */ + +/* Character look-ahead to be implemented as: ch=control(unit,TTY_IOC_NEXTC) */ + +#include + +#define EOF (-2) +#define NULL 0 + +#define SPC 01 +#define STP 02 + +#define SHORT 0 +#define REGULAR 1 +#define LONG 2 + +static int _innum(int **, int, int, int, int (*getc) (int, int), + int (*ungetc) (int, int), int, int, int *); +static int _instr(register char *, int, int, int (*getc) (int, int), + int (*ungetc) (int, int), int, int, int *); +static char *_getccl(char *); + +char _sctab[128] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, SPC, SPC, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + SPC, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +/*------------------------------------------------------------------------ + * _doscan - Scan and recognize input according to a format. + *------------------------------------------------------------------------ + */ +int _doscan( + register char *fmt, /* format str for scanf */ + register int **argp, /* arguments to scanf */ + int (*getch)(int, int), /* function to get char */ + int (*ungetch)(int, int),/* function to unget char */ + int arg1, /* arg to getch/ungetch */ + int arg2 /* 2nd arg to getch/unge*/ + ) +{ + register int ch; + int nmatch, len, ch1; + int **ptr, fileended, size; + + nmatch = 0; + fileended = 0; + for (;;) + { + switch (ch = *fmt++) + { + case '\0': + return (nmatch); + case '%': + if ((ch = *fmt++) == '%') + { + goto def; + } + ptr = 0; + if (ch != '*') + { + ptr = argp++; + } + else + { + ch = *fmt++; + } + len = 0; + size = REGULAR; + while (isdigit(ch)) + { + len = len * 10 + ch - '0'; + ch = *fmt++; + } + if (len == 0) + { + len = 30000; + } + if (ch == 'l') + { + ch = *fmt++; + size = LONG; + } + else if (ch == 'h') + { + size = SHORT; + ch = *fmt++; + } + else if (ch == '[') + { + fmt = _getccl(fmt); + } + if (isupper(ch)) + { + ch = tolower(ch); + size = LONG; + } + if (ch == '\0') + { + return (-1); + } + if (_innum + (ptr, ch, len, size, + getch, ungetch, arg1, arg2, &fileended) && ptr) + { + nmatch++; + } + if (fileended) + { + return (nmatch ? nmatch : -1); + } + break; + + case ' ': + case '\n': + case '\t': + while ((ch1 = + (*getch) (arg1, + arg2)) == ' ' || ch1 == '\t' || ch1 == '\n') + {; + } + if (ch1 != EOF) + { + (*ungetch) (arg1, arg2); + } + break; + + default: + def: + ch1 = (*getch) (arg1, arg2); + if (ch1 != ch) + { + if (ch1 == EOF) + { + return (-1); + } + (*ungetch) (arg1, arg2); + return nmatch; + } + } + } +} + +/*------------------------------------------------------------------------ + * _innum - DOCUMENT + *------------------------------------------------------------------------ + */ +static int _innum( + int **ptr, + int type, + int len, + int size, + int (*getch)(int, int), + int (*ungetch)(int, int), + int arg1, + int arg2, + int *eofptr + ) +{ + extern double atof(char *p); + register char *np; + char numbuf[64]; + register char c, base; + int negflg, c1, ndigit; + long lcval; + + if (type == 'c' || type == 's' || type == '[') + { + return (_instr + (ptr ? *(char **)ptr : (char *)NULL, type, len, getch, + ungetch, arg1, arg2, eofptr)); + } + lcval = 0; + ndigit = 0; + base = 10; + if (type == 'o') + { + base = 8; + } + else if (type == 'x') + { + base = 16; + } + np = numbuf; + negflg = 0; + while ((c = (*getch) (arg1, arg2)) == ' ' || c == '\t' || c == '\n') + {; + } + if (c == '-') + { + negflg++; + *np++ = c; + c = (*getch) (arg1, arg2); + len--; + } + else if (c == '+') + { + len--; + c = (*getch) (arg1, arg2); + } + + for (; --len >= 0; *np++ = c, c = (*getch) (arg1, arg2)) + { + if (((isdigit(c)) || base == 16) + && (('a' <= c && c <= 'f') || ('A' <= c && c <= 'F'))) + { + ndigit++; + if (base == 8) + { + lcval <<= 3; + } + else if (base == 10) + { + lcval = ((lcval << 2) + lcval) << 1; + } + else + { + lcval <<= 4; + } + c1 = c; + if ('0' <= c && c <= '9') + { + c -= '0'; + } + else if ('a' <= c && c <= 'f') + { + c -= 'a' - 10; + } + else + { + c -= 'A' - 10; + } + lcval += c; + c = c1; + continue; + } + else + { + break; + } + } + if (negflg) + { + lcval = -lcval; + } + if (c != EOF) + { + (*ungetch) (arg1, arg2); + *eofptr = 0; + } + else + { + *eofptr = 1; + } + if (ptr == NULL || np == numbuf) + { + return 0; + } + *np++ = 0; + switch (size) + { + case SHORT: + **(short **)ptr = lcval; + break; + + case REGULAR: + **(int **)ptr = lcval; + break; + + case LONG: + **(long **)ptr = lcval; + break; + } + return 1; +} + +/*------------------------------------------------------------------------ + * _instr - DOCUMENT + *------------------------------------------------------------------------ + */ +static int _instr( + register char *ptr, + int type, + int len, + int (*getch)(int, int), + int (*ungetch)(int, int), + int arg1, + int arg2, + int *eofptr + ) +{ + register unsigned int ch; + register char *optr; + int ignstp; + + *eofptr = 0; + optr = ptr; + if (type == 'c' && len == 30000) + { + len = 1; + } + ignstp = 0; + if (type == 's') + { + ignstp = SPC; + } + while (_sctab[ch = (*getch) (arg1, arg2)] & ignstp) + { + if (ch == EOF) + { + break; + } + } + ignstp = SPC; + if (type == 'c') + { + ignstp = 0; + } + else if (type == '[') + { + ignstp = STP; + } + while (ch != EOF && (_sctab[ch] & ignstp) == 0) + { + if (ptr) + { + *ptr++ = ch; + } + if (--len <= 0) + { + break; + } + ch = (*getch) (arg1, arg2); + } + if (ch != EOF) + { + if (len > 0) + { + (*ungetch) (arg1, arg2); + } + *eofptr = 0; + } + else + { + *eofptr = 1; + } + if (ptr && ptr != optr) + { + if (type != 'c') + { + *ptr++ = '\0'; + } + return 1; + } + return 0; +} + +/*------------------------------------------------------------------------ + * _getccl - DOCUMENT + *------------------------------------------------------------------------ + */ +static char *_getccl( + char *s + ) +{ + int c, t; + + t = 0; + if (*s == '^') + { + t++; + s++; + } + for (c = 0; c < 128; c++) + { + if (t) + { + _sctab[c] &= ~STP; + } + else + { + _sctab[c] |= STP; + } + } + while (((c = *s++) & 0177) != ']') + { + if (t) + { + _sctab[c++] |= STP; + } + else + { + _sctab[c++] &= ~STP; + } + if (c == 0) + { + return (--s); + } + } + return s; +} diff --git a/lib/messages.c b/lib/messages.c new file mode 100644 index 0000000..aaf0d4f --- /dev/null +++ b/lib/messages.c @@ -0,0 +1,14 @@ + +typedef unsigned int size_t; +#include + + +const char m1[] PROGMEM = "\n\nMain process recreating shell\n\n"; +const char m2[] PROGMEM = "Port system ran out of message nodes"; +const char m3[] PROGMEM = "\n\nAll user processes have completed.\n\n"; +const char m4[] PROGMEM = "namespace: cannot mount device %d\r\n"; +const char m5[] PROGMEM = "namespace: device name %s too long\r\n"; +const char m6[] PROGMEM = "Can't startup system"; + + + diff --git a/lib/original/abs.c b/lib/original/abs.c new file mode 100644 index 0000000..667e667 --- /dev/null +++ b/lib/original/abs.c @@ -0,0 +1,14 @@ +/* abs.c - abs */ + +/*------------------------------------------------------------------------ + * abs - Return the absolute value of an integer. + *------------------------------------------------------------------------ + */ +int abs( + int arg + ) +{ + if (arg < 0) + arg = -arg; + return (arg); +} diff --git a/lib/original/atoi.c b/lib/original/atoi.c new file mode 100644 index 0000000..317c59a --- /dev/null +++ b/lib/original/atoi.c @@ -0,0 +1,34 @@ +/* atoi.c - atoi */ + +/*------------------------------------------------------------------------ + * atoi - Converts an ascii value to an integer. + *------------------------------------------------------------------------ + */ +int atoi( + char *p + ) +{ + int n = 0, f = 0; + + for (;; p++) + { + switch (*p) + { + case ' ': + case '\t': + continue; + case '-': + f++; + case '+': + p++; + } + break; + } + + while (*p >= '0' && *p <= '9') + { + n = n * 10 + *p++ - '0'; + } + + return (f ? -n : n); +} diff --git a/lib/original/atol.c b/lib/original/atol.c new file mode 100644 index 0000000..7fd6d2d --- /dev/null +++ b/lib/original/atol.c @@ -0,0 +1,35 @@ +/* atol.c - atol */ + +/*------------------------------------------------------------------------ + * atol - Converts an ascii value to a long. + *------------------------------------------------------------------------ + */ +long atol( + char *p + ) +{ + long n; + int f; + + n = 0; + f = 0; + for (;; p++) + { + switch (*p) + { + case ' ': + case '\t': + continue; + case '-': + f++; + case '+': + p++; + } + break; + } + while (*p >= '0' && *p <= '9') + { + n = n * 10 + *p++ - '0'; + } + return (f ? -n : n); +} diff --git a/lib/original/bzero.c b/lib/original/bzero.c new file mode 100644 index 0000000..192e270 --- /dev/null +++ b/lib/original/bzero.c @@ -0,0 +1,24 @@ +/* bzero.c - bzero */ + +/*------------------------------------------------------------------------ + * bzero - Clears a block of characters to 0s. + *------------------------------------------------------------------------ + */ +void bzero( + void *p, + int len + ) +{ + int n; + char *pch = (char *)p; + + if ((n = len) <= 0) + { + return; + } + do + { + *pch++ = 0; + } + while (--n); +} diff --git a/lib/original/fdoprnt.c b/lib/original/fdoprnt.c new file mode 100644 index 0000000..ea9497d --- /dev/null +++ b/lib/original/fdoprnt.c @@ -0,0 +1,371 @@ +/* fdoprnt.c - _fdoprnt, _prtl2, _prtl8, _prtl10, _prtX16, _prtl16 */ + +#include + +#define MAXSTR 80 +#define NULL 0 + +static void _prtl10(long num, char *str); +static void _prtl8(long num, char *str); +static void _prtX16(long num, char *str); +static void _prtl16(long num, char *str); +static void _prtl2(long num, char *str); + +/*------------------------------------------------------------------------ + * _fdoprnt - Format and write output using 'func' to write characters. + * (Patched for Sun3 by Shawn Ostermann.) + * All arguments passed as 4 bytes, long==int. + *------------------------------------------------------------------------ + */ +void _fdoprnt( + char *fmt, /* format string */ + va_list ap, /* ap list of values */ + int (*func)(int, int), /* char output function */ + int farg /* arg for char output */ + ) +{ + int c; + int i; + int f; /* The format character (comes after %) */ + char *str; /* Running pointer in string */ + char string[20]; /* The string str points to this output */ + + /* from number conversion */ + int length; /* Length of string "str" */ + char fill; /* Fill character (' ' or '0') */ + int leftjust; /* 0 = right-justified, else left-just */ + int fmax, fmin; /* Field specifications % MIN . MAX s */ + int leading; /* No. of leading/trailing fill chars */ + char sign; /* Set to '-' for negative decimals */ + char digit1; /* Offset to add to first numeric digit */ + long larg; + + for (;;) + { + /* Echo characters until '%' or end of fmt string */ + while ((c = *fmt++) != '%') + { + if (c == '\0') + { + return; + } + (*func) (farg, c); + } + /* Echo "...%%..." as '%' */ + if (*fmt == '%') + { + (*func) (farg, *fmt++); + continue; + } + /* Check for "%-..." == Left-justified output */ + if ((leftjust = ((*fmt == '-')) ? 1 : 0)) + { + fmt++; + } + /* Allow for zero-filled numeric outputs ("%0...") */ + fill = (*fmt == '0') ? *fmt++ : ' '; + /* Allow for minimum field width specifier for %d,u,x,o,c,s */ + /* Also allow %* for variable width (%0* as well) */ + fmin = 0; + if (*fmt == '*') + { + fmin = va_arg(ap, int); + + ++fmt; + } + else + { + while ('0' <= *fmt && *fmt <= '9') + { + fmin = fmin * 10 + *fmt++ - '0'; + } + } + /* Allow for maximum string width for %s */ + fmax = 0; + if (*fmt == '.') + { + if (*(++fmt) == '*') + { + fmax = va_arg(ap, int); + ++fmt; + } + else + { + while ('0' <= *fmt && *fmt <= '9') + { + fmax = fmax * 10 + *fmt++ - '0'; + } + } + } + + str = string; + if ((f = *fmt++) == '\0') + { + (*func) (farg, '%'); + return; + } + sign = '\0'; /* sign == '-' for negative decimal */ + + switch (f) + { + case 'c': + string[0] = va_arg(ap, int); + string[1] = '\0'; + fmax = 0; + fill = ' '; + break; + + case 's': + str = va_arg(ap, char *); + + if (NULL == str) + { + str = "(null)"; + } + fill = ' '; + break; + + case 'd': + larg = va_arg(ap, long); + + if (larg < 0) + { + sign = '-'; + larg = -larg; + } + _prtl10(larg, str); + break; + + case 'u': + digit1 = '\0'; + /* "negative" longs in unsigned format */ + /* can't be computed with long division */ + /* convert *args to "positive", digit1 */ + /* = how much to add back afterwards */ + larg = va_arg(ap, long); + + while (larg < 0) + { + larg -= 1000000000L; + ++digit1; + } + _prtl10(larg, str); + str[0] += digit1; + fmax = 0; + break; + + case 'o': + larg = va_arg(ap, long); + + _prtl8(larg, str); + fmax = 0; + break; + + case 'X': + larg = va_arg(ap, long); + + _prtX16(larg, str); + fmax = 0; + break; + + case 'x': + larg = va_arg(ap, long); + + _prtl16(larg, str); + fmax = 0; + break; + + case 'b': + larg = va_arg(ap, long); + + _prtl2(larg, str); + fmax = 0; + break; + + default: + (*func) (farg, f); + break; + } + for (length = 0; str[length] != '\0'; length++) + {; + } + if (fmin > MAXSTR || fmin < 0) + { + fmin = 0; + } + if (fmax > MAXSTR || fmax < 0) + { + fmax = 0; + } + leading = 0; + if (fmax != 0 || fmin != 0) + { + if (fmax != 0) + { + if (length > fmax) + { + length = fmax; + } + } + if (fmin != 0) + { + leading = fmin - length; + } + if (sign == '-') + { + --leading; + } + } + if (sign == '-' && fill == '0') + { + (*func) (farg, sign); + } + if (leftjust == 0) + { + for (i = 0; i < leading; i++) + { + (*func) (farg, fill); + } + } + if (sign == '-' && fill == ' ') + { + (*func) (farg, sign); + } + for (i = 0; i < length; i++) + { + (*func) (farg, str[i]); + } + if (leftjust != 0) + { + for (i = 0; i < leading; i++) + (*func) (farg, fill); + } + } + +} + +/*------------------------------------------------------------------------ + * _prtl10 - Converts long to base 10 string. + *------------------------------------------------------------------------ + */ +static void _prtl10( + long num, + char *str + ) +{ + int i; + char temp[11]; + + temp[0] = '\0'; + for (i = 1; i <= 10; i++) + { + temp[i] = num % 10 + '0'; + num /= 10; + } + for (i = 10; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} + +/*------------------------------------------------------------------------ + * _prtl8 - Converts long to base 8 string. + *------------------------------------------------------------------------ + */ +static void _prtl8( + long num, + char *str + ) +{ + int i; + char temp[12]; + + temp[0] = '\0'; + for (i = 1; i <= 11; i++) + { + temp[i] = (num & 07) + '0'; + num = num >> 3; + } + temp[11] &= '3'; + for (i = 11; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} + +/*------------------------------------------------------------------------ + * _prtl16 - Converts long to lowercase hex string. + *------------------------------------------------------------------------ + */ +static void _prtl16( + long num, + char *str + ) +{ + int i; + char temp[9]; + + temp[0] = '\0'; + for (i = 1; i <= 8; i++) + { + temp[i] = "0123456789abcdef"[num & 0x0F]; + num = num >> 4; + } + for (i = 8; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} + +/*------------------------------------------------------------------------ + * _prtX16 - Converts long to uppercase hex string. + *------------------------------------------------------------------------ + */ +static void _prtX16( + long num, + char *str + ) +{ + int i; + char temp[9]; + + temp[0] = '\0'; + for (i = 1; i <= 8; i++) + { + temp[i] = "0123456789ABCDEF"[num & 0x0F]; + num = num >> 4; + } + for (i = 8; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} + +/*------------------------------------------------------------------------ + * _prtl2 - Converts long to binary string. + *------------------------------------------------------------------------ + */ +static void _prtl2( + long num, + char *str + ) +{ + int i; + char temp[35]; + + temp[0] = '\0'; + for (i = 1; i <= 32; i++) + { + temp[i] = ((num % 2) == 0) ? '0' : '1'; + num = num >> 1; + } + for (i = 32; temp[i] == '0'; i--); + if (i == 0) + i++; + while (i >= 0) + *str++ = temp[i--]; +} diff --git a/lib/original/fgetc.c b/lib/original/fgetc.c new file mode 100644 index 0000000..337dadd --- /dev/null +++ b/lib/original/fgetc.c @@ -0,0 +1,28 @@ +/* fgetc.c - fgetc */ + +extern int getc(int); + +#ifndef EOF +#define EOF (-2) +#endif + +/*------------------------------------------------------------------------ + * fgetc - Read a character from a device (file). + * Return character read, EOF if error. + *------------------------------------------------------------------------ + */ +int fgetc( + int dev + ) +{ + int result = (int)getc(dev); + + if (0 > result) + { + return EOF; + } + else + { + return result; + } +} diff --git a/lib/original/fgets.c b/lib/original/fgets.c new file mode 100644 index 0000000..6a6526a --- /dev/null +++ b/lib/original/fgets.c @@ -0,0 +1,43 @@ +/* fgets.c - fgets */ + +#ifndef NULL +#define NULL 0 +#endif +extern int getc(int); + +/*------------------------------------------------------------------------ + * fgets - Read a newline-terminated string from device (file). + *------------------------------------------------------------------------ + */ +char *fgets( + char *s, /* buffer for result */ + int n, /* maximum read length */ + int dev /* device to read from */ + ) +{ + int c = 0; + char *cs; + + cs = s; + + /* Read characters until maximum read length, */ + /* end of line, or end of file */ + while ((--n > 0) && ((c = getc(dev)) >= 0)) + { + *cs++ = c; + if (('\n' == c) || ('\r' == c)) + { + break; + } + } + + /* Check for EOF or empty string */ + if ((c < 0) && (cs == s)) + { + return NULL; + } + + /* Terminate string and return */ + *cs++ = '\0'; + return s; +} diff --git a/lib/original/fprintf.c b/lib/original/fprintf.c new file mode 100644 index 0000000..b722940 --- /dev/null +++ b/lib/original/fprintf.c @@ -0,0 +1,28 @@ +/* fprintf.c - _fdoprnt */ + +#include +#include + +extern void _fdoprnt(char *, va_list, int (*)(did32, char), int); + +/*------------------------------------------------------------------------ + * fprintf - Print a formatted message on specified device (file). + * Return 0 if the output was printed successfully, + * and -1 if an error occurred. + *------------------------------------------------------------------------ + */ +int fprintf( + int dev, /* device to write to */ + char *fmt, /* format string */ + ... + ) +{ + va_list ap; + syscall putc(did32, char); + + va_start(ap, fmt); + _fdoprnt(fmt, ap, putc, dev); + va_end(ap); + + return 0; +} diff --git a/lib/original/fputc.c b/lib/original/fputc.c new file mode 100644 index 0000000..fd27c42 --- /dev/null +++ b/lib/original/fputc.c @@ -0,0 +1,30 @@ +/* fputc.c - fputc */ + +extern int putc(int, char); + +#ifndef SYSERR +#define SYSERR (-1) +#endif +#ifndef EOF +#define EOF (-2) +#endif + +/*------------------------------------------------------------------------ + * fputc - Write a character string to a device (file). + * Return character written, EOF if error. + *------------------------------------------------------------------------ + */ +int fputc( + int c, /* char to write */ + int dev /* device to use */ + ) +{ + if (SYSERR == (int)putc(dev, c)) + { + return EOF; + } + else + { + return c; + } +} diff --git a/lib/original/fputs.c b/lib/original/fputs.c new file mode 100644 index 0000000..4385b27 --- /dev/null +++ b/lib/original/fputs.c @@ -0,0 +1,27 @@ +/* fputs.c - fputs */ + + + +// REALLY NEEDED? +//extern int putc(int, char); +extern int putc(int, char); + + +/*------------------------------------------------------------------------ + * fputs - Write a null-terminated string to a device (file). + * Return result of last putc. + *------------------------------------------------------------------------ + */ +int fputs( + char *s, /* string to write */ + int dev /* device to write to */ + ) +{ + int r = 0, c; + + while ((c = (*s++))) + { + r = putc(dev, c); + } + return r; +} diff --git a/lib/original/fscanf.c b/lib/original/fscanf.c new file mode 100644 index 0000000..a64a9d0 --- /dev/null +++ b/lib/original/fscanf.c @@ -0,0 +1,69 @@ +/* fscanf.c - fscanf, getch, ungetch */ + +#ifndef EMPTY +#define EMPTY (-1) +#endif +#ifndef EOF +#define EOF (-2) +#endif + +extern int getc(int); + +static int getch(int, int); +static int ungetch(int, int); +extern int _doscan(register char *, register int **, + int (*getc) (int, int), int (*ungetc) (int, int), int, + int); + +/*------------------------------------------------------------------------ + * fscanf - Read from a device (file) according to a format. + * Return result of _doscan. + *------------------------------------------------------------------------ + */ +int fscanf( + int dev, /* device to use */ + char *fmt, /* format string */ + int args /* num of args in format */ + ) +{ + int buf; + + buf = EMPTY; + return (_doscan + (fmt, (int **)&args, getch, ungetch, dev, (int)(int)&buf)); +} + +/*------------------------------------------------------------------------ + * getch - Get a character from a device with pushback. + *------------------------------------------------------------------------ + */ +static int getch( + int dev, /* device to use */ + int abuf /* buffer to use */ + ) +{ + int *buf = (int *)abuf; + + if (*buf != EOF && *buf != EMPTY) + { + *buf = getc(dev); + } +/* if( *buf != EOF ) */ +/* { *buf = control(dev, TTY_IOC_NEXTC, 0, 0); } */ + return (*buf); +} + +/*------------------------------------------------------------------------ + * ungetch - Pushback a character for getch. + *------------------------------------------------------------------------ + */ +static int ungetch( + int dev, /* device to use */ + int abuf /* buffer to use */ + ) +{ + int *buf = (int *)abuf; + + *buf = EMPTY; + return (*buf); +} diff --git a/lib/original/getchar.c b/lib/original/getchar.c new file mode 100644 index 0000000..2915e08 --- /dev/null +++ b/lib/original/getchar.c @@ -0,0 +1,15 @@ +/* getchar.c - getchar */ + +#include +#include + +/*------------------------------------------------------------------------ + * getchar - DOCUMENT + *------------------------------------------------------------------------ + */ +int getchar( + void + ) +{ + return fgetc(stdin); +} diff --git a/lib/original/labs.c b/lib/original/labs.c new file mode 100644 index 0000000..fdd2ca6 --- /dev/null +++ b/lib/original/labs.c @@ -0,0 +1,14 @@ +/* labs.c - labs */ + +/*------------------------------------------------------------------------ + * labs - Calculates the absolute value of a long. + *------------------------------------------------------------------------ + */ +long labs( + long arg + ) +{ + if (arg < 0) + arg = -arg; + return (arg); +} diff --git a/lib/original/memchr.c b/lib/original/memchr.c new file mode 100644 index 0000000..e69de29 diff --git a/lib/original/memcmp.c b/lib/original/memcmp.c new file mode 100644 index 0000000..d4e19ae --- /dev/null +++ b/lib/original/memcmp.c @@ -0,0 +1,26 @@ +/* memcmp.c - memcmp */ + +/*------------------------------------------------------------------------ + * memcmp - Compare two equal-size blocks of memory. If there are no + * differences, return 0. Otherwise return >0 or <0 + * if the first differing byte is greater or less + *------------------------------------------------------------------------ + */ +int memcmp( + const void *s1, /* first memory location */ + const void *s2, /* second memory location */ + int n /* length to compare */ + ) +{ + const unsigned char *c1; + const unsigned char *c2; + + for (c1 = s1, c2 = s2; n > 0; n--, c1++, c2++) + { + if (*c1 != *c2) + { + return ((int)*c1) - ((int)*c2); + } + } + return 0; +} diff --git a/lib/original/memcpy.c b/lib/original/memcpy.c new file mode 100644 index 0000000..da74590 --- /dev/null +++ b/lib/original/memcpy.c @@ -0,0 +1,23 @@ +/* memcpy.c - memcpy */ + +/*------------------------------------------------------------------------ + * memcpy - Copy a block of memory from src to dst, and return a + * pointer to the destination + *------------------------------------------------------------------------ + */ +void *memcpy( + void *s, /* Destination address */ + const void *ct, /* source address */ + int n /* number of bytes to copy */ + ) +{ + register int i; + char *dst = (char *)s; + char *src = (char *)ct; + + for (i = 0; i < n; i++) + { + *dst++ = *src++; + } + return s; +} diff --git a/lib/original/memset.c b/lib/original/memset.c new file mode 100644 index 0000000..da746cf --- /dev/null +++ b/lib/original/memset.c @@ -0,0 +1,23 @@ +/* memset.c - memset */ + +/*------------------------------------------------------------------------ + * memset - Set a block ot n bytes to the same value and return a + * pointer to the memory + *------------------------------------------------------------------------ + */ +void *memset( + void *s, /* Address of memory block */ + int c, /* Byte value to use */ + int n /* Size of block in bytes */ + ) +{ + register int i; + char *cp = (char *)s; + + for (i = 0; i < n; i++) + { + *cp = (unsigned char)c; + cp++; + } + return s; +} diff --git a/lib/original/printf.c b/lib/original/printf.c new file mode 100644 index 0000000..afdc081 --- /dev/null +++ b/lib/original/printf.c @@ -0,0 +1,28 @@ +/* printf.c - printf*/ + +#include +#include +#include + +extern void _fdoprnt(char *, va_list, int (*)(did32, char), int); +extern int xinu_putc(did32, char); + +/*------------------------------------------------------------------------ + * printf - standard C printf function + *------------------------------------------------------------------------ + */ +int printf( + const char *fmt, + ... + ) +{ + va_list ap; + //syscall putc(did32, char); + int xinu_putc(did32, char); + + va_start(ap, fmt); + _fdoprnt((char *)fmt, ap, putc, stdout); + va_end(ap); + + return 0; +} diff --git a/lib/original/putchar.c b/lib/original/putchar.c new file mode 100644 index 0000000..a1be5c0 --- /dev/null +++ b/lib/original/putchar.c @@ -0,0 +1,15 @@ +/* putchar.c - putchar */ + +#include +#include + +/*------------------------------------------------------------------------ + * putchar - C putchar function + *------------------------------------------------------------------------ + */ +int putchar( + int c + ) +{ + return fputc(c, stdout); +} diff --git a/lib/original/qsort.c b/lib/original/qsort.c new file mode 100644 index 0000000..f097cc5 --- /dev/null +++ b/lib/original/qsort.c @@ -0,0 +1,162 @@ +/* qsort.c - qsort, qs1, qsexc, qstexc */ + +static int (*qscmp) (char *, char *); +static int qses; +static void qs1(char *, char *); +static void qsexc(char *, char *); +static void qstexc(char *, char *, char *); + +/*------------------------------------------------------------------------ + * qsort - Use quicksort to sort an array + *------------------------------------------------------------------------ + */ +void qsort( + char *a, /* Array to sort */ + unsigned n, /* Length of the array */ + int es, /* Pivot value */ + int (*fc)(char *, char *) /* Comparison function */ + ) +{ + qscmp = fc; + qses = es; + qs1(a, a + n * es); +} + +/*------------------------------------------------------------------------ + * qs1 - internal quicksort function + *------------------------------------------------------------------------ + */ +static void qs1( + char *a, + char *l + ) +{ + register char *i, *j; + register int es; + char *lp, *hp; + int c; + unsigned n; + + es = qses; + + start: + if ((n = l - a) <= es) + { + return; + } + n = es * (n / (2 * es)); + hp = lp = a + n; + i = a; + j = l - es; + for (;;) + { + if (i < lp) + { + if ((c = (*qscmp) (i, lp)) == 0) + { + qsexc(i, lp -= es); + continue; + } + if (c < 0) + { + i += es; + continue; + } + } + + loop: + if (j > hp) + { + if ((c = (*qscmp) (hp, j)) == 0) + { + qsexc(hp += es, j); + goto loop; + } + if (c > 0) + { + if (i == lp) + { + qstexc(i, hp += es, j); + i = lp += es; + goto loop; + } + qsexc(i, j); + j -= es; + i += es; + continue; + } + j -= es; + goto loop; + } + + if (i == lp) + { + if (lp - a >= l - hp) + { + qs1(hp + es, l); + l = lp; + } + else + { + qs1(a, lp); + a = hp + es; + } + goto start; + } + + qstexc(j, lp -= es, i); + j = hp -= es; + } +} + +/*------------------------------------------------------------------------ + * qsexc - internal quicksort function + *------------------------------------------------------------------------ + */ +static void qsexc( + char *i, + char *j + ) +{ + register char *ri, *rj, c; + int n; + + n = qses; + ri = i; + rj = j; + do + { + c = *ri; + *ri++ = *rj; + *rj++ = c; + } + while (--n); +} + +/*------------------------------------------------------------------------ + * qstexc - internal quicksort function + *------------------------------------------------------------------------ + */ +static void qstexc( + char *i, + char *j, + char *k + ) +{ + register char *ri, *rj, *rk; + int c; + int n; + + n = qses; + ri = i; + rj = j; + rk = k; + do + { + c = *ri; + *ri++ = *rk; + *rk++ = *rj; + *rj++ = c; + } + while (--n); +} diff --git a/lib/original/rand.c b/lib/original/rand.c new file mode 100644 index 0000000..a237c0b --- /dev/null +++ b/lib/original/rand.c @@ -0,0 +1,38 @@ +/* rand.c - rand, rand_r, srand */ + +#include + +static unsigned int rand_seed = 1; +extern int rand_r(unsigned int*); + +/*------------------------------------------------------------------------ + * rand - Calculates a uniform random number [0, RAND_MAX] + *------------------------------------------------------------------------ + */ +int rand() +{ + return rand_r(&rand_seed); +} + +/*------------------------------------------------------------------------ + * rand_r - Calculates a uniform random number [0, RAND_MAX] + *------------------------------------------------------------------------ + */ +int rand_r( + unsigned int* seedp + ) +{ + *seedp = 16807 * (*seedp) % (RAND_MAX + 1); + return (int)(*seedp); +} + +/*------------------------------------------------------------------------ + * srand - Set the seed for rand + *------------------------------------------------------------------------ + */ +void srand( + unsigned int seed + ) +{ + rand_seed = seed; +} diff --git a/lib/original/sprintf.c b/lib/original/sprintf.c new file mode 100644 index 0000000..7b5abae --- /dev/null +++ b/lib/original/sprintf.c @@ -0,0 +1,43 @@ +/* sprintf.c - sprintf */ + +#include + +static int sprntf(int, int); +extern void _fdoprnt(char *, va_list, int (*func) (int, int), int); + +/*------------------------------------------------------------------------ + * sprintf - Format arguments and place output in a string. + *------------------------------------------------------------------------ + */ +int sprintf( + char *str, /* output string */ + char *fmt, /* format string */ + ... + ) +{ + va_list ap; + char *s; + + s = str; + va_start(ap, fmt); + _fdoprnt(fmt, ap, sprntf, (int)&s); + va_end(ap); + *s++ = '\0'; + + return ((int)str); +} + +/*------------------------------------------------------------------------ + * sprntf - Routine called by _doprnt to handle each character. + *------------------------------------------------------------------------ + */ +static int sprntf( + int acpp, + int ac + ) +{ + char **cpp = (char **)acpp; + char c = (char)ac; + + return (*(*cpp)++ = c); +} diff --git a/lib/original/sscanf.c b/lib/original/sscanf.c new file mode 100644 index 0000000..418baa3 --- /dev/null +++ b/lib/original/sscanf.c @@ -0,0 +1,50 @@ +/* sscanf.c - sscanf, sgetch, sungetch */ + +#define EOF (-2) + +static int sgetch(int, char **); +static int sungetch(int, char **); +extern int _doscan(register char *, register int **, + int (*getc) (int, char **), + int (*ungetc) (int, char **), int, int); + +/*------------------------------------------------------------------------ + * sscanf - Read from a string according to a format. + * Return result of _doscan. + *------------------------------------------------------------------------ + */ +int sscanf( + char *str, /* String to read from */ + char *fmt, /* Format string */ + int args /* Num of args in format string */ + ) +{ + char *s; + + s = str; + return (_doscan(fmt, (int **)&args, sgetch, sungetch, 0, (int)&s)); +} + +/*------------------------------------------------------------------------ + * sgetch - Get the next character from a string + *------------------------------------------------------------------------ + */ +static int sgetch( + int dummy, /* Dummy unused variable */ + char **cpp /* String to use */ + ) +{ + return (*(*cpp) == '\0' ? EOF : *(*cpp)++); +} + +/*------------------------------------------------------------------------ + * sungetch - Pushback a character in a string + *------------------------------------------------------------------------ + */ +static int sungetch( + int dummy, /* Dummy unused variable */ + char **cpp /* String for pushback */ + ) +{ + return (*(*cpp)--); +} diff --git a/lib/original/strchr.c b/lib/original/strchr.c new file mode 100644 index 0000000..98b0e25 --- /dev/null +++ b/lib/original/strchr.c @@ -0,0 +1,27 @@ +/* strchr.c - strchr */ + +/*------------------------------------------------------------------------ + * strchr - Returns a pointer to the location in a string at which a + * character appears or NULL if char not found + *------------------------------------------------------------------------ + */ +char *strchr( + const char *s, /* String to search */ + int c /* Character to locate */ + ) +{ + for (; *s != '\0'; s++) + { + if (*s == (const char)c) + { + return (char *)s; + } + } + + if ((const char)c == *s) + { + return (char *)s; + } + + return 0; +} diff --git a/lib/original/strcmp.c b/lib/original/strcmp.c new file mode 100644 index 0000000..be9cc36 --- /dev/null +++ b/lib/original/strcmp.c @@ -0,0 +1,25 @@ +/* strcmp.c - strcmp */ + +/*------------------------------------------------------------------------ + * strcmp - Compare two strings, returning 0 of they are the same <0 if + * first is lexically less and >0 if first is lexically > + *------------------------------------------------------------------------ + */ +int strcmp( + char *str1, + char *str2 + ) +{ + while (*str1 == *str2) { + if (*str1 == '\0') { + return 0; + } + str1++; + str2++; + } + if (*str1 < *str2) { + return -1; + } else { + return 1; + } +} diff --git a/lib/original/strcpy.c b/lib/original/strcpy.c new file mode 100644 index 0000000..2b72f83 --- /dev/null +++ b/lib/original/strcpy.c @@ -0,0 +1,16 @@ +/* strcpy.c - strcpy */ + +/*------------------------------------------------------------------------ + * strcpy - Copy the string given by the second argument into the first + *------------------------------------------------------------------------ + */ +int strcpy( + char *tar, /* target string */ + char *src /* source string */ + ) +{ + while ( (*tar++ = *src++) != '\0') { + ; + } + return 0; +} diff --git a/lib/original/strlen.c b/lib/original/strlen.c new file mode 100644 index 0000000..879ee7c --- /dev/null +++ b/lib/original/strlen.c @@ -0,0 +1,20 @@ +/* strlen.c - strlen */ + +/*------------------------------------------------------------------------ + * strlen - Compute the length of a null-terminated character string, not + * counting the null byte. + *------------------------------------------------------------------------ + */ +int strlen( + char *str /* string to use */ + ) +{ + int len; + + len = 0; + + while(*str++ != '\0') { + len++; + } + return len; +} diff --git a/lib/original/strncat.c b/lib/original/strncat.c new file mode 100644 index 0000000..2266690 --- /dev/null +++ b/lib/original/strncat.c @@ -0,0 +1,28 @@ +/* strncat.c - strncat */ + +/*------------------------------------------------------------------------ + * strncat - Concatenate s2 onto the end of s1. Sufficient space must + * exist at the end of s1; ar most n characters are + * copied + *------------------------------------------------------------------------ + */ +char *strncat( + char *s1, /* first string */ + const char *s2, /* second string */ + int n /* length to concatenate */ + ) +{ + char *os1; + + os1 = s1; + while (*s1++) + ; + --s1; + while ((*s1++ = *s2++)) + if (--n < 0) + { + *--s1 = '\0'; + break; + } + return (os1); +} diff --git a/lib/original/strncmp.c b/lib/original/strncmp.c new file mode 100644 index 0000000..4ef426d --- /dev/null +++ b/lib/original/strncmp.c @@ -0,0 +1,23 @@ +/* strncmp.c - strncmp */ + +/*------------------------------------------------------------------------ + * strncmp - Compare at most n bytes of two strings, returning + * >0 if s1>s2, 0 if s1=s2, and <0 if s1= 0 && *s1 == *s2++) + { + if (*s1++ == '\0') + { + return 0; + } + } + return (n < 0 ? 0 : *s1 - *--s2); +} diff --git a/lib/original/strncpy.c b/lib/original/strncpy.c new file mode 100644 index 0000000..84132a0 --- /dev/null +++ b/lib/original/strncpy.c @@ -0,0 +1,30 @@ +/* strncpy.c - strncpy */ + +/*------------------------------------------------------------------------ + * strncpy - Copy string s2 to s1, truncating or null-padding so that + * excatly n bytes are copied; return s1 + *------------------------------------------------------------------------ + */ +char *strncpy( + char *s1, /* First string */ + const char *s2, /* Second string */ + int n /* Length to copy */ + ) +{ + register int i; + register char *os1; + + os1 = s1; + for (i = 0; i < n; i++) + { + if (((*s1++) = (*s2++)) == '\0') + { + while (++i < n) + { + *s1++ = '\0'; + } + return os1; + } + } + return os1; +} diff --git a/lib/original/strnlen.c b/lib/original/strnlen.c new file mode 100644 index 0000000..1312767 --- /dev/null +++ b/lib/original/strnlen.c @@ -0,0 +1,20 @@ +/* strnlen.c - strnlen */ + +/*------------------------------------------------------------------------ + * strnlen - Return the length of a string (number of non-NULL bytes), + * up to the max specified by n + *------------------------------------------------------------------------ + */ +int strnlen( + const char *s, /* string */ + unsigned int len /* max length */ + ) +{ + int n; + + n = 0; + while (*s++ && n < len) + n++; + + return (n); +} diff --git a/lib/original/strrchr.c b/lib/original/strrchr.c new file mode 100644 index 0000000..4e9214c --- /dev/null +++ b/lib/original/strrchr.c @@ -0,0 +1,30 @@ +/* strrchr.c - strrchr */ + +/*------------------------------------------------------------------------ + * strrchr - Return a pointer to the location in a string at which a + * particular character last appears or NULL if the + * char is not found + *------------------------------------------------------------------------ + */ +char *strrchr( + const char *s, /* String to search */ + int c /* Character to locate */ + ) +{ + char *r = 0; + + for (; *s != '\0'; s++) + { + if (*s == (const char)c) + { + r = (char *)s; + } + } + + if ((const char)c == *s) + { + return (char *)s; + } + + return r; +} diff --git a/lib/original/strstr.c b/lib/original/strstr.c new file mode 100644 index 0000000..cc5a417 --- /dev/null +++ b/lib/original/strstr.c @@ -0,0 +1,38 @@ +/* strstr.c - strstr */ + +/*------------------------------------------------------------------------ + * strstr - Return a pointer to the location in a string at which a + * substring appears or NULL if not found + *------------------------------------------------------------------------ + */ +char *strstr( + const char *cs, /* String to search */ + const char *ct /* Substring to locate */ + ) +{ + char *cq; + char *cr; + + for (; *cs != '\0'; cs++) + { + if (*cs == *ct) + { + cq = (char *)cs; + cr = (char *)ct; + while ((*cq != '\0') && (*cr != '\0')) + { + if (*cq != *cr) + { + break; + } + cq++; + cr++; + } + if ('\0' == *cr) + { + return (char *)cs; + } + } + } + return 0; +} diff --git a/lib/userland.c b/lib/userland.c new file mode 100644 index 0000000..7da006e --- /dev/null +++ b/lib/userland.c @@ -0,0 +1,43 @@ +#include + +__attribute__((naked)) +uint32 xinu_syscall(int nr, uint32 arg1, uint32 arg2, uint32 arg3) +{ +/* + asm volatile("push {r0-r11}"); + asm volatile("push {lr}"); + asm volatile("svc 1"); /* Hack: For all service call use 1, arg1 got number */ +/* + asm volatile("pop {lr}"); + asm volatile("pop {r0-r11}"); + asm volatile("bx lr"); +*/ + +} + + + +//void xinu_open(did32 descrp, char * name, char * mode) { +// +// xinu_syscall(XINU_OPEN, descrp, name, mode); +//} + +int xinu_uptime() { + + return xinu_syscall(XINU_UPTIME, 0, 0, 0); +} + +int xinu_putc(int dev, char c) { + + return xinu_syscall(XINU_PUTC, dev, c, 0 ); + //return xinu_syscall(XINU_PUTC, dev, c, 0); +} + + +//int xinu_close(dev); +//int xinu_putc(dev); +// +//int xinu_yield(); +//int xinu_receive(); +// +//int xinu_gettime(); diff --git a/lib/userland.c.orig b/lib/userland.c.orig new file mode 100644 index 0000000..cc47c8a --- /dev/null +++ b/lib/userland.c.orig @@ -0,0 +1,40 @@ +#include + +__attribute__((naked)) +uint32 xinu_syscall(int nr, uint32 arg1, uint32 arg2, uint32 arg3) +{ + asm volatile("push {r0-r11}"); + asm volatile("push {lr}"); + asm volatile("svc 1"); /* Hack: For all service call use 1, arg1 got number */ + asm volatile("pop {lr}"); + asm volatile("pop {r0-r11}"); + asm volatile("bx lr"); + +} + + + +//void xinu_open(did32 descrp, char * name, char * mode) { +// +// xinu_syscall(XINU_OPEN, descrp, name, mode); +//} + +int xinu_uptime() { + + return xinu_syscall(XINU_UPTIME, 0, 0, 0); +} + +int xinu_putc(int dev, char c) { + + return xinu_syscall(XINU_PUTC, dev, c, 0 ); + //return xinu_syscall(XINU_PUTC, dev, c, 0); +} + + +//int xinu_close(dev); +//int xinu_putc(dev); +// +//int xinu_yield(); +//int xinu_receive(); +// +//int xinu_gettime(); diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..19a8882d81d28f3ba6ed1a9bf074b69495d0477d GIT binary patch literal 22649 zcmdqJbyQnjw?3MdQVO)CxWilA-L(aZmOyc*cyadtZ7Ei)c<~nZ;4a18C0KBRy9EN| zm%iWm&S&qr_uO&sUw4m@v6H#?SZlAjm&|8A&q|moQ0^HP85RHlc%~pPqXqyx{0RU& z`1<4_%2FkbV}d$iI?3z00szmuet#Y$us$aT0R8|d$h_9@O52B884zeMV66Ch)V@oM z`XiL-bAnALRiv!h6rHSDCkIWf4xYa0(smq)S?6a$rO#Pe;~ydzYDviP_FrjanLciD&3voiYroI10tL6d(Ax0bn~O`X(b%y#$M+R*1PWf%DX_U zRX!vAe5y@F9u={mg5x5|XOe9y<&?^cpJZ5${}s<{V_uxA91N~1MeIK7#pBP_ ze`+?7b%baLv09oTb2;9fz01FC-G{20*UvWDt= z^QM~aD1m@s^2&3&PdaS?!r@s~r-Qu0Qq8CRdpNqS*0Ld|Vl9^9Jtf8hzjRH19L6j6 zI^H^afNv6A8p7;b5}|q!%P)OUus=|kdbcWBCwiX|7*A(0V- zS_bniLBk=sJfJd}$lP~Q@>GZoVZF=NEzSW+tS?BcNE=(*7u(hMs2#h`kz%WqYwQDZ zaQ1O$VB3ymd*f5Ao7((R`FI`TwiU|oJF+6WlH~k==?_@2oJE3XF_Olyy{GOctu^(e&W0d*~dI zo;Y)~5sp60_nfrp{%e%Z)kpq&;WNo)5B=?EGu^XagrA0$HD>Y_7r$}n9n_SQzV7Aq zZZPY8hmTR`$-O=Srko>a-ZUVS>k^=7m@r11C8vllyH@e6nhK6Q5jm-cFC*~uAwCSw zO*qB@B`aB&GgxXGkN(XLgKMas(2t%hOU-yviTmu0`|Yn2X}WyKz(hr!dj zSe<2Lx>WTN_421(WKw2Z$jz`3(GtgyVI0vW9VHG%*WhUX?02k^>xs&6ZlIjZ08t#| zc{6gDSoDxbU>M`k^MhRn&e0ZpTp|h=ws*96FJ>y%x5NDH_X_Azdh2k??mhHN^qe|z zF(2tV*?xVV$n9F#36)5U-`89FS!=j4 z15*hPtn9X}e6oL7rr!o|SPJu%F$&}JiSDy#BRiS1efgXtvVq01kT1e>OCEG zNn4Tpdu5Rn*-QE%E6MazNQ4E)62bagpqJ6dUN*7fkVHKm+%nbQAPxWHB@ z$pWx*ehGRax0FOpq^n1oN*oTlJEWdzs%1Yu9%jp6TD@(5L=*c0_e3O8R(-?tTN!-( z@sA=eAAw=3jJe8nlip-k$(a2GFTMm$Hqq7(ZodW!w4-iH0_7sVuO!Fy4qp#u880U? z0rg&ng{La$+p7YdlSX$T5 z-Ys>#+#qH0`2aX1py;vk{r23OXwwJp`1T}=-Yv#{{Dk&6IvL;N1Xqr(d9~|v$?{CR z0A-U2;?h04CEdrr&b_l9#@`fBP%@pA;K!v%8@&AFdI>#_KX& zGMz*r=H3<{?(6B$RC}Q_A^vr)<-@Lg+iPjGHc<=S#kTAq9q{eCS-541Xi|Gyt*Xq4 zJze!-2V!FH#=muyt~QF_;_4`O#_h}*?1$AO|K= zBvi~*Vt#d7B-sAV|nQ!t=hj${%%y+7Hwyr3Z>=(28s|E|_ zXP2)GhGAh?R8SR7?7GpW`qflT;`jsE5ncRR@9y)ZNX5p!LE^4E%4H{b{>=EhE2EOU z!{u~il?;(P1T;Do=dKG1f8#5=$?x^$Dw18YH-3`c;2^TkH5OL7TPgFkr?i>({$4c3 z%%<9I3v`fFx~0Ys@}H=XPAW~gp7IjO(?;vqb4#1(nd_HT@Wv_YrVo3j&ewNiuYAzW zpN*C%$3SuC5AO?N#8Y7>6&`bRnZ3xz1u-jv=KC`{)aHkuL0k6nlc}6jYYmwWUQf(+ zF-fYdz!9g7;YR`uNjQ`Ws%PGHIFw)Dfj5ROPohpN;w1mIKfHt~RfFr`~;1_tWE3A zktH-JN)?V0ajG-XH>f;%zCge39TmDIoUtC}6-9>^rcnG*m-@rZaQchnti<|fhTO{U z`~|1O?P)7A-=6pt(s4QpNf@VdzGI>*?7vcBPOYt3XztjO1cK2%94GrGr=5|A4#hy>F zP3wkquIo}lLm@EBl>spg>mWIXo=Rxw1CM+n&e@V{xACEu_B4SsJeh~H6unAx^qIwH zB9x2?3fSN~vQ!cU7e(HO9E_}T^L-uhKYPWviHL|mz{|;Ou2I)qA&RqcEo_Lpw1_nBH*&(;FD_`+_#L?=B3ri)&UO|BbNFjdqvx3D3hJ~Z4( zw2jXDZ%vV&i}oGs)Z1;8?pH^2m4{JUL)}TpF^~oH%}n2C5`0%)(wHccpyWa}Q3*u% z+unK6nLdTL1YSki@gxe7B0%&cLD}2_Z_^0M^pd#{Lio3YS(Q9^D_zlS@cKmTA+cM5 zMN*?}yBg3CvMj(Tth=v~G#Y`4bN~tA##GLAP2(IU9>cz@9LaC=UhF<||CAEpY$#|2 z$$Q;|khGul=#HAl#$XpJWp+K&);=8{P9;SnZ%F1*0Qda-gHfEFUBxZoK@lD%E_aco zbntZabEvasX+wjjzTJBJ9W>LBeTynDN0iUO{M`iGXg*^;3sm3xd)2`Fk^2S5rt2Wc z=RD{Uq>NfXAg)|%*tf;j^Ppo|?be?}Ju~`Fq)AkdDHkiX2fE}u-0CZ+jtmqs8?Tn* zT=uEWQ#4BrhGMi@1@PY3aByq2nzh{uc@E;3XrG$9G`!V|ite`o%NeOwlg@zOTuz1; z8@Ox~A|(6}UON3GvSlvkANDLbiTo{~uu_9kf~R2CF#@M+@7*m%LQcnep2x`~gN^Q| z>yDc#jZ+DWt#{|&842h)#IGOl+dzIM;&zgV)?Jmxc}g}Aqy~n{-;G`iVMO=j(T5m- zA|w17Jv`L721E=+1>d$3+^zA&R5+}a-E6J7qc!LEh$|`!+N`Ww4wNSvWnQ`^vBY3FDqLiH(KVU@e-(enkTr}m;3=hNxp`1ypS zjAok?U32qOvz12qms*! z-B44l)YZ{XG|$whWRug=24!5X=ZEvKIbQfv)_{A1mg*s5o(BU7@$z#y$Uc~7t+IIP zF#fyCxnpA=4ziQ+@txJWYMI7`06Pg`+qK5@^_mKD#@nL;Rca7$YE)DdnAuQa21`K0 zpotSnaCl;{<~RshQ2Aaduoy8~f4?1qvvoMnkN-~O4| ziA6C;jQe1_@wKoXvzzXfY1CtOgm{pZon8Rk!H{?-iM)|8ip%0?s3LW3U?(f>@+SGL zGDEzw7VPb#1B><7ubg0dKNUOtyyrG<3SQL&k^Neo@V&A1NYW!Komu}Im8bc|!1fk+ zqqTDNIVQR;QZ%fxu}r{olul{af8`rVx(>;c9z8C_UTLkV=jW-^WCa^8u~}Cb_7a?@ ze*}?8oE>!%Bizqwgq*8$cpciI!Sri~=}m@?r}GEE({t>F#C;_%iD?B2(P}|aN}v80 zjPF6P!ZB(ntO$JuOWN<0aERolF@S zI$L4u!7_y)cQ=SM;mcYLqLHU5<0Hnq3SuxX+PD&!LJ;Q7xMd_78_RK6$oW5dGG_FRxPItCi+Lf?4|C`3D z-MOwprFnk84j8#eAg3I0-9`BL>O~0n`|WPqu`qIf;k!Tbg1lhOg9}hl%i%F8?bvWP0{WbrMT`9w}&GDbTM}_Y3ZnrDfukrO7>?2z6nmoQ=k%Pw2SVE;%d>Zfa;#Ki8!xt(y;{X+IJWe5af0;ws(v zp$5`n`G|6qAf@AtP31GWvUA8iD9>{AYO&;P{cI%fXP{W(lSp-^<8J2p(b=)lbJ^F! zBG*WRA(syZDlQBkJZ3fBPhb)9%Acm`SR_U^`&$x;!*A>P$3JJY5N1r;@TFv_H??Qe zeda!bcdwZ&5m|crlkp;6%}*ZafN+?d4zAM2p3BPM^=7zkT}^)(h94fI-7;eUkjxSG z;OnMZ2ZOqu-fy|a(RRj4_tmq_!|}Q5^WT~0hi4l=@6)ZW1a-AK1TJwf)5ofhIdNy) zw~NY|*|EtLT6%&HZ`wSS!Oe# z2#l0JIe(RHWiuaU46>(KKN;X9ejGh9>9B`mTyryxIH9w>>#p?{x63&CZt5#vL0M8h z)i9cszIx^(vRxqx05r>@Q!8W`%(ZMcA&0MBfX6@g^YATkT(w_t_hg{m=u$wbk}n3l z!+}?)bM=3LPEJg<-fI{I%6To%p1QtOurm5L#8hqK<_VND7qH*@NoQ)PUuT{L>?V9t zYyOv5?tLg^M<_S4DlRhil*%An2~S_h>;T#fyj}Ivu5_C}KSM<23OI~+$w!Coye3B= zGK%NK-nC~V3T@h*6~AC`PAvZiBCDVoMz={UPvMM?JC6b}b88*>)p+mClw!COEXv4k`T63tXoAZZ9$AwPvp5}I0rD0_>To_a0o}jDn)Vq9* zUE=dOe95WxN_#x|1>o005#C|1WbUMmci0z`h`mPPCV^-3P^7i@0->l4Cq?y2^_cUw ze~W{Ome?&0M1Uzv%+AA$2hQMRUebSwzEf$};%I5q+8iN6wAn!%EZeZ~b=FbdH^4Rc zKkxxhWp9P=XR|A=Q?k;Yq4Y8E+)j6ll;B1~S_y?UEw*|v)mfL0j?S_0T(GxC)K){* z-IFMFwc^6#m5YuimxUiVRja;CgDlcyy29RMgeE8omtGF9brx1lOiUOhGY--#qTrBu zH%E{&1!oKa^Je$uwkDe!d8+J8VX;;Dr87wL}v-wFZM8#n8|S7wa`UdmB4l@Z|PtD^65;eKBp% zfaiV^^_Ii+%YDU+w;V|dbFpP*WC*u|{hasl?u{M}-$BeGk&HAP^lRsLd4abJHZ&^B z{u2Dh!n$)<`63>phqW&KG5Lpx^MiF0dNY!Sf${9pq?Rx8x^>>H+N|iEdsuwv2L2g( z8x#>L(XHQB<}W&XEb(TFyuqFaWrp=BRzK=nWt`Gz0y)()Kl3ZqrF6tF&I~*1!eNe$ z33nn5@YrX#^oJ%cMMbaUv@_aQ{tIiIl;qA*o$fxrjMw<7!IE%_cV!9y+-dB4i`gDb zdrraUwPaC2B6-Zuvw&tgpIa-orr|lR5hYm}KGEiI0T07p`)L0eX9=19Qz(jyiPiGw(J#^xK()|wkjtp*v~n{4cecFGp}N7buuut~7)LhjNT*k%_~ z2czfsyiZO_a+VWI_^?Q7%&P*qk#zj``-e3#GI;8ctGixcHLnHs#ClYT5h=TeO0v?e z{k0DQQ+*~l^@J3HG-y~G#XDkY76yJu`y6DkuU>CisHM(zDl-qN(MwM<&PXajIYr{^ z{L;`qk9~0_6VLzJW&ToMgoXxsASsZU#_tRrIhmi0#J~5HXRiz)SZ??7@safB+;I~M z!vJu-pj~GE`TEXwT^EKG(uW3!C#TR43#~btg)&}u^~;D28nnOgM#YPgcG;`N9i4(B z2kOSUbJB&Dzpejue9SL`kc&jP*MXCsdGwD$@RB^-#Bzr~a&#uaH)rtOP~RVmA; zWsVQ_AXvg;m@SgDuQ?;x5J{&G07Z!dh{wR(_c>SsKG50jm^VvKW^BzE%2a2cnx1(g zJ2;C!U-gLNW;}coJBuX%sZ*_2>FKNSegEFr*h<|{7Swe)O&&#WBQtTjE9#ZS!@yfQ z#Dr-X0kxJCx6`u~K4})=9Y+<5P?gMHgE?_wsA&)S1#7N1s0AIzoOH}zOd_n`jql+$& zMwrFs`G+Mcj`Z*YBo`(T**UETWb&kEiJ7JPJ4Yr%FSv(r+thH(TzZ=u0Rqt7BE|Gzco_M?;285jteDc5mb~pXEU=~-L=j1 zdl|gtCX#-0a#2-*V{aqer&PkM`UG(7QGDpy+%;2?w}0Oa$=qK-c{>JO140SrQZ2vPhXX?G+z_>Yc)4?&!YPnqswP^V4r?`RC*iB`VgQYIKA%=;*RK$Z?`_J z!PBBiQsPf0Q)42O0gdElY8mTr?JV@*4aXcML77B+#gt4%S!Jd1e!@QcePxsXp^{Y{ zCmF<_&MR0Q9dU|}!Ycpy>s2GJ{a|{&Rk&D0oV%Y-Y9>nH&vrR7YV6-47%9Id_WnBKfs9xZew%0esxJjD ztLhmQCgEDKDB$=K(VN3xDWd57dzp)0STPV%zt{ztGj!1Qq9@6n|afH>Gi3)S-YwmF%@{f<52u6{;Neq z0c>P2|B_ZrTUoK>~p*jbFep$1xhQp!b!&V%e zZ4Y#DAySbkF}wQc;4KGCKF8cPN9^02RMFL*Wzbg;+LcWxIQYx4{J!{ z*z2j_4T~~56yP)j`==yogN{v&fR+QB=9}{DY>=lM8-LdVyv3$oW@U!jZ_4fH_RLnJ zj`N}BEU?&VBcsArl;P0XxpUlC2!Z``lyizu&M7n-G0+wCJO9ra~zFz!qabu-4J74^ye~4{*XNonc^`eG26Oqbw531w2FPD zXO!Nz(%qagR88Rho>fqBjRbSB(goia?2$3EQ)n$DjsajQYBVlplt2sxZ*s)-ur1#w zb8N0<{3!npQmel}><6YD@Z#hRv!kGsdDJOom_C_bBYb@%HP2Nq%s8!3RQ(RjN*eUaG2F9hk(C+qHv@K4U z1UyFJ&qqtqAvVvCdeMF@6sM$L9iw}b;UG0%(#oS|=YEK&avS6c0j zk=ui%?-+ld(*HbrnU(B~CD_Uem>V0PF&8RYXy9J=kqjng6FbZkQMFol5D%(xeyg~D zzck`at)p!N*Zmegr5`WVuWhjnOFjPj;VBp^+ulIAJ4-G8p|iC_g5h zhEv#deQ~pwnrsELh{wW|oiMDk>26+3hnkC)N6u~0rLH}^)!OO!42f8Opc0{Qb~1=I z_l=o##PY0b>$b|#?8fh;764Ec*F2_hH2K+5?e5@lKk7`mbc@9Qojb<7HOb{)BG)(hgfc zRNEW~ZcNN&WeLw>DgOq!*>1xc^7#b)=iEd-#2Ob*D$$-nB}gaEdtjrZ7R0rEDxo6r zsxN8L0UwdEU(?t5D|`iei0+sF8#>d?)c-Y6I@Juy+_v_grdgIv@^#x$Jw~LJ7c_~` z42-aOKPoXqoP_7s6|(z!Nr2|QqMe{SNNW#i*poEv#s-J}78T@^mZo~;v?G;|Y#eQ@ zIntYF^rh!ne@-T*55RO&VQ3FSJls*-?o!wj?B~LX1utVoJSfD+!S<91GH3A1_UUDZ za6$yF^x>@YR9E|f;ZXg#t(*Y5qi|ABe+ov~6FY~jN`XySu-mu|IB58ZNCvae+*Xg> zvWrEb@p2Edb)bm&Jonj@Sw`r;LF83pJCwwMUfnLsRAWim2BJ#0uiN~=7$mW`M$9)U zWWImHDq;#nn}Kf)AwdiFF@hMIQ3n{&he%*2+1FbPRE$l0&{Bp=CdS=!A(_IrqfTvm zaj?F1Mi;L`V)~Qm0pL}4aW#1Xr&=K%E@4B`&~I)L57?;q`C2pGmX{fCIk~vQ6&1!PL8H%&ChZ3T=0^7aBiK_fE7^an}`}WCo zyq2}eWbh^R{Y54!@|1KzLFSYT>S-nig7#oCj~8p6n~y!hJ# zDhbA$si3zR)e6X-tp(xPcuUr*3(;zIS-S<&IHO-@-U?QuOB&cX8KuyY;q`pd<6?n7TtG}EbDq@|{p($cKC@>cPQg~^5;i@yeZ{Hnd`dRx_% z?V3qXMZd;t*3m{z4V1}233@I9n}P(L&~1oLXxeNB0w3PbwVi?bT^Y)njka39lOu29tHJ{|Uf`NJc^NDVjoJARqWG55M>i139Az z8efk7UTn#Azw?}b=M;`9o*iRfh$MOMX>;;n!RpkaP9_i9pxho@Zi9ZK&^U(jEHH(@bJddgctNQG^V*~ zz~XLf)KWv3Z3>>oW}u?)8ORN*swu3nXaQ!2AS8r5*2;k847A^k`L9lsKcsp#`sypt z_gpOb<}U>nL#V<>X;2wkQBh_Ri}bQ|at7nC!1b_Dr7$7Cww*tawJCj*oK(`j{P?U% z6yCe7D$5d7T0Frq#T4T6K66T;@$M)&M~xa+bJ;8PUz=NnZ$@;KV)`_>T>hHd+WiN& zRl6}6r=DljM~2%Ja@##(&|{omh$aQ`@zv$~WS<$14rK#2i+LW=Q|* z5fX@Ro06F|<~vlwp|^=aj`w-w98ffX#y2eSXsZ%*^}^T&M1Iv{@A=BPD-LQby<2@e z#x%E!UXAwKqGU$t&*_Zlj~uHkGwEdPbsG_h@F0`JrG|wI1~BxHPNl8fzQ6TLhq~s! zBGFbIhME5*^aKfJhE9sc6ay^c?rBq(=L9b71XN_^tU3dB8a{N%$>oPEPvGr1ASv}sJRA=b#^Hltxik$a) zNC5yWQGK5d{RbW$CtgPNmzB0)dp?k+7rdvzZ#U`ONcaJ8Z5cDcT%(4`TlYVwt7fd_Z~U{Ck#6?3ME3t0ipE#`6%@5)(};6F!CtDE z1^-m+Nb$bGID)q(QPLVzbzr?wpg^$QTT4v}URRaHW_KxCoJuLywX;g)*9tKFg(C3| zByU$54I440XturnCBhcQ7r^~K+`+Zes+N=42>?L8o4$t%2gx<%%`sjY+O8d0`T7LJ zPt_TsF`F%&R=Km@iARvq^kiL3eIx87XGOQgv)y{1N`&uDn>uM>DDKH$C#$R<<}{4O zO3=}GnM#d!YM9vwqeS)Fa+A(^<^#>Axc#Vv|D8!^ZMtaZ%n;>_l$fXTrfe9*8v8dE z&0gKDwzc&+gy$}Hh;_H6Hzmi$B;)z5fKyqBiT65Id27>yYg(GtqjRhrrLY7r00obW z5EPsh?j_7k0h~2?snNcE3n2SNYi z2Z)SbNz-ts601^_q~?@ILYV$q`K_d^tQ!VEa3Kk((KvV_9Zlq5@A$INf* zmY-IMSGsIPf+|w}LeK%TqR$#uE2$RfGcHP|0uJRmXj-)fq~ zUy~0%4?h4bnNIsfZJkYD;{{2@rhp{*FJd$}@x(}wx0um<19;3YjW5kwca5V7OLR?wZop0QjSDQqx%q+bhxA()_D^>31;bmhPuLJn z$NhX6@><}l^2b}X6hPeXtLUj{faYnGmq&Byp`7JlizFYX_6ajxehPcn*tjY$8dJ(9 z47Wj1mw_CWSB(0yC3!iCbxE6T`9M0DOJfOn?+BfUPs75o6urp|<~GpE(yrc0$u z4iQn_Q{03!R3b53Lx`@YQQ0bbBaRW@2;>CUyKvELcI*?} zG0JASv(pVqgi&eWvc}PqoG4*e-HQ=9dkydF+H{|r-I0v2Nxc5u^NiW1_mBa1+s`<< zPpOct;;aU7N-F-ZBIn%;EV{UQMh^V;HlQja8|a9Va;bM<%R%-xjSB;jc(^e+mLWig zx~NS5jA^4k5L}tw=DjS-&~*sB3Ax8fqa9 z@fmKh#e^M2qzR3HtIST92+4st9|#=K+Q_Ucw?Z;aUED|^;3`8#kR52%e6jP3DZjUS zM_YelDdHL}^u@j5UfuY|J7^q$oe4P**Qms897tLDk6*r_t5_-#}lLj0( zL#ZCD%OczzOTwP$)@(J->K`SL)6>)f!M{}MJ8hAn0XM%W%+3yHM;rM{mhU_L?`|&k zAV-s)@ks$~=QM_#`b|(qWu9n?8^%Cl8zb{f)kcqf-LsjcNzD3C9Kf+L!?C}ZhO3t( z6=2C|dSBEN^g5%bGeEQN$wV%t;pqiX?4zciLW?Xr>6UHRH;ou#!;hngf0fZUbE6oo z0e)KYT_nqIQn)A-WFBELIF2o7kBzg;(-fXdg&i+|WOFk)N}+GN(s>t%0r*%{gtru( zG_}oTzn;PV2JZ(q(UQOGj2-miEO8~dg*=5zrfcehq{sd4*s-CnM^NcC$FZSRke6$$ zs0Yd2K}xw{+ikPO=0;R)aPr)DGHMV$U&%Z4W&$5k=Dl%#>9EZ!bg{1FphRTCG-LXTuVPtC9Y(Ye~lZ zEgr25G%MhU}hT&g{|vX}Og60a9SE{m z(?qmGkUitJHC)ZD|9?f28eUefON0lo_{hClJ6^plZU4k>+eaE?R;Npz2-;|b{-4(k-U51tfvwjSQH#S~A`I(1Gw7y&o5EIGk< z$L64vn-R`;pRhgeD+@f8F>!6xduxKj;$O--KrCRWIai0PBapZh1z;RYzqV0>CtGg& zole}c8UsB2#l3gWk31zEB+l`#@=3?P@(c2C3s}z#?DnO_NIy(6a3K-6#!td?kly+q zv07}XyFD~EOoTqxH@YeRF zz%Tu*Q~d$XF`6CKEDj}lxQJ27DJQp! zl@oaMyg;S7LoVj>BJ4N(g1yqTvar>Fv0&yh$jXS_)TW1=x@e^)f~HRQXp+k5|Ce;5 zQwp)dM$wV7SC7WOASzsLhSGa7X5b@K)FT~4(zplD@&7Nq>2OWC&S zAcs5Tb8cE=S-{DoLa|QSPrHE0D|~?BUdThmX`f2gD0}*Q1O5%aXp4~A zcCc7dTmr4VxyitoS?h*OSx0elLbAPGzG;|S7fEVrKPgS@RKdE2led}1*A&K{+424q zKRDdfOQQ#g%#!cybjJ;o)Q#YSNW7SW?+*?izY2HzT(4tc9NsGzItwj za_1r1a#b6tAHR0J_u(e*xWJLyRc)+d#9qr4umwXKoN#=fT%iIP0b<|o?EPZ@9iV7_(SZ*481|3`lBF>%^vSc|dp%6M> z>2}3_BE!4b;##+-Y}5o*$nZB=i1ot^y1Kj$iOD~DN?v*+yatS^f|nE+UwNjKzjt-y zkhGlK=_*dsQ|Z3KHePBv+dng_Ecc>!N&V;1NqJH z-~NaZFfP^F+N2dlElJG@5up4pk1xQHy<;fobMQ$wGE@f<1@((nNqf6tWK4_#KlkLb zvYpyNA&zMa`K{Z&7yrORfXzam7Orj`PlV6h`=nbCyR)?%u^*v-c8a(%hi0L<@SL|7 zVMb_Iy#N0V|(@MS8MA?USkA2^q^RfLJ1_HH25!)u7S&{j=Y*g{88Jp z3CDCOex(EQf>F$xvov$1ErSFFP-brAiy_oasJZiHPhM}cy>T^1ihIJlntL&~yQxbL ztX%c0xt}l1#0Y32H>s$jcc(k1mpT@ge2+U0$a}q6Wm2>qeip2S*_`7Te*AYe@qcH2*89CQ2&gV-tp!bxCq45V+2Tw1H8Lf14EwUd-egRYM zYHg&3MZBqNSmj+vA`n73t-uC(XkcQw;P-oj%v{D2HT{J>Sc*-+x5$r%NK>VOD3oD&&UNz z(kG0%U&Jg{tj|&l*ex{h+6^z7u-nO81rJ2VzRxU4546{NI~8dMOme?ioL(g3x5o|{ zo%JA_xjc-Lj5YGXkNp=)F4Pj^5x^@|<4V}bbWca!18HQVEJ%HIQ;QQvl_DaP@($LZ zYzu}zdVZpzTSG3MH50aSply8fxaIE~T7c!k`h`KCiPPN$Jx8#fd~ZQ`!1^sd-QVAT zQc|%vqbr=Z}77vRW`M1m@qFD z;yq6D%kx}e!Iv@b{MS}o5U44vRq5+08L z(^Bq|(VQu$BuR|MJx!JUpZr=4%5TWN$h(XLIo~YS*;%%uvQ{nrnu9-If?ad>%O22!qq`!;Z>%_~r zI7{BU8s-uuo*OL=Vp{zcrW6JRF-yzP=QouuGMz~IRsN|_7k5W#)F&;VLLLm`S zOQ}oeI_mCpeUV-Ai(!9U|0WOfU??AW5rwZ9(*B08VpTH@d`{79rplz*X@j{v9FFuE zkNjO^dt!wBB-o}rO}^Y*UXI>y3K_zsC}~Y}wH!>3rbi}4#QC2Q?>+b-QeXsOBTc1R zF8xp)FgtkEt1mz)X8qRFllAu!ff5fG48}BF4`*s#T_vAI<(<;G-)}TE4AZn_;I9fZ znn(1W;lJYeo6y*;JM~P;Ps{x0_HJ?WttHT_E$URa*1+iS{BRpHaDIk=owp2mz5aEq zPopCGp{8kkUtX{0LqDEN`{2hn?lyM$zcs{2xbwltb}y%v(UODgY(D0svA?8Iem}4Q zx5ja@Cr~icxSRx?U)v^@A$y0S*?JGJYwAIfBTALO18t<`L z%uIsb6pB4W?Lz}?ayVNpe>9Ft5?_jH=iB+m%Dse`)?=4#eJ-ctK`~&cD;16bB z;)o7w?dYhu3!&Q`fX@(1uUy;nIf(FAjy-ujS0-%TnZRkX%QN8ZaeA?sgmF2G#`dFQ)!s6Ra%L!?; znUbid)xrS44@I6n3YEqZ(PHWaV1fPV{NXuR_u*hl8Cs2}R{qXYohl!mK2(D0V^P0q zugAqaB&Yjxo22)!*cfLodfSfE*Wvw12$};>wNDl zjPGo*V)dse&0?Eb6z=B3ev6KENd-}?v4(E2sNZ^(K#!G&yL-{ad~fvynEBOZtL?$9 z=t+R}GgRfQlYbUD_$}$f(Q-HvI@P_rf8iQ*&u{#a+au+DQo{`pX3OYsXWK#U_#6Nz z7zw+?Z%lJiqz}HogQtU4@UjAwz1D{x(9Dqk0su(xfB!E43cRP7 zP}i)PIWB*#^1Rcq{+04Z-ZsJ$CcUoi`cwx$bm>o*Pc!h_c^VjXXjfD|#!8$5dmAbv zQ${Nk`=nvOzmlU?~FjSN-K5YhHJpS$d70GaJAFxrnz$p?oF=%#tbERt%hy=6! zQ-2uHCw%+v>tdy*&1(Q4;b*giiOsJsRr0j@G2fhs04t^Mj9i;n@kVGO?SiB_bO9gh zWUq5+xK%rJb7D$A$p6+(Br^57nLSnz3g@dN#KE*eCH0iq3iYpw`oQSN=S&8vR9s+J52}nwa;M?Ej zCOrFH?)^H;N@0-6Le>r_->9^1JtQGYt!n7 z{g3R=$5Rb-^>{4@jwz(#0EDG}6##gePm|H$8@N&a_^mRw=?f8*PxR4;P8?$?W}FJG zUlT}Sp!6iHNa6cuah+sL{Os|MexjkGl>`I@vZvqVS!@cCV({1lKy&xN^{i3eM!5x0 z85+vQZY1Kkt#(1KttkfuMPwF0*(xF5Z~N-2-Gy zI%;h&bg?_z)(4_;;LP1*Vm}_`I3mcF&F&spUBfQZG0#96H9(FtyGdHK!9enc*C;my zu@{IX8kwAweE#jWtsekb zVobK+f(o?70Y~ye`noJ^8JfPGE&V`jfNI!Nk=`~FGTpnEt9BNJRE_GZ-A))2Jh?H`)OaIWiCE!Q35!k^^S^5eX^+ab zcuQL>Ntag2Mo2U&X#B#Ar)H87wA`wKgftDmPnI`fPH@gg2NVzl-z3_jI?a=o$-Z56 z^+%aC+!ANa#ps0)T2yacu-Uc|I$eLuyC_Wxv87F8&TbS#6E?VSxB^PWP zrc)JGx)7~xdvfq7gcE0i{EZvOq0-qfhC0qS6D*VJt<36MwagTdbf^dk|Gx47@U-yj z$Vo|sCa>IIZ*j#{4*i3(i}J*B44taAD=XgTGkahsfW zU<#B;DYoAE{r3?@{?A9Py=b7F^y4_#2uZSlt7d&lM_QPC)UT2(@7ooUBWS-=rDXd5 zspU-Lq2Rs;u1!yb5JD(Y4?RdFyD4jyF^Nf&E!mBw8q?UPcpiojB3mdsgR#zF3|Y%E zBbl)?8oSBJZVcu(zu%kx|Nr9u^7rn3?yGz5Ip^MU?z!J1H@xqFZk8LVfg3)QW3e~a zf8*3t6~9fw=i5CHwHqkc;hbv6$%89HXW)NHxd!MgVA{@jXO!)1xC8ey`ykm``@>z1 zwlWLn#)fy|H>zr_T}c{&FXwAZZA!}sb&&T*qC5_c``zihPE!LERZ%v5vRy%wGETzA zsD{i3lV3}UH|Bj#Cd0iYD81FySJrl+9wt-$5A2#ua34UL0qa!>s4EpZ(-X=B^3uby zCk2FrMV^3_O`Ndolx|k~jg&s#v!Ut%5tqC(TM6W|YwYOzV_=xIZ95TJ>;ZTHjX^Cr>!GztQ;SlYbNLH;Z0dB_R}*j{-$f)NJ9+w+>HTy1e<%e+y#9j+ zZx-_hT2|5Mo}l)pW(I8$uJks1_&DnICHN^hpplX7$@9FjLMKxyZ7ye|^b}Y`SrkpN zjszbhW?VS`w{18T0AlD4z$}jf8Jdfve$;rRuUZ+R!FS6;1~>lvcB5P0n<6c4nOAU| zu59R|LO+enUBR*t2tjRxbV);OPMszDF~lBIn+wzgAy5jTuLa-Y&d# z{FL+{L>`kKf^E5}UbQn|b%miY8}I6dE2w zo4>sRr6#>B*OFOU<`0+aQf`gR1nUuBX$-z-PQg6xW0y?^q}mHUy2GG>aH3iAC)t zg)!cUfY};R7Ec;fRDsB#X}bc&e~8jPQNy9GYXbQ@*rDQ zzyH_}MHohx$hVs0BcvNTCsTFaSR=idlR(2R0N|y_!y`;lW(Z)7+$%w*=phEo^vm zYnc!1Ip3(g!v^Ee*s|lCy00P zb6A1GL2O((UbYv2Wf`84Bv-Reu2r_-&7{gM+kol8Uk0=3W}$>EbwW+qo-huDqC%?r zGjyu|kq3)Vp87d^1p-~Gdfk1fm+E2Z_e2QY80MkgBB+#3Iqi_7E2QtOE`Qs$$J=Cb ziYO#3qNXOlx$_5WbHkiQq z$$T-#QQ{WX>!X6F*_-3ps(Dm>^v9aR*DCo#vuED0FE6?;9Gm$8ORAiOw|*6wezpK! z&5XJ*r6wX1-pY(g{uI4<%rklT6EOsm#1|Lr1@38YR;vBjB=JG3@`c6edR9{0_ytmF zZbkOFt@0;Sh%2vulJi9E_G8~vGP-EdH-6>2-rD{*&ncFR(NEX}Z^R_J^Q&7kxf<34 zS#S8oi}gL6Ta<9p3>m3T9Xl-3^2%L(tUiQ_1{xa@Uo24gF*p5_tD#aHDO zRRkbT zOvgJ(+|fXn1bD91%nPfh&}GdmFzk#_ljzYUIn31N9?~2xC}_}Kr66$4Z(5M@8J=H| zn7?Kb{(^E3ciCl>9P<;lmW7*8iMr$B{_fRLNPBWexS*iJh+%*O`;g5k=#WIfolZXW zT@V^EKC2Ua5k&O#w7efz4S6fS-E>9(ah({pwPR;|wE4c|^X%zUQv`L~#r@Ir1=gb8 zP1=VEMwnkV*xHC3b)q}o3yT;h;P|9=bCWA)8FVQO>d&HHAV%j7G{jq*9nB6sSY45} zy`xsL%{K?AqE)N9NF!O#=f#E?Qo6xg1Qp+sACV_{EHDQv+w)jQ;oKH0hx(aWAp&-_ zR%}iB7Hm^RbUliUHPv>vxQJw1=XUdpPs-<2nvxZJ6%VDOJB&Dy9mggFE9$B=$eenm z>65l=xibEfw}~8PO|c9cusj&J)~k+92@F8A?W<9{JrEW=_Bwn-%!**si=J4iSC~pX z&&CEn8I}C~Gi<-D9{o!DK#!%49!_(0nAWl|44rr5cXA7I%OLdIfvrRYC4KLgAwJ!W zIK`unTN`tEhkD5vhsSSVH%UFJA7NOD%N5tc?pjIkIf~=LRb=&SmHPNfM`vjM=tg+y~-RbXRV=q0& z1`P(?I`-@1s{B+&E{dck#G5m6t5^GLUjT=|Lj$~aNTVRI{lmO_=;Olx^I}$Af4|AoW8+icI9L_ebmTf6_rX}-_DIL z7_NULHh36L^t`DkD;xD2b%Vl$3H>88kiLd_ik9YjE@)+Bh!7Fk&n&?6OK(U60y;lt zIJztCK!<^nJlgy%rM}IkR{d69z8Ig}mwDXYcc7*=Z->1Wgv0ibd(ZM&y%SM&@#+du zsJDx8|EQH-V_Z{(ckqQZ#wi7#Tj$pUjaNPZY$)~#k#rcYJHCuDpb z5WT?5T1GPQ$*ut>eMVjZ8ya4(5oMYQNSBk<=tmut7FxRyur6Y^xPLM!d?cl-FO6^~ zjF$N71t68utCH3-|7){7Sv?I%Q0llu8{6%M@$%OL+zcTzD<62 z-Gh~y!du40;kRHr*9z}_Xly%iDo^`P>+TyId-JW6Q}gdZ$3Zi~iGQ#y^CXhVhq(pt zvTQJTx+b+y*MzUPB^+0M^~&oXoqiul*5=jScuL06~p_om@0yUS+@;j zi8kTJm&-I68`X*b7s&Z<-7f4_1u?B-ka}-QM*NA>{0FnQj&aQl80zBt_{2LLb3zbM zgD{M((94`47k%}iv7%F4T;avFmyfowN@4c%GTp{dnTa$(U73u6w>P>?PxKBel6o(@ArTHpU$sDa5jucgl z{$v?&pXA~)EWmctQ|&}sn((s(xpAYe-G&gGjscIqrmW?JlEeBODt3V4u!)L}wID@= zUB)X~Lc*3jHVZCgQ)HxEnVP3v|2#UOBoZD#-C5rQ6l(ZZV%}iqm+^7Z^=+WT&1U9>B~F!TnmlQY_CswmM=yqVhO} z>eb$Hs4Wn>m-N}TAd`*aJb%6x4lny&8Afj@@lJWNw_F@es8`CVczX@=3en2`XXL|Q zfzH3w;w{g65$AOnVuFKVju`J7C&N-nVXj1SHNtX#DS8U;tp(U4m+X9QtK^8jIN2lN zf1eI0!a%2@P+8qu*pGis1T#qpcO6XzY2qshFziiE{6&43ALjUOcBUz)F{|HqLT#>s z(^lc=MmJFKuv}fm%zF*D8yLCtZ*+iwUd;8hOv&*$Cm&w}N zYW zza=_Zj?a +#include "shprototypes.h" + +/*------------------------------------------------------------------------ + * addargs - Add local copy of argv-style arguments to the stack of + * a command process that has been created by the shell + *------------------------------------------------------------------------ + */ +status addargs( + pid32 pid, /* ID of process to use */ + int32 ntok, /* Count of arguments */ + int32 tok[], /* Index of tokens in tokbuf */ + int32 tlen, /* Length of data in tokbuf */ + char *tokbuf, /* Array of null-term. tokens */ + void *dummy /* Dummy argument that was */ + /* used at creation and must */ + /* be replaced by a pointer */ + /* to an argument vector */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process' table entry */ + uint32 aloc; /* Argument location in process */ + /* stack as an integer */ + uint32 *argloc; /* Location in process's stack */ + /* to place args vector */ + char *argstr; /* Location in process's stack */ + /* to place arg strings */ + uint32 *search; /* pointer that searches for */ + /* dummy argument on stack */ + uint32 *aptr; /* Walks through args array */ + int32 i; /* Index into tok array */ + + mask = disable(); + + /* Check argument count and data length */ + + if ( (ntok <= 0) || (tlen < 0) ) { + restore(mask); + return SYSERR; + } + + prptr = &proctab[pid]; + + /* Compute lowest location in the process stack where the */ + /* args array will be stored followed by the argument */ + /* strings */ + + aloc = (uint32) (prptr->prstkbase + - prptr->prstklen + sizeof(uint32)); + argloc = (uint32*) ((aloc + 3) & ~0x3); /* round multiple of 4 */ + + /* Compute the first location beyond args array for the strings */ + + argstr = (char *) (argloc + (ntok+1)); /* +1 for a null ptr */ + + /* Set each location in the args vector to be the address of */ + /* string area plus the offset of this argument */ + + for (aptr=argloc, i=0; i < ntok; i++) { + *aptr++ = (uint32) (argstr + tok[i]); + } + + /* Add a null pointer to the args array */ + + *aptr++ = (uint32)NULL; + + /* Copy the argument strings from tokbuf into process's stack */ + /* just beyond the args vector */ + + memcpy(aptr, tokbuf, tlen); + + /* Find the second argument in process's stack */ + + for (search = (uint32 *)prptr->prstkptr; + search < (uint32 *)prptr->prstkbase; search++) { + + /* If found, replace with the address of the args vector*/ + + if (*search == (uint32)dummy) { + *search = (uint32)argloc; + restore(mask); + return OK; + } + } + + /* Argument value not found on the stack - report an error */ + + restore(mask); + return SYSERR; +} diff --git a/shell.orig/lexan.c b/shell.orig/lexan.c new file mode 100644 index 0000000..4e0cb8b --- /dev/null +++ b/shell.orig/lexan.c @@ -0,0 +1,148 @@ +/* lexan.c - lexan */ + +#include + +/*------------------------------------------------------------------------ + * lexan - Ad hoc lexical analyzer to divide command line into tokens + *------------------------------------------------------------------------ + */ + +int32 lexan ( + char *line, /* Input line terminated with */ + /* NEWLINE or NULLCH */ + int32 len, /* Length of the input line, */ + /* including NEWLINE */ + char *tokbuf, /* Buffer into which tokens are */ + /* stored with a null */ + /* following each token */ + int32 *tlen, /* Place to store number of */ + /* chars in tokbuf */ + int32 tok[], /* Array of pointers to the */ + /* start of each token */ + int32 toktyp[] /* Array that gives the type */ + /* of each token */ + ) +{ + char quote; /* Character for quoted string */ + uint32 ntok; /* Number of tokens found */ + char *p; /* Pointer that walks along the */ + /* input line */ + int32 tbindex; /* Index into tokbuf */ + char ch; /* Next char from input line */ + + /* Start at the beginning of the line with no tokens */ + + ntok = 0; + p = line; + tbindex = 0; + + /* While not yet at end of line, get next token */ + + while ( (*p != NULLCH) && (*p != SH_NEWLINE) ) { + + /* If too many tokens, return error */ + + if (ntok >= SHELL_MAXTOK) { + return SYSERR; + } + + /* Skip whitespace before token */ + + while ( (*p == SH_BLANK) || (*p == SH_TAB) ) { + p++; + } + + /* Stop parsing at end of line (or end of string) */ + + ch = *p; + if ( (ch==SH_NEWLINE) || (ch==NULLCH) ) { + *tlen = tbindex; + return ntok; + } + + /* Set next entry in tok array to be an index to the */ + /* current location in the token buffer */ + + tok[ntok] = tbindex; /* the start of the token */ + + /* Set the token type */ + + switch (ch) { + + case SH_AMPER: toktyp[ntok] = SH_TOK_AMPER; + tokbuf[tbindex++] = ch; + tokbuf[tbindex++] = NULLCH; + ntok++; + p++; + continue; + + case SH_LESS: toktyp[ntok] = SH_TOK_LESS; + tokbuf[tbindex++] = ch; + tokbuf[tbindex++] = NULLCH; + ntok++; + p++; + continue; + + case SH_GREATER: toktyp[ntok] = SH_TOK_GREATER; + tokbuf[tbindex++] = ch; + tokbuf[tbindex++] = NULLCH; + ntok++; + p++; + continue; + + default: toktyp[ntok] = SH_TOK_OTHER; + }; + + /* Handle quoted string (single or double quote) */ + + if ( (ch==SH_SQUOTE) || (ch==SH_DQUOTE) ) { + quote = ch; /* remember opening quote */ + + /* Copy quoted string to arg area */ + + p++; /* Move past starting quote */ + + while ( ((ch=*p++) != quote) && (ch != SH_NEWLINE) + && (ch != NULLCH) ) { + tokbuf[tbindex++] = ch; + } + if (ch != quote) { /* string missing end quote */ + return SYSERR; + } + + /* Finished string - count token and go on */ + + tokbuf[tbindex++] = NULLCH; /* terminate token */ + ntok++; /* count string as one token */ + continue; /* go to next token */ + } + + /* Handle a token other than a quoted string */ + + tokbuf[tbindex++] = ch; /* put first character in buffer*/ + p++; + + while ( ((ch = *p) != SH_NEWLINE) && (ch != NULLCH) + && (ch != SH_LESS) && (ch != SH_GREATER) + && (ch != SH_BLANK) && (ch != SH_TAB) + && (ch != SH_AMPER) && (ch != SH_SQUOTE) + && (ch != SH_DQUOTE) ) { + tokbuf[tbindex++] = ch; + p++; + } + + /* Report error if other token is appended */ + + if ( (ch == SH_SQUOTE) || (ch == SH_DQUOTE) + || (ch == SH_LESS) || (ch == SH_GREATER) ) { + return SYSERR; + } + + tokbuf[tbindex++] = NULLCH; /* terminate the token */ + + ntok++; /* count valid token */ + + } + *tlen = tbindex; + return ntok; +} diff --git a/shell.orig/shell.c b/shell.orig/shell.c new file mode 100644 index 0000000..c04620b --- /dev/null +++ b/shell.orig/shell.c @@ -0,0 +1,303 @@ +/* shell.c - shell */ + +#include +//#include +#include "shprototypes.h" + +/************************************************************************/ +/* Table of Xinu shell commands and the function associated with each */ +/************************************************************************/ +const struct cmdent cmdtab[] = { + {"argecho", TRUE, xsh_argecho}, + {"cat", FALSE, xsh_cat}, + {"clear", TRUE, xsh_clear}, + {"date", FALSE, xsh_date}, + {"devdump", FALSE, xsh_devdump}, + {"echo", FALSE, xsh_echo}, + {"exit", TRUE, xsh_exit}, + {"help", FALSE, xsh_help}, + {"kill", TRUE, xsh_kill}, + {"memdump", FALSE, xsh_memdump}, + {"memstat", TRUE, xsh_memstat}, /* Make built-in */ + {"ps", FALSE, xsh_ps}, + {"sleep", FALSE, xsh_sleep}, + {"uptime", FALSE, xsh_uptime}, + {"?", FALSE, xsh_help} + +}; + +uint32 ncmd = sizeof(cmdtab) / sizeof(struct cmdent); + +/************************************************************************/ +/* shell - Provide an interactive user interface that executes */ +/* commands. Each command begins with a command name, has */ +/* a set of optional arguments, has optional input or */ +/* output redirection, and an optional specification for */ +/* background execution (ampersand). The syntax is: */ +/* */ +/* command_name [args*] [redirection] [&] */ +/* */ +/* Redirection is either or both of: */ +/* */ +/* < input_file */ +/* or */ +/* > output_file */ +/* */ +/************************************************************************/ + +process shell ( + did32 dev /* ID of tty device from which */ + ) /* to accept commands */ +{ + char buf[SHELL_BUFLEN]; /* Input line (large enough for */ + int32 len; /* Length of line read */ + char tokbuf[SHELL_BUFLEN + /* Buffer to hold a set of */ + SHELL_MAXTOK]; /* Contiguous null-terminated */ + int32 tlen; /* Current length of all data */ + /* in array tokbuf */ + int32 tok[SHELL_MAXTOK]; /* Index of each token in */ + int32 toktyp[SHELL_MAXTOK]; /* Type of each token in tokbuf */ + int32 ntok; /* Number of tokens on line */ + pid32 child; /* Process ID of spawned child */ + bool8 backgnd; /* Run command in background? */ + char *outname, *inname; /* Pointers to strings for file */ + /* names that follow > and < */ + did32 stdinput, stdoutput; /* Descriptors for redirected */ + /* input and output */ + int32 i; /* Index into array of tokens */ + int32 j; /* Index into array of commands */ + int32 msg; /* Message from receive() for */ + /* child termination */ + int32 tmparg; /* Address of this var is used */ + /* when first creating child */ + /* process, but is replaced */ + char *src, *cmp; /* Pointers used during name */ + /* comparison */ + bool8 diff; /* Was difference found during */ + char *args[SHELL_MAXTOK]; /* Argument vector passed to */ + /* builtin commands */ + + /* Print shell banner and startup message */ + + fprintf(dev, "\n\n%s%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", + SHELL_BAN0,SHELL_BAN1,SHELL_BAN2,SHELL_BAN3,SHELL_BAN4, + SHELL_BAN5,SHELL_BAN6,SHELL_BAN7,SHELL_BAN8,SHELL_BAN9,SHELL_BAN10); + + fprintf(dev, "%s\n\n", SHELL_STRTMSG); + + /* Continually prompt the user, read input, and execute command */ + + + while (TRUE) { + + /* Display prompt */ + fprintf(dev, SHELL_PROMPT); + + + len = read(dev, buf, sizeof(buf)); + + /* Exit gracefully on end-of-file */ + + if (len == EOF) { + break; + } + + /* If line contains only NEWLINE, go to next line */ + + if (len <= 1) { + continue; + } + + buf[len] = SH_NEWLINE; /* terminate line */ + + /* Parse input line and divide into tokens */ + + ntok = lexan(buf, len, tokbuf, &tlen, tok, toktyp); + + /* Handle parsing error */ + + if (ntok == SYSERR) { + fprintf(dev,"%s\n", SHELL_SYNERRMSG); + continue; + } + + /* If line is empty, go to next input line */ + + if (ntok == 0) { + fprintf(dev, "\n"); + continue; + } + + /* If last token is '&', set background */ + + if (toktyp[ntok-1] == SH_TOK_AMPER) { + ntok-- ; + tlen-= 2; + backgnd = TRUE; + } else { + backgnd = FALSE; + } + + + /* Check for input/output redirection (default is none) */ + + outname = inname = NULL; + if ( (ntok >=3) && ( (toktyp[ntok-2] == SH_TOK_LESS) + ||(toktyp[ntok-2] == SH_TOK_GREATER))){ + if (toktyp[ntok-1] != SH_TOK_OTHER) { + fprintf(dev,"%s\n", SHELL_SYNERRMSG); + continue; + } + if (toktyp[ntok-2] == SH_TOK_LESS) { + inname = &tokbuf[tok[ntok-1]]; + } else { + outname = &tokbuf[tok[ntok-1]]; + } + ntok -= 2; + tlen = tok[ntok]; + } + + + if ( (ntok >=3) && ( (toktyp[ntok-2] == SH_TOK_LESS) + ||(toktyp[ntok-2] == SH_TOK_GREATER))){ + if (toktyp[ntok-1] != SH_TOK_OTHER) { + fprintf(dev,"%s\n", SHELL_SYNERRMSG); + continue; + } + if (toktyp[ntok-2] == SH_TOK_LESS) { + if (inname != NULL) { + fprintf(dev,"%s\n", SHELL_SYNERRMSG); + continue; + } + inname = &tokbuf[tok[ntok-1]]; + } else { + if (outname != NULL) { + fprintf(dev,"%s\n", SHELL_SYNERRMSG); + continue; + } + outname = &tokbuf[tok[ntok-1]]; + } + ntok -= 2; + tlen = tok[ntok]; + } + + /* Verify remaining tokens are type "other" */ + + for (i=0; i= ncmd) { + fprintf(dev, "command %s not found\n", tokbuf); + continue; + } + + /* Handle built-in command */ + + if (cmdtab[j].cbuiltin) { /* No background or redirect. */ + if (inname != NULL || outname != NULL || backgnd){ + fprintf(dev, SHELL_BGERRMSG); + continue; + } else { + /* Set up arg vector for call */ + + for (i=0; i +#include + +/*------------------------------------------------------------------------ + * xhs_argecho - display argecho message that lists shell commands + *------------------------------------------------------------------------ + */ +shellcmd xsh_argecho(int nargs, char *args[]) +{ + int32 i; + + printf("\n\nThe %d arguments are:\n", nargs); + for (i = 0; i < nargs; i++) { + printf(" %2d: %s\n", i, args[i]); + } + printf("\n"); + + return 0; +} diff --git a/shell.orig/xsh_cat.c b/shell.orig/xsh_cat.c new file mode 100644 index 0000000..13b3af1 --- /dev/null +++ b/shell.orig/xsh_cat.c @@ -0,0 +1,59 @@ +/* xsh_cat.c - xsh_cat */ + +#include +#include +#include + +/*------------------------------------------------------------------------ + * xsh_cat - shell command to cat one or more files + *------------------------------------------------------------------------ + */ +shellcmd xsh_cat(int nargs, char *args[]) +{ + int32 i; /* index into proctabl */ + int32 nextch; /* character read from file */ + did32 descr; /* descriptor for a file */ + char *argptr; /* pointer to next arg string */ + + + /* For argument '--help', emit help about the 'cat' command */ + + if (nargs == 2 && strncmp(args[1], "--help", 7) == 0) { + printf("Use: %s [file...]\n\n", args[0]); + printf("Description:\n"); + printf("\twrites contents of files or stdin to stdout\n"); + printf("Options:\n"); + printf("\tfile...\tzero or more file names\n"); + printf("\t--help\t display this help and exit\n"); + return 0; + } + + if (nargs == 1) { + nextch = getc(stdin); + while (nextch != EOF) { + putc(stdout, nextch); + nextch = getc(stdin); + } + return 0; + } + for (i = 1; i < nargs; i++) { + argptr = args[i]; + if ( (argptr[0] == '-') && (argptr[1] == NULLCH) ) { + descr = stdin; + } else { + descr = open(NAMESPACE, argptr, "ro"); + if (descr == (did32)SYSERR) { + fprintf(stderr, "%s: cannot open file %s\n", + args[0], argptr); + return 1; + } + } + nextch = getc(descr); + while (nextch != EOF) { + putc(stdout, nextch); + nextch = getc(descr); + } + close(descr); + } + return 0; +} diff --git a/shell.orig/xsh_clear.c b/shell.orig/xsh_clear.c new file mode 100644 index 0000000..a9442da --- /dev/null +++ b/shell.orig/xsh_clear.c @@ -0,0 +1,22 @@ +/* xsh_clear.c - xsh_clear */ + +#include +#include + +/*------------------------------------------------------------------------ + * xsh_clear - clear the display window (assumes xterm / VT100) + *------------------------------------------------------------------------ + */ +shellcmd xsh_clear(int nargs, char *args[]) +{ + + /* Insure no arguments were passed */ + + if (nargs > 1) { + fprintf(stderr,"use is: %s\n", args[0]); + return 1; + } + + printf("\033[0m\033[2J\033[H\n"); + return 0; +} diff --git a/shell.orig/xsh_date.c b/shell.orig/xsh_date.c new file mode 100644 index 0000000..2f27822 --- /dev/null +++ b/shell.orig/xsh_date.c @@ -0,0 +1,69 @@ +/* xsh_date.c - xsh_date */ + +#include +#include +#include + +/*------------------------------------------------------------------------ + * xsh_date - obtain and print the current month, day, year, and time + *------------------------------------------------------------------------ + */ +shellcmd xsh_date(int nargs, char *args[]) { + + int32 retval; /* return value */ + uint32 now; /* current local time */ + char datestr[64]; /* printable date in ascii */ + + /* Output info for '--help' argument */ + + if (nargs == 2 && strncmp(args[1], "--help", 7) == 0) { + printf("Usage: %s\n\n", args[0]); + printf("Description:\n"); + printf("\tDisplays the current date and time\n"); + printf("Options (one per invocation):\n"); + printf("\t-f\tforce a time server request to be sent\n"); + printf("\t-d\tset daylight savings time on\n"); + printf("\t-s\tset standard time (not daylight savings)\n"); + printf("\t-a\tset daylight savings to automatic\n"); + printf("\t--help\tdisplay this help and exit\n"); + return 0; + } + + /* Check argument count */ + + if (nargs > 2) { + fprintf(stderr, "%s: too many arguments\n", args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return 1; + } + + if (nargs == 2) { + if (strncmp(args[1], "-f", 3) == 0) { + Date.dt_bootvalid = FALSE; + } else if (strncmp(args[1], "-d", 3) == 0) { + Date.dt_daylight = DATE_DST_ON; + } else if (strncmp(args[1], "-s", 3) == 0) { + Date.dt_daylight = DATE_DST_OFF; + } else if (strncmp(args[1], "-a", 3) == 0) { + Date.dt_daylight = DATE_DST_AUTO; + } else { + fprintf(stderr, "%s: invalid argument\n", args[0]); + fprintf(stderr, + "Try '%s --help' for more information\n", + args[0]); + return 1; + } + } + + retval = gettime(&now); + if (retval == SYSERR) { + fprintf(stderr, + "%s: could not obtain the current date\n", + args[0]); + return 1; + } + ascdate(now, datestr); + printf("%s\n", datestr); + return 0; +} diff --git a/shell.orig/xsh_devdump.c b/shell.orig/xsh_devdump.c new file mode 100644 index 0000000..1e41454 --- /dev/null +++ b/shell.orig/xsh_devdump.c @@ -0,0 +1,36 @@ +/* xsh_devdump.c - xsh_devdump */ + +#include +#include + +/*------------------------------------------------------------------------ + * xsh_devdump - shell command to print info from the device switch table + *------------------------------------------------------------------------ + */ +shellcmd xsh_devdump ( + int nargs, /* number of arguments */ + char *args[] /* list of arguments */ + ) +{ + struct dentry *devptr; /* pointer to device entry */ + int32 i; /* walks through device table */ + + /* No arguments are expected */ + + if (nargs > 1) { + fprintf(stderr, "No arguments allowed\n"); + return 1; + } + + /* Walk through device table */ + + printf("Device Name Minor\n"); + printf("------ ------------ -----\n"); + + for (i = 0; i < NDEVS; i++) { + devptr = &devtab[i]; + printf("%4d %-12s %3d\n", i, devptr->dvname, + devptr->dvminor); + } + return 0; +} diff --git a/shell.orig/xsh_echo.c b/shell.orig/xsh_echo.c new file mode 100644 index 0000000..393c81a --- /dev/null +++ b/shell.orig/xsh_echo.c @@ -0,0 +1,24 @@ +/* xsh_echo.c - xsh_echo */ + +#include +#include + +/*------------------------------------------------------------------------ + * xhs_echo - write argument strings to stdout + *------------------------------------------------------------------------ + */ +shellcmd xsh_echo(int nargs, char *args[]) +{ + int32 i; /* walks through args array */ + + if (nargs > 1) { + printf("%s", args[1]); + + for (i = 2; i < nargs; i++) { + printf(" %s", args[i]); + } + } + printf("\n"); + + return 0; +} diff --git a/shell.orig/xsh_exit.c b/shell.orig/xsh_exit.c new file mode 100644 index 0000000..a4a77cd --- /dev/null +++ b/shell.orig/xsh_exit.c @@ -0,0 +1,13 @@ +/* xsh_exit.c - xshexit */ + +#include + +/*------------------------------------------------------------------------ + * xsh_exit - shell command returns the exit code causing shell exit + *------------------------------------------------------------------------ + */ + +shellcmd xsh_exit(int nargs, char *args[]) +{ + return SHELL_EXIT; +} diff --git a/shell.orig/xsh_help.c b/shell.orig/xsh_help.c new file mode 100644 index 0000000..0ebfece --- /dev/null +++ b/shell.orig/xsh_help.c @@ -0,0 +1,124 @@ +/* xsh_help.c - xsh_help */ + +#include +#include +#include + +/*------------------------------------------------------------------------ + * xhs_help - display help message that lists shell commands + *------------------------------------------------------------------------ + */ +shellcmd xsh_help(int nargs, char *args[]) +{ + int32 i; + char *argv[2]; /* argument vector for call */ + char *src, *cmp; /* used for string compare */ + int32 len; /* length of a command name */ + int32 maxlen; /* maximum length of all */ + /* command names */ + int32 cols; /* number of columns in the */ + /* formatted command list */ + int32 spac; /* space per column in the */ + /* formatted command list */ + int32 lines; /* total lines of output in the */ + /* formatted command list */ + int32 j; /* index of commands across one */ + /* line of formatted output */ + + /* For argument '--help', emit help about the 'help' command */ + + if (nargs == 2 && strncmp(args[1], "--help", 7) == 0) { + + printf("Use:\n"); + printf("\t%s [command]\n", args[0]); + printf("Description:\n"); + printf("\tProvides a list of shell commands or\n"); + printf("\thelp information for a specific command\n"); + printf("Options:\n"); + printf("\tcommand\tspecific command for which to\n"); + printf("\t\tdisplay help information\n"); + printf("\t--help\tdisplay this help and exit\n"); + return 0; + } + + /* Check for valid number of arguments */ + + if (nargs > 2) { + fprintf(stderr, "%s: too many arguments\n", args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return 1; + } + + /* Output help for specific command given as an argument */ + + if (nargs == 2) { + for (i = 0; i < ncmd; i++) { + src = cmdtab[i].cname; + cmp = args[1]; + while (*src != NULLCH) { + if (*src != *cmp) { + break; + } + src++; + cmp++; + } + if ( (*src != NULLCH) || (*cmp != NULLCH) ) { + continue; + } + + /* prepare args for shell command */ + + argv[0] = args[1]; + argv[1] = "--help"; + (*cmdtab[i].cfunc) (2, argv); + return 0; + } + printf("%s: no such command as '%s'\n", args[0], args[1]); + return 1; + } + + /* No arguments -- print a list of shell commands */ + + printf("\nshell commands are:\n\n"); + + /* Calculate the maximum length of a command name */ + + maxlen = 0; + for (i = 0; i < ncmd; i++) { + len = strnlen(cmdtab[i].cname, 80); + if (len > maxlen) { + maxlen = len; + } + } + + /* Calculate the number of command names per line */ + + cols = 80/(maxlen+1); + if (cols > 6) { + cols = 6; + } + + /* Calculate the width of a column */ + + spac = 80/cols; + + /* Calculate the number of lines of output */ + + lines = (ncmd+(cols-1))/cols; + + /* print the lines of command names */ + + for (i=0; i +#include +#include + +/*------------------------------------------------------------------------ + * xsh_kill - obtain and print the current month, day, year, and time + *------------------------------------------------------------------------ + */ +shellcmd xsh_kill(int nargs, char *args[]) { + + int32 retval; /* return value */ + pid32 pid; /* ID of process to kill */ + char ch; /* next character of argument */ + char *chptr; /* walks along argument string */ + + /* Output info for '--help' argument */ + + if (nargs == 2 && strncmp(args[1], "--help", 7) == 0) { + printf("Usage: %s PID\n\n", args[0]); + printf("Description:\n"); + printf("\tterminates a process\n"); + printf("Options:\n"); + printf("\tPID \tthe ID of a process to terminate\n"); + printf("\t--help\tdisplay this help and exit\n"); + return OK; + } + + /* Check argument count */ + + if (nargs != 2) { + fprintf(stderr, "%s: incorrect argument\n", args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return SYSERR; + } + + /* compute process ID from argument string */ + + chptr = args[1]; + ch = *chptr++; + pid = 0; + while(ch != NULLCH) { + if ( (ch < '0') || (ch > '9') ) { + fprintf(stderr, "%s: non-digit in process ID\n", + args[0]); + return 1; + } + pid = 10*pid + (ch - '0'); + ch = *chptr++; + } + if (pid == 0) { + fprintf(stderr, "%s: cannot kill the null process\n", + args[0]); + return 1; + } + + retval = kill(pid); + if (retval == SYSERR) { + fprintf(stderr, "%s: cannot kill process %d\n", + args[0], pid); + return 1; + } + return 0; +} diff --git a/shell.orig/xsh_memdump.c b/shell.orig/xsh_memdump.c new file mode 100644 index 0000000..96a0787 --- /dev/null +++ b/shell.orig/xsh_memdump.c @@ -0,0 +1,165 @@ +/* xsh_memdump.c - xsh_memdump */ + +#include +#include +#include + +static uint32 parseval(char *); +extern uint32 start; + +/*------------------------------------------------------------------------ + * xsh_memdump - dump a region of memory by displaying values in hex + * and ascii + *------------------------------------------------------------------------ + */ +shellcmd xsh_memdump(int nargs, char *args[]) +{ + bool8 force = FALSE; /* ignore address sanity checks */ + uint32 begin; /* begining address */ + uint32 stop; /* last address to dump */ + uint32 length; /* length of region to dump */ + int32 arg; /* index into args array */ + uint32 l; /* counts length during dump */ + int32 i; /* counts words during dump */ + uint32 *addr; /* address to dump */ + char *chptr; /* character address to dump */ + char ch; /* next character to print */ + + /* For argument '--help', emit help about the 'memdump' command */ + + if (nargs == 2 && strncmp(args[1], "--help", 7) == 0) { + printf("Use: %s [-f] Address Length\n\n", args[0]); + printf("Description:\n"); + printf("\tDumps Length bytes of memory begining at the\n"); + printf("\tspecified starting address (both the address\n"); + printf("\tand length can be specified in decimal or hex)\n"); + printf("Options:\n"); + printf("\t-f ignore sanity checks for addresses\n"); + printf("\tAddress memory address at which to start\n"); + printf("\tLength the number of bytes to dump\n"); + printf("\t--help display this help and exit\n"); + return 0; + } + + /* Check for valid number of arguments */ + + if (nargs < 3 || nargs > 4) { + fprintf(stderr, "%s: incorrect number of arguments\n", + args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return 1; + } + + arg = 1; + if (strncmp(args[arg], "-f", 2) == 0) { + force = TRUE; + arg++; + nargs --; + } + + if (nargs != 3) { + fprintf(stderr, "%s: too few arguments\n", args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return 1; + } + + if ( (begin=parseval(args[arg])) == 0 ) { + fprintf(stderr, "%s: invalid begining address\n", + args[0]); + return 1; + } + if ( (length =parseval(args[arg+1])) == 0 ) { + fprintf(stderr, "%s: invalid length address\n", + args[0]); + return 1; + } + + /* Round begining address down to multiple of four and round */ + /* length up to a multiple of four */ + + begin &= ~0x3; + length = (length + 3) & ~0x3; + + /* Add length to begin address */ + + stop = begin + length; + + /* verify that the address and length are reasonable */ + + if ( force || ( (begin >= (uint32)&start) && (stop > begin) && + (((void *)stop) < maxheap)) ) { + + /* values are valid; perform dump */ + + chptr = (char *)begin; + for (l=0; l= 0x20) && (ch <= 0x7e) ) { + printf("%c",ch); + } else { + printf("."); + } + } + printf("*\n"); + begin += 16; + } + return 0; + } else { + printf("Values are out of range; use -f to force\n"); + } + return 1; +} + +/*------------------------------------------------------------------------ + * parse - parse an argument that is either a decimal or hex value + *------------------------------------------------------------------------ + */ +static uint32 parseval( + char *string /* argument string to parse */ + ) +{ + uint32 value; /* value to return */ + char ch; /* next character */ + + + value = 0; + + /* argument string must consists of decimal digits or */ + /* 0x followed by hex digits */ + + ch = *string++; + if (ch == '0') { /* hexadecimal */ + if (*string++ != 'x') { + return 0; + } + for (ch = *string++; ch != NULLCH; ch = *string++) { + if ((ch >= '0') && (ch <= '9') ) { + value = 16*value + (ch - '0'); + } else if ((ch >= 'a') && (ch <= 'f') ) { + value = 16*value + 10 + (ch - 'a'); + } else if ((ch >= 'A') && (ch <= 'F') ) { + value = 16*value + 10 + (ch - 'A'); + } else { + return 0; + } + } + } else { /* decimal */ + while (ch != NULLCH) { + if ( (ch < '0') || (ch > '9') ) { + return 0; + } + value = 10*value + (ch - '0'); + ch = *string++; + } + } + return value; +} diff --git a/shell.orig/xsh_memstat.c b/shell.orig/xsh_memstat.c new file mode 100644 index 0000000..1648c21 --- /dev/null +++ b/shell.orig/xsh_memstat.c @@ -0,0 +1,115 @@ +/* xsh_memstat.c - xsh_memstat */ + +#include +#include +#include + +static void printMemUse(void); +static void printFreeList(void); + +/*------------------------------------------------------------------------ + * xsh_memstat - Print statistics about memory use and dump the free list + *------------------------------------------------------------------------ + */ +shellcmd xsh_memstat(int nargs, char *args[]) +{ + + /* For argument '--help', emit help about the 'memstat' command */ + + if (nargs == 2 && strncmp(args[1], "--help", 7) == 0) { + printf("use: %s \n\n", args[0]); + printf("Description:\n"); + printf("\tDisplays the current memory use and prints the\n"); + printf("\tfree list.\n"); + printf("Options:\n"); + printf("\t--help\t\tdisplay this help and exit\n"); + return 0; + } + + /* Check for valid number of arguments */ + + if (nargs > 1) { + fprintf(stderr, "%s: too many arguments\n", args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return 1; + } + + printMemUse(); + printFreeList(); + + return 0; +} + + +/*------------------------------------------------------------------------ + * printFreeList - Walk the list of free memory blocks and print the + * location and size of each + *------------------------------------------------------------------------ + */ +static void printFreeList(void) +{ + struct memblk *block; + + /* Output a heading for the free list */ + + printf("Free List:\n"); + printf("Block address Length (dec) Length (hex)\n"); + printf("------------- ------------ ------------\n"); + + for (block = memlist.mnext; block != NULL; block = block->mnext) { + printf(" 0x%08x %9d 0x%08x\n", block, + block->mlength, block->mlength); + } + printf("\n"); +} + +extern void start(void); +extern void *_end; + +/*------------------------------------------------------------------------ + * printMemUse - Print statistics about memory use + *------------------------------------------------------------------------ + */ +static void printMemUse(void) +{ + int i; /* Index into process table */ + uint32 code = 0; /* Total Xinu code memory */ + uint32 stack = 0; /* Total used stack memory */ + uint32 mspstack = HANDLERSTACK; /* Total used handler stack mem */ + uint32 kheap = 0; /* Free kernel heap memory */ + uint32 kfree = 0; /* Total free memory */ + struct memblk *block; /* Ptr to memory block */ + + /* Calculate amount of text memory */ + + code = (uint32)&etext - (uint32)&text; + + /* Calculate amount of allocated stack memory */ + /* Skip the NULL process since it has a private stack */ + + for (i = 0; i < NPROC; i++) { + if (proctab[i].prstate != PR_FREE) { + stack += (uint32)proctab[i].prstklen; + } + } + + /* Calculate the amount of memory on the free list */ + + for (block = memlist.mnext; block != NULL; block = block->mnext) { + kfree += block->mlength; + } + + /* Calculate the amount of free kernel heap memory */ + + kheap = kfree - stack; + + /* Output statistics on current memory use */ + + printf("Current system memory statistics:\n"); + printf("---------------------------------\n"); + printf("%10d bytes (0x%08x) of Xinu code\n", code, code); + printf("%10d bytes (0x%08x) of allocated stack space\n", stack, stack); + printf("%10d bytes (0x%08x) of allocated kernel stack space\n", mspstack, mspstack); + printf("%10d bytes (0x%08x) of available kernel heap space\n\n", kheap, kheap); +} diff --git a/shell.orig/xsh_ps.c b/shell.orig/xsh_ps.c new file mode 100644 index 0000000..5083e86 --- /dev/null +++ b/shell.orig/xsh_ps.c @@ -0,0 +1,69 @@ +/* xsh_ps.c - xsh_ps */ + +#include +#include +#include + +/*------------------------------------------------------------------------ + * xsh_ps - shell command to print the process table + *------------------------------------------------------------------------ + */ +shellcmd xsh_ps(int nargs, char *args[]) +{ + +// uint32 * linkreg; +// asm volatile ("mov %0, lr" : : "r" (linkreg)); +// kprintf("LINK REG: %x\n", linkreg); + + struct procent *prptr; /* pointer to process */ + int32 i; /* index into proctabl */ + char *pstate[] = { /* names for process states */ + "free ", "curr ", "ready", "recv ", "sleep", "susp ", + "wait ", "rtime"}; + + /* For argument '--help', emit help about the 'ps' command */ + + + if (nargs == 2 && strncmp(args[1], "--help", 7) == 0) { + printf("Use: %s\n\n", args[0]); + printf("Description:\n"); + printf("\tDisplays information about running processes\n"); + printf("Options:\n"); + printf("\t--help\t display this help and exit\n"); + return 0; + } + + /* Check for valid number of arguments */ + + if (nargs > 1) { + fprintf(stderr, "%s: too many arguments\n", args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return 1; + } + + /* Print header for items from the process table */ + + printf("%3s %-16s %5s %4s %4s %10s %-10s %10s\n", + "Pid", "Name", "State", "Prio", "Ppid", "Stack Base", + "Stack Ptr", "Stack Size"); + + printf("%3s %-16s %5s %4s %4s %10s %-10s %10s\n", + "---", "----------------", "-----", "----", "----", + "----------", "----------", "----------"); + + /* Output information for each process */ + + for (i = 0; i < NPROC; i++) { + prptr = &proctab[i]; + if (prptr->prstate == PR_FREE) { /* skip unused slots */ + continue; + } + printf("%3d %-16s %s %4d %4d 0x%08X 0x%08X %8d\n", + i, prptr->prname, pstate[(int)prptr->prstate], + prptr->prprio, prptr->prparent, prptr->prstkbase, + prptr->prstkptr, prptr->prstklen); + } + + return 0; +} diff --git a/shell.orig/xsh_rdstest.c b/shell.orig/xsh_rdstest.c new file mode 100644 index 0000000..949e2e9 --- /dev/null +++ b/shell.orig/xsh_rdstest.c @@ -0,0 +1,118 @@ +/* xsh_rdstest.c - xsh_rdstest */ +#include +#include + +/*------------------------------------------------------------------------ + * xsh_rdstest - shell to print the time the system has been up + *------------------------------------------------------------------------ + */ +shellcmd xsh_rdstest(int nargs, char *args[]) +{ + bool8 err; + int32 retval; + int32 i, j; + char dskname[] = "TestDisk"; + + char buff[2048]; + char buff2[2048]; + + retval = open(RDISK,dskname,"rw"); + + if (retval < 0) { + kprintf("xsh_rdstest: open %s returns %s, stopping\r\n", + dskname, retval==SYSERR?"SYSERR":"TIMEOUT"); + close( RDISK ); + return 1; + } else { + kprintf("xsh_rdstest: open %s returns %d\r\n", + dskname, retval); + } + + kprintf("writing eight blocks to the disk\r\n"); + for (i=7; i>=0; i--) { + memset(buff, (char)(i&0xff), RD_BLKSIZ); + kprintf("\n\r*** writing block %d\n\r",i); + retval = write(RDISK, buff, i); + if (retval < 0) { + kprintf("write to block %d returns %d\r\n", i, retval); + } + } + kprintf("reading block 1\n\r"); + retval = read(RDISK, buff, 1); + kprintf("read from block 1 has return value %d\r\n", retval); + + err = 0; + for (i=0; i +#include +#include + +/*------------------------------------------------------------------------ + * xsh_sleep - Shell command to delay for a specified number of seconds + *------------------------------------------------------------------------ + */ +shellcmd xsh_sleep(int nargs, char *args[]) +{ + int32 delay; /* Delay in seconds */ + char *chptr; /* Walks through argument */ + char ch; /* Next character of argument */ + + /* For argument '--help', emit help about the 'sleep' command */ + + if (nargs == 2 && strncmp(args[1], "--help", 7) == 0) { + printf("Use: %s\n\n", args[0]); + printf("Description:\n"); + printf("\tDelay for a specified number of seconds\n"); + printf("Options:\n"); + printf("\t--help\t display this help and exit\n"); + return 0; + } + + /* Check for valid number of arguments */ + + if (nargs > 2) { + fprintf(stderr, "%s: too many arguments\n", args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return 1; + } + + if (nargs != 2) { + fprintf(stderr, "%s: argument in error\n", args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return 1; + } + + chptr = args[1]; + ch = *chptr++; + delay = 0; + while (ch != NULLCH) { + if ( (ch < '0') || (ch > '9') ) { + fprintf(stderr, "%s: nondigit in argument\n", + args[0]); + return 1; + } + delay = 10*delay + (ch - '0'); + ch = *chptr++; + } + sleep(delay); + return 0; +} diff --git a/shell.orig/xsh_uptime.c b/shell.orig/xsh_uptime.c new file mode 100644 index 0000000..f691064 --- /dev/null +++ b/shell.orig/xsh_uptime.c @@ -0,0 +1,76 @@ +/* xsh_uptime.c - xsh_uptime */ + +#include +#include +#include + +/*------------------------------------------------------------------------ + * xsh_uptime - shell to print the time the system has been up + *------------------------------------------------------------------------ + */ +shellcmd xsh_uptime(int nargs, char *args[]) +{ + + uint32 days, hrs, mins, secs; /* days, hours, minutes, and */ + /* seconds since system boot */ + uint32 secperday = 86400; /* seconds in a day */ + uint32 secperhr = 3600; /* seconds in an hour */ + uint32 secpermin = 60; /* seconds in a minute */ + + /* For argument '--help', emit help about the 'uptime' command */ + + if (nargs == 2 && strncmp(args[1], "--help", 7) == 0) { + printf("Use: %s\n\n", args[0]); + printf("Description:\n"); + printf("\tDisplays time since the system booted\n"); + printf("Options:\n"); + printf("\t--help\t display this help and exit\n"); + return 0; + } + + /* Check for valid number of arguments */ + + if (nargs > 1) { + fprintf(stderr, "%s: too many arguments\n", args[0]); + fprintf(stderr, "Try '%s --help' for more information\n", + args[0]); + return 1; + } + + secs = clktime; /* total seconds since boot */ + + /* subtract number of whole days */ + + days = secs/secperday; + secs -= days*secperday; + + /* subtract number of hours */ + + hrs = secs/secperhr; + secs -= hrs*secperhr; + + /* subtract number of minutes */ + + mins = secs/secpermin; + secs -= mins*secpermin; + + printf("Xinu has been up "); + if (days > 0) { + printf(" %d day(s) ", days); + } + + if (hrs > 0) { + printf(" %d hour(s) ", hrs); + } + + if (mins > 0) { + printf(" %d minute(s) ", mins); + } + + if (secs > 0) { + printf(" %d second(s) ", secs); + } + printf("\n"); + + return 0; +} diff --git a/shell/addargs.c b/shell/addargs.c new file mode 100644 index 0000000..ba3b7f1 --- /dev/null +++ b/shell/addargs.c @@ -0,0 +1,93 @@ +/* addargs.c - addargs */ + +#include +#include "shprototypes.h" + +/*------------------------------------------------------------------------ + * addargs - Add local copy of argv-style arguments to the stack of + * a command process that has been created by the shell + *------------------------------------------------------------------------ + */ +status addargs( + pid32 pid, /* ID of process to use */ + int32 ntok, /* Count of arguments */ + int32 tok[], /* Index of tokens in tokbuf */ + int32 tlen, /* Length of data in tokbuf */ + char *tokbuf, /* Array of null-term. tokens */ + void *dummy /* Dummy argument that was */ + /* used at creation and must */ + /* be replaced by a pointer */ + /* to an argument vector */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process' table entry */ + uint32 aloc; /* Argument location in process */ + /* stack as an integer */ + uint32 *argloc; /* Location in process's stack */ + /* to place args vector */ + char *argstr; /* Location in process's stack */ + /* to place arg strings */ + uint32 *search; /* pointer that searches for */ + /* dummy argument on stack */ + uint32 *aptr; /* Walks through args array */ + int32 i; /* Index into tok array */ + + mask = disable(); + + /* Check argument count and data length */ + + if ( (ntok <= 0) || (tlen < 0) ) { + restore(mask); + return SYSERR; + } + + prptr = &proctab[pid]; + + /* Compute lowest location in the process stack where the */ + /* args array will be stored followed by the argument */ + /* strings */ + + aloc = (uint32) (prptr->prstkbase + - prptr->prstklen + sizeof(uint32)); + argloc = (uint32*) ((aloc + 3) & ~0x3); /* round multiple of 4 */ + + /* Compute the first location beyond args array for the strings */ + + argstr = (char *) (argloc + (ntok+1)); /* +1 for a null ptr */ + + /* Set each location in the args vector to be the address of */ + /* string area plus the offset of this argument */ + + for (aptr=argloc, i=0; i < ntok; i++) { + *aptr++ = (uint32) (argstr + tok[i]); + } + + /* Add a null pointer to the args array */ + + *aptr++ = (uint32)NULL; + + /* Copy the argument strings from tokbuf into process's stack */ + /* just beyond the args vector */ + + memcpy(aptr, tokbuf, tlen); + + /* Find the second argument in process's stack */ + + for (search = (uint32 *)prptr->prstkptr; + search < (uint32 *)prptr->prstkbase; search++) { + + /* If found, replace with the address of the args vector*/ + + if (*search == (uint32)dummy) { + *search = (uint32)argloc; + restore(mask); + return OK; + } + } + + /* Argument value not found on the stack - report an error */ + + restore(mask); + return SYSERR; +} diff --git a/shell/lexan.c b/shell/lexan.c new file mode 100644 index 0000000..4e0cb8b --- /dev/null +++ b/shell/lexan.c @@ -0,0 +1,148 @@ +/* lexan.c - lexan */ + +#include + +/*------------------------------------------------------------------------ + * lexan - Ad hoc lexical analyzer to divide command line into tokens + *------------------------------------------------------------------------ + */ + +int32 lexan ( + char *line, /* Input line terminated with */ + /* NEWLINE or NULLCH */ + int32 len, /* Length of the input line, */ + /* including NEWLINE */ + char *tokbuf, /* Buffer into which tokens are */ + /* stored with a null */ + /* following each token */ + int32 *tlen, /* Place to store number of */ + /* chars in tokbuf */ + int32 tok[], /* Array of pointers to the */ + /* start of each token */ + int32 toktyp[] /* Array that gives the type */ + /* of each token */ + ) +{ + char quote; /* Character for quoted string */ + uint32 ntok; /* Number of tokens found */ + char *p; /* Pointer that walks along the */ + /* input line */ + int32 tbindex; /* Index into tokbuf */ + char ch; /* Next char from input line */ + + /* Start at the beginning of the line with no tokens */ + + ntok = 0; + p = line; + tbindex = 0; + + /* While not yet at end of line, get next token */ + + while ( (*p != NULLCH) && (*p != SH_NEWLINE) ) { + + /* If too many tokens, return error */ + + if (ntok >= SHELL_MAXTOK) { + return SYSERR; + } + + /* Skip whitespace before token */ + + while ( (*p == SH_BLANK) || (*p == SH_TAB) ) { + p++; + } + + /* Stop parsing at end of line (or end of string) */ + + ch = *p; + if ( (ch==SH_NEWLINE) || (ch==NULLCH) ) { + *tlen = tbindex; + return ntok; + } + + /* Set next entry in tok array to be an index to the */ + /* current location in the token buffer */ + + tok[ntok] = tbindex; /* the start of the token */ + + /* Set the token type */ + + switch (ch) { + + case SH_AMPER: toktyp[ntok] = SH_TOK_AMPER; + tokbuf[tbindex++] = ch; + tokbuf[tbindex++] = NULLCH; + ntok++; + p++; + continue; + + case SH_LESS: toktyp[ntok] = SH_TOK_LESS; + tokbuf[tbindex++] = ch; + tokbuf[tbindex++] = NULLCH; + ntok++; + p++; + continue; + + case SH_GREATER: toktyp[ntok] = SH_TOK_GREATER; + tokbuf[tbindex++] = ch; + tokbuf[tbindex++] = NULLCH; + ntok++; + p++; + continue; + + default: toktyp[ntok] = SH_TOK_OTHER; + }; + + /* Handle quoted string (single or double quote) */ + + if ( (ch==SH_SQUOTE) || (ch==SH_DQUOTE) ) { + quote = ch; /* remember opening quote */ + + /* Copy quoted string to arg area */ + + p++; /* Move past starting quote */ + + while ( ((ch=*p++) != quote) && (ch != SH_NEWLINE) + && (ch != NULLCH) ) { + tokbuf[tbindex++] = ch; + } + if (ch != quote) { /* string missing end quote */ + return SYSERR; + } + + /* Finished string - count token and go on */ + + tokbuf[tbindex++] = NULLCH; /* terminate token */ + ntok++; /* count string as one token */ + continue; /* go to next token */ + } + + /* Handle a token other than a quoted string */ + + tokbuf[tbindex++] = ch; /* put first character in buffer*/ + p++; + + while ( ((ch = *p) != SH_NEWLINE) && (ch != NULLCH) + && (ch != SH_LESS) && (ch != SH_GREATER) + && (ch != SH_BLANK) && (ch != SH_TAB) + && (ch != SH_AMPER) && (ch != SH_SQUOTE) + && (ch != SH_DQUOTE) ) { + tokbuf[tbindex++] = ch; + p++; + } + + /* Report error if other token is appended */ + + if ( (ch == SH_SQUOTE) || (ch == SH_DQUOTE) + || (ch == SH_LESS) || (ch == SH_GREATER) ) { + return SYSERR; + } + + tokbuf[tbindex++] = NULLCH; /* terminate the token */ + + ntok++; /* count valid token */ + + } + *tlen = tbindex; + return ntok; +} diff --git a/shell/shell.c b/shell/shell.c new file mode 100644 index 0000000..d8788f8 --- /dev/null +++ b/shell/shell.c @@ -0,0 +1,35 @@ +/* shell.c - shell */ + +#include +//#include +#include "shprototypes.h" + +/************************************************************************/ +/* Table of Xinu shell commands and the function associated with each */ +/************************************************************************/ +// RAFA const struct cmdent cmdtab[] = { + +/************************************************************************/ +/* shell - Provide an interactive user interface that executes */ +/* commands. Each command begins with a command name, has */ +/* a set of optional arguments, has optional input or */ +/* output redirection, and an optional specification for */ +/* background execution (ampersand). The syntax is: */ +/* */ +/* command_name [args*] [redirection] [&] */ +/* */ +/* Redirection is either or both of: */ +/* */ +/* < input_file */ +/* or */ +/* > output_file */ +/* */ +/************************************************************************/ + +process shell ( + did32 dev /* ID of tty device from which */ + ) /* to accept commands */ +{ + return OK; +} + diff --git a/system/ascdate.c b/system/ascdate.c new file mode 100644 index 0000000..04ff8c9 --- /dev/null +++ b/system/ascdate.c @@ -0,0 +1,231 @@ +/* ascdate.c - ascdate */ + +#include +#include + +// RAFA struct dateinfo Date = {0, FALSE, DATE_DST_AUTO, +// RAFA {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, +// RAFA {"J", "F", "Mar", "A", "May", "Jun", "Jul", +// RAFA "Au", "S","O","N","D"}, +// RAFA {"S", "M", "T", "W", "Th", "F", "Sa"}}; + + // RAFA {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", +// RAFA "Aug", "Sep","Oct","Nov","Dec"}, +// RAFA {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}}; + +/*------------------------------------------------------------------------ + * ascdate - Format a date in ascii including day, year hours:mins:secs + *------------------------------------------------------------------------ + */ +status ascdate ( + uint32 now, /* Date and time in xinu format */ + char *str /* String ( >= 20 chars long) */ + ) +{ + uint32 tmp; /* Counts remaining seconds */ + /* during computations */ + int32 year, month, day, /* Values for various parts of */ + hour, minute, second; /* the date */ + uint32 days; /* Number of days in a year */ + uint32 leapyrs; /* Number of leap years between */ + /* 1970 and now */ + uint32 shift; /* Number of times the calendar */ + /* shifted by a day */ + uint32 dayofweek; /* Day of the week (0 - 6) */ + /* For DST, day of the week for:*/ + int32 jan1; /* January 1 this year */ + int32 mar1; /* March 1 this year */ + int32 nov1; /* November 1 this year */ + int32 marss; /* Day of second sunday in march*/ + int32 novfs; /* Day of second sunday in march*/ + bool8 dst; /* Should we adjust for DST? */ + int32 i; /* Indexes through months */ + + char *zones[] = {"EST", "CST", "MST", "PST"}; + char *dzones[] = {"EDT", "CDT", "MDT", "PDT"}; + + /* Compute the year (1970-2099) */ + + for (year=1970 ; TRUE ; year++) { + days = isleap(year) ? 366 : 365; + tmp = days * SECPERDY; + if (tmp > now) + break; + now -= tmp; + } + + /* Compute the number of whole days that have already passed */ + /* during the current year (0 through 365) */ + + days = now / SECPERDY; + + /* Compute the month (0-11) */ + + for (month=0 ; month<12 ; month++) { + // RAFA tmp = Date.dt_msize[month] * SECPERDY; + tmp = 1; + if ((month == 1) && isleap(year)) { + tmp += SECPERDY; + } + if (tmp > now) + break; + now -= tmp; + } + + /* Compute the day of month (1-31) */ + + day = (int32)( now/SECPERDY ) + 1; + now %= SECPERDY; + + /* Compute the hour (0-23) */ + + hour = (int32) ( now/SECPERHR ); + now %= SECPERHR; + + /* Compute the minutes (0-59) */ + + minute = now / SECPERMN; + now %= SECPERMN; + + /* Compute the seconds (0-59) */ + second = (int32) now; + + /* Compute the day of the week (0-6) */ + /* */ + /* Note: Jan 1, 1970 was a Thursday (4 on a 0 to 6 range) */ + /* Add one day of the week each full year (365%7 == 1) plus */ + /* one extra day for each leap year */ + + /* Compute number of leap years prior to current year */ + + leapyrs = (year-1969)/4; + + /* Compute shift for all previous years (i.e., day of week of */ + /* Jan 1 of the current year) */ + + shift = 4 + (year - 1970) + leapyrs; + + /* Remember day of the week for Jan 1 this year (for DST) */ + + jan1 = shift % 7; + + /* Add the number of days so far this year */ + + shift += days; + + /* Convert to integer from 0 through 6 */ + + dayofweek = shift % 7; + + /* */ + /* Handle daylight savings time */ + /* */ + /* Date.dt_daylight specifies whether to set it on, off, */ + /* or automatically compute the setting */ + /* */ + + dst = FALSE; + // RAFA if (Date.dt_daylight == DATE_DST_ON) { + // RAFA dst = TRUE; + // RAFA } else if (Date.dt_daylight == DATE_DST_AUTO) { + + /* Automatic DST calculation: DST is on between 2:00 AM */ + /* the second Sunday of March and 2:00 AM the first */ + /* sunday in November */ + + /* Calculate day of the week for March 1 */ + + // RAFA mar1 = (jan1 + Date.dt_msize[0] + Date.dt_msize[1] + + //RAFA isleap(year)) % 7; + + /* Caculate day (1-31) of the second sunday in March */ + + if (mar1 == 0) { /* Mar. 1 is a Sunday */ + marss = 8; + } else { /* Mar. 1 is Monday - Saturday */ + marss = 15 - mar1; + } + + /* Calculate day of the week for November 1 */ + + nov1 = jan1; + // RAFA for (i=0; i<10; i++) { + // RAFA nov1 += Date.dt_msize[i]; + // RAFA } + if (isleap(year)) { + nov1++; + } + nov1 = nov1 % 7; + if (nov1 == 0) { /* Nov. 1 is a Sunday */ + novfs = 1; + } else { /* Nov. 1 is Monday - Saturday */ + novfs = 8 - nov1; + } + + /* Set dst based on time of the year */ + + /* DST is off during December, January, and Feburary */ + + if ( (month == 11) || (month == 0) || (month == 1) ) { + dst = FALSE; + + /* DST is on from April through October */ + + } else if ( (month>2) && (month<10) ) { + dst = TRUE; + + /* DST is on in March past 2 AM on the second Sunday */ + + } else if (month == 2) { + + dst = FALSE; + if (day > marss) { + dst = TRUE; + } else if ( (day == marss) && (hour >= 2) ) { + dst = TRUE; + } + + /* DST is on in November until 2 am on first Sunday */ + + + } else if (month == 10) { + + dst = TRUE; + if (day > novfs) { + dst = FALSE; + } else if ( (day == novfs) && (hour >= 1) ) { + dst = FALSE; + } + } + // RAFA } + + /* If we are doing DST, move ahead one hour and handle the */ + /* case where we move to the next day or the next month */ + + if (dst) { + hour++; + + /* If day exceeded, move to next day */ + + if (hour > 23) { + hour = 0; + day++; + + /* If month exceeded, move to next month */ + +// RAFA if (day > Date.dt_msize[month]) { + day = 1; + month++; + + /* Stop here because DST does not occur */ + /* during the year boundary */ +// RAFA } + } + } + +// RAFA sprintf(str, "%3s %3s %2d %2d:%02d:%02d %s %d", +// RAFA Date.dt_dnam[dayofweek], Date.dt_mnam[month], +// RAFA day, hour, minute, second, dst? dzones[TIMEZONE-5]: +// RAFA zones[TIMEZONE-5], year); + return OK; +} diff --git a/system/blink_avr.c b/system/blink_avr.c new file mode 100644 index 0000000..0fa217b --- /dev/null +++ b/system/blink_avr.c @@ -0,0 +1,21 @@ + +#include + +void my_delay(unsigned long delay) { + volatile unsigned long i = 0; + for (i = 0; i < delay; i++) { + __asm__ __volatile__ ("nop"); + } +} + + +void blink_avr(void) { + + DDRB = (1< + +struct bpentry buftab[NBPOOLS]; /* Buffer pool table */ +bpid32 nbpools; + +/*------------------------------------------------------------------------ + * bufinit - Initialize the buffer pool data structure + *------------------------------------------------------------------------ + */ +status bufinit(void) +{ + nbpools = 0; + return OK; +} diff --git a/system/chprio.c b/system/chprio.c new file mode 100644 index 0000000..6c567d4 --- /dev/null +++ b/system/chprio.c @@ -0,0 +1,28 @@ +/* chprio.c - chprio */ + +#include + +/*------------------------------------------------------------------------ + * chprio - Change the scheduling priority of a process + *------------------------------------------------------------------------ + */ +pri16 chprio( + pid32 pid, /* ID of process to change */ + pri16 newprio /* New priority */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process's table entry */ + pri16 oldprio; /* Priority to return */ + + mask = disable(); + if (isbadpid(pid)) { + restore(mask); + return (pri16) SYSERR; + } + prptr = &proctab[pid]; + oldprio = prptr->prprio; + prptr->prprio = newprio; + restore(mask); + return oldprio; +} diff --git a/system/clkhandler.c b/system/clkhandler.c new file mode 100644 index 0000000..3aa5fac --- /dev/null +++ b/system/clkhandler.c @@ -0,0 +1,63 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* clkhandler.c - clkhandler */ + +#include + +/*----------------------------------------------------------------------- + * clkhandler - high level clock interrupt handler + *----------------------------------------------------------------------- + */ +void clkhandler() +{ + struct timer_csreg *tptr; + tptr = (struct timer_csreg *)TIM2_BASE; + + /* Clear interrupt flag */ + + tptr->sr &= ~(1 << TIM_UIF); + + /* Increment 1000ms counter */ + + count1000++; + + /* After 1 sec, increment clktime */ + + if(count1000 >= 1000) { + clktime++; + count1000 = 0; + } + + /* check if sleep queue is empty */ + + if(!isempty(sleepq)) { + /* sleepq nonempty, decrement the key of */ + /* topmost process on sleepq */ + + if((--queuetab[firstid(sleepq)].qkey) == 0) { + + wakeup(); + } + } + + /* Decrement the preemption counter */ + /* Reschedule if necessary */ + + if((--preempt) == 0) { + preempt = QUANTUM; + // PendSV call + *SCB_ICSR |= (1 << PENDSV_INTR); + } +} diff --git a/system/clkinit.c b/system/clkinit.c new file mode 100644 index 0000000..a4a82d3 --- /dev/null +++ b/system/clkinit.c @@ -0,0 +1,63 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* clkinit.c - clkinit STM32 */ + +#include + +uint32 clktime; /* Seconds since boot */ +uint32 count1000; /* ms since last clock tick */ +qid16 sleepq; /* Queue of sleeping processes */ +uint32 preempt; /* Preemption counter */ + +/*------------------------------------------------------------------------ + * clkinit - Initialize the clock and sleep queue at startup + *------------------------------------------------------------------------ + */ +void clkinit(void) +{ + + struct clock_csreg * clockptr; + struct timer_csreg * tptr; + clockptr = (struct clock_csreg *)CLOCK_BASE; + tptr = (struct timer_csreg *)TIM2_BASE; + + sleepq = newqueue(); /* Allocate a queue to hold the delta */ + /* list of sleeping processes */ + preempt = QUANTUM; /* Set the preemption time */ + clktime = 0; /* Start counting seconds */ + count1000 = 0; + + /* Enable timer peripheral */ + clockptr->apb1enr |= (1 << TIM2EN); + + /* Configuration for 1ms interrupt timer + Based on 8 MHz chip CLK / 2 */ + tptr->cr1 |= (1 << TIM_URS); + tptr->psc = 0x7; /* Set to 0x3 for 1Mhz */ + tptr->arr = 0x1000; /* Set to 1000 */ + tptr->dier |= 0x1; /* Enable interrupts */ + + /* Set interrupt vector for timer */ + set_evec(TIM2_IRQ, (uint32)clkhandler); + *NVIC_ISER0 |= (1 << 28); + + /* Set interrupt for PendSV: a pendsv call will execute the scheduler */ + set_evec(PENDSV_ENTRY, (uint32)resched); + + /* Enable and start timer */ + tptr->cr1 |= (1 << TIM_CEN); + + return; +} diff --git a/system/close.c b/system/close.c new file mode 100644 index 0000000..52a701e --- /dev/null +++ b/system/close.c @@ -0,0 +1,26 @@ +/* close.c - close */ + +#include + +/*------------------------------------------------------------------------ + * close - Close a device + *------------------------------------------------------------------------ + */ +syscall close( + did32 descrp /* Descriptor for device */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct dentry *devptr; /* Entry in device switch table */ + int32 retval; /* Value to return to caller */ + + mask = disable(); + if (isbaddev(descrp)) { + restore(mask); + return SYSERR; + } + devptr = (struct dentry *) &devtab[descrp]; + retval = (*devptr->dvclose) (devptr); + restore(mask); + return retval; +} diff --git a/system/control.c b/system/control.c new file mode 100644 index 0000000..7581177 --- /dev/null +++ b/system/control.c @@ -0,0 +1,29 @@ +/* control.c - control */ + +#include + +/*------------------------------------------------------------------------ + * control - Control a device or a driver (e.g., set the driver mode) + *------------------------------------------------------------------------ + */ +syscall control( + did32 descrp, /* Descriptor for device */ + int32 func, /* Specific control function */ + int32 arg1, /* Specific argument for func */ + int32 arg2 /* Specific argument for func */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct dentry *devptr; /* Entry in device switch table */ + int32 retval; /* Value to return to caller */ + + mask = disable(); + if (isbaddev(descrp)) { + restore(mask); + return SYSERR; + } + devptr = (struct dentry *) &devtab[descrp]; + retval = (*devptr->dvcntl) (devptr, func, arg1, arg2); + restore(mask); + return retval; +} diff --git a/system/create.c b/system/create.c new file mode 100644 index 0000000..ce6f9c6 --- /dev/null +++ b/system/create.c @@ -0,0 +1,118 @@ +/* create.c - create, newpid */ + +#include + +local pid32 newpid(); + +#define roundew(x) ( (x+3)& ~0x3) + +//RAFA + +char nombre[10]; + +/*------------------------------------------------------------------------ + * create - create a process to start running a procedure + *------------------------------------------------------------------------ + */ +pid32 create( + void *procaddr, /* procedure address */ + uint32 ssize, /* stack size in bytes */ + pri16 priority, /* process priority > 0 */ + char *name, /* name (for debugging) */ + uint32 nargs, /* number of args that follow */ + ... + ) +{ + intmask mask; /* interrupt mask */ + pid32 pid; /* stores new process id */ + struct procent *prptr; /* pointer to proc. table entry */ + int32 i; + uint32 *a; /* points to list of args */ + uint32 *saddr; /* stack address */ + + + mask = disable(); + if (ssize < MINSTK) + ssize = MINSTK; + ssize = (uint32) roundew(ssize); + strncpy(nombre, name, 4); + if (((saddr = (uint32 *)getstk(ssize)) == + (uint32 *)SYSERR ) || + (pid=newpid()) == SYSERR || priority < 1 ) { + restore(mask); + return SYSERR; + } + + + + prcount++; + prptr = &proctab[pid]; + + /* initialize process table entry for new process */ + prptr->prstate = PR_SUSP; /* initial state is suspended */ + prptr->prprio = priority; + prptr->prstkbase = (char *)saddr; + prptr->prstklen = ssize; + prptr->prname[PNMLEN-1] = NULLCH; + for (i=0 ; iprname[i]=name[i])!=NULLCH; i++) + ; + prptr->prsem = -1; + prptr->prparent = (pid32)getpid(); + prptr->prhasmsg = FALSE; + + /* set up initial device descriptors for the shell */ + prptr->prdesc[0] = CONSOLE; /* stdin is CONSOLE device */ + prptr->prdesc[1] = CONSOLE; /* stdout is CONSOLE device */ + prptr->prdesc[2] = CONSOLE; /* stderr is CONSOLE device */ + + + /* Initialize stack as if the process was called */ + uint32 * tmpstk; + uint32 * extraregs; + a = (uint32 *)(&nargs + 1); + tmpstk = ((uint32) saddr) - 0x1C; + extraregs = ((uint32) tmpstk) - 0x20; /* r4 - r11 */ + + for (int i = 0; i < nargs; i++) { + tmpstk[i] = (uint32) *a++; + } + + tmpstk[5] = (uint32) userret; /* LR */ + tmpstk[6] = (uint32) procaddr; /* Function */ + tmpstk[7] = (uint32) 0x01000000; /* Flag register */ + + + for (int i = 0; i <= 7; i++) { + extraregs[i] = 0x0; /* Initialize to zero */ + } + prptr->prstkptr = (char *)extraregs; + + restore(mask); + return pid; +} + +/*------------------------------------------------------------------------ + * newpid - Obtain a new (free) process ID + *------------------------------------------------------------------------ + */ +local pid32 newpid(void) +{ + uint32 i; /* iterate through all processes*/ +// static pid32 nextpid = 1; /* position in table to try or */ + static pid32 nextpid = 0; /* position in table to try or */ + /* one beyond end of table */ + + /* check all NPROC slots */ + + for (i = 0; i < NPROC; i++) { + nextpid %= NPROC; /* wrap around to beginning */ + if (proctab[nextpid].prstate == PR_FREE) { + return nextpid++; + } else { + nextpid++; + } + } + if (strncmp(nombre, "Main", 4) == 0) + notmain(); // RAFA + return (pid32) SYSERR; +} diff --git a/system/debug.c b/system/debug.c new file mode 100644 index 0000000..55cf538 --- /dev/null +++ b/system/debug.c @@ -0,0 +1,78 @@ +/* debug.c - hexdump_print, hexdump */ + +#include +#include +#include + +static void hexdump_print(byte, byte); + +/*------------------------------------------------------------------------ + * hexdump_print - Print a byte in ASCII or hex + *------------------------------------------------------------------------ + */ +static void hexdump_print( + byte data, /* Item to print */ + byte mode /* ASCII or hex mode */ + ) +{ + switch (mode) + { + case DEBUG_ASCII: + data = (' ' <= data && data <= '~') ? data : '.'; + fprintf(stdout, "%c", data); + break; + case DEBUG_HEX: + fprintf(stdout, "%02x ", data); + break; + default: + break; + } +} + + +/*------------------------------------------------------------------------ + * hexdump - Dump a region of memory + *------------------------------------------------------------------------ + */ +void hexdump( + void *buffer, /* Addresss of memory area */ + uint32 length, /* Length in bytes */ + bool8 canon /* Print in ASCII or hex */ + ) +{ + uint32 m, n, remain; + + byte *b = (byte *)buffer; + + for (n = 0; n < length; n += 0x10) { + fprintf(stdout, "%08x ", (uint32)buffer + n); + + remain = length - n; + + for (m = 0; m < remain && m < 0x10; m++) { + if (m % 0x08 == 0) { + fprintf(stdout, " "); + } + hexdump_print(b[n + m], DEBUG_HEX); + } + + /* Pad the rest if needed */ + if (remain < 0x10) { + for (m = 0; m < 0x10 - remain; m++) { + if ((0 != m) && (0 == m % 0x08)) { + fprintf(stdout, " "); + } + fprintf(stdout, " "); + } + } + + if (canon == TRUE) { + fprintf(stdout, " |"); + for (m = 0; m < remain && m < 0x10; m++) { + hexdump_print(b[n + m], DEBUG_ASCII); + } + fprintf(stdout, "|"); + } + fprintf(stdout, "\n"); + } +} diff --git a/system/evec.c b/system/evec.c new file mode 100644 index 0000000..f20cbba --- /dev/null +++ b/system/evec.c @@ -0,0 +1,150 @@ +/* evec.c -- initintc, set_evec */ + +typedef unsigned int size_t; +#include + +#include +#include + + +uint32 __attribute__((aligned(0x100))) intc_vector[92]; /* Interrupt vector */ + +/* Each message corresponds to an exception in the vector table. */ +char * exception_message(uint8 intnr) { + + +/* RAFA +E_A "--", +E_B "RESET", +E_etc "NMI", + "HARD FAULT", + "MEMMANAGE FAULT", + "BUS FAULT", + "USAGE FAULT", + "RESERVED", + "RESERVED", + "RESERVED", + "RESERVED", + "SVC", + "DEBUG MONITOR", + "RESERVED", + "RESERVED", + "RESERVED", + "RESERVED", + "PENDSV", + "SYSTICK", + "IRQ1", + "IRQ2", + "IRQ3", + "IRQ4", + // add more if needed +*/ +// RAFA char * messages[] = { +const char messages[] PROGMEM = { + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'N', + 'N', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + // add more if needed +}; + +if (intnr < 20) // TODO: strlen + return pgm_read_word(&messages[intnr]); + +return "UNKNOWN"; + +} + +__attribute__ ((naked)) void * dummy_isr(void) { + + uint32 * current_sp; + + /* Test whether system call was invoked from supervisor (use MSP) or + * user (use PSP) mode */ + /* asm volatile ( + "tst lr, #4" "\n\t" + "ite eq" "\n\t" + "mrseq %0, msp" "\n\t" + "mrsne %0, psp" : "=r" (current_sp)); */ + +/* + asm volatile ("mrs %0, psp" : "=r" (current_sp)); + + uint8 nr = *SCB_ICSR & 0xFF; + kprintf("EXCEPTION: %s\n", exception_message(nr)); + kprintf("STACKFRAME:\n"); + for (int i = 0; i < 8; i++) { + kprintf("STACK[%d]: %x\n", i, current_sp[i]); + } + + halt(); +*/ +} +/*------------------------------------------------------------------------ + * initintc - Initialize the Interrupt Controller + *------------------------------------------------------------------------ + */ +int32 initintc() +{ + /* System control block */ + struct scb_csreg *csrptr = (struct scb_csreg *)0xE000ED00; + + /* clear entire IVT location in memory */ + memset(&intc_vector, 0, (sizeof(uint32) * 92)); + + /* set dummy handlers */ + for (int i = 1; i <= 64 ; i++) { + set_evec(i, (uint32) dummy_isr); + } + + /* Enable memory management, bus and usage fault exceptions handlers + * If these are not enabled, the processor treats them as a hard + * faults. Unpriviliged access will cause a busfault in case no MPU */ + csrptr->shcsr |= (1 << MPUFAULT_EN) | (1 << BUSFAULT_EN) | (1 << USAGEFAULT_EN); + + /* The vector table is intially at 0x0. The vector table can be + * relocated to other memory locations. We can do this by setting + * a register in the NVIC called the vector table offset register */ + csrptr->vtor = (uint32) &intc_vector; + + return OK; +} + +/*------------------------------------------------------------------------ + * set_evec - set exception vector to point to an exception handler + *------------------------------------------------------------------------ + */ +int32 set_evec(uint32 xnum, uint32 handler) +{ + /* There are only 92 interrupts allowed 0-2 */ + + if(xnum > 92) { + return SYSERR; + } + + /* Install the handler */ + + intc_vector[xnum] = handler; + + return OK; +} + diff --git a/system/evec.c.orig b/system/evec.c.orig new file mode 100644 index 0000000..31d3bc8 --- /dev/null +++ b/system/evec.c.orig @@ -0,0 +1,117 @@ +/* evec.c -- initintc, set_evec */ + +#include +#include + + +uint32 __attribute__((aligned(0x100))) intc_vector[92]; /* Interrupt vector */ + +/* Each message corresponds to an exception in the vector table. */ +char * exception_message(uint8 intnr) { + +char * messages[] = { + "--", + "RESET", + "NMI", + "HARD FAULT", + "MEMMANAGE FAULT", + "BUS FAULT", + "USAGE FAULT", + "RESERVED", + "RESERVED", + "RESERVED", + "RESERVED", + "SVC", + "DEBUG MONITOR", + "RESERVED", + "RESERVED", + "RESERVED", + "RESERVED", + "PENDSV", + "SYSTICK", + "IRQ1", + "IRQ2", + "IRQ3", + "IRQ4", + // add more if needed +}; + +if (intnr < 20) // TODO: strlen + return messages[intnr]; + +return "UNKNOWN"; + +} + +__attribute__ ((naked)) void * dummy_isr(void) { + + uint32 * current_sp; + + /* Test whether system call was invoked from supervisor (use MSP) or + * user (use PSP) mode */ + /* asm volatile ( + "tst lr, #4" "\n\t" + "ite eq" "\n\t" + "mrseq %0, msp" "\n\t" + "mrsne %0, psp" : "=r" (current_sp)); */ + + asm volatile ("mrs %0, psp" : "=r" (current_sp)); + + uint8 nr = *SCB_ICSR & 0xFF; + kprintf("EXCEPTION: %s\n", exception_message(nr)); + kprintf("STACKFRAME:\n"); + for (int i = 0; i < 8; i++) { + kprintf("STACK[%d]: %x\n", i, current_sp[i]); + } + + halt(); +} +/*------------------------------------------------------------------------ + * initintc - Initialize the Interrupt Controller + *------------------------------------------------------------------------ + */ +int32 initintc() +{ + /* System control block */ + struct scb_csreg *csrptr = (struct scb_csreg *)0xE000ED00; + + /* clear entire IVT location in memory */ + memset(&intc_vector, 0, (sizeof(uint32) * 92)); + + /* set dummy handlers */ + for (int i = 1; i <= 64 ; i++) { + set_evec(i, (uint32) dummy_isr); + } + + /* Enable memory management, bus and usage fault exceptions handlers + * If these are not enabled, the processor treats them as a hard + * faults. Unpriviliged access will cause a busfault in case no MPU */ + csrptr->shcsr |= (1 << MPUFAULT_EN) | (1 << BUSFAULT_EN) | (1 << USAGEFAULT_EN); + + /* The vector table is intially at 0x0. The vector table can be + * relocated to other memory locations. We can do this by setting + * a register in the NVIC called the vector table offset register */ + csrptr->vtor = (uint32) &intc_vector; + + return OK; +} + +/*------------------------------------------------------------------------ + * set_evec - set exception vector to point to an exception handler + *------------------------------------------------------------------------ + */ +int32 set_evec(uint32 xnum, uint32 handler) +{ + /* There are only 92 interrupts allowed 0-2 */ + + if(xnum > 92) { + return SYSERR; + } + + /* Install the handler */ + + intc_vector[xnum] = handler; + + return OK; +} + diff --git a/system/exit.c b/system/exit.c new file mode 100644 index 0000000..e648c3e --- /dev/null +++ b/system/exit.c @@ -0,0 +1,12 @@ +/* exit.c - exit */ + +#include + +/*------------------------------------------------------------------------ + * exit - Cause the calling process to exit + *------------------------------------------------------------------------ + */ +void exit(void) +{ + kill(getpid()); /* Kill the current process */ +} diff --git a/system/freebuf.c b/system/freebuf.c new file mode 100644 index 0000000..44fd542 --- /dev/null +++ b/system/freebuf.c @@ -0,0 +1,39 @@ +/* freebuf.c - freebuf */ + +#include + +/*------------------------------------------------------------------------ + * freebuf - Free a buffer that was allocated from a pool by getbuf + *------------------------------------------------------------------------ + */ +syscall freebuf( + char *bufaddr /* Address of buffer to return */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct bpentry *bpptr; /* Pointer to entry in buftab */ + bpid32 poolid; /* ID of buffer's pool */ + + mask = disable(); + + /* Extract pool ID from integer prior to buffer address */ + + bufaddr -= sizeof(bpid32); + poolid = *(bpid32 *)bufaddr; + if (poolid < 0 || poolid >= nbpools) { + restore(mask); + return SYSERR; + } + + /* Get address of correct pool entry in table */ + + bpptr = &buftab[poolid]; + + /* Insert buffer into list and signal semaphore */ + + ((struct bpentry *)bufaddr)->bpnext = bpptr->bpnext; + bpptr->bpnext = (struct bpentry *)bufaddr; + signal(bpptr->bpsem); + restore(mask); + return OK; +} diff --git a/system/freemem.c b/system/freemem.c new file mode 100644 index 0000000..afd697a --- /dev/null +++ b/system/freemem.c @@ -0,0 +1,70 @@ +/* freemem.c - freemem */ + +#include + +/*------------------------------------------------------------------------ + * freemem - Free a memory block, returning the block to the free list + *------------------------------------------------------------------------ + */ +syscall freemem( + char *blkaddr, /* Pointer to memory block */ + uint32 nbytes /* Size of block in bytes */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct memblk *next, *prev, *block; + uint32 top; + + mask = disable(); + if ((nbytes == 0) || ((uint32) blkaddr < (uint32) minheap) + || ((uint32) blkaddr > (uint32) maxheap)) { + restore(mask); + return SYSERR; + } + + nbytes = (uint32) roundmb(nbytes); /* Use memblk multiples */ + block = (struct memblk *)blkaddr; + + prev = &memlist; /* Walk along free list */ + next = memlist.mnext; + while ((next != NULL) && (next < block)) { + prev = next; + next = next->mnext; + } + + if (prev == &memlist) { /* Compute top of previous block*/ + top = (uint32) NULL; + } else { + top = (uint32) prev + prev->mlength; + } + + /* Ensure new block does not overlap previous or next blocks */ + + if (((prev != &memlist) && (uint32) block < top) + || ((next != NULL) && (uint32) block+nbytes>(uint32)next)) { + restore(mask); + return SYSERR; + } + + memlist.mlength += nbytes; + + /* Either coalesce with previous block or add to free list */ + + if (top == (uint32) block) { /* Coalesce with previous block */ + prev->mlength += nbytes; + block = prev; + } else { /* Link into list as new node */ + block->mnext = next; + block->mlength = nbytes; + prev->mnext = block; + } + + /* Coalesce with next block if adjacent */ + + if (((uint32) block + block->mlength) == (uint32) next) { + block->mlength += next->mlength; + block->mnext = next->mnext; + } + restore(mask); + return OK; +} diff --git a/system/getbuf.c b/system/getbuf.c new file mode 100644 index 0000000..844f8da --- /dev/null +++ b/system/getbuf.c @@ -0,0 +1,43 @@ +/* getbuf.c - getbuf */ + +#include + +/*------------------------------------------------------------------------ + * getbuf - Get a buffer from a preestablished buffer pool + *------------------------------------------------------------------------ + */ +char *getbuf( + bpid32 poolid /* Index of pool in buftab */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct bpentry *bpptr; /* Pointer to entry in buftab */ + struct bpentry *bufptr; /* Pointer to a buffer */ + + mask = disable(); + + /* Check arguments */ + + if ( (poolid < 0 || poolid >= nbpools) ) { + restore(mask); + return (char *)SYSERR; + + } + bpptr = &buftab[poolid]; + + /* Wait for pool to have > 0 buffers and allocate a buffer */ + + wait(bpptr->bpsem); + bufptr = bpptr->bpnext; + + /* Unlink buffer from pool */ + + bpptr->bpnext = bufptr->bpnext; + + /* Record pool ID in first four bytes of buffer and skip */ + + *(bpid32 *)bufptr = poolid; + bufptr = (struct bpentry *)(sizeof(bpid32) + (char *)bufptr); + restore(mask); + return (char *)bufptr; +} diff --git a/system/getc.c b/system/getc.c new file mode 100644 index 0000000..bed57c3 --- /dev/null +++ b/system/getc.c @@ -0,0 +1,26 @@ +/* getc.c - getc */ + +#include + +/*------------------------------------------------------------------------ + * getc - Obtain one byte from a device + *------------------------------------------------------------------------ + */ +syscall getc( + did32 descrp /* Descriptor for device */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct dentry *devptr; /* Entry in device switch table */ + int32 retval; /* Value to return to caller */ + + mask = disable(); + if (isbaddev(descrp)) { + restore(mask); + return SYSERR; + } + devptr = (struct dentry *) &devtab[descrp]; + retval = (*devptr->dvgetc) (devptr); + restore(mask); + return retval; +} diff --git a/system/getdev.c b/system/getdev.c new file mode 100644 index 0000000..a92d8dc --- /dev/null +++ b/system/getdev.c @@ -0,0 +1,26 @@ +/* getdev.c - getdev */ + +#include +#include + +/*------------------------------------------------------------------------ + * getdev - Convert a device name to a device ID + *------------------------------------------------------------------------ + */ +did32 getdev( + char *devname /* Name of the device */ + ) +{ + intmask mask; /* Saved interrupt mask */ + did32 id; /* Value to return to caller */ + + mask = disable(); + for (id = 0; id < NDEVS; id++) { + if (strncmp(devname, devtab[id].dvname, DEVNAMLEN)) { + restore(mask); + return id; + } + } + restore(mask); + return (did32) SYSERR; +} diff --git a/system/getitem.c b/system/getitem.c new file mode 100644 index 0000000..801f505 --- /dev/null +++ b/system/getitem.c @@ -0,0 +1,58 @@ +/* getitem.c - getfirst, getlast, getitem */ + +#include + +/*------------------------------------------------------------------------ + * getfirst - Remove a process from the front of a queue + *------------------------------------------------------------------------ + */ +pid32 getfirst( + qid16 q /* ID of queue from which to */ + ) /* Remove a process (assumed */ + /* valid with no check) */ +{ + pid32 head; + + if (isempty(q)) { + return EMPTY; + } + + head = queuehead(q); + return getitem(queuetab[head].qnext); +} + +/*------------------------------------------------------------------------ + * getlast - Remove a process from end of queue + *------------------------------------------------------------------------ + */ +pid32 getlast( + qid16 q /* ID of queue from which to */ + ) /* Remove a process (assumed */ + /* valid with no check) */ +{ + pid32 tail; + + if (isempty(q)) { + return EMPTY; + } + + tail = queuetail(q); + return getitem(queuetab[tail].qprev); +} + +/*------------------------------------------------------------------------ + * getitem - Remove a process from an arbitrary point in a queue + *------------------------------------------------------------------------ + */ +pid32 getitem( + pid32 pid /* ID of process to remove */ + ) +{ + pid32 prev, next; + + next = queuetab[pid].qnext; /* Following node in list */ + prev = queuetab[pid].qprev; /* Previous node in list */ + queuetab[prev].qnext = next; + queuetab[next].qprev = prev; + return pid; +} diff --git a/system/getmem.c b/system/getmem.c new file mode 100644 index 0000000..dd0d593 --- /dev/null +++ b/system/getmem.c @@ -0,0 +1,50 @@ +/* getmem.c - getmem */ + +#include + +/*------------------------------------------------------------------------ + * getmem - Allocate heap storage, returning lowest word address + *------------------------------------------------------------------------ + */ +char *getmem( + uint32 nbytes /* Size of memory requested */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct memblk *prev, *curr, *leftover; + + mask = disable(); + if (nbytes == 0) { + restore(mask); + return (char *)SYSERR; + } + + nbytes = (uint32) roundmb(nbytes); /* Use memblk multiples */ + + prev = &memlist; + curr = memlist.mnext; + while (curr != NULL) { /* Search free list */ + + if (curr->mlength == nbytes) { /* Block is exact match */ + prev->mnext = curr->mnext; + memlist.mlength -= nbytes; + restore(mask); + return (char *)(curr); + + } else if (curr->mlength > nbytes) { /* Split big block */ + leftover = (struct memblk *)((uint32) curr + + nbytes); + prev->mnext = leftover; + leftover->mnext = curr->mnext; + leftover->mlength = curr->mlength - nbytes; + memlist.mlength -= nbytes; + restore(mask); + return (char *)(curr); + } else { /* Move to next block */ + prev = curr; + curr = curr->mnext; + } + } + restore(mask); + return (char *)SYSERR; +} diff --git a/system/getpid.c b/system/getpid.c new file mode 100644 index 0000000..77a5ba9 --- /dev/null +++ b/system/getpid.c @@ -0,0 +1,12 @@ +/* getpid.c - getpid */ + +#include + +/*------------------------------------------------------------------------ + * getpid - Return the ID of the currently executing process + *------------------------------------------------------------------------ + */ +pid32 getpid(void) +{ + return (currpid); +} diff --git a/system/getprio.c b/system/getprio.c new file mode 100644 index 0000000..43f86af --- /dev/null +++ b/system/getprio.c @@ -0,0 +1,24 @@ +/* getprio.c - getprio */ + +#include + +/*------------------------------------------------------------------------ + * getprio - Return the scheduling priority of a process + *------------------------------------------------------------------------ + */ +syscall getprio( + pid32 pid /* Process ID */ + ) +{ + intmask mask; /* Saved interrupt mask */ + uint32 prio; /* Priority to return */ + + mask = disable(); + if (isbadpid(pid)) { + restore(mask); + return SYSERR; + } + prio = proctab[pid].prprio; + restore(mask); + return prio; +} diff --git a/system/getstk.c b/system/getstk.c new file mode 100644 index 0000000..860416e --- /dev/null +++ b/system/getstk.c @@ -0,0 +1,52 @@ +/* getstk.c - getstk */ + +#include + +/*------------------------------------------------------------------------ + * getstk - Allocate stack memory, returning highest word address + *------------------------------------------------------------------------ + */ +char *getstk( + uint32 nbytes /* Size of memory requested */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct memblk *prev, *curr; /* Walk through memory list */ + struct memblk *fits, *fitsprev; /* Record block that fits */ + + mask = disable(); + if (nbytes == 0) { + restore(mask); + return (char *)SYSERR; + } + + nbytes = (uint32) roundmb(nbytes); /* Use mblock multiples */ + + prev = &memlist; + curr = memlist.mnext; + fits = NULL; + fitsprev = NULL; /* Just to avoid a compiler warning */ + + while (curr != NULL) { /* Scan entire list */ + if (curr->mlength >= nbytes) { /* Record block address */ + fits = curr; /* when request fits */ + fitsprev = prev; + } + prev = curr; + curr = curr->mnext; + } + + if (fits == NULL) { /* No block was found */ + restore(mask); + return (char *)SYSERR; + } + if (nbytes == fits->mlength) { /* Block is exact match */ + fitsprev->mnext = fits->mnext; + } else { /* Remove top section */ + fits->mlength -= nbytes; + fits = (struct memblk *)((uint32)fits + fits->mlength); + } + memlist.mlength -= nbytes; + restore(mask); + return (char *)((uint32) fits + nbytes - sizeof(uint32)); +} diff --git a/system/getticks.c b/system/getticks.c new file mode 100644 index 0000000..24ba759 --- /dev/null +++ b/system/getticks.c @@ -0,0 +1,14 @@ +/* getticks.c - getticks */ + +#include + +/*------------------------------------------------------------------------ + * getticks - Retrieve the number of clock ticks since CPU reset + *------------------------------------------------------------------------ + */ +uint32 getticks() +{ + /* Cortex M3 does have a clock cycle cnt register */ + uint32 ret = 0; + return ret; +} diff --git a/system/gettime.c b/system/gettime.c new file mode 100644 index 0000000..69fe09f --- /dev/null +++ b/system/gettime.c @@ -0,0 +1,28 @@ +/* gettime.c - gettime */ + +#include + +/*------------------------------------------------------------------------ + * gettime - Get xinu time in seconds past Jan 1, 1970 + *------------------------------------------------------------------------ + */ +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); + retval = SYSERR; + if (retval == SYSERR) { + return SYSERR; + } + + /* Adjust to xinu time and store result */ + + *timvar = utim2ltim(now); + return OK; +} diff --git a/system/init.c b/system/init.c new file mode 100644 index 0000000..535bdd3 --- /dev/null +++ b/system/init.c @@ -0,0 +1,26 @@ +/* init.c - init */ + +#include + +/*------------------------------------------------------------------------ + * init - Initialize a device and its driver + *------------------------------------------------------------------------ + */ +syscall init( + did32 descrp /* Descriptor for device */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct dentry *devptr; /* Entry in device switch table */ + int32 retval; /* Value to return to caller */ + + mask = disable(); + if (isbaddev(descrp)) { + restore(mask); + return SYSERR; + } + devptr = (struct dentry *) &devtab[descrp]; + retval = (*devptr->dvinit) (devptr); + restore(mask); + return retval; +} diff --git a/system/initialize.c b/system/initialize.c new file mode 100644 index 0000000..b5e7c9c --- /dev/null +++ b/system/initialize.c @@ -0,0 +1,283 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* initialize.c - nulluser, sysinit */ + +/* Handle system initialization and become the null process */ + +#include +#include + +//RAFA +#include + + +extern void start(void); /* Start of Xinu code */ +extern void *_end; /* End of Xinu code */ + +/* Function prototypes */ + +extern void main(void); /* Main is the first process created */ +static void sysinit(); /* Internal system initialization */ +extern void meminit(void); /* Initializes the free memory list */ +extern int32 initintc(void); +void startup(int, struct procent *); /* Process to finish startup tasks */ + +/* Declarations of major kernel variables */ + +struct procent proctab[NPROC]; /* Process table */ +struct sentry semtab[NSEM]; /* Semaphore table */ +struct memblk memlist; /* List of free memory blocks */ + +/* Active system status */ + +int prcount; /* Total number of live processes */ +pid32 currpid; /* ID of currently executing process */ + +/* Control sequence to reset the console colors and cusor positiion */ + +#define CONSOLE_RESET " \033[0m\033[2J\033[;H" + +/*------------------------------------------------------------------------ + * nulluser - initialize the system and become the null process + * + * Note: execution begins here after the C run-time environment has been + * established. Interrupts are initially DISABLED, and must eventually + * be enabled explicitly. The code turns itself into the null process + * after initialization. Because it must always remain ready to execute, + * the null process cannot execute code that might cause it to be + * suspended, wait for a semaphore, put to sleep, or exit. In + * particular, the code must not perform I/O except for polled versions + * such as kprintf. + *------------------------------------------------------------------------ + */ + +// RAFA +// void PUT32 ( unsigned int, unsigned int ); +unsigned int GET32 ( unsigned int ); +void dummy ( unsigned int ); + +#define GPIOCBASE 0x40011000 +#define RCCBASE 0x40021000 + +void notmain ( void ) +{ + unsigned int ra; + unsigned int rx; + + +// ra=GET32(RCCBASE+0x18); + // ra|=1<<4; //enable port c + // PUT32(RCCBASE+0x18,ra); + //config + // ra=GET32(GPIOCBASE+0x04); + //ra&=~(3<<20); //PC13 +// ra|=1<<20; //PC13 + // ra&=~(3<<22); //PC13 + // ra|=0<<22; //PC13 + // PUT32(GPIOCBASE+0x04,ra); + +// for(rx=0;rx<10;rx++) + // { + // PUT32(GPIOCBASE+0x10,1<<(13+0)); + // for(ra=0;ra<200000;ra++) dummy(ra); + // PUT32(GPIOCBASE+0x10,1<<(13+16)); + // for(ra=0;ra<200000;ra++) dummy(ra); + // } +} + +// FIN RAFA + + +void nullprocess(void) { + + notmain(); + + + + resume(create((void *)main, INITSTK, INITPRIO, "Main Process", 0, NULL)); + + for(;;); +} + + +//RAFA +#include + +char frase[] = "Xinu AVR loading...\n"; +void nulluser() +{ + struct memblk *memptr; /* Ptr to memory block */ + uint32 free_mem; /* Total amount of free memory */ + + //RAFA + cli(); + blink_avr(); + + // RAFA uartinit(); + serial_init(); + serial_put_char('A'); + serial_put_char('B'); + char f = serial_get_char(); + int c = atoi(&f); + serial_put_char('X'); + serial_put_char(frase[c]); + + /* Initialize the system */ + + sysinit(); + + /* Output Xinu memory layout */ + free_mem = 0; + for (memptr = memlist.mnext; memptr != NULL; + memptr = memptr->mnext) { + free_mem += memptr->mlength; + } + // RAFA kprintf("%10d bytes of free memory. Free list:\n", free_mem); + for (memptr=memlist.mnext; memptr!=NULL;memptr = memptr->mnext) { + kprintf(" [0x%08X to 0x%08X]\n", + (uint32)memptr, ((uint32)memptr) + memptr->mlength - 1); + } + +// RAFA kprintf("%10d bytes of Xinu code.\n", +// RAFA (uint32)&etext - (uint32)&text); +// RAFA kprintf(" [0x%08X to 0x%08X]\n", +// RAFA (uint32)&text, (uint32)&etext - 1); +// RAFA kprintf("%10d bytes of data.\n", +// RAFA (uint32)&ebss - (uint32)&data); +// RAFA kprintf(" [0x%08X to 0x%08X]\n\n", +// RAFA (uint32)&data, (uint32)&ebss - 1); + + + /* Initialize the Null process entry */ + int pid = create((void *)nullprocess, INITSTK, 10, "Null process", 0, NULL); + + struct procent * prptr = &proctab[pid]; + prptr->prstate = PR_CURR; + + /* Enable interrupts */ + enable(); + + /* Initialize the real time clock */ + clkinit(); + + /* Start of nullprocess */ + startup(0, prptr); + + for(;;); + +} + +/* Startup does a system call, the processor switches to handler + * mode and prepares for executing the null process (see syscall.c) + * This is also where a kernel mode to user mode switch can + * take place */ +void startup(int INIT, struct procent *p) { + +// asm volatile ( +// "push {r0}" "\n\t" + //"mov r0, 0x3" "\n\t" // kernel to user mode switch + //"msr control, r0" "\n\t" + //"isb" "\n\t" + // "pop {r0}" ); + // asm volatile("svc 1"); + + /* Should not be here, panic */ + // RAFA panic("Can't startup system"); + panic(&m6[0]); +} + + +/*------------------------------------------------------------------------ + * + * sysinit - Initialize all Xinu data structures and devices + * + *------------------------------------------------------------------------ + */ +static void sysinit() +{ + int32 i; + struct procent *prptr; /* Ptr to process table entry */ + struct sentry *semptr; /* Ptr to semaphore table entry */ + + + /* Platform Specific Initialization */ + + platinit(); + + kprintf(CONSOLE_RESET); + kprintf("\n%s\n\n", VERSION); + + /* Initialize free memory list */ + + meminit(); + + /* Initialize system variables */ + + /* Count the Null process as the first process in the system */ + prcount = 0; +// prcount = 1; + + /* Scheduling is not currently blocked */ + + Defer.ndefers = 0; + + /* Initialize process table entries free */ + + for (i = 0; i < NPROC; i++) { + prptr = &proctab[i]; + prptr->prstate = PR_FREE; + prptr->prname[0] = NULLCH; + prptr->prstkbase = NULL; + prptr->prprio = 0; + } + + + /* Initialize semaphores */ + + for (i = 0; i < NSEM; i++) { + semptr = &semtab[i]; + semptr->sstate = S_FREE; + semptr->scount = 0; + semptr->squeue = newqueue(); + } + + /* Initialize buffer pools */ + + bufinit(); + + /* Create a ready list for processes */ + + readylist = newqueue(); + + + for (i = 0; i < NDEVS; i++) { + init(i); + } + return; +} + +int32 stop(char *s) +{ + kprintf("%s\n", s); +// kprintf("looping... press reset\n"); + while(1) + /* Empty */; +} + +int32 delay(int n) +{ + DELAY(n); + return OK; +} diff --git a/system/initialize.c.orig b/system/initialize.c.orig new file mode 100644 index 0000000..d829707 --- /dev/null +++ b/system/initialize.c.orig @@ -0,0 +1,261 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* initialize.c - nulluser, sysinit */ + +/* Handle system initialization and become the null process */ + +#include +#include + +extern void start(void); /* Start of Xinu code */ +extern void *_end; /* End of Xinu code */ + +/* Function prototypes */ + +extern void main(void); /* Main is the first process created */ +static void sysinit(); /* Internal system initialization */ +extern void meminit(void); /* Initializes the free memory list */ +extern int32 initintc(void); +void startup(int, struct procent *); /* Process to finish startup tasks */ + +/* Declarations of major kernel variables */ + +struct procent proctab[NPROC]; /* Process table */ +struct sentry semtab[NSEM]; /* Semaphore table */ +struct memblk memlist; /* List of free memory blocks */ + +/* Active system status */ + +int prcount; /* Total number of live processes */ +pid32 currpid; /* ID of currently executing process */ + +/* Control sequence to reset the console colors and cusor positiion */ + +#define CONSOLE_RESET " \033[0m\033[2J\033[;H" + +/*------------------------------------------------------------------------ + * nulluser - initialize the system and become the null process + * + * Note: execution begins here after the C run-time environment has been + * established. Interrupts are initially DISABLED, and must eventually + * be enabled explicitly. The code turns itself into the null process + * after initialization. Because it must always remain ready to execute, + * the null process cannot execute code that might cause it to be + * suspended, wait for a semaphore, put to sleep, or exit. In + * particular, the code must not perform I/O except for polled versions + * such as kprintf. + *------------------------------------------------------------------------ + */ + +// RAFA +// void PUT32 ( unsigned int, unsigned int ); +unsigned int GET32 ( unsigned int ); +void dummy ( unsigned int ); + +#define GPIOCBASE 0x40011000 +#define RCCBASE 0x40021000 + +void notmain ( void ) +{ + unsigned int ra; + unsigned int rx; + + ra=GET32(RCCBASE+0x18); + ra|=1<<4; //enable port c + PUT32(RCCBASE+0x18,ra); + //config + ra=GET32(GPIOCBASE+0x04); + ra&=~(3<<20); //PC13 + ra|=1<<20; //PC13 + ra&=~(3<<22); //PC13 + ra|=0<<22; //PC13 + PUT32(GPIOCBASE+0x04,ra); + + for(rx=0;rx<10;rx++) + { + PUT32(GPIOCBASE+0x10,1<<(13+0)); + for(ra=0;ra<200000;ra++) dummy(ra); + PUT32(GPIOCBASE+0x10,1<<(13+16)); + for(ra=0;ra<200000;ra++) dummy(ra); + } +} + +// FIN RAFA + + +void nullprocess(void) { + + notmain(); + + + + resume(create((void *)main, INITSTK, INITPRIO, "Main Process", 0, NULL)); + + for(;;); +} + + + +void nulluser() +{ + struct memblk *memptr; /* Ptr to memory block */ + uint32 free_mem; /* Total amount of free memory */ + + /* Initialize the system */ + + sysinit(); + + /* Output Xinu memory layout */ + free_mem = 0; + for (memptr = memlist.mnext; memptr != NULL; + memptr = memptr->mnext) { + free_mem += memptr->mlength; + } + kprintf("%10d bytes of free memory. Free list:\n", free_mem); + for (memptr=memlist.mnext; memptr!=NULL;memptr = memptr->mnext) { + kprintf(" [0x%08X to 0x%08X]\n", + (uint32)memptr, ((uint32)memptr) + memptr->mlength - 1); + } + + kprintf("%10d bytes of Xinu code.\n", + (uint32)&etext - (uint32)&text); + kprintf(" [0x%08X to 0x%08X]\n", + (uint32)&text, (uint32)&etext - 1); + kprintf("%10d bytes of data.\n", + (uint32)&ebss - (uint32)&data); + kprintf(" [0x%08X to 0x%08X]\n\n", + (uint32)&data, (uint32)&ebss - 1); + + + /* Initialize the Null process entry */ + int pid = create((void *)nullprocess, INITSTK, 10, "Null process", 0, NULL); + + struct procent * prptr = &proctab[pid]; + prptr->prstate = PR_CURR; + + /* Enable interrupts */ + enable(); + + /* Initialize the real time clock */ + clkinit(); + + /* Start of nullprocess */ + startup(0, prptr); + + for(;;); + +} + +/* Startup does a system call, the processor switches to handler + * mode and prepares for executing the null process (see syscall.c) + * This is also where a kernel mode to user mode switch can + * take place */ +void startup(int INIT, struct procent *p) { + + asm volatile ( + "push {r0}" "\n\t" + //"mov r0, 0x3" "\n\t" // kernel to user mode switch + //"msr control, r0" "\n\t" + //"isb" "\n\t" + "pop {r0}" ); + asm volatile("svc 1"); + + /* Should not be here, panic */ + panic("Can't startup system"); +} + + +/*------------------------------------------------------------------------ + * + * sysinit - Initialize all Xinu data structures and devices + * + *------------------------------------------------------------------------ + */ +static void sysinit() +{ + int32 i; + struct procent *prptr; /* Ptr to process table entry */ + struct sentry *semptr; /* Ptr to semaphore table entry */ + + + /* Platform Specific Initialization */ + + platinit(); + + kprintf(CONSOLE_RESET); + kprintf("\n%s\n\n", VERSION); + + /* Initialize free memory list */ + + meminit(); + + /* Initialize system variables */ + + /* Count the Null process as the first process in the system */ + prcount = 0; +// prcount = 1; + + /* Scheduling is not currently blocked */ + + Defer.ndefers = 0; + + /* Initialize process table entries free */ + + for (i = 0; i < NPROC; i++) { + prptr = &proctab[i]; + prptr->prstate = PR_FREE; + prptr->prname[0] = NULLCH; + prptr->prstkbase = NULL; + prptr->prprio = 0; + } + + + /* Initialize semaphores */ + + for (i = 0; i < NSEM; i++) { + semptr = &semtab[i]; + semptr->sstate = S_FREE; + semptr->scount = 0; + semptr->squeue = newqueue(); + } + + /* Initialize buffer pools */ + + bufinit(); + + /* Create a ready list for processes */ + + readylist = newqueue(); + + + for (i = 0; i < NDEVS; i++) { + init(i); + } + return; +} + +int32 stop(char *s) +{ + kprintf("%s\n", s); + kprintf("looping... press reset\n"); + while(1) + /* Empty */; +} + +int32 delay(int n) +{ + DELAY(n); + return OK; +} diff --git a/system/insert.c b/system/insert.c new file mode 100644 index 0000000..ecf4274 --- /dev/null +++ b/system/insert.c @@ -0,0 +1,36 @@ +/* insert.c - insert */ + +#include + +/*------------------------------------------------------------------------ + * insert - Insert a process into a queue in descending key order + *------------------------------------------------------------------------ + */ +status insert( + pid32 pid, /* ID of process to insert */ + qid16 q, /* ID of queue to use */ + int32 key /* Key for the inserted process */ + ) +{ + qid16 curr; /* Runs through items in a queue*/ + qid16 prev; /* Holds previous node index */ + + if (isbadqid(q) || isbadpid(pid)) { + return SYSERR; + } + + curr = firstid(q); + while (queuetab[curr].qkey >= key) { + curr = queuetab[curr].qnext; + } + + /* Insert process between curr node and previous node */ + + prev = queuetab[curr].qprev; /* Get index of previous node */ + queuetab[pid].qnext = curr; + queuetab[pid].qprev = prev; + queuetab[pid].qkey = key; + queuetab[prev].qnext = pid; + queuetab[curr].qprev = pid; + return OK; +} diff --git a/system/insertd.c b/system/insertd.c new file mode 100644 index 0000000..8f5e700 --- /dev/null +++ b/system/insertd.c @@ -0,0 +1,42 @@ +/* insertd.c - insertd */ + +#include + +/*------------------------------------------------------------------------ + * insertd - Insert a process in delta list using delay as the key + *------------------------------------------------------------------------ + */ +status insertd( /* Assumes interrupts disabled */ + pid32 pid, /* ID of process to insert */ + qid16 q, /* ID of queue to use */ + int32 key /* Delay from "now" (in ms.) */ + ) +{ + int32 next; /* Runs through the delta list */ + int32 prev; /* Follows next through the list*/ + + if (isbadqid(q) || isbadpid(pid)) { + return SYSERR; + } + + prev = queuehead(q); + next = queuetab[queuehead(q)].qnext; + while ((next != queuetail(q)) && (queuetab[next].qkey <= key)) { + key -= queuetab[next].qkey; + prev = next; + next = queuetab[next].qnext; + } + + /* Insert new node between prev and next nodes */ + + queuetab[pid].qnext = next; + queuetab[pid].qprev = prev; + queuetab[pid].qkey = key; + queuetab[prev].qnext = pid; + queuetab[next].qprev = pid; + if (next != queuetail(q)) { + queuetab[next].qkey -= key; + } + + return OK; +} diff --git a/system/intr.S b/system/intr.S new file mode 100644 index 0000000..2ba3f8d --- /dev/null +++ b/system/intr.S @@ -0,0 +1,60 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* intr.S - enable, disable, restore, halt, pause, (ARM) */ + +#include + + .text + .globl disable + .globl restore + .globl enable + .globl pause + .globl halt + +/*------------------------------------------------------------------------ + * disable - Disable interrupts and return the previous state + *------------------------------------------------------------------------ + */ +disable: +// mrs r0, psr /* Copy the CPSR into r0 */ +// cpsid i /* Disable interrupts */ +// bx lr /* Return the CPSR */ + +/*------------------------------------------------------------------------ + * restore - Restore interrupts to value given by mask argument + Cortex M3 hardware handles a lot, rewrite + *------------------------------------------------------------------------ + */ +restore: +// msr psr_nzcvq, r0 /* Restore the CPSR */ +// cpsie i +// bx lr /* Return to caller */ + +/*------------------------------------------------------------------------ + * enable - Enable interrupts + *------------------------------------------------------------------------ + */ +enable: +// cpsie i /* Enable interrupts */ +// bx lr /* Return */ + +/*------------------------------------------------------------------------ + * pause or halt - Place the processor in a hard loop + *------------------------------------------------------------------------ + */ +halt: +pause: +// cpsid i /* Disable interrupts */ +//dloop: b dloop /* Dead loop */ diff --git a/system/intr.S.orig b/system/intr.S.orig new file mode 100644 index 0000000..7b06e1d --- /dev/null +++ b/system/intr.S.orig @@ -0,0 +1,60 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* intr.S - enable, disable, restore, halt, pause, (ARM) */ + +#include + + .text + .globl disable + .globl restore + .globl enable + .globl pause + .globl halt + +/*------------------------------------------------------------------------ + * disable - Disable interrupts and return the previous state + *------------------------------------------------------------------------ + */ +disable: + mrs r0, psr /* Copy the CPSR into r0 */ + cpsid i /* Disable interrupts */ + bx lr /* Return the CPSR */ + +/*------------------------------------------------------------------------ + * restore - Restore interrupts to value given by mask argument + Cortex M3 hardware handles a lot, rewrite + *------------------------------------------------------------------------ + */ +restore: + msr psr_nzcvq, r0 /* Restore the CPSR */ + cpsie i + bx lr /* Return to caller */ + +/*------------------------------------------------------------------------ + * enable - Enable interrupts + *------------------------------------------------------------------------ + */ +enable: + cpsie i /* Enable interrupts */ + bx lr /* Return */ + +/*------------------------------------------------------------------------ + * pause or halt - Place the processor in a hard loop + *------------------------------------------------------------------------ + */ +halt: +pause: + cpsid i /* Disable interrupts */ +dloop: b dloop /* Dead loop */ diff --git a/system/ioerr.c b/system/ioerr.c new file mode 100644 index 0000000..4bbfbef --- /dev/null +++ b/system/ioerr.c @@ -0,0 +1,12 @@ +/* ioerr.c - ioerr */ + +#include + +/*------------------------------------------------------------------------ + * ioerr - Return an error status (used for "error" entries in devtab) + *------------------------------------------------------------------------ + */ +devcall ioerr(void) +{ + return SYSERR; +} diff --git a/system/ionull.c b/system/ionull.c new file mode 100644 index 0000000..ea67864 --- /dev/null +++ b/system/ionull.c @@ -0,0 +1,12 @@ +/* ionull.c - ionull */ + +#include + +/*------------------------------------------------------------------------ + * ionull - Do nothing (used for "don't care" entries in devtab) + *------------------------------------------------------------------------ + */ +devcall ionull(void) +{ + return OK; +} diff --git a/system/kill.c b/system/kill.c new file mode 100644 index 0000000..d0b711e --- /dev/null +++ b/system/kill.c @@ -0,0 +1,59 @@ +/* kill.c - kill */ + +#include + +/*------------------------------------------------------------------------ + * kill - Kill a process and remove it from the system + *------------------------------------------------------------------------ + */ +syscall kill( + pid32 pid /* ID of process to kill */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process's table entry */ + int32 i; /* Index into descriptors */ + + mask = disable(); + if (isbadpid(pid) || (pid == NULLPROC) + || ((prptr = &proctab[pid])->prstate) == PR_FREE) { + restore(mask); + return SYSERR; + } + + if (--prcount <= 1) { /* Last user process completes */ + xdone(); + } + + send(prptr->prparent, pid); + for (i=0; i<3; i++) { + close(prptr->prdesc[i]); + } + freestk(prptr->prstkbase, prptr->prstklen); + + switch (prptr->prstate) { + case PR_CURR: + prptr->prstate = PR_FREE; /* Suicide */ + *SCB_ICSR |= (1 << PENDSV_INTR); + + case PR_SLEEP: + case PR_RECTIM: + unsleep(pid); + prptr->prstate = PR_FREE; + break; + + case PR_WAIT: + semtab[prptr->prsem].scount++; + /* Fall through */ + + case PR_READY: + getitem(pid); /* Remove from queue */ + /* Fall through */ + + default: + prptr->prstate = PR_FREE; + } + + restore(mask); + return OK; +} diff --git a/system/kprintf.c b/system/kprintf.c new file mode 100644 index 0000000..f10b8e9 --- /dev/null +++ b/system/kprintf.c @@ -0,0 +1,57 @@ +/* kprintf.c - kputc, kgetc, kprintf */ +/* Kprintf uses a direct method to write to serial + * Used for debugging purposes. Should in normal cases + * use printf that does a syscall + * */ + +#include +#include + +/*------------------------------------------------------------------------ + * kputc - use polled I/O to write a character to the console serial line + *------------------------------------------------------------------------ + */ +syscall kputc( + byte c /* character to write */ + ) +{ + intmask mask; + volatile struct uart_csreg * uptr = 0x40013800; + + mask = disable(); + + if (c == '\n') { + while(!(uptr->sr & UART_TC)); + uptr->dr = 0x0D; // return line + } + while(!(uptr->sr & UART_TC)); + uptr->dr = c; + + restore(mask); + return OK; +} + +/*------------------------------------------------------------------------ + * kgetc - use polled I/O to read a character from the console serial line + *------------------------------------------------------------------------ + */ +syscall kgetc(void) +{ + // Not used +} + +extern void _doprnt(char *, va_list, int (*)(int)); + +/*------------------------------------------------------------------------ + * kprintf - use polled I/O to print formatted output on the console + *------------------------------------------------------------------------ + */ +syscall kprintf(char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + _doprnt(fmt, ap, (int (*)(int))kputc); + va_end(ap); + return OK; +} diff --git a/system/main.c b/system/main.c new file mode 100644 index 0000000..a3f8ff3 --- /dev/null +++ b/system/main.c @@ -0,0 +1,31 @@ +/* main.c - main */ +// This is user land + +#include + +extern void notmain(void); + +process main(void) +{ + //RAFA + notmain(); + + /* Run the Xinu shell */ + recvclr(); + + + resume(create(shell, 4096, 50, "shell", 1, 0)); + + /* Wait for shell to exit and recreate it */ + + while (TRUE) { + receive(); + //kprintf("Entering sleep"); + sleepms(200); + // RAFA kprintf("\n\nMain process recreating shell\n\n"); + kprintf(&m1[0]); + resume(create(shell, 4096, 20, "shell", 1, CONSOLE)); + } + return OK; + +} diff --git a/system/mark.c b/system/mark.c new file mode 100644 index 0000000..f20a304 --- /dev/null +++ b/system/mark.c @@ -0,0 +1,47 @@ +/* mark.c - markinit, mark */ + +#include + +int32 *marks[MAXMARK]; /* Pointers to marked locations */ +int32 nmarks; /* Number of marked locations */ +sid32 mkmutex; /* Mutual exclusion semaphore */ + +/*------------------------------------------------------------------------ + * markinit - Called once at system startup + *------------------------------------------------------------------------ + */ +void markinit(void) +{ + nmarks = 0; + mkmutex = semcreate(1); +} + + +/*------------------------------------------------------------------------ + * mark - Mark a specified memory location + *------------------------------------------------------------------------ + */ +status mark( + int32 *loc /* Location to mark */ + ) +{ + + /* If location is already marked, do nothing */ + + if ( (*loc>=0) && (*loc= MAXMARK) { + return SYSERR; + } + + /* Obtain exclusive access and mark the specified location */ + + wait(mkmutex); + marks[ (*loc) = nmarks++ ] = loc; + signal(mkmutex); + return OK; +} diff --git a/system/meminit.c b/system/meminit.c new file mode 100644 index 0000000..3fbecd8 --- /dev/null +++ b/system/meminit.c @@ -0,0 +1,39 @@ +/* meminit.c - meminit */ + +#include + +void *minheap; /* Start address of heap */ +void *maxheap; /* End address of heap */ + +/*------------------------------------------------------------------------ + * meminit - Initialize the free memory list for BeagleBone Black + *------------------------------------------------------------------------ + */ + +//RAFA AGREGO ESTO +extern int __bss_end; + + + +void meminit(void) +{ + struct memblk *memptr; /* Memory block pointer */ + + /* Initialize the minheap and maxheap variables */ + + //RAFA AGREGO ESTO + int end = __bss_end + 1; + + minheap = (void *)&end; + /* 1024 bytes is reserved for supervise mode handling */ + maxheap = (void *)MAXADDR - HANDLERSTACK; + + /* Initialize the memory list as one big block */ + + memlist.mnext = (struct memblk *)minheap; + memptr = memlist.mnext; + + memptr->mnext = (struct memblk *)NULL; + memlist.mlength = memptr->mlength = + (uint32)maxheap - (uint32)minheap; +} diff --git a/system/mkbufpool.c b/system/mkbufpool.c new file mode 100644 index 0000000..9191b62 --- /dev/null +++ b/system/mkbufpool.c @@ -0,0 +1,55 @@ +/* mkbufpool.c - mkbufpool */ + +#include + +/*------------------------------------------------------------------------ + * mkbufpool - Allocate memory for a buffer pool and link the buffers + *------------------------------------------------------------------------ + */ +bpid32 mkbufpool( + int32 bufsiz, /* Size of a buffer in the pool */ + int32 numbufs /* Number of buffers in the pool*/ + ) +{ + intmask mask; /* Saved interrupt mask */ + bpid32 poolid; /* ID of pool that is created */ + struct bpentry *bpptr; /* Pointer to entry in buftab */ + char *buf; /* Pointer to memory for buffer */ + + mask = disable(); + if (bufsizBP_MAXB + || numbufs<1 || numbufs>BP_MAXN + || nbpools >= NBPOOLS) { + restore(mask); + return (bpid32)SYSERR; + } + /* Round request to a multiple of 4 bytes */ + + bufsiz = ( (bufsiz + 3) & (~3) ); + + buf = (char *)getmem( numbufs * (bufsiz+sizeof(bpid32)) ); + if ((int32)buf == SYSERR) { + restore(mask); + return (bpid32)SYSERR; + } + poolid = nbpools++; + bpptr = &buftab[poolid]; + bpptr->bpnext = (struct bpentry *)buf; + bpptr->bpsize = bufsiz; + if ( (bpptr->bpsem = semcreate(numbufs)) == SYSERR) { + freemem(buf, numbufs * (bufsiz+sizeof(bpid32)) ); + nbpools--; + restore(mask); + return (bpid32)SYSERR; + } + bufsiz+=sizeof(bpid32); + for (numbufs-- ; numbufs>0 ; numbufs-- ) { + bpptr = (struct bpentry *)buf; + buf += bufsiz; + bpptr->bpnext = (struct bpentry *)buf; + } + bpptr = (struct bpentry *)buf; + bpptr->bpnext = (struct bpentry *)NULL; + restore(mask); + return poolid; +} diff --git a/system/newqueue.c b/system/newqueue.c new file mode 100644 index 0000000..3a0a530 --- /dev/null +++ b/system/newqueue.c @@ -0,0 +1,30 @@ +/* newqueue.c - newqueue */ + +#include + +/*------------------------------------------------------------------------ + * newqueue - Allocate and initialize a queue in the global queue table + *------------------------------------------------------------------------ + */ +qid16 newqueue(void) +{ + static qid16 nextqid=NPROC; /* Next list in queuetab to use */ + qid16 q; /* ID of allocated queue */ + + q = nextqid; + if (q >= NQENT) { /* Check for table overflow */ + return SYSERR; + } + + nextqid += 2; /* Increment index for next call*/ + + /* Initialize head and tail nodes to form an empty queue */ + + queuetab[queuehead(q)].qnext = queuetail(q); + queuetab[queuehead(q)].qprev = EMPTY; + queuetab[queuehead(q)].qkey = MAXKEY; + queuetab[queuetail(q)].qnext = EMPTY; + queuetab[queuetail(q)].qprev = queuehead(q); + queuetab[queuetail(q)].qkey = MINKEY; + return q; +} diff --git a/system/open.c b/system/open.c new file mode 100644 index 0000000..c4827fe --- /dev/null +++ b/system/open.c @@ -0,0 +1,41 @@ +/* open.c - open */ + +#include + +//RAFA +typedef unsigned int size_t; +#include +typedef void (*fn_ptr) (void); + + +/*------------------------------------------------------------------------ + * open - Open a device (some devices ignore name and mode parameters) + *------------------------------------------------------------------------ + */ +syscall open( + did32 descrp, /* Descriptor for device */ + char *name, /* Name to use, if any */ + char *mode /* Mode for device, if any */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct dentry *devptr; /* Entry in device switch table */ + int32 retval; /* Value to return to caller */ + + mask = disable(); + if (isbaddev(descrp)) { + restore(mask); + return SYSERR; + } + devptr = (struct dentry *) &devtab[descrp]; + retval = (*devptr->dvopen) (devptr, name, mode); + // devcall * f = (devcall *) pgm_read_word(&devtab[descrp].dvopen); + // (f) (devptr, name, mode); + // devptr = (struct dentry *) pgm_read_word(&devtab[descrp]); + //retval = (*fn_ptr) (pgm_read_word(*devptr->dvopen)) (devptr, name, mode); + // retval = (fn_ptr pgm_read_word(&devtab[descrp].dvopen)) (devptr, name, mode); + // retval = (fn_ptr pgm_read_word(*devptr->dvopen) (devptr, name, mode); + + restore(mask); + return retval; +} diff --git a/system/panic.c b/system/panic.c new file mode 100644 index 0000000..830b51f --- /dev/null +++ b/system/panic.c @@ -0,0 +1,16 @@ +/* panic.c - panic */ + +#include + +/*------------------------------------------------------------------------ + * panic - Display a message and stop all processing + *------------------------------------------------------------------------ + */ +void panic ( + char *msg /* Message to display */ + ) +{ + disable(); /* Disable interrupts */ + kprintf("\n\n\rpanic: %s\n\n", msg); + while(TRUE) {;} /* Busy loop forever */ +} diff --git a/system/platinit.c b/system/platinit.c new file mode 100644 index 0000000..0dbce0b --- /dev/null +++ b/system/platinit.c @@ -0,0 +1,85 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* platinit.c - platinit */ + +#include + +//RAFA +#include + + +void uartinit(); + + +/*------------------------------------------------------------------------ + * platinit - platform specific initialization + *------------------------------------------------------------------------ + */ + +// RAFA puso lo siguiente +// extern int _edata; +// extern int __data_start; +// extern int _etext; + +void platinit(void) +{ + /* Load .data segment into SRAM */ + // extern uint32 * etext, data, edata; + // int size = (&edata - &data); + // memcpy(&data, &etext, size); + + /* Initialize UART Serial communication */ + // RAFA uartinit(); + // serial_init(); + // serial_put_char('A'); + // serial_put_char('B'); + // serial_put_str("Xinu AVR loading...\n"); + + /* Initialize the Interrupt Controller (evec.c) */ + initintc(); + + /* System calls */ + syscall_init(); +} + +/* Simple UART initialization, not using a TTY device +Used by kprintf and early system debugging */ + +void uartinit() +{ + + struct uart_csreg *uptr; /* Address of UART's CSRs */ + struct gpio_csreg *gptr; + struct clock_csreg *cptr; + + /* Enable 'clock' on peripherals */ + cptr = (struct clock_csreg *)CLOCK_BASE; + cptr->apb2enr |= (1 << IOPAEN) | (1 << USART1EN); + + /* Set in and output mode (dirty) */ + gptr = (struct gpio_csreg *)(0x40010800); + gptr->crh = 0x44444894; + + /* Enable peripheral */ + uptr = (struct uart_csreg *)(0x40013800); + uptr->cr1 &= ~(1 << UART_EN); + + /* Set baudrate 115200 */ + uptr->brr = 0x00000045; + + uptr->cr1 |= (1 << UART_INTR_RX) | (1 << UART_TX_EN) | (1 << UART_RX_EN); + uptr->cr1 |= (1 << UART_EN); + +} diff --git a/system/ptclear.c b/system/ptclear.c new file mode 100644 index 0000000..8ea1384 --- /dev/null +++ b/system/ptclear.c @@ -0,0 +1,50 @@ +/* ptclear.c - _ptclear */ + +#include + +/*------------------------------------------------------------------------ + * _ptclear - Used by ptdelete and ptreset to clear or reset a port + * (internal function assumes interrupts disabled and + * arguments have been checked for validity) + *------------------------------------------------------------------------ + */ +void _ptclear( + struct ptentry *ptptr, /* Table entry to clear */ + uint16 newstate, /* New state for port */ + int32 (*dispose)(int32)/* Disposal function to call */ + ) +{ + struct ptnode *walk; /* Pointer to walk message list */ + + /* Place port in limbo state while waiting processes are freed */ + + ptptr->ptstate = PT_LIMBO; + + ptptr->ptseq++; /* Reset accession number */ + walk = ptptr->pthead; /* First item on msg list */ + + if ( walk != NULL ) { /* If message list nonempty */ + + /* Walk message list and dispose of each message */ + + for( ; walk!=NULL ; walk=walk->ptnext) { + (*dispose)( walk->ptmsg ); + } + + /* Link entire message list into the free list */ + + (ptptr->pttail)->ptnext = ptfree; + ptfree = ptptr->pthead; + } + + if (newstate == PT_ALLOC) { + ptptr->pttail = ptptr->pthead = NULL; + semreset(ptptr->ptssem, ptptr->ptmaxcnt); + semreset(ptptr->ptrsem, 0); + } else { + semdelete(ptptr->ptssem); + semdelete(ptptr->ptrsem); + } + ptptr->ptstate = newstate; + return; +} diff --git a/system/ptcount.c b/system/ptcount.c new file mode 100644 index 0000000..12076a4 --- /dev/null +++ b/system/ptcount.c @@ -0,0 +1,44 @@ +/* ptcount.c - ptcount */ + +#include + +/*------------------------------------------------------------------------ + * ptcount - Return the count of messages currently waiting in a port + * (a non-negative count K means the port contains K + * K messages, including messages from senders that + * are blocked waiting to send a message; a count of + * negative K means a port is empty and K processes + * are blocked waiting to receive a message) + *------------------------------------------------------------------------ + */ +int32 ptcount( + int32 portid /* ID of a port to use */ + ) +{ + intmask mask; /* Saved interrupt mask */ + int32 count; /* Count of messages available */ + int32 sndcnt; /* Count of sender semaphore */ + struct ptentry *ptptr; /* Pointer to port table entry */ + + mask = disable(); + if ( isbadport(portid) || + (ptptr= &porttab[portid])->ptstate != PT_ALLOC ) { + restore(mask); + return SYSERR; + } + + /* Get count of messages available */ + + count = semcount(ptptr->ptrsem); + + /* If messages are waiting, check for blocked senders */ + + if (count >= 0) { + sndcnt = semcount(ptptr->ptssem); + if (sndcnt < 0) { /* -sndcnt senders blocked */ + count += -sndcnt; + } + } + restore(mask); + return count; +} diff --git a/system/ptcreate.c b/system/ptcreate.c new file mode 100644 index 0000000..c020876 --- /dev/null +++ b/system/ptcreate.c @@ -0,0 +1,46 @@ +/* ptcreate.c - ptcreate */ + +#include + +/*------------------------------------------------------------------------ + * ptcreate - Create a port that allows "count" outstanding messages + *------------------------------------------------------------------------ + */ +syscall ptcreate( + int32 count /* Size of port */ + ) +{ + intmask mask; /* Saved interrupt mask */ + int32 i; /* Counts all possible ports */ + int32 ptnum; /* Candidate port number to try */ + struct ptentry *ptptr; /* Pointer to port table entry */ + + mask = disable(); + if (count < 0) { + restore(mask); + return SYSERR; + } + + for (i=0 ; i= NPORTS) { + ptnextid = 0; /* Reset for next iteration */ + } + + /* Check table entry that corresponds to ID ptnum */ + + ptptr= &porttab[ptnum]; + if (ptptr->ptstate == PT_FREE) { + ptptr->ptstate = PT_ALLOC; + ptptr->ptssem = semcreate(count); + ptptr->ptrsem = semcreate(0); + ptptr->pthead = ptptr->pttail = NULL; + ptptr->ptseq++; + ptptr->ptmaxcnt = count; + restore(mask); + return ptnum; + } + } + restore(mask); + return SYSERR; +} diff --git a/system/ptdelete.c b/system/ptdelete.c new file mode 100644 index 0000000..4fc51d2 --- /dev/null +++ b/system/ptdelete.c @@ -0,0 +1,27 @@ +/* ptdelete.c - ptdelete */ + +#include + +/*------------------------------------------------------------------------ + * ptdelete - Delete a port, freeing waiting processes and messages + *------------------------------------------------------------------------ + */ +syscall ptdelete( + int32 portid, /* ID of port to delete */ + int32 (*disp)(int32) /* Function to call to dispose */ + ) /* of waiting messages */ +{ + intmask mask; /* Saved interrupt mask */ + struct ptentry *ptptr; /* Pointer to port table entry */ + + mask = disable(); + if ( isbadport(portid) || + (ptptr= &porttab[portid])->ptstate != PT_ALLOC ) { + restore(mask); + return SYSERR; + } + _ptclear(ptptr, PT_FREE, disp); + ptnextid = portid; + restore(mask); + return OK; +} diff --git a/system/ptinit.c b/system/ptinit.c new file mode 100644 index 0000000..a6af980 --- /dev/null +++ b/system/ptinit.c @@ -0,0 +1,45 @@ +/* ptinit.c - ptinit */ + +#include + +struct ptnode *ptfree; /* List of free message nodes */ +struct ptentry porttab[NPORTS]; /* Port table */ +int32 ptnextid; /* Next table entry to try */ + +/*------------------------------------------------------------------------ + * ptinit - Initialize all ports + *------------------------------------------------------------------------ + */ +syscall ptinit( + int32 maxmsgs /* Total messages in all ports */ + ) +{ + int32 i; /* Runs through the port table */ + struct ptnode *next, *curr; /* Used to build a free list */ + + /* Allocate memory for all messages on all ports */ + + ptfree = (struct ptnode *)getmem(maxmsgs*sizeof(struct ptnode)); + if (ptfree == (struct ptnode *)SYSERR) { + panic("ptinit - insufficient memory"); + } + + /* Initialize all port table entries to free */ + + for (i=0 ; i 0 ; curr=next ) { + curr->ptnext = ++next; + } + + /* Set the pointer in the final node to NULL */ + + curr->ptnext = NULL; + return OK; +} diff --git a/system/ptrecv.c b/system/ptrecv.c new file mode 100644 index 0000000..bcfc9b2 --- /dev/null +++ b/system/ptrecv.c @@ -0,0 +1,48 @@ +/* ptrecv.c - ptrecv */ + +#include + +/*------------------------------------------------------------------------ + * ptrecv - Receive a message from a port, blocking if port empty + *------------------------------------------------------------------------ + */ +uint32 ptrecv( + int32 portid /* ID of port to use */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct ptentry *ptptr; /* Pointer to table entry */ + int32 seq; /* Local copy of sequence num. */ + umsg32 msg; /* Message to return */ + struct ptnode *msgnode; /* First node on message list */ + + mask = disable(); + if ( isbadport(portid) || + (ptptr= &porttab[portid])->ptstate != PT_ALLOC ) { + restore(mask); + return (uint32)SYSERR; + } + + /* Wait for message and verify that the port is still allocated */ + + seq = ptptr->ptseq; /* Record orignal sequence */ + if (wait(ptptr->ptrsem) == SYSERR || ptptr->ptstate != PT_ALLOC + || ptptr->ptseq != seq) { + restore(mask); + return (uint32)SYSERR; + } + + /* Dequeue first message that is waiting in the port */ + + msgnode = ptptr->pthead; + msg = msgnode->ptmsg; + if (ptptr->pthead == ptptr->pttail) /* Delete last item */ + ptptr->pthead = ptptr->pttail = NULL; + else + ptptr->pthead = msgnode->ptnext; + msgnode->ptnext = ptfree; /* Return to free list */ + ptfree = msgnode; + signal(ptptr->ptssem); + restore(mask); + return msg; +} diff --git a/system/ptreset.c b/system/ptreset.c new file mode 100644 index 0000000..607a499 --- /dev/null +++ b/system/ptreset.c @@ -0,0 +1,27 @@ +/* ptreset.c - ptreset */ + +#include + +/*------------------------------------------------------------------------ + * ptreset - Reset a port, freeing waiting processes and messages and + leaving the port ready for further use + *------------------------------------------------------------------------ + */ +syscall ptreset( + int32 portid, /* ID of port to reset */ + int32 (*disp)(int32) /* Function to call to dispose */ + ) /* of waiting messages */ +{ + intmask mask; /* Saved interrupt mask */ + struct ptentry *ptptr; /* Pointer to port table entry */ + + mask = disable(); + if ( isbadport(portid) || + (ptptr= &porttab[portid])->ptstate != PT_ALLOC ) { + restore(mask); + return SYSERR; + } + _ptclear(ptptr, PT_ALLOC, disp); + restore(mask); + return OK; +} diff --git a/system/ptsend.c b/system/ptsend.c new file mode 100644 index 0000000..acb14ea --- /dev/null +++ b/system/ptsend.c @@ -0,0 +1,60 @@ +/* ptsend.c - ptsend */ + +#include + +/*------------------------------------------------------------------------ + * ptsend - Send a message to a port by adding it to the queue + *------------------------------------------------------------------------ + */ +syscall ptsend( + int32 portid, /* ID of port to use */ + umsg32 msg /* Message to send */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct ptentry *ptptr; /* Pointer to table entry */ + int32 seq; /* Local copy of sequence num. */ + struct ptnode *msgnode; /* Allocated message node */ + struct ptnode *tailnode; /* Last node in port or NULL */ + + mask = disable(); + if ( isbadport(portid) || + (ptptr= &porttab[portid])->ptstate != PT_ALLOC ) { + restore(mask); + return SYSERR; + } + + /* Wait for space and verify port has not been reset */ + + seq = ptptr->ptseq; /* Record original sequence */ + if (wait(ptptr->ptssem) == SYSERR + || ptptr->ptstate != PT_ALLOC + || ptptr->ptseq != seq) { + restore(mask); + return SYSERR; + } + if (ptfree == NULL) { + // RAFA panic("Port system ran out of message nodes"); + panic(&m2[0]); + } + + /* Obtain node from free list by unlinking */ + + msgnode = ptfree; /* Point to first free node */ + ptfree = msgnode->ptnext; /* Unlink from the free list */ + msgnode->ptnext = NULL; /* Set fields in the node */ + msgnode->ptmsg = msg; + + /* Link into queue for the specified port */ + + tailnode = ptptr->pttail; + if (tailnode == NULL) { /* Queue for port was empty */ + ptptr->pttail = ptptr->pthead = msgnode; + } else { /* Insert new node at tail */ + tailnode->ptnext = msgnode; + ptptr->pttail = msgnode; + } + signal(ptptr->ptrsem); + restore(mask); + return OK; +} diff --git a/system/putc.c b/system/putc.c new file mode 100644 index 0000000..f94b526 --- /dev/null +++ b/system/putc.c @@ -0,0 +1,27 @@ +/* putc.c - putc */ + +#include + +/*------------------------------------------------------------------------ + * putc - Send one character of data (byte) to a device + *------------------------------------------------------------------------ + */ +syscall putc( + did32 descrp, /* Descriptor for device */ + char ch /* Character to send */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct dentry *devptr; /* Entry in device switch table */ + int32 retval; /* Value to return to caller */ + + mask = disable(); + if (isbaddev(descrp)) { + restore(mask); + return SYSERR; + } + devptr = (struct dentry *) &devtab[descrp]; + retval = (*devptr->dvputc) (devptr, ch); + restore(mask); + return retval; +} diff --git a/system/queue.c b/system/queue.c new file mode 100644 index 0000000..facf0bf --- /dev/null +++ b/system/queue.c @@ -0,0 +1,52 @@ +/* queue.c - enqueue, dequeue */ + +#include + +struct qentry queuetab[NQENT]; /* Table of process queues */ + +/*------------------------------------------------------------------------ + * enqueue - Insert a process at the tail of a queue + *------------------------------------------------------------------------ + */ +pid32 enqueue( + pid32 pid, /* ID of process to insert */ + qid16 q /* ID of queue to use */ + ) +{ + qid16 tail, prev; /* Tail & previous node indexes */ + + if (isbadqid(q) || isbadpid(pid)) { + return SYSERR; + } + + tail = queuetail(q); + prev = queuetab[tail].qprev; + + queuetab[pid].qnext = tail; /* Insert just before tail node */ + queuetab[pid].qprev = prev; + queuetab[prev].qnext = pid; + queuetab[tail].qprev = pid; + return pid; +} + +/*------------------------------------------------------------------------ + * dequeue - Remove and return the first process on a list + *------------------------------------------------------------------------ + */ +pid32 dequeue( + qid16 q /* ID of queue to use */ + ) +{ + pid32 pid; /* ID of process removed */ + + if (isbadqid(q)) { + return SYSERR; + } else if (isempty(q)) { + return EMPTY; + } + + pid = getfirst(q); + queuetab[pid].qprev = EMPTY; + queuetab[pid].qnext = EMPTY; + return pid; +} diff --git a/system/read.c b/system/read.c new file mode 100644 index 0000000..0374788 --- /dev/null +++ b/system/read.c @@ -0,0 +1,28 @@ +/* read.c - read */ + +#include + +/*------------------------------------------------------------------------ + * read - Read one or more bytes from a device + *------------------------------------------------------------------------ + */ +syscall read( + did32 descrp, /* Descriptor for device */ + char *buffer, /* Address of buffer */ + uint32 count /* Length of buffer */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct dentry *devptr; /* Entry in device switch table */ + int32 retval; /* Value to return to caller */ + + mask = disable(); + if (isbaddev(descrp)) { + restore(mask); + return SYSERR; + } + devptr = (struct dentry *) &devtab[descrp]; + retval = (*devptr->dvread) (devptr, buffer, count); + restore(mask); + return retval; +} diff --git a/system/ready.c b/system/ready.c new file mode 100644 index 0000000..4cf6281 --- /dev/null +++ b/system/ready.c @@ -0,0 +1,30 @@ +/* ready.c - ready */ + +#include + +qid16 readylist; /* Index of ready list */ + +/*------------------------------------------------------------------------ + * ready - Make a process eligible for CPU service + *------------------------------------------------------------------------ + */ +status ready( + pid32 pid /* ID of process to make ready */ + ) +{ + register struct procent *prptr; + + if (isbadpid(pid)) { + return SYSERR; + } + + /* Set process state to indicate ready and add to ready list */ + + prptr = &proctab[pid]; + prptr->prstate = PR_READY; + insert(pid, readylist, prptr->prprio); + + *SCB_ICSR |= (1 << PENDSV_INTR); + + return OK; +} diff --git a/system/receive.c b/system/receive.c new file mode 100644 index 0000000..daa8b0c --- /dev/null +++ b/system/receive.c @@ -0,0 +1,25 @@ +/* receive.c - receive */ + +#include + +/*------------------------------------------------------------------------ + * receive - Wait for a message and return the message to the caller + *------------------------------------------------------------------------ + */ +umsg32 receive(void) +{ + //intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process's table entry */ + umsg32 msg; /* Message to return */ + + //mask = disable(); + prptr = &proctab[currpid]; + if (prptr->prhasmsg == FALSE) { + prptr->prstate = PR_RECV; + *SCB_ICSR |= (1 << PENDSV_INTR); /* Reschedule */ + } + msg = prptr->prmsg; /* Retrieve message */ + prptr->prhasmsg = FALSE; /* Reset message flag */ + //restore(mask); + return msg; +} diff --git a/system/recvclr.c b/system/recvclr.c new file mode 100644 index 0000000..d0393fd --- /dev/null +++ b/system/recvclr.c @@ -0,0 +1,25 @@ +/* recvclr.c - recvclr */ + +#include + +/*------------------------------------------------------------------------ + * recvclr - Clear incoming message, and return message if one waiting + *------------------------------------------------------------------------ + */ +umsg32 recvclr(void) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process's table entry */ + umsg32 msg; /* Message to return */ + + mask = disable(); + prptr = &proctab[currpid]; + if (prptr->prhasmsg == TRUE) { + msg = prptr->prmsg; /* Retrieve message */ + prptr->prhasmsg = FALSE;/* Reset message flag */ + } else { + msg = OK; + } + restore(mask); + return msg; +} diff --git a/system/recvtime.c b/system/recvtime.c new file mode 100644 index 0000000..8ff7558 --- /dev/null +++ b/system/recvtime.c @@ -0,0 +1,45 @@ +/* recvtime.c - recvtime */ + +#include + +/*------------------------------------------------------------------------ + * recvtime - Wait specified time to receive a message and return + *------------------------------------------------------------------------ + */ +umsg32 recvtime( + int32 maxwait /* Ticks to wait before timeout */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Tbl entry of current process */ + umsg32 msg; /* Message to return */ + + if (maxwait < 0) { + return SYSERR; + } + mask = disable(); + + /* Schedule wakeup and place process in timed-receive state */ + + prptr = &proctab[currpid]; + if (prptr->prhasmsg == FALSE) { /* Delay if no message waiting */ + if (insertd(currpid,sleepq,maxwait) == SYSERR) { + restore(mask); + return SYSERR; + } + prptr->prstate = PR_RECTIM; + *SCB_ICSR |= (1 << PENDSV_INTR); + //resched(); + } + + /* Either message arrived or timer expired */ + + if (prptr->prhasmsg) { + msg = prptr->prmsg; /* Retrieve message */ + prptr->prhasmsg = FALSE;/* Reset message indicator */ + } else { + msg = TIMEOUT; + } + restore(mask); + return msg; +} diff --git a/system/resched.c b/system/resched.c new file mode 100644 index 0000000..dcdf060 --- /dev/null +++ b/system/resched.c @@ -0,0 +1,146 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* resched.c - resched, resched_cntl */ + +#include + +struct defer Defer; + +/* Reschedule is implemented on Cortex's PendSV call + * The __attribute__((naked)) makes sure the compiler doesn't + * places registers on the stack + * + * A PendSV is similar to an exception or interrupt + * A stack frame is pushed on entry and popped + * on exit BY PROCESSOR. */ + +/* A pendSV call before entering this handler + * places the following on the stack + * + * R0 <- args[0] + * R1 <- args[1] + * R2 + * R3 + * R12 + * LR <- Not a real LR, A certain 'mask' + * PC + * PSR <- Status of processor before call + * + * */ + +__attribute__ ((naked)) +void resched(void) +{ + uint32 * restorestk; +/* + asm volatile("mrs r0, psp"); + asm volatile("stmdb r0!, {r4-r11}"); + asm volatile("mov %0, r0" : "=r" (restorestk)); // save tmp pointer + +*/ + struct procent *ptold; /* Ptr to table entry for old process */ + struct procent *ptnew; /* Ptr to table entry for new process */ + + /* If rescheduling is deferred, record attempt and return */ + + if (Defer.ndefers > 0) { +/* + Defer.attempt = TRUE; + asm volatile ("mov r0, %0" : : "r" (restorestk)); + asm volatile("ldmia r0!, {r4-r11} "); + asm volatile ("msr psp, r0"); + asm volatile ( + "ldr r0, =0xFFFFFFFD" "\n\t" + "mov lr, r0" "\n\t" + "bx lr"); +*/ + } + + /* Point to process table entry for the current (old) process */ + + ptold = &proctab[currpid]; + + if (ptold->prstate == PR_CURR) { /* Process remains eligible */ + if (ptold->prprio > firstkey(readylist)) { +/* + asm volatile ("mov r0, %0" : : "r" (restorestk)); + asm volatile("ldmia r0!, {r4-r11} "); + asm volatile ("msr psp, r0"); + asm volatile ( + "ldr r0, =0xFFFFFFFD" "\n\t" + "mov lr, r0" "\n\t" + "bx lr"); +*/ + } + + /* Old process will no longer remain current */ + + ptold->prstate = PR_READY; + insert(currpid, readylist, ptold->prprio); + } + + /* Force context switch to highest priority ready process */ + + + currpid = dequeue(readylist); + ptnew = &proctab[currpid]; + ptnew->prstate = PR_CURR; + preempt = QUANTUM; /* Reset time slice for process */ + + + ptold->prstkptr = restorestk; + + /* Old process returns here when resumed */ +/* + asm volatile ("mov r0, %0" : : "r" (ptnew->prstkptr)); + asm volatile("ldmia r0!, {r4-r11} "); + asm volatile ("msr psp, r0"); + asm volatile ( + "ldr r0, =0xFFFFFFFD" "\n\t" + "mov lr, r0" "\n\t" + "bx lr"); +*/ +} + +/*------------------------------------------------------------------------ + * resched_cntl - Control whether rescheduling is deferred or allowed + *------------------------------------------------------------------------ + */ +status resched_cntl( /* Assumes interrupts are disabled */ + int32 defer /* Either DEFER_START or DEFER_STOP */ + ) +{ + switch (defer) { + + case DEFER_START: /* Handle a deferral request */ + + if (Defer.ndefers++ == 0) { + Defer.attempt = FALSE; + } + return OK; + + case DEFER_STOP: /* Handle end of deferral */ + if (Defer.ndefers <= 0) { + return SYSERR; + } + if ( (--Defer.ndefers == 0) && Defer.attempt ) { + *SCB_ICSR |= (1 << PENDSV_INTR); + } + return OK; + + default: + return SYSERR; + } +} diff --git a/system/resched.c.orig b/system/resched.c.orig new file mode 100644 index 0000000..f6ee210 --- /dev/null +++ b/system/resched.c.orig @@ -0,0 +1,138 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* resched.c - resched, resched_cntl */ + +#include + +struct defer Defer; + +/* Reschedule is implemented on Cortex's PendSV call + * The __attribute__((naked)) makes sure the compiler doesn't + * places registers on the stack + * + * A PendSV is similar to an exception or interrupt + * A stack frame is pushed on entry and popped + * on exit BY PROCESSOR. */ + +/* A pendSV call before entering this handler + * places the following on the stack + * + * R0 <- args[0] + * R1 <- args[1] + * R2 + * R3 + * R12 + * LR <- Not a real LR, A certain 'mask' + * PC + * PSR <- Status of processor before call + * + * */ + +__attribute__ ((naked)) +void resched(void) +{ + uint32 * restorestk; + asm volatile("mrs r0, psp"); + asm volatile("stmdb r0!, {r4-r11}"); + asm volatile("mov %0, r0" : "=r" (restorestk)); // save tmp pointer + + struct procent *ptold; /* Ptr to table entry for old process */ + struct procent *ptnew; /* Ptr to table entry for new process */ + + /* If rescheduling is deferred, record attempt and return */ + + if (Defer.ndefers > 0) { + Defer.attempt = TRUE; + asm volatile ("mov r0, %0" : : "r" (restorestk)); + asm volatile("ldmia r0!, {r4-r11} "); + asm volatile ("msr psp, r0"); + asm volatile ( + "ldr r0, =0xFFFFFFFD" "\n\t" + "mov lr, r0" "\n\t" + "bx lr"); + } + + /* Point to process table entry for the current (old) process */ + + ptold = &proctab[currpid]; + + if (ptold->prstate == PR_CURR) { /* Process remains eligible */ + if (ptold->prprio > firstkey(readylist)) { + asm volatile ("mov r0, %0" : : "r" (restorestk)); + asm volatile("ldmia r0!, {r4-r11} "); + asm volatile ("msr psp, r0"); + asm volatile ( + "ldr r0, =0xFFFFFFFD" "\n\t" + "mov lr, r0" "\n\t" + "bx lr"); + } + + /* Old process will no longer remain current */ + + ptold->prstate = PR_READY; + insert(currpid, readylist, ptold->prprio); + } + + /* Force context switch to highest priority ready process */ + + + currpid = dequeue(readylist); + ptnew = &proctab[currpid]; + ptnew->prstate = PR_CURR; + preempt = QUANTUM; /* Reset time slice for process */ + + + ptold->prstkptr = restorestk; + + /* Old process returns here when resumed */ + asm volatile ("mov r0, %0" : : "r" (ptnew->prstkptr)); + asm volatile("ldmia r0!, {r4-r11} "); + asm volatile ("msr psp, r0"); + asm volatile ( + "ldr r0, =0xFFFFFFFD" "\n\t" + "mov lr, r0" "\n\t" + "bx lr"); +} + +/*------------------------------------------------------------------------ + * resched_cntl - Control whether rescheduling is deferred or allowed + *------------------------------------------------------------------------ + */ +status resched_cntl( /* Assumes interrupts are disabled */ + int32 defer /* Either DEFER_START or DEFER_STOP */ + ) +{ + switch (defer) { + + case DEFER_START: /* Handle a deferral request */ + + if (Defer.ndefers++ == 0) { + Defer.attempt = FALSE; + } + return OK; + + case DEFER_STOP: /* Handle end of deferral */ + if (Defer.ndefers <= 0) { + return SYSERR; + } + if ( (--Defer.ndefers == 0) && Defer.attempt ) { + *SCB_ICSR |= (1 << PENDSV_INTR); + } + return OK; + + default: + return SYSERR; + } +} diff --git a/system/resume.c b/system/resume.c new file mode 100644 index 0000000..6b1fe8d --- /dev/null +++ b/system/resume.c @@ -0,0 +1,35 @@ +/* resume.c - resume */ + +#include + +/*------------------------------------------------------------------------ + * resume - Unsuspend a process, making it ready + *------------------------------------------------------------------------ + */ +pri16 resume( + pid32 pid /* ID of process to unsuspend */ + ) +{ + + + //intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process's table entry */ + pri16 prio; /* Priority to return */ + + //mask = disable(); + if (isbadpid(pid)) { +// RAFA ACA ABORTA notmain(); + // restore(mask); + return (pri16)SYSERR; + } + prptr = &proctab[pid]; + if (prptr->prstate != PR_SUSP) { + // restore(mask); + return (pri16)SYSERR; + } + prio = prptr->prprio; /* Record priority to return */ + + ready(pid); + //restore(mask); + return prio; +} diff --git a/system/seek.c b/system/seek.c new file mode 100644 index 0000000..38cd6b7 --- /dev/null +++ b/system/seek.c @@ -0,0 +1,27 @@ +/* seek.c - seek */ + +#include + +/*------------------------------------------------------------------------ + * seek - Position a random access device + *------------------------------------------------------------------------ + */ +syscall seek( + did32 descrp, /* Descriptor for device */ + uint32 pos /* Position */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct dentry *devptr; /* Entry in device switch table */ + int32 retval; /* Value to return to caller */ + + mask = disable(); + if (isbaddev(descrp)) { + restore(mask); + return SYSERR; + } + devptr = (struct dentry *) &devtab[descrp]; + retval = (*devptr->dvseek) (devptr, pos); + restore(mask); + return retval; +} diff --git a/system/semcount.c b/system/semcount.c new file mode 100644 index 0000000..d993206 --- /dev/null +++ b/system/semcount.c @@ -0,0 +1,26 @@ +/* semcount.c - semcount */ + +#include + +/*------------------------------------------------------------------------ + * semcount - Return the count of a semaphore (because any integer is + * possible, return of SYSERR may be ambiguous) + *------------------------------------------------------------------------ + */ +syscall semcount( + sid32 semid /* ID of semaphore to use */ + ) +{ + intmask mask; /* Saved interrupt mask */ + int32 count; /* Current sempahore count */ + + mask = disable(); + + if (isbadsem(semid) || semtab[semid].sstate == S_FREE) { + restore(mask); + return SYSERR; + } + count = semtab[semid].scount; + restore(mask); + return count; +} diff --git a/system/semcreate.c b/system/semcreate.c new file mode 100644 index 0000000..32401b4 --- /dev/null +++ b/system/semcreate.c @@ -0,0 +1,50 @@ +/* semcreate.c - semcreate, newsem */ + +#include + +local sid32 newsem(void); + +/*------------------------------------------------------------------------ + * semcreate - Create a new semaphore and return the ID to the caller + *------------------------------------------------------------------------ + */ +sid32 semcreate( + int32 count /* Initial semaphore count */ + ) +{ + intmask mask; /* Saved interrupt mask */ + sid32 sem; /* Semaphore ID to return */ + + mask = disable(); + + if (count < 0 || ((sem=newsem())==SYSERR)) { + restore(mask); + return SYSERR; + } + semtab[sem].scount = count; /* Initialize table entry */ + + restore(mask); + return sem; +} + +/*------------------------------------------------------------------------ + * newsem - Allocate an unused semaphore and return its index + *------------------------------------------------------------------------ + */ +local sid32 newsem(void) +{ + static sid32 nextsem = 0; /* Next semaphore index to try */ + sid32 sem; /* Semaphore ID to return */ + int32 i; /* Iterate through # entries */ + + for (i=0 ; i= NSEM) + nextsem = 0; + if (semtab[sem].sstate == S_FREE) { + semtab[sem].sstate = S_USED; + return sem; + } + } + return SYSERR; +} diff --git a/system/semdelete.c b/system/semdelete.c new file mode 100644 index 0000000..5990652 --- /dev/null +++ b/system/semdelete.c @@ -0,0 +1,36 @@ +/* semdelete.c - semdelete */ + +#include + +/*------------------------------------------------------------------------ + * semdelete - Delete a semaphore by releasing its table entry + *------------------------------------------------------------------------ + */ +syscall semdelete( + sid32 sem /* ID of semaphore to delete */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct sentry *semptr; /* Ptr to semaphore table entry */ + + mask = disable(); + if (isbadsem(sem)) { + restore(mask); + return SYSERR; + } + + semptr = &semtab[sem]; + if (semptr->sstate == S_FREE) { + restore(mask); + return SYSERR; + } + semptr->sstate = S_FREE; + + resched_cntl(DEFER_START); + while (semptr->scount++ < 0) { /* Free all waiting processes */ + ready(getfirst(semptr->squeue)); + } + resched_cntl(DEFER_STOP); + restore(mask); + return OK; +} diff --git a/system/semreset.c b/system/semreset.c new file mode 100644 index 0000000..9331312 --- /dev/null +++ b/system/semreset.c @@ -0,0 +1,35 @@ +/* semreset.c - semreset */ + +#include + +/*------------------------------------------------------------------------ + * semreset - Reset a semaphore's count and release waiting processes + *------------------------------------------------------------------------ + */ +syscall semreset( + sid32 sem, /* ID of semaphore to reset */ + int32 count /* New count (must be >= 0) */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct sentry *semptr; /* Ptr to semaphore table entry */ + qid16 semqueue; /* Semaphore's process queue ID */ + pid32 pid; /* ID of a waiting process */ + + mask = disable(); + + if (count < 0 || isbadsem(sem) || semtab[sem].sstate==S_FREE) { + restore(mask); + return SYSERR; + } + + semptr = &semtab[sem]; + semqueue = semptr->squeue; /* Free any waiting processes */ + resched_cntl(DEFER_START); + while ((pid=getfirst(semqueue)) != EMPTY) + ready(pid); + semptr->scount = count; /* Reset count as specified */ + resched_cntl(DEFER_STOP); + restore(mask); + return OK; +} diff --git a/system/send.c b/system/send.c new file mode 100644 index 0000000..1983c6d --- /dev/null +++ b/system/send.c @@ -0,0 +1,41 @@ +/* send.c - send */ + +#include + +/*------------------------------------------------------------------------ + * send - Pass a message to a process and start recipient if waiting + *------------------------------------------------------------------------ + */ +syscall send( + pid32 pid, /* ID of recipient process */ + umsg32 msg /* Contents of message */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process's table entry */ + + mask = disable(); + if (isbadpid(pid)) { + restore(mask); + return SYSERR; + } + + prptr = &proctab[pid]; + if (prptr->prhasmsg) { + restore(mask); + return SYSERR; + } + prptr->prmsg = msg; /* Deliver message */ + prptr->prhasmsg = TRUE; /* Indicate message is waiting */ + + /* If recipient waiting or in timed-wait make it ready */ + + if (prptr->prstate == PR_RECV) { + ready(pid); + } else if (prptr->prstate == PR_RECTIM) { + unsleep(pid); + ready(pid); + } + restore(mask); /* Restore interrupts */ + return OK; +} diff --git a/system/serial_avr.c b/system/serial_avr.c new file mode 100644 index 0000000..bd1cc61 --- /dev/null +++ b/system/serial_avr.c @@ -0,0 +1,130 @@ +#include + +/* Completar la estructura de datos para que se superponga a los registros + del periferico de hardware del USART del atmega328, segun sugerido + en el apunte */ + +typedef struct +{ + uint8_t status_control_a; /* ucsr0a USART Control and Status A */ + + uint8_t status_control_b; /* ucsr0b USART Control and Status B */ + uint8_t status_control_c; /* ucsr0c USART Control and Status C */ + uint8_t _reserved; /* espacio sin utilizar */ + uint8_t baud_rate_l; /* ubrr0l baud rate low */ + uint8_t baud_rate_h; /* ubrr0h baud rate high */ + + uint8_t data_es; /* udr0 i/o data */ + +} volatile uart_t; + +/* puntero a la estructura de los registros del periferico */ +// volatile uart_t *puerto_serial = (uart_t *) (0xc0); + +char letra_start = 'R'; +char cadena[100]; + +#define F_CPU 16000000UL + +#define USART_BAUDRATE 9600 +#define BAUD_PRESCALE (((F_CPU/(USART_BAUDRATE*16UL)))-1) +#define INIT 0x06 +#define EN_RX_TX 0x18 +#define EN_TX 0x20 +#define EN_RX 0x80 + + + +void serial_init() { + + /* Configurar los registros High y Low con BAUD_PRESCALE */ + + blink_avr(); + + /* Load .data segment into SRAM */ + // extern uint32 * etext, data, edata; + // extern uint32 * _rom_data_begin; + // int size = (&edata - &data); + // memcpy(&data, &_rom_data_begin, size); + + + + extern uint32_t __data; + extern uint32_t __data_end; + extern uint32_t __data_load; + extern uint32_t __bss; + extern uint32_t __bss_end; + extern uint32_t __vectors; + + uint32_t *from = &__data_load; + uint32_t *to = &__data; + unsigned char b; + // Relocate .data section +// for (uint32_t *from = &__data_load, *to = &__data; to < &__data_end; from++, to++) { + // b = *from; + // *to = b; + //} + + // Clear .bss + //for (uint32_t *to = &__bss; to < &__bss_end; to++) + //{ + // *to = 0; + //} + + + volatile uart_t *puerto_serial = (uart_t *) (0xc0); + + puerto_serial->baud_rate_h = (unsigned char) (BAUD_PRESCALE>>8); + puerto_serial->baud_rate_l = (unsigned char) (BAUD_PRESCALE); + /* Configurar un frame de 8bits, con un bit de paridad y bit de stop */ + puerto_serial->status_control_c = (unsigned char)(INIT); + + /* Activar la recepcion y transmicion */ + puerto_serial->status_control_b = (unsigned char)(EN_RX_TX); + + while(!((puerto_serial->status_control_a) & (EN_TX))); + // puerto_serial->data_es = letra_start; + puerto_serial->data_es = 'R'; +} + + +/* enviar un byte a traves del del dispositivo inicializado */ +void serial_put_char (char outputChar) +{ + volatile uart_t *puerto_serial = (uart_t *) (0xc0); + + while(!((puerto_serial->status_control_a) & (EN_TX))); + + puerto_serial->data_es = outputChar; +} + + +char serial_get_char(void) +{ + volatile uart_t *puerto_serial = (uart_t *) (0xc0); + /* Wait for the next character to arrive. */ + while(!((puerto_serial->status_control_a) & (EN_RX))); + return (puerto_serial->data_es); +} + +void serial_put_str (char * mensaje) +{ + while (*mensaje) { + serial_put_char(*mensaje); + mensaje++; + }; +} + +char* serial_get_str(void) +{ + int i = 0; + char l = serial_get_char(); + while((l != '\r') && (l != '\n') && (l != '\0')){ + cadena[i]=l; + i++; + l = serial_get_char(); + }; + cadena[i]='\0';/*agrega el fin de cadena*/ + return cadena; + +} diff --git a/system/signal.c b/system/signal.c new file mode 100644 index 0000000..94c2179 --- /dev/null +++ b/system/signal.c @@ -0,0 +1,31 @@ +/* signal.c - signal */ + +#include + +/*------------------------------------------------------------------------ + * signal - Signal a semaphore, releasing a process if one is waiting + *------------------------------------------------------------------------ + */ +syscall signal( + sid32 sem /* ID of semaphore to signal */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct sentry *semptr; /* Ptr to sempahore table entry */ + + mask = disable(); + if (isbadsem(sem)) { + restore(mask); + return SYSERR; + } + semptr= &semtab[sem]; + if (semptr->sstate == S_FREE) { + restore(mask); + return SYSERR; + } + if ((semptr->scount++) < 0) { /* Release a waiting process */ + ready(dequeue(semptr->squeue)); + } + restore(mask); + return OK; +} diff --git a/system/signaln.c b/system/signaln.c new file mode 100644 index 0000000..7b0e316 --- /dev/null +++ b/system/signaln.c @@ -0,0 +1,37 @@ +/* signaln.c - signaln */ + +#include + +/*------------------------------------------------------------------------ + * signaln - Signal a semaphore n times, releasing n waiting processes + *------------------------------------------------------------------------ + */ +syscall signaln( + sid32 sem, /* ID of semaphore to signal */ + int32 count /* Number of times to signal */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct sentry *semptr; /* Ptr to sempahore table entry */ + + mask = disable(); + if (isbadsem(sem) || (count < 0)) { + restore(mask); + return SYSERR; + } + semptr = &semtab[sem]; + if (semptr->sstate == S_FREE) { + restore(mask); + return SYSERR; + } + + resched_cntl(DEFER_START); + for (; count > 0; count--) { + if ((semptr->scount++) < 0) { + ready(dequeue(semptr->squeue)); + } + } + resched_cntl(DEFER_STOP); + restore(mask); + return OK; +} diff --git a/system/sleep.c b/system/sleep.c new file mode 100644 index 0000000..90e1024 --- /dev/null +++ b/system/sleep.c @@ -0,0 +1,54 @@ +/* sleep.c - sleep sleepms */ + +#include + +#define MAXSECONDS 2147483 /* Max seconds per 32-bit msec */ + +/*------------------------------------------------------------------------ + * sleep - Delay the calling process n seconds + *------------------------------------------------------------------------ + */ +syscall sleep( + int32 delay /* Time to delay in seconds */ + ) +{ + if ( (delay < 0) || (delay > MAXSECONDS) ) { + return SYSERR; + } + sleepms(1000*delay); + return OK; +} + +/*------------------------------------------------------------------------ + * sleepms - Delay the calling process n milliseconds + *------------------------------------------------------------------------ + */ +syscall sleepms( + int32 delay /* Time to delay in msec. */ + ) +{ + intmask mask; /* Saved interrupt mask */ + + if (delay < 0) { + return SYSERR; + } + + if (delay == 0) { + yield(); + return OK; + } + + /* Delay calling process */ + + mask = disable(); + if (insertd(currpid, sleepq, delay) == SYSERR) { + restore(mask); + return SYSERR; + } + + proctab[currpid].prstate = PR_SLEEP; + *SCB_ICSR |= (1 << PENDSV_INTR); + + restore(mask); + return OK; +} diff --git a/system/start.S b/system/start.S new file mode 100644 index 0000000..c8ad97f --- /dev/null +++ b/system/start.S @@ -0,0 +1,53 @@ +#include + +.weak __heap_end +.set __heap_end, 0 + +.macro vector name + .weak \name + .set \name, __vectors + jmp \name +.endm + +.section .vectors +__vectors: +// jmp __init + jmp __ctors_end + vector __vector_1 + vector __vector_2 + vector __vector_3 + vector __vector_4 + vector __vector_5 + vector __vector_6 + vector __vector_7 + vector __vector_8 + vector __vector_9 + vector __vector_10 + vector __vector_11 + vector __vector_12 + vector __vector_13 + vector __vector_14 + vector __vector_15 + vector __vector_16 + vector __vector_17 + vector __vector_18 + vector __vector_19 + vector __vector_20 + vector __vector_21 + vector __vector_22 + vector __vector_23 + vector __vector_24 + vector __vector_25 + +// .section .init2 +// __init: +// clr r1 + // out _SFR_IO_ADDR(SREG), r1 +// ldi r28, lo8(RAMEND) +// ldi r29, hi8(RAMEND) +// out _SFR_IO_ADDR(SPL), r28 +// out _SFR_IO_ADDR(SPH), r29 + +// .section .init9 +.section .init8 + jmp nulluser diff --git a/system/start.S.avr b/system/start.S.avr new file mode 100644 index 0000000..14d13c3 --- /dev/null +++ b/system/start.S.avr @@ -0,0 +1,51 @@ +#include + +.weak __heap_end +.set __heap_end, 0 + +.macro vector name + .weak \name + .set \name, __vectors + jmp \name +.endm + +.section .vectors +__vectors: + jmp __init + vector __vector_1 + vector __vector_2 + vector __vector_3 + vector __vector_4 + vector __vector_5 + vector __vector_6 + vector __vector_7 + vector __vector_8 + vector __vector_9 + vector __vector_10 + vector __vector_11 + vector __vector_12 + vector __vector_13 + vector __vector_14 + vector __vector_15 + vector __vector_16 + vector __vector_17 + vector __vector_18 + vector __vector_19 + vector __vector_20 + vector __vector_21 + vector __vector_22 + vector __vector_23 + vector __vector_24 + vector __vector_25 + +.section .init2 +__init: + clr r1 + out _SFR_IO_ADDR(SREG), r1 + ldi r28, lo8(RAMEND) + ldi r29, hi8(RAMEND) + out _SFR_IO_ADDR(SPL), r28 + out _SFR_IO_ADDR(SPH), r29 + +.section .init9 + jmp nulluser diff --git a/system/start.S.orig b/system/start.S.orig new file mode 100644 index 0000000..9454775 --- /dev/null +++ b/system/start.S.orig @@ -0,0 +1,94 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +/* start.S - start, bzero */ + +#include + +/*------------------------------------------------------------------------ + * start - Initial entry point for a Xinu image (ARM Cortex-M3) + *------------------------------------------------------------------------ + */ + .text + .equ STACK_TOP, MAXADDR /* 64kB SRAM Top */ + .globl start /* entry point */ + .globl reset + .code 16 + .syntax unified +start: + /* Load the stack pointer with end of memory */ + .word STACK_TOP, reset + .type reset, function + +reset: + /* Disable interrupts */ + cpsid i + + /* Use bzero (below) to zero out the BSS area */ + ldr r0, =edata + ldr r1, =end + bl bzero + + /* Since the OS is directly running from flash */ + /* we need to load the .data segment in SRAM */ + /* See nulluser (initialize.c) */ + + /* Call nulluser to initialize the Xinu system */ + /* (Note: the call never returns) */ + + b nulluser + +// RAFA +.align + +.thumb_func +.globl PUT16 +PUT16: + strh r1,[r0] + bx lr + +.thumb_func +.globl PUT32 +PUT32: + str r1,[r0] + bx lr + +.thumb_func +.globl GET32 +GET32: + ldr r0,[r0] + bx lr + +.thumb_func +.globl dummy +dummy: + bx lr + + +// FIN RAFA + +/* Function to zero memory (r0 is lowest addr; r1 is highest) */ + +bzero: + mov r2, #0 /* Round address to multiple */ + add r0, r0, #3 /* of four by adding 3 and */ + and r0, r0, #0xFFFFFFFC /* taking the result module 4 */ +bloop: cmp r0, r1 /* Loop until last address */ + bhs bexit /* has been reached */ + str r2, [r0] /* Zero four-byte word of memory*/ + add r0, r0, #4 /* Move to next word */ + b bloop /* Continue to iterate */ +bexit: mov pc, lr /* Return to caller */ + + .end diff --git a/system/suspend.c b/system/suspend.c new file mode 100644 index 0000000..05553fc --- /dev/null +++ b/system/suspend.c @@ -0,0 +1,41 @@ +/* suspend.c - suspend */ + +#include + +/*------------------------------------------------------------------------ + * suspend - Suspend a process, placing it in hibernation + *------------------------------------------------------------------------ + */ +syscall suspend( + pid32 pid /* ID of process to suspend */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process's table entry */ + pri16 prio; /* Priority to return */ + + mask = disable(); + if (isbadpid(pid) || (pid == NULLPROC)) { + restore(mask); + return SYSERR; + } + + /* Only suspend a process that is current or ready */ + + prptr = &proctab[pid]; + if ((prptr->prstate != PR_CURR) && (prptr->prstate != PR_READY)) { + restore(mask); + return SYSERR; + } + if (prptr->prstate == PR_READY) { + getitem(pid); /* Remove a ready process */ + /* from the ready list */ + prptr->prstate = PR_SUSP; + } else { + prptr->prstate = PR_SUSP; /* Mark the current process */ + *SCB_ICSR |= (1 << PENDSV_INTR); + } + prio = prptr->prprio; + restore(mask); + return prio; +} diff --git a/system/syscall.c b/system/syscall.c new file mode 100644 index 0000000..94d5d9a --- /dev/null +++ b/system/syscall.c @@ -0,0 +1,102 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +#include + +/* System call handler + * The __attribute__((naked)) makes sure the compiler doesn't + * places registers on the stack + * + * A SVC is similar to an exception or interrupt + * A stack frame is pushed on entry and popped + * on exit BY PROCESSOR. Please see in-function command */ + +__attribute__ ((naked)) +void _svc_handler(void) { + + uint32 * args; + + /* Test whether system call was invoked from supervisor (use MSP) or + * user (use PSP) mode (needed for future purposes) */ +/* + asm volatile ( + "tst lr, #4" "\n\t" + "ite eq" "\n\t" + "mrseq %0, msp" "\n\t" + "mrsne %0, psp" "\n\t" + "push {lr}" "\n\t" + "push {r4-r11}" : "=r" (args)); + + /* An exception (or interrupt) before entering this handler + * places the following on the stack + * + * R0 <- args[0] + * R1 <- args[1] + * R2 + * R3 + * R12 + * LR <- Not a real LR, A certain 'mask' + * PC <- placed at args[6], see description below + * PSR <- Status of processor before call + * + * PC contains the return address that will continue after this SVC handler + * is finised. The previous address (the svc # call) is at PC - 2, the + * first byte contains the svc number. + * */ + + //uint8 svc_nr = ((char *) args[6])[-2]; + uint8 svc_nr = args[0]; + int ret = -1; + struct procent * p; + + switch(svc_nr) { + /* The nullprocess is a special case and used only for startup + * The stack for the nullprocess is loaded and the processor makes + * a jump back to thread mode with the PSP stack */ + case XINU_NULLPROCESS: + p = (struct procent *) args[1]; +// asm volatile ("mov r0, %0" : : "r" (p->prstkptr)); + // asm volatile("ldmia r0!, {r4-r11} "); + // asm volatile ("msr psp, r0"); + // asm volatile ( + // "ldr r0, =0xFFFFFFFD" "\n\t" + // "mov lr, r0" "\n\t" + // "bx lr"); + break; + case XINU_PUTC: /* Example system call usage */ + ret = putc(args[1], args[2]); + break; + default: + kprintf("System call not implemented\n"); + break; + } + + /* Return value in r0 for callee */ + args[0] = ret; + +// asm volatile ("pop {r4-r11}"); + /* exception return, 0xFFFFFFFX (<-- last value is flag + * and gives the processor information to return to what */ +// asm volatile ("pop {lr}"); +// asm volatile ("bx lr"); + + +} + +void syscall_init() { + /* SVC handler function is set in the interrupt vector table */ +// set_evec(SVC_ENTRY, (uint32)_svc_handler); +} + + diff --git a/system/syscall.c.orig b/system/syscall.c.orig new file mode 100644 index 0000000..1e1c387 --- /dev/null +++ b/system/syscall.c.orig @@ -0,0 +1,101 @@ +/* Xinu for STM32 + * + * Original license applies + * Modifications for STM32 by Robin Krens + * Please see LICENSE and AUTHORS + * + * $LOG$ + * 2019/11/11 - ROBIN KRENS + * Initial version + * + * $DESCRIPTION$ + * + * */ + +#include + +/* System call handler + * The __attribute__((naked)) makes sure the compiler doesn't + * places registers on the stack + * + * A SVC is similar to an exception or interrupt + * A stack frame is pushed on entry and popped + * on exit BY PROCESSOR. Please see in-function command */ + +__attribute__ ((naked)) +void _svc_handler(void) { + + uint32 * args; + + /* Test whether system call was invoked from supervisor (use MSP) or + * user (use PSP) mode (needed for future purposes) */ + asm volatile ( + "tst lr, #4" "\n\t" + "ite eq" "\n\t" + "mrseq %0, msp" "\n\t" + "mrsne %0, psp" "\n\t" + "push {lr}" "\n\t" + "push {r4-r11}" : "=r" (args)); + + /* An exception (or interrupt) before entering this handler + * places the following on the stack + * + * R0 <- args[0] + * R1 <- args[1] + * R2 + * R3 + * R12 + * LR <- Not a real LR, A certain 'mask' + * PC <- placed at args[6], see description below + * PSR <- Status of processor before call + * + * PC contains the return address that will continue after this SVC handler + * is finised. The previous address (the svc # call) is at PC - 2, the + * first byte contains the svc number. + * */ + + //uint8 svc_nr = ((char *) args[6])[-2]; + uint8 svc_nr = args[0]; + int ret = -1; + struct procent * p; + + switch(svc_nr) { + /* The nullprocess is a special case and used only for startup + * The stack for the nullprocess is loaded and the processor makes + * a jump back to thread mode with the PSP stack */ + case XINU_NULLPROCESS: + p = (struct procent *) args[1]; + asm volatile ("mov r0, %0" : : "r" (p->prstkptr)); + asm volatile("ldmia r0!, {r4-r11} "); + asm volatile ("msr psp, r0"); + asm volatile ( + "ldr r0, =0xFFFFFFFD" "\n\t" + "mov lr, r0" "\n\t" + "bx lr"); + break; + case XINU_PUTC: /* Example system call usage */ + ret = putc(args[1], args[2]); + break; + default: + kprintf("System call not implemented\n"); + break; + } + + /* Return value in r0 for callee */ + args[0] = ret; + + asm volatile ("pop {r4-r11}"); + /* exception return, 0xFFFFFFFX (<-- last value is flag + * and gives the processor information to return to what */ + asm volatile ("pop {lr}"); + asm volatile ("bx lr"); + + +} + +void syscall_init() { + /* SVC handler function is set in the interrupt vector table */ + set_evec(SVC_ENTRY, (uint32)_svc_handler); +} + + diff --git a/system/unsleep.c b/system/unsleep.c new file mode 100644 index 0000000..89f0771 --- /dev/null +++ b/system/unsleep.c @@ -0,0 +1,47 @@ +/* unsleep.c - unsleep */ + +#include + +/*------------------------------------------------------------------------ + * unsleep - Internal function to remove a process from the sleep + * queue prematurely. The caller must adjust the delay + * of successive processes. + *------------------------------------------------------------------------ + */ +status unsleep( + pid32 pid /* ID of process to remove */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process's table entry */ + + pid32 pidnext; /* ID of process on sleep queue */ + /* that follows the process */ + /* which is being removed */ + + mask = disable(); + + if (isbadpid(pid)) { + restore(mask); + return SYSERR; + } + + /* Verify that candidate process is on the sleep queue */ + + prptr = &proctab[pid]; + if ((prptr->prstate!=PR_SLEEP) && (prptr->prstate!=PR_RECTIM)) { + restore(mask); + return SYSERR; + } + + /* Increment delay of next process if such a process exists */ + + pidnext = queuetab[pid].qnext; + if (pidnext < NPROC) { + queuetab[pidnext].qkey += queuetab[pid].qkey; + } + + getitem(pid); /* Unlink process from queue */ + restore(mask); + return OK; +} diff --git a/system/userret.c b/system/userret.c new file mode 100644 index 0000000..5e7a975 --- /dev/null +++ b/system/userret.c @@ -0,0 +1,12 @@ +/* userret.c - userret */ + +#include + +/*------------------------------------------------------------------------ + * userret - Called when a process returns from the top-level function + *------------------------------------------------------------------------ + */ +void userret(void) +{ + kill(getpid()); /* Force process to exit */ +} diff --git a/system/wait.c b/system/wait.c new file mode 100644 index 0000000..3341bc5 --- /dev/null +++ b/system/wait.c @@ -0,0 +1,39 @@ +/* wait.c - wait */ + +#include + +/*------------------------------------------------------------------------ + * wait - Cause current process to wait on a semaphore + *------------------------------------------------------------------------ + */ +syscall wait( + sid32 sem /* Semaphore on which to wait */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct procent *prptr; /* Ptr to process's table entry */ + struct sentry *semptr; /* Ptr to sempahore table entry */ + + mask = disable(); + if (isbadsem(sem)) { + restore(mask); + return SYSERR; + } + + semptr = &semtab[sem]; + if (semptr->sstate == S_FREE) { + restore(mask); + return SYSERR; + } + + if (--(semptr->scount) < 0) { /* If caller must block */ + prptr = &proctab[currpid]; + prptr->prstate = PR_WAIT; /* Set state to waiting */ + prptr->prsem = sem; /* Record semaphore ID */ + enqueue(currpid,semptr->squeue);/* Enqueue on semaphore */ + *SCB_ICSR |= (1 << PENDSV_INTR); + } + + restore(mask); + return OK; +} diff --git a/system/wakeup.c b/system/wakeup.c new file mode 100644 index 0000000..aa19aec --- /dev/null +++ b/system/wakeup.c @@ -0,0 +1,19 @@ +/* wakeup.c - wakeup */ + +#include + +/*------------------------------------------------------------------------ + * wakeup - Called by clock interrupt handler to awaken processes + *------------------------------------------------------------------------ + */ +void wakeup(void) +{ + /* Awaken all processes that have no more time to sleep */ + resched_cntl(DEFER_START); + while (nonempty(sleepq) && (firstkey(sleepq) <= 0)) { + ready(dequeue(sleepq)); + } + + resched_cntl(DEFER_STOP); + return; +} diff --git a/system/write.c b/system/write.c new file mode 100644 index 0000000..0cbcb78 --- /dev/null +++ b/system/write.c @@ -0,0 +1,28 @@ +/* write.c - write */ + +#include + +/*------------------------------------------------------------------------ + * write - Write one or more bytes to a device + *------------------------------------------------------------------------ + */ +syscall write( + did32 descrp, /* Descriptor for device */ + char *buffer, /* Address of buffer */ + uint32 count /* Length of buffer */ + ) +{ + intmask mask; /* Saved interrupt mask */ + struct dentry *devptr; /* Entry in device switch table */ + int32 retval; /* Value to return to caller */ + + mask = disable(); + if (isbaddev(descrp)) { + restore(mask); + return SYSERR; + } + devptr = (struct dentry *) &devtab[descrp]; + retval = (*devptr->dvwrite) (devptr, buffer, count); + restore(mask); + return retval; +} diff --git a/system/xdone.c b/system/xdone.c new file mode 100644 index 0000000..ec20f15 --- /dev/null +++ b/system/xdone.c @@ -0,0 +1,14 @@ +/* xdone.c - xdone */ + +#include + +/*------------------------------------------------------------------------ + * xdone - Print system completion message as last process exits + *------------------------------------------------------------------------ + */ +void xdone(void) +{ + // RAFA kprintf("\n\nAll user processes have completed.\n\n"); + kprintf(&m3[0]); + halt(); /* Halt the processor */ +} diff --git a/system/yield.c b/system/yield.c new file mode 100644 index 0000000..4e70819 --- /dev/null +++ b/system/yield.c @@ -0,0 +1,17 @@ +/* yield.c - yield */ + +#include + +/*------------------------------------------------------------------------ + * yield - Voluntarily relinquish the CPU (end a timeslice) + *------------------------------------------------------------------------ + */ +syscall yield(void) +{ + intmask mask; /* Saved interrupt mask */ + + mask = disable(); + *SCB_ICSR |= (1 << PENDSV_INTR); + restore(mask); + return OK; +} diff --git a/xinu-avr-port.txt b/xinu-avr-port.txt new file mode 100644 index 0000000..fccd207 --- /dev/null +++ b/xinu-avr-port.txt @@ -0,0 +1,26 @@ + +en el ldscript hay que limpiar y dejar las variables tal cual + +El simbolo etext tiene la dirección en flash donde termina .text, +por lo tanto, ahí comienza .data, y desde ahí hay que copiar +a la ram + +la ram empieza en 0x800100 (en realidad parece empezar en +0x800060, pero el linker de avr-gcc pone esa dirección porque al parecer +en el 0x800060 hay registros. + +Hay que copiar .data a 0x800100, la cantidad de datos: que es +_data_end - etext. + +Luego hay que iniciarlizar bss. Podría hacerse con memset en +RAM 0x800100 + (_data_end - etext) y la cantidad de bytes +end - _bss_begin (end es el final de la imagen). + +Todos estos simbolos estan en el ld.script.avr + + +Hay que establecer el stack. Al menos puede ser 0x8008FF. pero +no sé si necesita estar alineado. + +El inicio del stack es +0x800100 + (_data_end - etext) + (end - _bss_begin)