Fall 2020

Fri Oct 30


deadlines and labs

I was asked about deadlines for the "three longer writeups" ... those can be done later, especially since you haven't seen all the labs yet and don't know which you will want to do.

I will be posting some of my answers for the labs. If you're doing to do one of the longer writeups, show as much as you can of your own work. It's OK to also explain other people's answers ... but that won't be as impressive. In any case, as always, be clear about what is your own work.

Ideally you should be turning in something ("this is what I've done so far") by the deadlines.

All of you are taking this pass/fail. Clearly this is a "get out of it what you put into it" course.

C's ternary operator

What is x = y == 3 ? 1 : 0 all about ...


The datalab is due tonight ... any questions about that ?

next week

I've posted the assignments for next week - working on the material in chapter 3 of the text, understanding how processes run at the machine code level.

I've also put up the start of assignments for the week after. I'm planning to have us get through the chapter 3 material (by watching the videos, reading the book, playing with the labs, ...) within the next two weeks.

My students in the past have really enjoyed the bomblab ... so dig in.

(I think these next few weeks have the most new stuff this term. If the bomblab deadline needs to slip a bit, so bit it.)

machine code 101

I think the best order to study this is

- basic ideas
- what the registers are
- mov instructions and addressing
- procedure calls and the stack

... and use gdb to find examples of these things in real code.

Only then move onto the condition codes ("if" statements with jumps) and the logic and arithmetic operations.

gdb demo.c

Here's a demo C program which has a few language features we haven't looked at closely yet and are worth mentioning : structs (which is as close as C gets to objects) and their foo->bar notation, as well as scanf() which is used in the bomblab.

I've also included a Makefile ; check it out.

I'm going to use that code as an example of using gdb to examine code while its running : registers, addresses, data, instructions, the stack, the heap, and all that, exploring the ideas from those slides.

I've attached an annotated gdb session that we can walk through in class.

Note that there are tutorials and cheat sheets for this stuff on the resources page.


Some assembly language inspired videogames that might give you an intutition for this sort of stuff.

after class

I've uploaded the memory.txt example I discussed at the start of class : cpu - cache - RAM - disk - network.

And I've uploaded the gdb_demo_example.txt that I couldn't find, the one that I think gives a better example of a gdb session. /courses /fall2020 /systems /notes /oct30
last modified Fri October 30 2020 4:07 pm

attachments [paper clip]

  last modified size
TXT gdb_demo_example.txt Fri Oct 30 2020 04:05 pm 6.4K
TXT memory.txt Fri Oct 30 2020 04:05 pm 283B