Dahisar Comfortable Call Girls ,09167354423,Mira Road Model Call Girls
Memory_AllocationUNIX_MINIX-COSCUP2012
1. Memory Allocation
In
Classic Monolithic Kernel
And
Classic Micro Kernel
陳膺正 (Hawx Chen )
yingjheng.chen@gmail.com
http://gplus.to/HawxChen
http://hawxchen.blogspot.tw
Presented at COSCUP2012- JuluOS Workshop/JuluOSDev http://www.juluos.org/
2. Who Am I
• Experience
– 2008 NCTU CS Bachelor
– 2010 NTU CSIE Master
– 2010~presnet Mstar Semiconductor
• Senior software engineer
• Open Source
– https://github.com/HawxChen/MIT-6.828-
Adventure Enjoy to implement OS
3. Memory Management
• Importance of History.
• Based Arch:
– Classic Monolithic: UNIX v6
– Classic Microkernel: MINIX
• UNIX
– Kernel(Physical) Memory Allocator
– User(virtual) Memory Allocator
• MINIX
– Kernel(Physical) Memory Allocator
– User Memory Allocator
4. Memory Management
• Importance of History.
• Based Arch:
– Classic Monolithic: UNIX v6
– Classic Microkernel: MINIX
• UNIX
– Kernel(Physical) Memory Allocator
– User(virtual) Memory Allocator
• MINIX
– Kernel(Physical) Memory Allocator
– User Memory Allocator
5. Importance of History
• Computer
programmming is Art?
From
http://www2.uwstout.edu/content/profdev/images/kelly_art_history.jpg
http://www.informit.com/ShowCover.aspx?isbn=0201485419
6.
7. Importance of history
• Having an understanding of the battles
fought in the past will give you the
ammunition for your current battles
了解過去的戰場在爭什麼,會讓你得到現
行戰場的火藥。
10. Memory Management
• Importance of History.
• Based Arch:
– Classic Monolithic: UNIX v6
– Classic Microkernel: MINIX
• UNIX
– Kernel(Physical) Memory Allocator
– User(virtual) Memory Allocator
• MINIX
– Kernel(Physical) Memory Allocator
– User Memory Allocator
11. UNIX Arch
User Process
System Call
Process
Management I/O Services
Device
Drivers
Scheduler
Hardware
I/O Buffers
Memory
Management File
System
Kernel Space
Interface (Library Routines)
User Process
16. UNIX Kernel Addressing Space
Physical
• Kernel segment registers
Loader/
initialized at m40.S INT&Trap
– KISA0 ~ KISA5 : 0~48KB functions
– KISA6 KISD6: Per process data and
structure. Kernel context
– KISA7 KISD7: IO Segment
Kernel
data/bss
u per-process
data
• #0 system process(scheduler) IO address
space
• #1 init process
17. UNIX Kernel Addressing Space
• Kernel segment registers
initialized at m40.S
– KISA0 ~ KISA5 : 0~48KB
– KISA6 KISD6: Per process data and
structure.
– KISA7 KISD7: IO Segment
stack
kernel stack
u per-
process data
1K
struct user data structure
• #0 system process(scheduler)
• #1 init process
18. UNIX Kernel Memory Allocation
• coremap counted from *ka6+USIZE
Loader/
INT&Trap
functions
Kernel context
First Fit Avail Memory
Kernel
data/bss
u per-process 48K
data stack
struct user
Avail
Memory
49K
IO address
space
19. UNIX User Memory Allocation
• User segment registers initialized at main
– UISA/UISD
– Text+Data(BSS)+Stack + U(Kernel Stack/Internal PCB) <=
64KB
0
Virtual Physical
0
Context
Context
Data
Data
Stack
unmapped
64KB Stack 256KB
20. Memory Management
• Importance of History.
• Based Arch:
– Classic Monolithic: UNIX v6
– Classic Microkernel: MINIX
– UNIX
– Kernel(Physical) Memory Allocator
– User(virtual) Memory Allocator
• MINIX
– Kernel(Physical) Memory Allocator
– User Memory Allocator
21. MINIX Kernel Address Space
• Kernel don’t use any dynamic
memory
• Hardware independent
• View entire available memory
as CLIKCS (1024 Byte)