Various minor debugging changes
authorRon Minnich <rminnich@gmail.com>
Wed, 11 Mar 2015 13:37:34 +0000 (06:37 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 17 Mar 2015 14:55:59 +0000 (10:55 -0400)
At least give a HINT when things go wrong. Just a teensy weensy one.

(git-fu'd by brho, and changed the arg order in kmalloc's print)

.gitignore
kern/src/hexdump.c
kern/src/kmalloc.c
kern/src/ns/parse.c
scripts/STARTUP_UBUNTU_SERVER [new file with mode: 0644]

index 3011874..c5af7cb 100644 (file)
@@ -41,3 +41,5 @@ kern/include/generated/*
 tags
 TAGS
 cscope.*
+*~
+#*
index 7abcb5c..02281e4 100644 (file)
@@ -25,6 +25,7 @@
 #include <string.h>
 #include <assert.h>
 #include <smp.h>
+#include <pmap.h>
 
 static int isprint(int c)
 {
index 872a25f..d1d14f6 100644 (file)
@@ -137,8 +137,8 @@ static struct kmalloc_tag *__get_km_tag(void *buf)
        struct kmalloc_tag *tag = (struct kmalloc_tag*)(buf -
                                                    sizeof(struct kmalloc_tag));
        if (tag->canary != KMALLOC_CANARY){
-               printk("__get_km_tag bad canary: %08lx, expected %08lx\n", tag->canary,
-                      KMALLOC_CANARY);
+               printk("__get_km_tag bad canary: %08lx@%p, buf %p, expected %08lx\n",
+                      tag->canary, &tag->canary, buf, KMALLOC_CANARY);
                hexdump((void *)(buf - sizeof(struct kmalloc_tag)), 256);
                panic("Bad canary");
        }
index 8d95419..0e4128e 100644 (file)
@@ -88,7 +88,7 @@ void cmderror(struct cmdbuf *cb, char *s)
        for (i = 0; i < cb->nf; i++) {
                if (i > 0)
                        p = seprintf(p, e, " ");
-               p = seprintf(p, e, "%q", cb->f[i]);
+               p = seprintf(p, e, "%s", cb->f[i]);
        }
        strncpy(p, "\"", sizeof(p));
        error(get_cur_genbuf());
@@ -117,8 +117,11 @@ struct cmdtab *lookupcmd(struct cmdbuf *cb, struct cmdtab *ctab, int nctab)
                if (strcmp(ct->cmd, "*") != 0)  /* wildcard always matches */
                        if (strcmp(ct->cmd, cb->f[0]) != 0)
                                continue;
-               if (ct->narg != 0 && ct->narg != cb->nf)
-                       cmderror(cb, Ecmdargs);
+               if (ct->narg != 0 && ct->narg != cb->nf) {
+                       // oh how I hate plan 9 error handling sometimes.
+                       printk("%s for %s have %d want %d", Ecmdargs, cb->f[0], cb->nf, ct->narg);
+                       cmderror(cb, "bring me another fucking rock");
+               }
                return ct;
        }
 
diff --git a/scripts/STARTUP_UBUNTU_SERVER b/scripts/STARTUP_UBUNTU_SERVER
new file mode 100644 (file)
index 0000000..41bf046
--- /dev/null
@@ -0,0 +1,51 @@
+Get the isc-dhcp-server.
+
+
+a config file.
+ddns-update-style none;
+
+
+default-lease-time 600;
+max-lease-time 7200;
+
+subnet 192.168.28.0 netmask 255.255.255.0 {
+range 192.168.28.15 192.168.28.17;
+}
+
+host passacaglia {
+  hardware ethernet 00:0c:29:cf:de:0;
+   fixed-address 192.168.28.16;   
+}
+allow booting;
+allow bootp;
+option option-128 code 128 = string;
+option option-129 code 129 = text;
+#next-server 192.168.28.250;
+filename "pxelinux.0";
+
+
+The pxelinux file
+
+
+\e]0;root@rminnich-virtual-machine: ~/projects/akaros\aroot@rminnich-virtual-machine:~/projects/akaros# cat /var/lib/tftpboot/pxelinux.cfg/defaullt 
+label akaros 
+       kernel mboot.c32
+       append akaros
+
+default akaros
+      
+\e]0;root@rminnich-virtual-machine: ~/projects/akaros\aroot@rminnich-virtual-machine:~/projects/akaros# du -a /var/lib/tftpboot/
+68     /var/lib/tftpboot/ldlinux.bin
+68     /var/lib/tftpboot/ldlinux.sys
+4      /var/lib/tftpboot/pxelinux.cfg/default
+8      /var/lib/tftpboot/pxelinux.cfg
+4      /var/lib/tftpboot/ldlinux.bss
+184    /var/lib/tftpboot/libcom32.c32
+80000  /var/lib/tftpboot/akaros
+120    /var/lib/tftpboot/ldlinux.c32
+48     /var/lib/tftpboot/pxelinux.0
+12     /var/lib/tftpboot/mboot.c32
+80516  /var/lib/tftpboot/
+\e]0;root@rminnich-virtual-machine: ~/projects/akaros\aroot@rminnich-virtual-machine:~/projects/akaros# exit
+
+Script done on Wed 04 Mar 2015 08:34:44 PM PST