Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Low level C programming

Name: Anonymous 2010-09-08 4:27

Hello /prog/. Tomorrow, I have an exam about Operating Systems. I just noticed that apparently (although it has never been subject of the lecture), there is always one task about low level C programming, concerning semaphores, in the exam. I have experience in C++ and Java, but I've never done anything as close to the hardware as is required.

Is there any online book or something similar that can teach me low level C in one day?

Example solution for a task of an exam held in 2003:

int main(argc,argv) {
pid_t pid;
int pipefd[2];
int pipebackfd[2];
int r=-1;
char str[100]="Test";
int i;
pipe(pipefd);
pipe(pipebackfd);
if (fork()!=0) {
if (fork()!=0) {
close(1);
dup (pipefd[1]);
close(pipefd[0]);
get_data();
// wait(NULL);
} else {
close(0);
dup (pipebackfd[0]);
close(pipebackfd[1]);
while(r==-1) {
r=get(str);
}
printf("Layer3:str=%s\n",str);
}
}
else {
close(0);
dup (pipefd[0],0);
close(pipefd[1]);
close(1);
dup (pipebackfd[1]);
close(pipebackfd[0]);
fflush(stdout);
while(r==-1){
r=get(str);
}
addcrc(str);
}
return 0;
}

Name: Anonymous 2010-09-08 13:14

>>11

I already have a physical copy of it lying next to my monitor, thanks. That's probably more than you can claim.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List