> Is menu.c's other program option -s just a placeholder or does it
> have run user program functionality? It calls userprog, but I
> can't get it to run anything. I was hoping to see userprog in
> action, before modifying it for fork and exec. I wanted to see how
> the files are identified (path) so that I can add test programs and
> run them once I get fork and exec to work. Any help you could
> offer would be greatly appreciated.
's' is equivalent to 'p /bin/sh'
...or at least it should be. (Please make sure when you're done with
asst2 that this is still true.)
--
- David A. Holland / dholland(a)eecs.harvard.edu
hi guys and gals:
just a reminder that jonathan is out of town and won't be holding his 6-8
office hours tonight.
sasha's mine and david's will take place as usual (barring any more
"unusual" weather ;-)
good luck with assignment two!
-gwa-
Dear Students:
Today's 7:30 PM section that is normally taught by Sasha Fedorova at 53
Church street has been rescheduled, because the Extension School
building that we use for this section is closed today.
The time and location for today's section are:
When: Today, Tuesday, February 18th, 7PM
Where: Maxwell-Dworkin, G-115, (33 Oxford Street).
The change affects only this week's section. Starting from next week this
section will be held as noted on the syllabus.
(Don't let this change in schedule discourage your attendance - we will be
covering some very important material that will help you get started with
Assignemnt 2.)
-- Sasha
Hi 161ers,
Just letting you know that your animal groups now exist on FAS and that
you should be able to chgrp your CVS repositories as shown in the
assignment now.
-jonathan
hello cs161ers:
a few things in this email:
1) volatile
somebody took me up on my offer to cook up compiler output showing the
effect of declaring a variable volatile. an example of the difference in
compile output when "volatile" is used (attached) (compiled with gcc -S
-O2)
2) goto use
it occured to me recently that it might be wise to try and reverse a bit
of the "never ever ever use goto" conditioning that some of you received
in cs50. in systems programming goto is frequently used for cleanup on
error, as in the following example:
******************************
if (!(var1 = kmalloc())) {
goto out1;
}
if (!(var2 = kmalloc())) {
goto out2;
}
if (!(var3 = kmalloc())) {
goto out3;
}
... do something ...
return successvalue;
out3:
kfree(var2);
out2:
kfree(var1);
out1:
return NULL;
******************************
pretty clean actually... we like this stuff. of course, you need to
decide when this is appropriate. for a lot of kernel-level stuff, failure
means BIG problems. if a kernel thread can't allocated a lock/sem/cv it
probably is going to die and perhaps take the entire system with it so
error checking as presented above is nice but probably unnecessary (just
call panic).
you can think more about preventing low memory situations in asst3.
3) optimization
we had a few people approach us during asst1 who either wanted to or were
in the midst of doing some pretty crazy optimizations. we don't want to
discourage you from optimizing your code, but please keep the following in
mind:
* when you do your design, design clean interfaces to make later
optimizations possible.
* optimizations should not be attempted until all code that needs to be
submitted has been written and THROROUGHLY tested. we like fast code, but
we like correct code more.
* think about the tradeoffs of optimization: how often is this piece of
code going to be run? is it worth it to trade {speed, space} for {space,
speed} and added complexity? are you going to able to understand this
code two months later?
we'll have more to say about optimizations later, but please feel free to
approach the course staff for guidance if you want to attempt something
cool... we'd love to hear about it.
good luck on asst2.
-gwa-
It has been observed that the question about userptr_t inadvertently
got asked twice. It is both question #7 and #13. You don't need to
repeat the answer twice.
--
- David A. Holland / dholland(a)eecs.harvard.edu
Hi cs161-ers,
I will not be able to hold office hours this week on 2/19 from 6-8pm
because I will be away at a conference in Berkeley. Sorry!
-jonathan
hi there -- apologies for the mass email: I thought I'd give this
one more shot... does anybody out there need a cs161 partner (and not
already have one)?? if so, me too! - please email me!! :]
cheers,
courtney