OpenSolaris邮件列表中关于HAT layer(硬件地址转换层)的讨论
发表于:2007-06-08来源:作者:点击数:
标签:
转载自:OpenSolaris: code HAT layer Posted: Jul 3, 2005 2:36 AM Hi, I would like to understand the HAT layer with respect to the code and also if there any good docs. -Jay elowe On Sat, Jul 02, 2005 at 11:36:40AM -0700, Saravanan Jayakumar
转载自:OpenSolaris: code
HAT layer
Posted: Jul 3, 2005 2:36 AM
Hi,
I would like to understand the HAT layer with respect to the code and also if there any good docs.
-Jay
elowe
On Sat, Jul 02, 2005 at 11:36:40AM -0700, Saravanan Jayakumar wrote:
| Hi,
| I would like to understand the HAT layer with respect to the code and also if there any good docs.
There aren't any good documents out there yet. The Solaris Internals book
has a brief overview of the HAT interfaces and a description of what they
do. Things have changed somewhat since then with the introduction of
MPSS (superpages) but otherwise it's fairly close.
As far as the code I'd recommend starting with the x86 HAT layer which
was rewritten for Solaris 10. It's a lot simpler and easier to
understand, and has lots of good comments. The sfmmu HAT layer is
aging and is about due for a rewrite, and is a lot more complicated
due to the need to walk page tables in software from trap code.
The x86 HAT is under usr/src/uts/i86pc/vm and the sfmmu HAT (SPARC)
is under usr/src/uts/sfmmu/vm.
--
Eric Lowe Solaris Kernel Development Austin, Texas
Sun Microsystems. We make the net work. x64155/+1(512)401-1155
Hi Eric,
Thanks for your response. Can you please let me know in which logical order i need to start looking into the files.
\usr\src\uts\i86pc\vm has around 8 files.
Thanks
Jay
I have one more query. Where can find the 86 specific code?
> Hi Eric,
> Thanks for your response. Can you please let me know in which logical order i
need to start looking into the files.
>
> \usr\src\uts\i86pc\vm has around 8 files.
> Thanks
> Jay
Hi Jay,
start looking at the header files first.
The "HAT Layer" (in the sense of "Hardware Address Translation" -
NOT "Hardware AbsTraction") is well-specified although not publicly
documented. But the interfaces an implementation has to provide for
the generic Solaris VM code to work are listed in:
usr/src/uts/common/vm/hat.h (
in any Solaris system)
There are two classes of interfaces defined there:
1. mandatory ones which an implementation must provide
2. optional ones which an implementation can provide to enable
better performance/additional features. See func hat_supported().
Generically, I'd start with the arch-independent VM code to get the
overview. When it comes to implementation, the x86/x64 HAT code that
was mentioned is indeed far easier to read than the sfmmu (sparc)
HAT code. But the "big five":
- address spaces, vm_as.c
- segments, vm_seg.c (and segment types, seg_*.c, if you've got time)
- pages, vm_page.c
- anon/swap, vm_anon.c, vm_swap.c,
filesystem interfaces, vm_pvn.c and seg_map.c
- heap (kernel freelists), vm_pagelist.c
are all architecture-independent, in usr/src/uts/common/vm/*.
In the arch-specific code, read /vm/hat* first.
As far as "hardware abstraction" goes, that's different. There are
multiple areas involved here. Not necessarily complete list of code
with large architecture-dependent parts:
a) boot code
b) system startup/initialization
c) MMU/VM interfaces (classical "HAT" in the UNIX sense)
d) trap/interrupt/exception/fault/syscall handling
e) context switching
f) device driver framework and actual device drivers
g) atomics, lock primitives, SMP interrupt handling, crosscalls
h) system timers, HW statistics (cpc, trapstat, busstat, ...)
i) kmdb / dtrace
Have you meant these ? The answer to "where are these and how do these
work in Solaris" is probably worth a blog entry ... if only to collect
references to all those OpenSolaris blogs that already explain one
part or the other ...
FrankH.
原文转自:http://www.ltesting.net