Presentation is loading. Please wait.

Presentation is loading. Please wait.

Memory The programmer’s model .text, .data .ktext, .kdata

Similar presentations


Presentation on theme: "Memory The programmer’s model .text, .data .ktext, .kdata"— Presentation transcript:

1 Memory The programmer’s model .text, .data .ktext, .kdata
user program (instruction memory) and data area .ktext, .kdata kernel program and data area The computer’s model instruction memory user space 0-7fffffff, kernel space ffffffff data memory

2 How can we tell User/Kernel apart?
31 30 29 28 27 ? x x x x…... By looking at the address! PC[31] 0, User program 1, Kernel program data addr[31] 0, User data 1, Kernel data

3 Address Decoding So far; Instruction decoding Now address decoding 32
PC PC[31] TAP BOX [31]

4 How to detect a kernel instruction
CPU model How to detect a kernel instruction kinst CP0 MIPS PIPELINE 32 instruction address [31] Instruction Memory

5 How to detect kernel data access
CPU model How to detect kernel data access kdata CP0 MIPS PIPELINE data mem address 32 [31] Instruction Memory

6 Address Mapping CP0 MIPS PIPELINE data mem address 32 32 data
8/16/32 bits Address bus Data bus

7 Address Mapping CP0 MIPS PIPELINE Control signals r/w, 8, 16, 32 bits
Address bus Data bus Control bus

8 Address Mapping Address bus Data bus Control bus 00……0 .. . 0fff…..f
10……0 .. . 1fff…..f n0……0 .. . nfff…..f …. Mem 1 Mem 2 Mem n

9 Enable and REDUCED address
Address 0-7fffffff 31 30 29 28 27 [27:0] points out the REDUCED address in mem 1 mem 1 Enable

10 lw $t0 0($t1), $t1=0…0 Address bus Data bus Control bus
read=(ADDR[31..28]=0000) and CTRL[READ] word=CTRL[WORD] 32 address decoder read, word 28 data word 00……0 .. . 0fff…..f

11 lw $t0 0($t1), $t1=0…0 Address bus Data bus Control bus
CTRL[stall]=0 Until data ready 32 address decoder read, word 28 data word 00……0 .. . 0fff…..f

12 sb $t0 0($t1), $t1=0…0 Address bus Data bus Control bus
write=(ADDR[31..28]=0000) and CTRL[WRITE] byte=CTRL[BYTE] 32 address decoder write, byte 28 data word 00……0 .. . 0fff…..f

13 sw $t0 0($t1), $t1=0…1 Address bus Data bus Control bus
CTRL[ALIGNMENT]=(ADDR[31..28]=0000) and (ADDR[0] or ADDR[1]) 32 address decoder Alignment Error!!!


Download ppt "Memory The programmer’s model .text, .data .ktext, .kdata"

Similar presentations


Ads by Google