Advertisement
Pit-kun

OpSys_Proj2.c

Oct 6th, 2024 (edited)
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <string.h>
  5. #include <sys/wait.h>
  6. while (number < 100)
  7. {
  8. for (int row = 0; row < nrows; ++row)
  9. {
  10. for (int col = 0; col < ncols; ++col)
  11. {
  12. a[row*ncols+col] += 1;
  13. }
  14. }
  15. number += 1;
  16. }
  17. int main(int arg, char *argv[])
  18. {
  19. int fd[2];
  20.  
  21. if (pipe(fd) < 0) { perror("pipe"); return 1; }
  22.  
  23. int pid1 = fork();
  24.  
  25. if (pid1 < 0) { perror("fork"); return 1; }
  26.  
  27. else if (pid1 == 0)
  28. {
  29. dup2(fd[1], 1);
  30. close(fd[0]);
  31. close(fd[1]);
  32. }
  33.  
  34. else
  35. {
  36. int pid2 = fork();
  37. if (pid2 < 0) { perror("fork"); return 1; }
  38.  
  39. else if (pid2 == 0)
  40. {
  41. close(fd[1]);
  42. dup2(fd[0], 0);
  43. close(fd[0]);
  44.  
  45. char *myargs[3];
  46. myargs[0] = strdup("wc");
  47. myargs[2] = NULL;
  48. execvp(myargs[0], myargs);
  49. }
  50. pin 7 goes to +12 v
  51. pin 4 g0es to -12 v
  52. pin 4 and 3 of the 741 and dac respectively go to -12 v
  53. get from power supply
  54. put into random row
  55. then connect to the same row as the one thats goiing to the power supply (dont put any other wire across the bridge)
  56.  
  57. else
  58. {
  59. close(fd[0]);
  60. close(fd[1]);
  61. wait(0); wait(0);
  62. }
  63. }
  64.  
  65. return 0;
  66.  
  67. }
  68.  
  69.  
  70.  
  71.  
  72. click on select go to 25 v side, 25 volt is max, so sleect it and go to 5v, thjen
  73.  
  74. one as 5 volt rail (6 volt max)
  75. one as ground (black and black)
  76. one as 25 (25 volt max)
  77. one as -25 (-25 volt max)
  78.  
  79. 5 volt DOES NOT share the same line as the 12 volt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement