i 23 cat.c int fd, i; i 30 cat.c for(i = 1; i < argc; i++){ i 31 cat.c if((fd = open(argv[i], 0)) < 0){ i 32 cat.c printf(1, "cat: cannot open %s\n", argv[i]); i 31 console.c int i; i 39 console.c i = 0; i 41 console.c buf[i++] = digits[x % base]; i 45 console.c buf[i++] = '-'; i 47 console.c while(--i >= 0) i 48 console.c consputc(buf[i]); i 56 console.c int i, c, locking; i 68 console.c for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ i 73 console.c c = fmt[++i] & 0xff; i 108 console.c int i; i 117 console.c for(i=0; i<10; i++) i 118 console.c cprintf(" %p", pcs[i]); i 268 console.c int i; i 272 console.c for(i = 0; i < n; i++) i 273 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 40 exec.c for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ i 133 file.c int i = 0; i 134 file.c while(i < n){ i 135 file.c int n1 = n - i; i 141 file.c if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) i 150 file.c i += r; i 152 file.c return i == n ? n : -1; i 394 fs.c int i, j; i 398 fs.c for(i = 0; i < NDIRECT; i++){ i 399 fs.c if(ip->addrs[i]){ i 400 fs.c bfree(ip->dev, ip->addrs[i]); i 401 fs.c ip->addrs[i] = 0; i 41 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 50 ide.c int i; i 59 ide.c for(i=0; i<1000; i++){ i 51 ioapic.c int i, id, maxintr; i 64 ioapic.c for(i = 0; i <= maxintr; i++){ i 65 ioapic.c ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i)); i 66 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 142 lapic.c int i; i 167 lapic.c for(i = 0; i < 2; i++){ i 89 log.c int i; i 91 log.c for (i = 0; i < log.lh.n; i++) { i 92 log.c log.lh.block[i] = lh->block[i]; i 105 log.c int i; i 107 log.c for (i = 0; i < log.lh.n; i++) { i 108 log.c hb->block[i] = log.lh.block[i]; i 213 log.c int i; i 221 log.c for (i = 0; i < log.lh.n; i++) { i 222 log.c if (log.lh.block[i] == b->blockno) // log absorbtion i 225 log.c log.lh.block[i] = b->blockno; i 226 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 29 mp.c int i, sum; i 32 mp.c for(i=0; i<len; i++) i 33 mp.c sum += addr[i]; i 80 pipe.c int i; i 83 pipe.c for(i = 0; i < n; i++){ i 92 pipe.c p->data[p->nwrite++ % PIPESIZE] = addr[i]; i 102 pipe.c int i; i 112 pipe.c for(i = 0; i < n; i++){ //DOC: piperead-copy i 115 pipe.c addr[i] = p->data[p->nread++ % PIPESIZE]; i 119 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 131 proc.c int i, pid; i 152 proc.c for(i = 0; i < NOFILE; i++) i 153 proc.c if(proc->ofile[i]) i 154 proc.c np->ofile[i] = filedup(proc->ofile[i]); i 446 proc.c int i; i 461 proc.c for(i=0; i<10 && pc[i] != 0; i++) i 462 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 453 sh.c int i; i 466 sh.c for(i=0; ecmd->argv[i]; i++) i 467 sh.c *ecmd->eargv[i] = 0; i 71 spinlock.c int i; i 74 spinlock.c for(i = 0; i < 10; i++){ i 77 spinlock.c pcs[i] = ebp[1]; // saved %eip i 80 spinlock.c for(; i < 10; i++) i 81 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 57 syscall.c int i; i 59 syscall.c if(argint(n, &i) < 0) i 61 syscall.c if((uint)i >= proc->sz || (uint)i+size > proc->sz) i 63 syscall.c *pp = (char*)i; i 398 sysfile.c int i; i 405 sysfile.c for(i=0;; i++){ i 406 sysfile.c if(i >= NELEM(argv)) i 408 sysfile.c if(fetchint(uargv+4*i, (int*)&uarg) < 0) i 411 sysfile.c argv[i] = 0; i 414 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 199 vm.c uint i, pa, n; i 204 vm.c for(i = 0; i < sz; i += PGSIZE){ i 205 vm.c if((pte = walkpgdir(pgdir, addr+i, 0)) == 0) i 208 vm.c if(sz - i < PGSIZE) i 209 vm.c n = sz - i; i 212 vm.c if(readi(ip, p2v(pa), offset+i, n) != n) i 280 vm.c uint i; i 285 vm.c for(i = 0; i < NPDENTRIES; i++){ i 286 vm.c if(pgdir[i] & PTE_P){ i 287 vm.c char * v = p2v(PTE_ADDR(pgdir[i])); i 314 vm.c uint pa, i, flags; i 319 vm.c for(i = 0; i < sz; i += PGSIZE){ i 320 vm.c if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) i 329 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]);