📄 1142.html
字号:
· 六个段寄存器(Segment Register):分为可见部分和隐藏部分,可见部分为段选择符,隐藏部分为段描述符;六个段寄存器分别为CS、SS、DS、ES、FS、GS;关于这些段寄存器的作用参见[1]中3.4.2 'Segment Register';<br>
86工作在保护模式时,进程使用的48bits逻辑地址(Logical address)。逻辑地址的高16bits为段选择符,低32bits是段内的偏移量。通过段选择符在GDT或LDT中索引相应的段描述符(得到该段的基地址),再加上偏移量得到逻辑地址对应的线性地址(Linear Address)。如果没有采用分叶管理,线性地址是直接映射物理地址(Physical Address),于是可以直接用线性地址访问内存;否则,还要通过X86的分页转换,将线性地址转换为物理地址。<br>
以上是对X86分段相关内容的简要描述,对于各数据结构、寄存器的细节和逻辑地址转换为线性地址的细节,请查阅 [1]。 <br>
<br>
II. X86的分页机制和相应系统结构<br>
32bits的线性地址空间可以直接映射到物理地址空间,也可以间接映射到许多小块的物理空间(磁盘存储空间)上。这种间接映射方式就是分页机制。X86可用页大小为4KB、2MB和4MB(2MB和4MB只能在Pentium和Pentium Pro处理器中使用,本文中限定采用4KB页)。<br>
在分页机制,X86使用了四种数据结构:<br>
· 页目录项(PDE,Page Directory Entry):32bits结构,高20bits为页表基地址(物理地址),以4KB为递增单位,低12bits为页表属性,具体换算参见后面初始化部分;<br>
· 页目录(Page directory):存储页目录项,位于一页中,总共可容纳1024个页目录项;<br>
· 页表项(PTE,Page Table Entry):32bits结构,高20bits为页基地址(物理地址),低12bits为页属性;<br>
· 页表(Page table):存储页表项,位于一页中,总共可容纳1024个页表项;<br>
· 页(Page):4KB的连续地址空间;<br>
为了实现分页机制和提高地址转换的效率,X86提供和使用了如下的硬件结构:<br>
· 页标志位(PG,Page):该标志位为1,说明采用页机制;实际就是控制寄存器CR0的第31bit;<br>
· 页缓存/快表(TLBs,Translation Lookaside Buffers):存储最近使用的PDE和PTE,以提高地址转换的效率;<br>
· 页目录基地址寄存器(PDBR,Page Directory Base Register):用于存储页目录的基地址(物理地址),实际就是控制寄存器CR3;<br>
为了实现将线性地址映射到物理地址,X86将32bits线性地址解释为三部分:第31bit到第22bit为页目录中的偏移,用于索引页目录项(得到对应页表的基地址);第21bit到第12bit为页表中的偏移,用于索引页表项(得到对应页的基地址);第11bit到第0bit为页中的偏移。这样,通过两级索引和页中的偏移量,最后能正确得到线性地址对应的物理地址。<br>
关于分页机制的详细描述和作用,请查阅参考文档[1]。<br>
<br>
LINUX的分段策略<br>
<br>
Linux在X86上采用最低限度的分段机制,其目的是为了避开复杂的分段机制,提高Linux在其他不支持分段机制的硬件平台的可移植性,同时又充分利用X86的分段机制来隔离用户代码和内核代码。因此,在Linux上,逻辑地址和线性地址具有相同的值。<br>
由于X86的GDT最大表长为64KB,每个段描述符为8B,所以GDT最多能够容纳8192个段描述符。每产生一个进程,Linux为该进程在GDT中创建两个描述符:LDT段描述符和TSS描述符,除去Linux在GDT中保留的前12项,GDT实际最多能容纳4090个进程。Linux的内核自身有独立的代码段和数据段,其对应的段描述符分别存储在GDT中的第2项和第3项。每个进程也有独立的代码段和数据段,对应的段描述符存储在它自己的LDT中。有关LinuxGDT表项和DLT表项分布情况参见附表1,附表2所示。<br>
在Linux中,每个用户进程都可以访问4GB的线性地址空间。其中0x0~0xBFFFFFFF的3GB空间为用户态空间,用户态进程可以直接访问。从0xC0000000~0x3FFFFFFF的1GB空间为内核态空间,存放内核访问的代码和数据,用户态进程不能直接访问。当用户进程通过中断或系统调用访问内核态空间时,会触发X86的特权级转换(从特权级3切换到特权级0),即从用户态切换到内核态。<br>
<br>
LINUX的分页策略<br>
<br>
标准Linux的分页是三级页表结构,除了X86支持的页目录和页,还有一级被称为中间页目录。因此,线性地址在转换为物理地址的过程中,线性地址就被解释为四个部分(不是X86所认识的三个部分),增加了页中间目录中的索引。当运行在X86平台上时,Linux通过将中间页目录最大的页目录项个数定义为1,并提供一组相关的宏(这些宏将中间页目录用页目录来替换)将三级页面结构分解过程完美的转换为X86使用的二级页面分解。这样,无需改动内核中页面解释的主要代码(这些代码都是认为线性地址由四个部分组成)。关于这些宏定义参见Linux源码"/include/asm/pgtable.h","/include/asm/page.h"。<br>
内核态虚拟空间从3GB到3GB+4MB的一段(对应进程页目录第768项指引的页表),被映射到物理地址0x0~0x3FFFFF(4MB)。因此,进程处于内核态时,只要通过访问3GB到3GB+4MB就可访问物理内存的低4MB空间。所有进程从3GB到4GB的线性空间都是一样的,由同样的页目录项,同样的页表,映射到相同的物理内存段。Linux以这种方式让内核态进程共享代码和数据。<br>
<br>
Linux分段分页初始化<br>
<br>
无论Linux系统如何被引导,经过zImage(参见arch/i386/boot/bootsect.s)或经过LILO,最后都会跳转执行arch/i386/boot/setup.s(被装载到SETUPSEG,物理地址 0x90200),setup.s从BIOS中获取计算机系统的硬件参数(如硬盘参数),放到内存参数区(临时寄放),同时做一些初步的状态检查,为进入保护模式做准备。关于引导过程和setup.s的具体执行参见[2]。<br>
保护模式下的内核初始化模块从物理地址0x100000开始执行,该地址开始的代码和数据结构都对应在arch/i386/kernel/head.s中,参见附表3。初始化模块主要功能是对相关寄存器IDT,GDT,页目录及页表等进行初始化。下面,忽略head.s执行流程的细节,概要阐述head.s主要的初始化功能。<br>
1. 部分寄存器的初始化:将段寄存器DS、ES、GS和FS用__KERNEL_DS(0x18,include/asm-i386/segment.h)来初始化(通过前面对段寄存器的描述和段选择符的介绍可知道,其作用是将定位到GDT中的第三项(内核数据段),并设置对该段的操作特限级为0);置位CR0的PG位,并根据CPU的型号选择置位AM, WP, NE 和 MP;用0x101000初始化CR3(页目录swapper_pg_dir的地址);置ESP高32bits为__KERNEL_DS(0x18),低32bits为init_user_stack+8192;LDTR初始化为0。<br>
2. 有关IDT的初始化:这只是临时初始化IDT,进一步的操作在start_kernel中进行;用于表示IDT的变量(idt_table[ ])在arch/i386/kenel/traps.c中定义,变量类型(desc_struct)定义在include/asm-i386/desc.h。IDT共有IDT_ENTRIES(256)个中断描述符,属性字均为0x8E00,每个中断描述符都指向同一个中断服务程序ignore_init。Ignore_int的功能仅仅是输出消息int_msg("unknown interrupt")。而IDTR的值为通过命令lidt idt_descr实现。通过在head.s中查看idt_descr的值可以计算得知,IDT的基地址为idt_table的地址,表长IDT_ENTRIES*8-1(0x7FF)。<br>
3. 有关GDT的初始化:GDT共有GDT_ENTRIES个段描述符。GDT_ENTRIES的计算公式为:12+2*NR_TASKS。其中12表示前面提到的Linux在GDT中保留的12项,NR_TASKS(512)指系统设定容纳的进程数,定义在include/linux/tasks.h。GDT在head.s直接分配存储单元(标号为gdt_table)。初始化后的GDT如附表1所示。GDTR的值通过命令lgdt gdt_descr实现。通过在head.s中查看gdt_descr的值可以计算得知,GDT的基地址为gdt_table的地址,表长GDT_ENTRIES*8-1(0x205F)。<br>
4. 页目录的初始化:页目录由变量swapper_pg_dir表示,共有1024个页目录项。其第0项和第768项均指向pg0(第0页),初始化值为0x00102007(根据其高20bits的值0x102换算:0x102*4KB=0x102000,第0页紧跟页目录后,物理地址为0x102000),由此可知,Linux 4GB空间中的虚拟地址0x0和0xBFFFFFFF(3GB)均由pg0映射(物理地址0x0~0x3FFFFF(4MB));其他页目录项初始值为0x0;<br>
5. pg0的初始化:第n项对应第n页,属性为0x007;即第n项的初始化值的高20bits值为n,底12bits值为0x007;由此可见pg0映射了物理空间的低4MB空间;<br>
6. 初始化empty_zero_page:该页的前2KB空间用来存储setup.s保存在内存参数区的来自BIOS的系统硬件参数;后2KB空间作为命令行缓冲区;<br>
head.s进行完初始化后调用start_kernel(init/main.c)继续各方面的初始化,主要是调用各方面函数初始化内核的数据结构,下面对与X86系统相关的调用函数简述其(与本文相关的)功能。<br>
1. setup_arch() (arch/i386/kernel/setup.c);设置内核可用物理地址范围(memory_start~memory_end);设置init_task.mm的范围;调用request_region(kernel/resource.c)申请I/O空间,参见附表4。<br>
2. paging_init() (arch/i386/mm/init.c);取消虚拟地址0x0对物理地址的低端4MB空间的映射;根据物理地址的实际大小初始化所有的页表。<br>
3. trap_init() (arch/i386/kernel/traps.c);在IDT中设置各种入口地址,如异常事件处理程序入口,系统调用入口,调用门等。其中,trap0~trap17为各种错误入口(溢出,0除,页错误等,错误处理函数定义在arch/i386/kernel/entry.s);trap18~trap47保留;设置系统调用(INT 0x80)的入口为system_call(arch/i386/kernel/entry.s);在GDT中设置0号进程的TSS段描述符和LDT段描述符。<br>
4. init_IRQ() (arch/i386/kernel/irq.c);初始化IDT 中0x20~0xff项。<br>
5. time_init() (arch/i386/kernel/time.c);读取实时时间,重新设置时钟中断irq0的中断服务程序入口。<br>
6. mem_init() (arch/i386/mm/init.c);初始化empty_zero_page;标记已被占用的页。<br>
<br>
Linux进程和分段分页<br>
<br>
每当启动一个新的进程,Linux都为其创建一个进程控制块(task_struct,include/linux/sched.h)。task_struct中最重要的与存储有关的成员为mm(mm_struct* mm,include/linux/sched.h)和tss(thread_struct tss,include/asm-i386/processor.h)。在创建过程中,系统所涉及的(与分段分页相关)功能包括:<br>
1. 每个进程(根据需要)建立新页目录(mm成员pgd_t * pgd),并将其地址置入寄存器CR3中;相关代码:<br>
new_page_tables(mm/memory.c);//创建和初始化新页目录<br>
SET_PAGE_DIR(include/asm-i386/pgtable.h);//设置页目录基地址寄存器<br>
2. 在GDT中添加进程对应的TSS项和LDT项,其占用的GDT项号分别记录在tss成员tr(unsigned long tr)和ldt(unsigned long ldt)中;相关代码:<br>
_LDT / _TSS(include/asm-i386/desc.h);//换算LDT / TSS对应的GDT项号<br>
set_ldt_desc / set_tss_desc (arch/i386/kernel/traps.c);//在GDT中添加LDT / TSS描述符<br>
3. 创建该进程的LDT(mm成员void * segments);相关代码:<br>
copy_segments(arch/i386/kernel/process.c);//创建进程的LDT并初始化LDT <br>
Linux采用"按需调页"的原则来分配内存页面,从而避免页表过多占用存储空间。创建一个进程时页面分配的情况大致是这样的:进程控制块(1页);内存态堆栈(1页);页目录(1页);页表(需要的n页)。在进程以后执行的执行中,再根据需要逐渐分配更多的内存页面。<br>
附表<br>
附表1 Linux的GDT表项分布<br>
<br>
<br>
附表2 Linux的LDT表项分布 <br>
<br>
<br>
附表3,head.s在物理内存中的映射<br>
<br>
<br>
附表4,设备申请I/O空间<br>
<br>
<br>
参考资料<br>
1. "Inter Architecture Software Developer's Manual Volume 3: System Programming", http://developer.intel.com/design/pentiumii/manuals/243192.htm<br>
2. "Linux操作系统及实验教程",李善平 郑扣根编著,机械工业出版社<br>
3. "Linux 内核源代码分析",Scott Maxwell著,冯锐 邢飞 刘隆国 陆丽娜译,机械工业出版社<br>
4. "Linux 系统分析与高级编程技术",周巍松等编著,机械工业出版社<br>
</FONT><br>
</TD>
</TR>
<TR>
<TD colSpan=2><FONT
class=middlefont></FONT><BR>
<FONT
class=normalfont>全文结束</FONT> </TD>
</TR>
<TR>
<TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2
height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top width="20%"
background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2>
<DIV align=center>
<table class=tableoutline cellspacing=1 cellpadding=4
width="100%" align=center border=0>
<tr class=firstalt>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
<font class=normalfont><b>所有分类</b></font></td>
</tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td> </tr> </table></td></tr> </table>
</DIV></TD></TR>
<TR vAlign=top>
<TD width="80%">
<DIV align=center><BR>
</DIV>
</TD></TR></TBODY></TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee
border=0><TBODY>
<TR>
<TD width="50%">
<P><FONT class=middlefont>版权所有 © 2004 <A
href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
违者必究. </FONT></P>
</TD>
<TD width="50%">
<DIV align=right><FONT class=middlefont>Powered by: <A
href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
</TD></TR></TBODY></TABLE>
<CENTER></CENTER></TD></TR>
</TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -