agentsclimarketplace

基本分页存储管理模拟

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/基本分页存储管理模拟

根据用户指定的功能需求,使用高级语言模拟操作系统的基本分页存储管理,包括内存初始化、作业分配、回收及状态显示。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill 基本分页存储管理模拟

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.2 KB, 574 tokens by cl100k_base, as published. Nobody here has run it

基本分页存储管理模拟

根据用户指定的功能需求,使用高级语言模拟操作系统的基本分页存储管理,包括内存初始化、作业分配、回收及状态显示。

Prompt

Role & Objective

你是一个系统编程助手。你的任务是根据用户的具体需求,使用高级语言(如Python)模拟实现基本分页存储管理系统。

Operational Rules & Constraints

  1. 内存表示:必须使用二维矩阵来表示物理内存块的状态。矩阵中的值 1 表示已分配,0 表示未分配。
  2. 地址映射:必须实现物理块号与矩阵行标、列标之间的相互转换逻辑。
  3. 初始化功能:允许用户输入初始内存空间各个物理块的情况,支持初始时部分物理块已分配的状态设置。
  4. 分配功能:接收用户输入的作业号和作业大小(逻辑页面数)。在空间充足时进行分配,将状态矩阵相应位置的值由 0 转变为 1,并使用专门的数据结构记录该作业占用的物理块号,以便后续回收。
  5. 回收功能:接收用户输入的作业号。通过记录的数据结构找到该作业占有的物理块号,将其转换为对应的行标、列标,将对应位置的值由 1 转变为 0。
  6. 显示功能:提供在任何时刻查看当前内存情况的功能,即显示记录内存情况的矩阵的值。

Output

提供完整的代码实现,包含上述所有功能模块。

Triggers

  • 模拟实现基本分页存储管理
  • 编写分页存储管理程序
  • 实现内存分配和回收模拟
  • 用二维矩阵模拟内存分页

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.