-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
支持syscall指令 #417
支持syscall指令 #417
Conversation
* 添加rust重构版本的HPET驱动和tsc驱动,并使用HPET校准tsc频率和cpu总线频率 * 把hpet.c移动到arch文件夹下
* 测试RESET * 测试RESET * 基于轮询的实现 * 规范化部分unsafe的使用 * 完成中断处理函数,同时去除了不必要的内存拷贝行为,准备编写napi机制 * 实现现有协议栈下的部分napi机制;修复了内存泄漏的问题;添加了一部分代码注释 * 去除部分无用代码 * 去除一些无用代码 * 适配新的驱动模型 * 完成msi中断测试 * 去除一些无用代码 * 格式化代码 * 增加了一些注释,提高代码可读性 * 去除无关文件 * 优化了读取mac地址的方式,提高可读性
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
然后就是函数和数据结构需要添加注释
); | ||
} | ||
|
||
pub fn init_syscall_stack(&mut self, stack: VirtAddr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方最好把syscall_stack的引用传入进来
/// user data segment selector | ||
pub const USER_DS: SegmentSelector = SegmentSelector::new(6, Ring::Ring3); | ||
pub const USER_DS: SegmentSelector = SegmentSelector::new(5, Ring::Ring3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前后顺序更改一下
kernel/src/exception/entry.S
Outdated
movq %gs:0x0, %rsp | ||
|
||
pushq $43 //USER_DS | ||
pushq %gs:0x8 //rsp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释的格式修改一下,//
右边需要空格
pushq %rax //ds | ||
xorq %rax, %rax | ||
|
||
pushq %rbp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的格式对齐有问题
kernel/src/smp/smp.c
Outdated
@@ -186,6 +195,23 @@ static void __smp__flush_tlb_ipi_handler(uint64_t irq_num, uint64_t param, struc | |||
flush_tlb(); | |||
} | |||
|
|||
void smp_syscall_init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数最好是调用rust里面的代码,暴露一个接口出来,不然的话代码就冗余了
kernel/src/exception/trap.h
Outdated
void sys_vector_init(); | ||
void syscall_64(); // syscall指令入口 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个如果没用到的话就不用在这导出了
kernel/src/exception/entry.S
Outdated
cli | ||
// 将原本要返回的栈帧的栈指针传入do_signal的第一个参数 | ||
// movq %rsp, %rdi | ||
// callq do_signal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删掉这段即可
加点函数注释即可merge了 |
No description provided.