i 27 cat.c int fd, i; i 34 cat.c for(i = 1; i < argc; i++){ i 35 cat.c if((fd = open(argv[i], 0)) < 0){ i 36 cat.c printf(1, "cat: cannot open %s\n", argv[i]); i 32 console.c int i; i 40 console.c i = 0; i 42 console.c buf[i++] = digits[x % base]; i 46 console.c buf[i++] = '-'; i 48 console.c while(--i >= 0) i 49 console.c consputc(buf[i]); i 57 console.c int i, c, locking; i 69 console.c for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ i 74 console.c c = fmt[++i] & 0xff; i 109 console.c int i; i 119 console.c for(i=0; i<10; i++) i 120 console.c cprintf(" %p", pcs[i]); i 276 console.c int i; i 280 console.c for(i = 0; i < n; i++) i 281 console.c consputc(buf[i] & 0xff); i 8 echo.c int i; i 10 echo.c for(i = 1; i < argc; i++) i 11 echo.c printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n"); i 14 exec.c int i, off; i 43 exec.c for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ i 134 file.c int i = 0; i 135 file.c while(i < n){ i 136 file.c int n1 = n - i; i 142 file.c if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) i 151 file.c i += r; i 153 file.c return i == n ? n : -1; i 174 fs.c int i = 0; i 177 fs.c for(i = 0; i < NINODE; i++) { i 178 fs.c initsleeplock(&icache.inode[i].lock, "inode"); i 410 fs.c int i, j; i 414 fs.c for(i = 0; i < NDIRECT; i++){ i 415 fs.c if(ip->addrs[i]){ i 416 fs.c bfree(ip->dev, ip->addrs[i]); i 417 fs.c ip->addrs[i] = 0; i 42 fs.h #define IBLOCK(i, sb) ((i) / IPB + sb.inodestart) i 41 grep.c int fd, i; i 55 grep.c for(i = 2; i < argc; i++){ i 56 grep.c if((fd = open(argv[i], 0)) < 0){ i 57 grep.c printf(1, "grep: cannot open %s\n", argv[i]); i 53 ide.c int i; i 61 ide.c for(i=0; i<1000; i++){ i 51 ioapic.c int i, id, maxintr; i 61 ioapic.c for(i = 0; i <= maxintr; i++){ i 62 ioapic.c ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i)); i 63 ioapic.c ioapicwrite(REG_TABLE+2*i+1, 0); i 8 kill.c int i; i 14 kill.c for(i=1; i<argc; i++) i 15 kill.c kill(atoi(argv[i])); i 131 lapic.c int i; i 156 lapic.c for(i = 0; i < 2; i++){ i 90 log.c int i; i 92 log.c for (i = 0; i < log.lh.n; i++) { i 93 log.c log.lh.block[i] = lh->block[i]; i 106 log.c int i; i 108 log.c for (i = 0; i < log.lh.n; i++) { i 109 log.c hb->block[i] = log.lh.block[i]; i 216 log.c int i; i 224 log.c for (i = 0; i < log.lh.n; i++) { i 225 log.c if (log.lh.block[i] == b->blockno) // log absorbtion i 228 log.c log.lh.block[i] = b->blockno; i 229 log.c if (i == log.lh.n) i 76 ls.c int i; i 82 ls.c for(i=1; i<argc; i++) i 83 ls.c ls(argv[i]); i 8 mkdir.c int i; i 15 mkdir.c for(i = 1; i < argc; i++){ i 16 mkdir.c if(mkdir(argv[i]) < 0){ i 17 mkdir.c printf(2, "mkdir: %s failed to create\n", argv[i]); i 70 mkfs.c int i, cc, fd; i 110 mkfs.c for(i = 0; i < FSSIZE; i++) i 111 mkfs.c wsect(i, zeroes); i 130 mkfs.c for(i = 2; i < argc; i++){ i 131 mkfs.c assert(index(argv[i], '/') == 0); i 133 mkfs.c if((fd = open(argv[i], 0)) < 0){ i 134 mkfs.c perror(argv[i]); i 142 mkfs.c if(argv[i][0] == '_') i 143 mkfs.c ++argv[i]; i 149 mkfs.c strncpy(de.name, argv[i], DIRSIZ); i 241 mkfs.c int i; i 246 mkfs.c for(i = 0; i < used; i++){ i 247 mkfs.c buf[i/8] = buf[i/8] | (0x1 << (i%8)); i 21 mp.c int i, sum; i 24 mp.c for(i=0; i<len; i++) i 25 mp.c sum += addr[i]; i 81 pipe.c int i; i 84 pipe.c for(i = 0; i < n; i++){ i 93 pipe.c p->data[p->nwrite++ % PIPESIZE] = addr[i]; i 103 pipe.c int i; i 113 pipe.c for(i = 0; i < n; i++){ //DOC: piperead-copy i 116 pipe.c addr[i] = p->data[p->nread++ % PIPESIZE]; i 120 pipe.c return i; i 16 printf.c int i, neg; i 27 printf.c i = 0; i 29 printf.c buf[i++] = digits[x % base]; i 32 printf.c buf[i++] = '-'; i 34 printf.c while(--i >= 0) i 35 printf.c putc(fd, buf[i]); i 43 printf.c int c, i, state; i 48 printf.c for(i = 0; fmt[i]; i++){ i 49 printf.c c = fmt[i] & 0xff; i 40 proc.c int apicid, i; i 48 proc.c for (i = 0; i < ncpu; ++i) { i 49 proc.c if (cpus[i].apicid == apicid) i 50 proc.c return &cpus[i]; i 183 proc.c int i, pid; i 206 proc.c for(i = 0; i < NOFILE; i++) i 207 proc.c if(curproc->ofile[i]) i 208 proc.c np->ofile[i] = filedup(curproc->ofile[i]); i 514 proc.c int i; i 529 proc.c for(i=0; i<10 && pc[i] != 0; i++) i 530 proc.c cprintf(" %p", pc[i]); i 8 rm.c int i; i 15 rm.c for(i = 1; i < argc; i++){ i 16 rm.c if(unlink(argv[i]) < 0){ i 17 rm.c printf(2, "rm: %s failed to delete\n", argv[i]); i 452 sh.c int i; i 465 sh.c for(i=0; ecmd->argv[i]; i++) i 466 sh.c *ecmd->eargv[i] = 0; i 75 spinlock.c int i; i 78 spinlock.c for(i = 0; i < 10; i++){ i 81 spinlock.c pcs[i] = ebp[1]; // saved %eip i 84 spinlock.c for(; i < 10; i++) i 85 spinlock.c pcs[i] = 0; i 19 stressfs.c int fd, i; i 26 stressfs.c for(i = 0; i < 4; i++) i 30 stressfs.c printf(1, "write %d\n", i); i 32 stressfs.c path[8] += i; i 34 stressfs.c for(i = 0; i < 20; i++) i 42 stressfs.c for (i = 0; i < 20; i++) i 61 syscall.c int i; i 64 syscall.c if(argint(n, &i) < 0) i 66 syscall.c if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz) i 68 syscall.c *pp = (char*)i; i 400 sysfile.c int i; i 407 sysfile.c for(i=0;; i++){ i 408 sysfile.c if(i >= NELEM(argv)) i 410 sysfile.c if(fetchint(uargv+4*i, (int*)&uarg) < 0) i 413 sysfile.c argv[i] = 0; i 416 sysfile.c if(fetchstr(uarg, &argv[i]) < 0) i 20 trap.c int i; i 22 trap.c for(i = 0; i < 256; i++) i 23 trap.c SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0); i 54 uart.c int i; i 58 uart.c for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++) i 55 ulib.c int i, cc; i 58 ulib.c for(i=0; i+1 < max; ){ i 62 ulib.c buf[i++] = c; i 66 ulib.c buf[i] = '\0'; i 142 usertests.c int i; i 152 usertests.c for(i = 0; i < 100; i++){ i 154 usertests.c printf(stdout, "error: write aa %d new file failed\n", i); i 158 usertests.c printf(stdout, "error: write bb %d new file failed\n", i); i 171 usertests.c i = read(fd, buf, 2000); i 172 usertests.c if(i == 2000){ i 190 usertests.c int i, fd, n; i 200 usertests.c for(i = 0; i < MAXFILE; i++){ i 201 usertests.c ((int*)buf)[0] = i; i 203 usertests.c printf(stdout, "error: write big file failed\n", i); i 218 usertests.c i = read(fd, buf, 512); i 219 usertests.c if(i == 0){ i 225 usertests.c } else if(i != 512){ i 226 usertests.c printf(stdout, "read failed %d\n", i); i 247 usertests.c int i, fd; i 253 usertests.c for(i = 0; i < 52; i++){ i 254 usertests.c name[1] = '0' + i; i 260 usertests.c for(i = 0; i < 52; i++){ i 261 usertests.c name[1] = '0' + i; i 309 usertests.c int seq, i, n, cc, total; i 320 usertests.c for(i = 0; i < 1033; i++) i 321 usertests.c buf[i] = seq++; i 333 usertests.c for(i = 0; i < n; i++){ i 334 usertests.c if((buf[i] & 0xff) != (seq++ & 0xff)){ i 407 usertests.c int i, pid; i 409 usertests.c for(i = 0; i < 100; i++){ i 467 usertests.c int fd, pid, i, n, nc, np; i 480 usertests.c for(i = 0; i < 1000; i++){ i 498 usertests.c for(i = 0; i < sizeof(buf); i++){ i 499 usertests.c if(buf[i] == 'c') i 501 usertests.c if(buf[i] == 'p') i 520 usertests.c int fd, pid, i, j, n, total, pi; i 544 usertests.c for(i = 0; i < 12; i++){ i 558 usertests.c for(i = 0; i < 2; i++){ i 559 usertests.c fname = names[i]; i 564 usertests.c if(buf[j] != '0'+i){ i 587 usertests.c int pid, i, fd, pi; i 602 usertests.c for(i = 0; i < N; i++){ i 603 usertests.c name[1] = '0' + i; i 610 usertests.c if(i > 0 && (i % 2 ) == 0){ i 611 usertests.c name[1] = '0' + (i / 2); i 627 usertests.c for(i = 0; i < N; i++){ i 630 usertests.c name[1] = '0' + i; i 632 usertests.c if((i == 0 || i >= N/2) && fd < 0){ i 635 usertests.c } else if((i >= 1 && i < N/2) && fd >= 0){ i 644 usertests.c for(i = 0; i < N; i++){ i 646 usertests.c name[0] = 'p' + i; i 647 usertests.c name[1] = '0' + i; i 768 usertests.c int i, pid, n, fd; i 778 usertests.c for(i = 0; i < 40; i++){ i 779 usertests.c file[1] = '0' + i; i 782 usertests.c if(pid && (i % 3) == 1){ i 784 usertests.c } else if(pid == 0 && (i % 5) == 1){ i 807 usertests.c i = de.name[1] - '0'; i 808 usertests.c if(i < 0 || i >= sizeof(fa)){ i 812 usertests.c if(fa[i]){ i 816 usertests.c fa[i] = 1; i 827 usertests.c for(i = 0; i < 40; i++){ i 828 usertests.c file[1] = '0' + i; i 834 usertests.c if(((i % 3) == 0 && pid == 0) || i 835 usertests.c ((i % 3) == 1 && pid != 0)){ i 860 usertests.c int pid, i; i 872 usertests.c for(i = 0; i < 100; i++){ i 895 usertests.c int i, fd; i 908 usertests.c for(i = 0; i < 500; i++){ i 910 usertests.c name[1] = '0' + (i / 64); i 911 usertests.c name[2] = '0' + (i % 64); i 920 usertests.c for(i = 0; i < 500; i++){ i 922 usertests.c name[1] = '0' + (i / 64); i 923 usertests.c name[2] = '0' + (i % 64); i 1132 usertests.c int i; i 1133 usertests.c for(i = 0; i < 2; i++){ i 1150 usertests.c int fd, i, total, cc; i 1160 usertests.c for(i = 0; i < 20; i++){ i 1161 usertests.c memset(buf, i, 600); i 1175 usertests.c for(i = 0; ; i++){ i 1187 usertests.c if(buf[0] != i/2 || buf[299] != i/2){ i 1346 usertests.c int i, fd; i 1351 usertests.c for(i = 0; i < 50 + 1; i++){ i 1426 usertests.c int i; i 1427 usertests.c for(i = 0; i < 5000; i++){ i 1430 usertests.c printf(stdout, "sbrk test failed %d %x %x\n", i, a, b); i 1518 usertests.c for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ i 1519 usertests.c if((pids[i] = fork()) == 0){ i 1526 usertests.c if(pids[i] != -1) i 1532 usertests.c for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ i 1533 usertests.c if(pids[i] == -1) i 1535 usertests.c kill(pids[i]); i 1597 usertests.c int i; i 1600 usertests.c for(i = 0; i < sizeof(uninit); i++){ i 1601 usertests.c if(uninit[i] != '\0'){ i 1621 usertests.c int i; i 1622 usertests.c for(i = 0; i < MAXARG-1; i++) i 1623 usertests.c args[i] = "bigargs test: failed\n "; i 200 vm.c uint i, pa, n; i 205 vm.c for(i = 0; i < sz; i += PGSIZE){ i 206 vm.c if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) i 209 vm.c if(sz - i < PGSIZE) i 210 vm.c n = sz - i; i 213 vm.c if(readi(ip, P2V(pa), offset+i, n) != n) i 286 vm.c uint i; i 291 vm.c for(i = 0; i < NPDENTRIES; i++){ i 292 vm.c if(pgdir[i] & PTE_P){ i 293 vm.c char * v = P2V(PTE_ADDR(pgdir[i])); i 320 vm.c uint pa, i, flags; i 325 vm.c for(i = 0; i < sz; i += PGSIZE){ i 326 vm.c if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) i 335 vm.c if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) { i 10 wc.c int i, n; i 16 wc.c for(i=0; i<n; i++){ i 18 wc.c if(buf[i] == '\n') i 20 wc.c if(strchr(" \r\t\n\v", buf[i])) i 38 wc.c int fd, i; i 45 wc.c for(i = 1; i < argc; i++){ i 46 wc.c if((fd = open(argv[i], 0)) < 0){ i 47 wc.c printf(1, "wc: cannot open %s\n", argv[i]); i 50 wc.c wc(fd, argv[i]);