END; require_once "include/calendar.php"; require_once "include/planner-include.php"; require_once "include/header.inc.php"; ?>


B1XCheck mon's submission from E-Mail from tayag@mydestiny.net {{Tasks:786}} (2004.03.26)

If you're looking for my old (very disorganized) student notes, they're at 2001.Sem2.CS161

CS161 resources can be found at http://sacha.sachachua.com/notebook/cs161/ - check out the reviewers/ subdirectory, and contribute your own! =)



24. CS161 Final Exam Schedule

Categories: 2004.03.12:3 -- Permalink, Comment form

Thursday, 2004.03.25, 9:30 - 11:30, CTC 312

Permalink, Comment form -- Back to top

23. CS161 Finals Schedule

Categories: 2004.03.09:4 -- Permalink, Comment form

Whoops, we don't have a schedule for the CS161 finals yet. I'd like to have it on Thursday morning or on Wednesday. Tell all your classmates who are not currently exempted to e-mail me their schedule for the finals by Wednesday midnight. Urgent.

Permalink, Comment form -- Back to top

22. Pre-final exemptions

Categories: 2004.03.05:3 -- Permalink, Comment form




Permalink, Comment form -- Back to top

21. CS161 Finals

Categories: 2004.02.22:5 -- Permalink, Comment form

The following students are to take the CS161 final exam on Thursday. They can e-mail me at sacha@sachachua.com to find out their pre-final grade and what they need to score in order to attain a target letter grade.
000100Alindogan, John Marlon J.4BS MIS
000146Ang, Lindsay Ritz T.4BS MIS
000257Balagot, Julyett D.4BS MIS
000322Bautista, Jose Miguel O.4BS MIS
000336Baybay, Maria Margarita F.4BS MIS
000459Cadelinia, Dwight Jr. M.4BS MIS
005011Chan, Jacky T.4BS MIS
000612Ching, James Henry Y.4BS MIS
000628Chua, Aimee Lou T.4BS MIS
000822De Claro, Ada Mae I.4BS MIS
000834De Guzman, Myron Patrick S.4BS MIS
990791Delfino, John Tristan S.4BS MIS
001191Garcia, Miguel Jose A.4BS MIS
991211Irigo, Justin A.4BS CS
001469Kho, Krystle Ann G.4BS MIS
991571Marchan, Allison Lilac S.4BS MIS
002032Ong, Emmanuel I.4BS MIS
002050Ong, Wendilyn Lou O.4BS MIS
992113Sabilano, Jose Leonardo A.4BS MIS
981077Sanchez, Patrick Philip R.4BS CS
002477Santiago, Victor Roberto Manuel O.4BS MIS
002478Santillan, Arthur A.4BS MIS
002536Sembrano, Cyrus V.4BS MIS
002601Songco, Marvin L.4BS MIS

Permalink, Comment form -- Back to top

20. Exemptions for CS161

Categories: 2004.02.22:4 -- Permalink, Comment form

No MIS student qualified for exemption.

Permalink, Comment form -- Back to top

19. Fantastic news! Wonderful news! Excellent news!

Categories: 2004.02.22:3 -- Permalink, Comment form

We get to postpone finals for juniors in CS161 to the normal time. Wheee! I feel so much better now.

Of course, this gives us time to make really nasty tests... <evil grin> CS students can expect lots of problem-solving, as we're _supposed_ to know this.

Permalink, Comment form -- Back to top

18. CS161 announcements

Categories: 2004.02.20:8 -- Permalink, Comment form

Yes, there are exemptions: 90 and above. This includes the grades from the projects. The list of exempted people will be posted on Monday.

Bad news for the CS juniors: you have to take the test also at the same date! (Uh oh...) Thursday, 1:30 - 3:30 PM at C115. (That's Chem 115) AND there's extra work _after_ the finals.

(Apologies for the confusion. Apparently, missed important small text. My bad.)

Permalink, Comment form -- Back to top

17. CS161: Notes on file systems

Categories: 2004.02.20:1 -- Permalink, Comment form

I might not be able to give a lecture on filesystems this Friday (or it might whiz past with my mile-a-minute speech), so here are some detailed lecture notes on file systems to help you review for the final exams.

File systems. You know about file systems because that's one of the most obvious things about your computer. You know that your documents are hidden somewhere on your hard disk. You know that programs are stored in another directory. You know that you can make your own directories to organize your programs and your data.

Why are file systems important? Well, remember what happens during brown-outs or power fluctuations? If the power goes off and then on again in a computer lab without uninterruptible power supplies (UPSes), people will lose all their unsaved work. That's because the kind of memory we use loses its data if it doesn't have power. Hard disks, on the other hand, keep data even when the computer is off - so save often!


Let's take a look at the data associated with files. Different operating systems keep track of different things, but here's a short list.

Access methods

Your hard disk is divided into partitions (PC term) or volumes (Mac term). These are the "drives" you see on Windows. You can split up one hard disk into a C: drive and a D: drive. If you learn about something called RAID, you can combine two hard disks into just one drive. ("Drive" is a confusing term, though, as you can have C:, D:, E:, F:, etc. on just one hard disk.)

Single-level directory

Long, long ago, MSDOS didn't have directories. Seriously. Well, there was one directory, and all of your files had to be under it. You can imagine how this sucked, as all of your program files had to be in the same place as your data. Not only that, you were limited to 8 characters for the filename and 3 characters for the extension.

People used clever names like AAAAAAAA.TXT, AAAAAAAB.TXT and AAAAAAAC.TXT for their files. Of course, after six months, who could remember what the contents of each file were?

The diagram shows a single-level directory. The directory entries are "cat", "bo", "a", "test", "data", "mail", "cont", "hex" and "records". All of these entries point to files.

Two-level directory

Now we got to organize them by user, at least. Still sucked because all of your files were in just one directory, but at least you didn't have to worry about other people's naming schemes.

Tree-structured directory

This is the kind of directory tree you got used to in Microsoft Windows. You can create directories (aka folders) inside directories inside directories inside directories.

Links aren't actually real directories. In Microsoft Windows, they're fake - for example, you can't cd into them from the command line.

Acyclic graph directory

Remember the ln command from Unix? This is where links in Unix come in. (They're _real_ links, not like the fake ones in Microsoft Windows. =) )

ln somefile anotherfile

creates a link: anotherfile will refer to the exact same file that somefile refers to on the hard disk. They point to the same place on the hard disk.

This allows you to have acyclic graph directories, because the same file is referred to in two or more places.

General graph directory

ln returns! This time, we use it to make a symbolic link.

ln somefileordir anotherfileordir -s

Symbolic links can point to directories, so it's perfectly acceptable to make a link that points to one of your parent directories and thus get into some kind of loop.

Basically, a general graph directory is anything that could have these loops.

File protection

You don't want just anyone messing around with your files. Remember Unix file permissions and chmod? This slide talks about some of those permissions, although the access groups the slide uses are different from Unix permissions. Under Unix, it's user, group, others. Other operating systems support access control lists (ACLs) - this means that instead of just giving permission to one group, you can specify exactly who gets to do what to the file.

Allocation methods

Here we start looking at how things are physically stored on your hard disk. You can start up defrag to get an idea of what it looks like.

Contiguous allocation

It's like contiguous allocation for memory. All the space the file needs should be in one continuous block. The nice thing about it is that it's easy to figure out where all the data is - just find the starting position and count off so and so many bytes. If you need to allocate space for a new file, try either first-fit or best-fit. Downside of this is that file sizes are fixed, because once it's been allocated and another file has been allocated next to it, the file can't grow.

Linked allocation

The file is treated as a list of blocks, where a block is a fixed-size contiguous collection of bytes on the hard disk. The blocks don't all have to be together on the hard disk - each block in the file points to the next one. Plus side: files can grow, just link in new blocks. Minus: To read the file, you have to hop around the hard disk, plus all of that pointing around wastes space because each block has to refer to the next one. Solution: use groups of blocks (aka clusters), but these might be bigger than you need - if so, then space is wasted.

File allocation table

Form of linked allocation. The links to the next block are kept in one large table in a certain place in the hard disk.

Indexed allocation

Still uses blocks, but instead of each block pointing to the next one, one block has an index that points to all of the blocks. This block is called the inode (index node) under Unix. If the file is too big for one index block, the index block refers to other index blocks.

Free-space management

How your computer can tell how much space you have free.

Directory implementation

How directories work. That is - how do directories store info about files within them?

One way is to just keep a list of all the filenames in that directory. If you have a million files (and it's happened!), this can get _really_ slow.

Hashtables are supposed to be faster at lookup, so naturally there's a way to use them too.

Consistency checking

Remember the scandisk that shows up when you improperly shutdown your computer? This is what's happening. Your computer's checking if what it thinks your filesystem should be like is different from what it actually is.

Permalink, Comment form -- Back to top

16. Christmas song

Categories: None -- Permalink, Comment form

(and advanced merry Christmas and a happy New Year!)

Please e-mail me a snapshot of your work by Saturday - whatever you've worked on, even if it's just something along the lines of "okay, Foo in charge of doing this and Bar in charge of that, and this is how we plan to work over the break."

Santa Claus Learns Unix
   better !pout !cry
   better watchout
   lpr why
   santa claus <north pole >town
   cat /etc/passwd >list
   ncheck list
   ncheck list
   cat list | grep naughty >nogiftlist
   cat list | grep nice >giftlist
   santa claus <north pole > town
   who | grep sleeping
   who | grep awake
   who | grep bad || good
   for (goodness sake) {be good}
   echo "Oh,"
   better !pout !cry
   better watchout
   lpr why
   santa claus <north pole >town

- somewhere
Permalink, Comment form -- Back to top

15. More reviewers!

Categories: 2004.01.09:3 -- Permalink, Comment form

Cliff's group has nicely made a few reviewers for CS161. You can find them at http://sacha.sachachua.com/notebook/cs161/reviewers/ .

E-Mail from Cliff

Permalink, Comment form -- Back to top

14. 2003.12.17 Release of project specifications

Categories: None -- Permalink, Comment form

For more details, see

Permalink, Comment form -- Back to top

13. 2003.12.15 Unix for Poets

Categories: None -- Permalink, Comment form

You can Google to find the original text.

Permalink, Comment form -- Back to top

12. 2003.12.12 Discussion of solutions to exercises

Categories: None -- Permalink, Comment form

Permalink, Comment form -- Back to top

11. 2003.12.10 Discussion of solutions to exercises

Categories: None -- Permalink, Comment form

Permalink, Comment form -- Back to top

10. 2003.12.05 Assignment: shell scripting exercise set 1

Categories: None -- Permalink, Comment form

Please see the instructions for exercise 1. This is due by 11:59:59 PM on Tuesday. It is not easy, but it is doable. =) Have fun!

Permalink, Comment form -- Back to top

9. 2003.12.03 Introduction to shell scripting

Categories: None -- Permalink, Comment form

How to get help
man commandDisplays the manual page for the command. You can also use man to find out about some configuration files. For example, man hosts brings up the explanation for /etc/hosts. You will occasionally see commands followed by numbers in parentheses; these
apropos keywordSearches the whatis database for a command that has the keyword in its description. NOTE: You may need to run makewhatis to initialize the database that apropos uses.
http://www.rpmfind.netJust in case you haven't installed the packages you need yet, you can find them on your distribution CDs (most likely) or on http://www.rpmfind.net (if the CDs are not handy).

FILENAME=$(date +%Y.%m.%d)
TIME=$(date +%T)

echo >> $FILENAME
echo $TIME $1 >> $FILENAME
Permalink, Comment form -- Back to top

8. 2003.12.01: Quiz

Categories: None -- Permalink, Comment form

Assigned reading:

Both can be found at the Linux Documentation Project, http://www.tldp.org

Permalink, Comment form -- Back to top

7. 2003.11.28: Introduction to shell scripting

Categories: None -- Permalink, Comment form

Permalink, Comment form -- Back to top

6. 2003.11.24: The Evolution of Unix

Categories: None -- Permalink, Comment form

Funny: http://www.cs.bgu.ac.il/~omri/Humor/unix-history.html

(Sung to the tune of "Hotel California")

In the darkness of Bell Labs
Monitors glowing blue
Thompson hacked on UNIX 1
Dennis Ritchie did too

(that's about as far as I got; can you think of other stanzas, poems or songs?)
Teacher's notesPPT SXI

Permalink, Comment form -- Back to top

5. 2003.11.21 No classes

Categories: None -- Permalink, Comment form

Did not have classes because of ACP.

Permalink, Comment form -- Back to top

4. 2003.11.19 Reviewer for slide set 1

Categories: None -- Permalink, Comment form

Reviewed slide set 1 through an ungraded in-class exercise. (SXI, PPT) It's a good thing we reviewed it, as we missed a lot of objective questions.

Permalink, Comment form -- Back to top

3. 2003.11.17 Slide set 1: Operating systems history, concepts, architecture

Categories: None -- Permalink, Comment form

Quickly went through the first slide set. PPT

Permalink, Comment form -- Back to top

2. 2003.11.14 Recitation, Chapter 2

Categories: None -- Permalink, Comment form

Went through chapter 2 of Silberschatz and Galvin with recitation.

Permalink, Comment form -- Back to top

1. 2003.11.12 Welcome to CS161

Categories: None -- Permalink, Comment form

Groups, discussion of what we'll take up

Permalink, Comment form -- Back to top