Presentation is loading. Please wait.

Presentation is loading. Please wait.

Project 4 Kristoffer Robin Stokke. Direct Memory Access New hardware device to toy with! Hardware controller with direct access to physical devices as.

Similar presentations


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:

1 Project 4 Kristoffer Robin Stokke

2 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 2015.04.132

3 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! 2015.04.133

4 Processes in P4 User mode Virtual address space –?–? 2015.04.134

5 Virtual Address Space Each process «believes» to run in a separate address space entirely dedicated to itself 2015.04.135 Shell Virtual RAM 0x0 0xFFFFFFFF

6 Virtual Address Space Behind the scenes, the MMU maps virtual addresses to physical addresses using paging mechanisms. 2015.04.136 Shell Virtual RAM 0x0 0xFFFFFFFF Physical RAM 0x0 0xFFFFFFFF

7 Virtual Address Space Code to set up processes with paging enabled have been given see kernel.c and paging.c 2015.04.137 Kernel Process Kernel Process data, code, stack Kernel ProcessesThreadsPhysical memory 0x1000000 1 – to - 1 0x0

8 Process Management Dynamic loading – how? – Simple filesystem on floppy containing process directory – Implement readdir() – Implement loadproc() – Who calls these functions? 2015.04.138

9 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! 2015.04.139

10 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 2015.04.1310

11 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() 2015.04.1311

12 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 2015.04.1312

13 Snake x86 2015.04.1313

14 A Word of Warning 2015.04.1314 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?

15 Good luck! 2015.04.1315


Download ppt "Project 4 Kristoffer Robin Stokke. Direct Memory Access New hardware device to toy with! Hardware controller with direct access to physical devices as."

Similar presentations


Ads by Google