virtual memory 2
1
virtual memory 2 1 xv6 memory layout 0x80000000 (KERNBASE) page - - PowerPoint PPT Presentation
virtual memory 2 1 xv6 memory layout 0x80000000 (KERNBASE) page tables store this mapping (one kernel, one user) for user memory two virtual address same in every process = PA VA 0x8000000 + kernel-only memory 2 Virtual 4 Gig Device
1
User data User text User stack Program data & heap + 0x100000 Kernel text end KERNBASE Kernel data 4 Gig RW-- RW- RWU Device memory 0xFE000000 Free memory RW- R--
Virtual
0x100000 PHYSTOP Unused if less than 2 Gig
Extended memory 640K I/O space Base memory
Physical
4 Gig RWU RWU PAGESIZE RW- At most 2 Gig Memory-mapped 32-bit I/O devices Unused if less than 2 Gig
2
User data User text User stack Program data & heap + 0x100000 Kernel text end KERNBASE Kernel data 4 Gig RW-- RW- RWU Device memory 0xFE000000 Free memory RW- R--
Virtual
0x100000 PHYSTOP Unused if less than 2 Gig
Extended memory 640K I/O space Base memory
Physical
4 Gig RWU RWU PAGESIZE RW- At most 2 Gig Memory-mapped 32-bit I/O devices Unused if less than 2 Gig
2
User data User text User stack Program data & heap + 0x100000 Kernel text end KERNBASE Kernel data 4 Gig RW-- RW- RWU Device memory 0xFE000000 Free memory RW- R--
Virtual
0x100000 PHYSTOP Unused if less than 2 Gig
Extended memory 640K I/O space Base memory
Physical
4 Gig RWU RWU PAGESIZE RW- At most 2 Gig Memory-mapped 32-bit I/O devices Unused if less than 2 Gig
2
User data User text User stack Program data & heap + 0x100000 Kernel text end KERNBASE Kernel data 4 Gig RW-- RW- RWU Device memory 0xFE000000 Free memory RW- R--
Virtual
0x100000 PHYSTOP Unused if less than 2 Gig
Extended memory 640K I/O space Base memory
Physical
4 Gig RWU RWU PAGESIZE RW- At most 2 Gig Memory-mapped 32-bit I/O devices Unused if less than 2 Gig
2
User data User text User stack Program data & heap + 0x100000 Kernel text end KERNBASE Kernel data 4 Gig RW-- RW- RWU Device memory 0xFE000000 Free memory RW- R--
Virtual
0x100000 PHYSTOP Unused if less than 2 Gig
Extended memory 640K I/O space Base memory
Physical
4 Gig RWU RWU PAGESIZE RW- At most 2 Gig Memory-mapped 32-bit I/O devices Unused if less than 2 Gig
2
3
4
KERNBASE text data stack heap PAGESIZE argument 0 argument N address of argument 0 address of argument N address of address of argument 0 0xFFFFFFF (empty) argc ... ... nul-terminated string argv[argc] argv[0] argv argument of main argc argument of main return PC for main guard page
invalid initial stack pointer
5
6
7
8
9
9
9
10
11
11
11
11
fmags
phys. page byte addr
12
13
14
14
14
14
14
15
16
17
phys. page#
18
phys. page#
18
phys. page#
18
phys. page#
19
phys. page#
20
phys. page#
20
phys. page#
20
phys. page#
20
phys. page#
21
22
22
23
23
23
23
24
25
26
26
26
26
26
27
28
29
30
31
32
32
32
33
33
33
33
34
35
36
KERNBASE text data stack heap PAGESIZE argument 0 argument N address of argument 0 address of argument N address of address of argument 0 0xFFFFFFF (empty) argc ... ... nul-terminated string argv[argc] argv[0] argv argument of main argc argument of main return PC for main guard page
invalid initial stack pointer
37
38
39
KERNBASE text data stack heap PAGESIZE argument 0 argument N address of argument 0 address of argument N address of address of argument 0 0xFFFFFFF (empty) argc ... ... nul-terminated string argv[argc] argv[0] argv argument of main argc argument of main return PC for main guard page
invalid initial stack pointer
40
KERNBASE text data stack heap PAGESIZE argument 0 argument N address of argument 0 address of argument N address of address of argument 0 0xFFFFFFF (empty) argc ... ... nul-terminated string argv[argc] argv[0] argv argument of main argc argument of main return PC for main guard page
invalid initial stack pointer
40
41
42
42
42
42
43
43
pid 4 processname: trap 14 err 6 on cpu 0 eip 0x1a addr 0x800444--kill proc
44
pid 4 processname: trap 14 err 6 on cpu 0 eip 0x1a addr 0x800444--kill proc
44
pid 4 processname: trap 14 err 6 on cpu 0 eip 0x1a addr 0x800444--kill proc
44
pid 4 processname: trap 14 err 6 on cpu 0 eip 0x1a addr 0x800444--kill proc
44
45
45
45
45
46
47
47
47
48
48
48
49
50
51
52
53
53
53
54
55
55
55
55
56
57
58
59
61
62
63
63
63
63
63
64
64
64
64
64