CSC2560-01 | 2:00PM-3:15PM | Tue, Thu: Jan 21-May 12 | Edgerley 106 |
Instructor: | Stephen Taylor |
Office: | Edgerly 312A |
Office hours: | W: 11:00-12:15; 2:00-3:30, (and by appointment) |
Web page: | http://computersystemsartists.net/ |
Email: | staylor@fitchburgstate.edu |
Office phone: | 978-665-3704 |
Home phone: | 508-867-9288 |
Course Description: (From the catalog) This course provides the student with the fundamentals of structured programming at the systems level. UNIX is used as a base for this course. Students obtain a thorough knowledge of the C language, comfort in using the UNIX operating system and an appreciation for a systems approach to low-level programming tasks.
We assume you already know how to program from previous courses; in this course you will learn some new concepts, and yet another language. C is still an important language in the marketplace, but in addition it is used as the foundation for python, java, and many of the other languages you have yet to learn.
As part of that foundation, C requires you to explicitly manage memory allocation and deallocation, and for that management requires you to use, and gives you the opportunity to misuse, pointers.
Occasionally we'll discuss how the C ideas relate to the similar but safer ideas in Python and Java. The basic scheme for programming in all three languages is the same, but the tools that the languages provide are different.
The course is named Systems Programming because traditionally big tools like compilers, shells, and operating systems have been written in C. Part of the reason for that choice is that, in return for extra effort, C gives you greater control how resources like memory and I/O devices are used. Part of the reason is that while Java and Python promise you freedom to switch between machines -- for example, you can develop Android apps on the PC and then run them on your phone -- each C compiler builds code for a specific machine, and this often gives C programs a speed advantage. Part of the reason is just an accident of history; large new systems today may be written in any language. But C still has a place when you want firmer control over what your program is doing. For example, most embedded systems are still programmed in C.
This is partly a lab course. You can't do the labs if you aren't in the lab. I don't take attendence, but my grading reflects my expectation of seeing you regularly:
Quizzes and exams are ordinarily due in the period in which they are given, and may not be turned in later, although they may be excused if you have a convincing story, such as your grandmother getting married in Provincetown.Labs are due on the day on which they are assigned, but not necessarily in class. Anything turned in by midnight is on time, and unless I am actually in my office at midnight, anything I find in the Blackboard dropbox on the following morning is assumed to have been turned in on time.
Papers and programming assignments are similarly due by midnight. Late papers and programs may be accepted after their due date, but I am likely to mark them down for lateness.
The textbooks for this course are all available online. The Downey C book is not available any other way, although he has a book Think C++ which you probably shouldn't buy for this course. Editions of the Morin book are also available on paper.The texts are:
Allan Downey, Thomas Scheffler, Think C: How to think like a Computer Scientist
This is an introduction to C for non-programmers, so you should be able to skim it. Don't go too fast, though. For the first few weeks of the class, I'll assign a chapter of the book per lecture, plus programming exercises to turn in; my plan is that the programs should take you less than two hours altogether, but that isn't likely to be true if you haven't glanced over the material in the chapter. Of course, I'll also cover some of the content in lecture, but not necessarily all the pieces you'll need.I also assign a couple of chapters from
the wikibook C programming It reads like it was written by a committee, each member of which hoped that the others were covering the fundamentals. But we'll use a couple of the late chapters, once we've mastered the fundamentals with Think C Neither of these is a great reference. So as the semester goes on you'll want good reference material. The following are good references, but unless you already know quite a bit of C, they're not much fun to read from start to finish (and it would take quite a long time:)
Another text, for linked lists and trees (and quite a bit more that we won't cover) is Pat Morin, Open Data Structures The book has an on-line website at http://opendatastructures.org/ and is also available in paperback from Amazon. We're only going to use a couple of chapters this term.
The GNU C manual http://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html
The GNU C pre-processor manual, https://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html
The C library reference guide http://www.gnu.org/software/libc/manual/pdf/libc.pdf This is probably the reference you'll want to look at most often. It is available on paper from Amazon. Although it is updated frequently, major changes are rare, and if you do buy it on paper, an older version, like 2001, would be fine.
http://linux-documentation.com/en/man/man2/ is the documentation for the linux system calls, but the unix system calls are almost the same, and the C library for Windows provides versions of these functions when possible (which isn't always.)This is the operating-system dependent part of C, the source of many glitches which prevent programs from running freely on every system.
I like the idea of
Andy Oram and Adam Hyde, editors: Introduction to the command line
but I only plan to assign a few pages of this book. I hope you'll be tempted to browse through more of it though, because it really does give you good suggestions.
Operating System
I run Ubuntu linux on my laptop, because I'm not very enthusiastic about the options for software development on MS Windows. There are C compilers for Windows and DOS, though. See below.
One component of the course is my intention to make you familiar with unix-style operating systems and software development on the command line. Towards the end of the course we will write systems software to run on unix-like systems. Such systems include:
Thousands of man-years went into the Multics OS. About half a man-year went into the first Unix system, which ran on a Digital Equipment PDP-7.
By about the third re-write at Bell Labs, it was written in C, and that version of C is the foundation that all later C compilers are built on. Since the C library provided access to the Unix operating systems facilities, all subsequent C libraries have endeavored to provide similar access to whatever OS they are configured for.
AT&T, which owned Bell Labs, sold the Unix trademark and the software to Novell. Bell Labs went on to build a number of operating systems which nobody uses anymore.
Over the years, several different companies, including Sun and Microsoft, released software under the Unix trademark. Oracle Solaris is still entitled to use the Unix trademark, and there are freeware distributions of Solaris, which are are also legally Unix systems.
Many of the systems programs in use today on linux and Macintosh are derived from software developed at Berkeley and released under BSD license. FreeBSD is/was a
There are hundreds of linux distributions, in which enthusiasts or companies bundle up their favorite software along with the linux kernel. For the last couple of years I've been using Ubuntu. It looks like Mint is the currently most popular distribution. Both of those are based on Debian. Other well known distributions include Fedora and slackwareSome distributions are designed to work on a Live CD or DVD, or USB drive. These don't require you to make changes to your hard drive to run them, which means that you can just load the CD into the drive and reboot in linux. This is convenient if you depend on Windows software for other courses, for example to run the student edition of MultiSim or MatLab, although naturally I think that this is the most important course you are taking. It's also handy if you share a PC with your brother, and can't persuade him to change.
In this course I plan to push the slax.org live distro, which is designed to run from USB. I encourage you to download one of the other linux distros to your PC, but if you don't want to do that now, slax is a good choice.
gcc is included in slax already, so if you decide to go with slax, you can skip over the next section.
Other packages with a similar goal include Cygwin, which I don't like as well, and DJGPP.
C Compiler Software
For Windows:
Microsoft Visual Studio system continues to support C, although it no longer appears in any of the menus and is hard to find in the documentation. You should be able to download a copy of Visual Studio through Fitchburg State arrangement with the Microsoft DreamSpark program
Included with Visual Studio is the non-mouse version of the software, which runs in a DOS box (with appropriate paths and environmental variables set.) The Visual Studio installation includes an entry for Command Line Utiliies which is a DOS box properly setup to run the C compiler, which is named vc.exe.
mingw includes gcc, the GNU C compiler, and gdb, the GNU debugger, excellent tools for this course.
DJGPP is named after its C++ compiler, which is called GPP for GNU - PLUS - PLUS. The DJ is after the initials of the package originator, DJ DeLorie. It includes a version of gcc and gdb. Both mingw and DJGPP compilers are available on the Fitchburg State computer science image.
&bnsp;
(for Linux)
Almost every linux installation either includes a C compiler, usually gcc, or has a site from which you can download one. For example, the slax distro, which I plugged above as being designed to run from a USB thumbdrive, includes gcc, but you have to download gdb if you want it.
Other
From time to time I will put programs from lectures on the web.
I usually record grades in blackboard.
Tentative grade rubric:
- There will be several pop quizes, making up in total 10% of the final grade.
- There will be several programming projects, making up 50% of the final grade.
- There will be a final exam and two midterms, which will make up 30% of the final grade
- The remaining 10% of the grade will be based on class participation and other utterly subjective measures.
I do not consider homework which is emailed to me to be turned in on time, no matter when you sent it. Instead use the Blackboard dropbox.
There are no makeup or early exams, but I may excuse an exam for a good story, presented in advance, like your grandmother getting married that day in Provincetown.
Each student is responsible for completing all course requirements and for keeping up with all activities of the course (whether a student is present or not).
I consider it plagiarism to share typing or fail to give credit to other peoples' ideas.
Fitchburg State College has an Academic Integrity policy, which can be found in the college catalog. Penalties for academic dishonesty, including submitting work which is not your own, and assisting other students on examinations, can be severe.