Download Embedded Xinu Documentation

Transcript
Embedded Xinu Documentation, Release master
system/initialize.c
system/main.c
system/queue.c
system/create.c
system/ctxsw.S
system/ready.c
system/resched.c
system/getstk.c
compile/Makefile
Updated initialization for Project 4.
A “main program” for testing scheduling.
An implementation of the queue data structure.
A partial function for creating a new process.
An incomplete assembly routine for switching process contexts.
A function for adding a process to the ready queue.
The primary scheduling code, equivalent to yield().
A rudimentary function for dynamically allocating new stacks for new processes.
Updated rules for compiling XINU.
The create() and ctxsw() functions are incomplete and must be filled in. The file system/initialize.c
contains code to test your context switch with three processes, each of which prints a process ID and then yields. Once
your context switch and creation functions are working, you will see these three processes take turns running.
Some Assembly Required
An operating system’s context switch function typically must be written in assembly language because the low level
manipulations it performs are not modeled well in higher-level languages. If you have not worked in Mips assembly
language before, there are many helpful resources available online. Despite its low-level nature, a context switch does
not require complex instructions. Our context switch can be completed using only arithmetic opcodes, and the load
(lw), store (sw), and move (move) opcodes.
README
There are many possible layouts for your operating system’s activation records. It is critical that your create()
function and your ctxsw() agree on the design you choose. Turn in a plain text file, "README" that diagrams and
explains the activation records created by create() and expected by ctxsw(). Label the purpose of each field.
This design document will be worth 25% of the assignment credit.
Testing
The default test case provided with the tarball is necessary, but not sufficient. Just because it switches between a
handful of identical processes does not guarantee correctness. In embedded systems, details matter. (A LOT!) Students
in previous terms have found that subtle bugs in this phase of the term project were responsible for nightmares weeks
and months down the line. Test your code thoroughly:
• Processes can be passed an arbitrary number of parameters upon creation;
• Processes should terminate cleanly upon exit;
• Stack pointers and activation records should align properly and have known contents at critical check points.
You have a working I/O driver, a kprintf() function for formatted output, and code from earlier assignments for
parsing integers. Use these to explore every aspect of the operating system structures you are building.
6.10.8 Assignment: DHCP Implementation
Overview
This assignment is part of the Networking with Xinu track for professors that are teaching with Xinu and it is intended
to be completed in groups of two or three.
6.10. Assignments
137