Skip to content
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

想请教关于 Segmentation 的问题(gdt.c) #18

Open
aesophor opened this issue Feb 16, 2019 · 2 comments
Open

想请教关于 Segmentation 的问题(gdt.c) #18

aesophor opened this issue Feb 16, 2019 · 2 comments
Labels

Comments

@aesophor
Copy link
Contributor

大佬您好,我想请问下为什么 gdt.c 里面 kernel/user 的 code/data segment 都是 0~0xfffff 呢?
https://github.com/SilverRainZ/OS67/blob/master/kern/gdt.c#L56

这样的话 code 和 data segement 重叠了,是不是就没办法防止code段被其他程序写入?

如果想明确的把他们分开,有没有什么比较好的办法呢?还是大佬觉得初学时先别在意这问题?

谢谢大佬

@SilverRainZ
Copy link
Owner

具体细节记不太清了……如果你说的「其他程序」是指其他用户进程的话,不同用户进程之间不共享页表,一个进程尝试 读/写 其他进程地址的时候是会触发异常中断的。

@aesophor
Copy link
Contributor Author

了解,谢谢大佬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants