CS 4411: Operating Systems Practicum
Edward Tremel Spring 2020
CS 4411: Operating Systems Practicum Edward Tremel Spring 2020 - - PowerPoint PPT Presentation
CS 4411: Operating Systems Practicum Edward Tremel Spring 2020 Outline for Today Course Overview Introductions Course Goals Warm-up Activity Logistics and Administrivia C and Pointers What is 4411? Grass Hands-on
Edward Tremel Spring 2020
an operating system
concepts you’ll learn in 4410
features to the same operating system, EGOS (Earth and Grass OS)
Host OS (Linux, Mac) Earth FS
Threads Scheduler Block Cache
Grass
Disk NIC RAM “Disk” “RAM” CPU
Hardware
Clock
experience
OS works
project, not just self-contained homework assignments
literature, Pokémon
Edward Tremel
applications to create multiple threads, scheduled by the OS
scheduling algorithm and create an implementation of it
implement a block cache for disk storage that uses the CLOCK algorithm
allows the OS to store and retrieve files from block storage (disk)
What are all the differences between these two variables? int x = 100; int *y = malloc(sizeof(int)); What is x + y? What is x + *y?
Host OS (Linux, Mac) Earth FS
Threads Scheduler Block Cache
Grass
Disk NIC RAM “Disk” “RAM” CPU
Hardware
Clock
private discussions are disruptive
http://www.cs.cornell.edu/courses/cs4411/2020sp/
2020sp/egos
cs4411-2020sp organization and the students team within it
soon) so that we can add you
members of the team
int queue_append(struct queue q, void *item); int queue_append(struct queue *q, void *item);
int queue_append(struct queue* q, void* item);
18ed009ffff78a42 int* x 18ed009ffff78a00 char* y 18ed009ffff789da long* z *x Heap Memory 4 bytes *y 1 byte *z 8 bytes 64-bit memory address A pointer is just a number! It’s a memory address
Pointer Type Size of Memory char* 1 byte int* 4 bytes long* 8 bytes float* 4 bytes double* 8 bytes struct foo* sizeof(struct foo) void* ????????? sizeof(int)
int queue_append(struct queue* q, void* item);
long x = 100 + *(long*)(item); long* z = item; long x2 = 200 + *z;
18ed009ffff789da item
int queue_dequeue(struct queue* q, void** pitem);
18ed009ffff78a42 void** pitem 18ed009ffff78a00 The item “Pointer to pointer to void” 64-bit memory address This is how dequeue “returns” an item to the caller
typedef struct message { msg_id_t id; char body[256]; } message_t;
typedef struct queue* queue_t;
message_t is now an alias for struct message queue_t is now an alias for struct queue*