构建基于MMU和TLB的软件
我正在尝试破解旧的 UNIX 内核。我只是想用软件来实现MMU和TLB。有人可以告诉我构建数据结构和算法时使用的最佳数据结构和算法是什么吗?我看到很多人使用展开树,因为它很容易实现 LRU。有没有更好的数据结构?在软件中将虚拟地址转换为物理地址的最有效方法是什么?假设其 x86 架构和转换与任何基本页表转换一样。
I am trying to hack an old unix kernel. I just want to implement the MMU and TLB using software. Can some one tell me what are the best Data structures and algorithms to use in building one. I saw lots of people using splay trees because its easy to implement LRU. Is there any better Data Structure ? What is the most efficient way of translating virtual to physical address in software.Assume its x86 architecture and translation as any basic page table translation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你提到效率。这是您正在努力实现的目标吗?如果你没有被任何特定的目标所限制,那就试着让它发挥作用。如果可以的话,我会做一个单级页表,无论是直接的还是完全关联的。听起来你已经过去了。
最有效的方法将取决于大小、速度的权衡以及您期望的位置类型。您是否有任何关键应用程序的概要分析,或者这只是为了尝试一些实现?一些较新的体系结构使用倒排页表。我认为这表明有人花了很多时间在这方面工作,认为这是一个很好的方法。
You mention efficiency. Is that the goal you're engineering towards? If you're not constrained to any particular goal, just try to get it working. I'd do a single level page table if you can, either direct or fully associative. It sounds like you're past this though.
Most efficient is going to depend on size-speed tradeoffs and what kind of locality you expect. Do you have any critical apps profiled or is this just messing around to try out some implementations? Inverted page tables are used on some newer architectures. I would take that as an indication that someone spending a lot of time working on this thinks it's a good way to go.