Presentation on theme: "Project 4 Kristoffer Robin Stokke. Direct Memory Access New hardware device to toy with! Hardware controller with direct access to physical devices as."— Presentation transcript:
Project 4 Kristoffer Robin Stokke
Direct Memory Access New hardware device to toy with! Hardware controller with direct access to physical devices as well as RAM Used to transfer data from floppy to (physical) memory in our project! See the code in floppy.c
Direct Memory Access Limitations – Transfers to memory must be within the first 16 MBs! – Transfers must not cross a 64kB boundary! – All addresses are physical! – See the P4 FAQ!
Processes in P4 User mode Virtual address space –?–?
Virtual Address Space Each process «believes» to run in a separate address space entirely dedicated to itself Shell Virtual RAM 0x0 0xFFFFFFFF
Virtual Address Space Behind the scenes, the MMU maps virtual addresses to physical addresses using paging mechanisms Shell Virtual RAM 0x0 0xFFFFFFFF Physical RAM 0x0 0xFFFFFFFF
Virtual Address Space Code to set up processes with paging enabled have been given see kernel.c and paging.c Kernel Process Kernel Process data, code, stack Kernel ProcessesThreadsPhysical memory 0x – to - 1 0x0
Process Management Dynamic loading – how? – Simple filesystem on floppy containing process directory – Implement readdir() – Implement loadproc() – Who calls these functions?
readdir(uint32_t* buf) Systemcall called from shell Copies data from floppy to memory (buf) using DMA – From where? Is there a problem with that? – Explain in design!
loadproc() Systemcall by shell to load a process Allocate space for data (see memory.c) – Enough for code / data + 8kB stack! Load data into memory from floppy Use create_process() to setup the process
Keyboard Keyboard is connected to the CPU like the interrupt controller – IRQ1 signals keypress – Key can be read from port 0x60 Code set up for you in entry.S – Calls keyboard_interrupt(), which calls appropriate handler, which might call putchar() Design getchar(), putchar() and init()
Remember.. Lots of small things that can go wrong! – Attempt to identify such sections and design correctly to avoid them Use the makefile to test the different implementations as stated in the project description
A Word of Warning Only one delivery; goes for printed documents as well as deliveries by mail. Correctors now take the first of the delivered items to avoid duplicate work. Is this OK?